Blame toonz/sources/toonzlib/tvectorimageutils.cpp
|
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 |
|
|
Shinya Kitaoka |
120a6e |
void getGroupsList(const TVectorImageP &vi, std::vector<tvectorimagep> &list) {</tvectorimagep>
|
|
Shinya Kitaoka |
120a6e |
// Scan vi's strokes
|
|
Shinya Kitaoka |
120a6e |
unsigned int i, j, strokeCount = vi->getStrokeCount();
|
|
Shinya Kitaoka |
120a6e |
for (i = 0; i < strokeCount;) {
|
|
Shinya Kitaoka |
120a6e |
std::vector<int> indexes;</int>
|
|
Shinya Kitaoka |
120a6e |
// Find the group interval
|
|
Shinya Kitaoka |
120a6e |
for (j = i;
|
|
Shinya Kitaoka |
120a6e |
j < strokeCount && vi->areDifferentGroup(i, false, j, false) == -1;
|
|
Shinya Kitaoka |
120a6e |
++j)
|
|
Shinya Kitaoka |
120a6e |
indexes.push_back(j);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Fill a new list item with the strokes
|
|
Shinya Kitaoka |
120a6e |
TVectorImageP item(vi->splitImage(indexes, false));
|
|
Shinya Kitaoka |
120a6e |
if (item->getPalette() == 0) item->setPalette(new TPalette);
|
|
Shinya Kitaoka |
120a6e |
list.push_back(item);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
i = j;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
}
|