Example #1
0
	void OpenVG_SVGHandler::onGroupBegin() {
		_mode = kGroupParseMode;
		_current_group->children.push_back( group_t() );
		group_t* top = &_current_group->children.back();
		top->parent = _current_group;
		_current_group = top;
		// copy any use transform
		_current_group->transform = _use_transform;
	}
Example #2
0
wxDataViewItem ThingTypeTreeView::getGroup(string group)
{
	// Check if group was already made
	for (unsigned a = 0; a < groups.size(); a++)
	{
		if (group == groups[a].name)
			return groups[a].item;
	}

	// Split group into subgroups
	wxArrayString path = wxSplit(group, '/');

	// Create group needed
	wxDataViewItem current = root;
	string fullpath = "";
	for (unsigned p = 0; p < path.size(); p++)
	{
		if (p > 0) fullpath += "/";
		fullpath += path[p];

		bool found = false;
		for (unsigned a = 0; a < groups.size(); a++)
		{
			if (groups[a].name == fullpath)
			{
				current = groups[a].item;
				found = true;
				break;
			}
		}

		if (!found)
		{
			current = AppendContainer(current, path[p], -1, 1);
			groups.push_back(group_t(current, fullpath));
		}
	}

	return current;
}