Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "toonz/tvectorimageutils.h"
Toshihiro Shimizu 890ddd
#include "tpalette.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
void getGroupsList(const TVectorImageP &vi, std::vector<tvectorimagep> &list)</tvectorimagep>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	//Scan vi's strokes
Toshihiro Shimizu 890ddd
	unsigned int i, j, strokeCount = vi->getStrokeCount();
Toshihiro Shimizu 890ddd
	for (i = 0; i < strokeCount;) {
Toshihiro Shimizu 890ddd
		std::vector<int> indexes;</int>
Toshihiro Shimizu 890ddd
		//Find the group interval
Toshihiro Shimizu 890ddd
		for (j = i; j < strokeCount && vi->areDifferentGroup(i, false, j, false) == -1; ++j)
Toshihiro Shimizu 890ddd
			indexes.push_back(j);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		//Fill a new list item with the strokes
Toshihiro Shimizu 890ddd
		TVectorImageP item(vi->splitImage(indexes, false));
Toshihiro Shimizu 890ddd
		if (item->getPalette() == 0)
Toshihiro Shimizu 890ddd
			item->setPalette(new TPalette);
Toshihiro Shimizu 890ddd
		list.push_back(item);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		i = j;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
}