修改了ShortCutTree部分的线部分索引
parent
b2803f777a
commit
4d9fe01fe9
|
@ -112,10 +112,8 @@ void ShortCutTree::generateShortCutSegment(ShortCutNode& nowTreeNode) {
|
||||||
}
|
}
|
||||||
for (auto& iter : pointSet) {
|
for (auto& iter : pointSet) {
|
||||||
nowTreeNode.lineSet.push_back(numLine);
|
nowTreeNode.lineSet.push_back(numLine);
|
||||||
lineIndexs.push_back(iter.first);
|
lineIndexs.push_back((iter.first << 16) + iter.first);
|
||||||
lineIndexs.push_back(iter.first);
|
lineIndexs.push_back((iter.second << 16) + iter.second);
|
||||||
lineIndexs.push_back(iter.second);
|
|
||||||
lineIndexs.push_back(iter.second);
|
|
||||||
numLine++;
|
numLine++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,14 +147,28 @@ bool ShortCutTree::handleShortCutNode(ShortCutNode& fa, ShortCutNode& nowTreeNod
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShortCutTree::simplifyLineVector() {
|
void ShortCutTree::simplifyLineVector() {
|
||||||
|
bool canPut = false;
|
||||||
|
GLuint index = 0;
|
||||||
numLine = allLines.size();
|
numLine = allLines.size();
|
||||||
for (auto& nowLine : allLines) {
|
for (auto& nowLine : allLines) {
|
||||||
PointVector pointVector = nowLine->toPointVector();
|
PointVector pointVector = nowLine->toPointVector();
|
||||||
|
canPut = false;
|
||||||
|
index = 0;
|
||||||
for (Point& p : pointVector) {
|
for (Point& p : pointVector) {
|
||||||
int pointIndex = getPointIndex(p);
|
int pointIndex = getPointIndex(p);
|
||||||
lineIndexs.push_back(pointIndex);
|
if (pointVector.size() == 2) {
|
||||||
if (pointVector.size() == 2)
|
index = (pointIndex << 16) + pointIndex;
|
||||||
lineIndexs.push_back(pointIndex);
|
lineIndexs.push_back(index);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
index <<= 16;
|
||||||
|
index += pointIndex;
|
||||||
|
if (canPut) {
|
||||||
|
lineIndexs.push_back(index);
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
|
canPut = !canPut;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (auto& nowTreeNode : restOfTreeNodes) {
|
for (auto& nowTreeNode : restOfTreeNodes) {
|
||||||
|
|
Loading…
Reference in New Issue