}
} else {
float aDist = 0;
- bool aInit = true;
+ float aShift = 0;
+ float aPrevDist = 0;
+ // bool aInit = true;
int i;
QMap<VISU::Prs3d_i*, int>::Iterator it;
for (it = myPrsMap.begin(), i = 0; it != myPrsMap.end(); ++it, i++) {
VISU::Prs3d_i* aPrs = it.key();
if (VISU_Actor* aActor = VisuGUI::GetActor(aPrs, myViewFrame)){
int aAxis = getAxis();
- if (aInit) {
- float aBounds[6];
- aActor->GetBounds(aBounds);
- switch (aAxis) {
- case XAxis:
- aDist = fabs(aBounds[1] - aBounds[0]);
- break;
- case YAxis:
- aDist = fabs(aBounds[3] - aBounds[2]);
- break;
- case ZAxis:
- aDist = fabs(aBounds[5] - aBounds[4]);
- }
- aDist = aDist*getDistance();
- aInit = false;
+ // if (aInit) {
+ float aBounds[6];
+ aActor->GetBounds(aBounds);
+ switch (aAxis) {
+ case XAxis:
+ aDist = fabs(aBounds[1] - aBounds[0]);
+ break;
+ case YAxis:
+ aDist = fabs(aBounds[3] - aBounds[2]);
+ break;
+ case ZAxis:
+ aDist = fabs(aBounds[5] - aBounds[4]);
}
+ // aInit = false;
+ // }
float aOffset[3];
aOffset[0] = aOffset[1] = aOffset[2] = 0;
- aOffset[aAxis] = aDist * i;
+
+ aShift = (i == 0)? 0 : aShift + (aDist + aPrevDist) * getDistance() / 2;
+
+ aOffset[aAxis] = aShift;
aActor->SetPosition(aOffset);
if (mySaveChk)
if (mySaveChk->isChecked())
aPrs->SetOffset(aOffset);
+ aPrevDist = aDist;
}
}
}