FieldData& aData = myAnimator->getFieldData(0);
if (aData.myPrs.empty())
myAnimator->generatePresentations(0);
- VISU_Actor* aActor = aActor = aData.myPrs[0]->CreateActor();
+ VISU_Actor* aActor = aData.myPrs[0]->CreateActor();
float aBounds[6];
aActor->GetBounds(aBounds);
aActor->Delete();
for (it = myPrsMap.begin(); it != myPrsMap.end(); ++it) {
VISU::Prs3d_i* aPrs = it.key();
Offset& aOffs = myOffsets[it.data()];
- if (VISU_Actor* anActor = VISU::GetActor(aPrs, myViewWindow)) anActor->SetPosition(aOffs.myOffset);
+ if (VISU_Actor* anActor = VISU::GetActor(aPrs, myViewWindow))
+ anActor->SetPosition(aOffs.myOffset);
if (mySaveChk)
if (mySaveChk->isChecked())
aPrs->SetOffset(aOffs.myOffset);
float aShift = 0;
float aPrevDist = 0;
float aPrevShift = 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 = VISU::GetActor(aPrs, myViewWindow)){
+ if (VISU_Actor* aActor = VISU::GetActor(aPrs, myViewWindow)) {
int aAxis = getAxis();
- // if (aInit) {
float aBounds[6];
aActor->GetBounds(aBounds);
switch (aAxis) {
case ZAxis:
aDist = fabs(aBounds[5] - aBounds[4]);
}
- // aInit = false;
- // }
float aOffset[3];
- aOffset[0] = aOffset[1] = aOffset[2] = 0;
+ aOffset[0] = (aBounds[1] < aBounds[0]) ? -aBounds[1] : -aBounds[0];
+ aOffset[1] = (aBounds[3] < aBounds[2]) ? -aBounds[3] : -aBounds[2];
+ aOffset[2] = (aBounds[5] < aBounds[4]) ? -aBounds[5] : -aBounds[4];
if (i > 0) {
float aCCDist = (aDist + aPrevDist) / 2.0;
aShift = aPrevShift + aPrevDist/2.0 + aCCDist*getDistance() - aDist/2.0;
}
- aOffset[aAxis] = aShift;
+ aOffset[aAxis] += aShift;
aActor->SetPosition(aOffset);
if (mySaveChk)
if (mySaveChk->isChecked())