init();
QStringList aFieldNames;
// Find names of fields
- for (int i = 0; i < theAnimator->getNbFields(); i++) {
- aFieldNames.append(VISU::getValue(theAnimator->getFieldData(i).myField, "myName"));
+ for (int i = 0; i < myAnimator->getNbFields(); i++) {
+ aFieldNames.append(VISU::getValue(myAnimator->getFieldData(i).myField, "myName"));
Offset aOffs;
aOffs.myOffset[0] = myAnimator->getFieldData(i).myOffset[0];
aOffs.myOffset[1] = myAnimator->getFieldData(i).myOffset[1];
QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 6);
aMainLayout->setSpacing(5);
+ // Range of time stamps
QFrame* aRangeGrp = new QFrame(this);
QGridLayout* aRangeLayout = new QGridLayout( aRangeGrp );
aRangeLayout->setSpacing( 6 );
aRangeLayout->addMultiCellWidget(myUseRangeChk, 0, 0, 0, 3);
myUseRangeChk->setChecked(myAnimator->isRangeDefined());
+ double aMaxTime = myAnimator->getMaxTime();
+ double aMinTime = myAnimator->getMinTime();
+ double aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1);
+
QLabel* aMinLbl = new QLabel("From", aRangeGrp);
aMinLbl->setEnabled(myUseRangeChk->isChecked());
aRangeLayout->addWidget(aMinLbl, 1, 0);
- double aStep = (myAnimator->getMaxTime() - myAnimator->getMinTime())/(theAnimator->getFieldData(0).myNbTimes - 1);
- myMinVal = new QtxDblSpinBox( myAnimator->getMinTime(), myAnimator->getMaxTime(), aStep, aRangeGrp );
+ myMinVal = new QtxDblSpinBox( aMinTime, aMaxTime, aStep, aRangeGrp );
myMinVal->setEnabled(myUseRangeChk->isChecked());
if (myUseRangeChk->isChecked())
myMinVal->setValue( myAnimator->getMinRange() );
else
- myMinVal->setValue( myAnimator->getMinTime() );
+ myMinVal->setValue( aMinTime );
connect(myMinVal, SIGNAL( valueChanged(double)),
this, SLOT( onMinValue(double) ));
QLabel* aMaxLbl = new QLabel("To", aRangeGrp);
aMaxLbl->setEnabled(myUseRangeChk->isChecked());
aRangeLayout->addWidget(aMaxLbl, 1, 2);
- myMaxVal = new QtxDblSpinBox( myAnimator->getMinTime(), myAnimator->getMaxTime(), aStep, aRangeGrp );
+ myMaxVal = new QtxDblSpinBox( aMinTime, aMaxTime, aStep, aRangeGrp );
myMaxVal->setEnabled(myUseRangeChk->isChecked());
if (myUseRangeChk->isChecked())
myMaxVal->setValue( myAnimator->getMaxRange() );
else
- myMaxVal->setValue( myAnimator->getMaxTime() );
+ myMaxVal->setValue( aMaxTime );
connect(myMaxVal, SIGNAL( valueChanged(double)),
this, SLOT( onMaxValue(double) ));
aMainLayout->addWidget(aRangeGrp);
+ // Fields and Properties
QHBox* aPropFrame = new QHBox(this);
aPropFrame->setSpacing(5);
myFieldLst = new QListBox(aNamesBox);
QStringList aFieldNames;
// Find names of fields
- for (int i = 0; i < theAnimator->getNbFields(); i++) {
- _PTR(SObject) aSO = theAnimator->getFieldData(i).myField;
+ for (int i = 0; i < myAnimator->getNbFields(); i++) {
+ _PTR(SObject) aSO = myAnimator->getFieldData(i).myField;
aFieldNames.append(VISU::getValue(aSO, "myName"));
}
myFieldLst->insertStringList(aFieldNames);
// this, SLOT( onScalarBarDlg() ) );
myPropBtn = new QPushButton("Properties...", aPropBox);
- // myPropBtn->setEnabled(theAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP);
+ // myPropBtn->setEnabled(myAnimator->getFieldData(0).myPrsType != VISU::TSCALARMAP);
connect( myPropBtn, SIGNAL( clicked() ),
this, SLOT( onPreferencesDlg() ) );
connect( myView, SIGNAL( destroyed() ), this, SLOT( onViewDeleted() ) );
}
- myMaxVal = 0;
- myMinVal = 0;
+ myTimeMinVal = 0;
+ myTimeMaxVal = 0;
myTimeMin = 0;
myTimeMax = 0;
myLastError = "";
FieldData& theData,
VISU::Result_i* theResult,
bool theIsRangeDefined,
- CORBA::Double& theMinVal,
- CORBA::Double& theMaxVal,
CORBA::Double theTimeMin,
CORBA::Double theTimeMax)
{
- theMinVal = VTK_LARGE_FLOAT;
- theMaxVal = -VTK_LARGE_FLOAT;
+ double aMin = VTK_LARGE_FLOAT, aMax = -VTK_LARGE_FLOAT;
_PTR(ChildIterator) anIter = theStudy->NewChildIterator(theData.myField);
anIter->Next(); // First is reference on support
aFieldName.latin1(), aTimeStampId);
theData.myPrs[aFrameId++] = aPresent;
- theMinVal = std::min(aPresent->GetMin(),theMinVal);
- theMaxVal = std::max(aPresent->GetMax(),theMaxVal);
+ aMin = std::min(aPresent->GetMin(), aMin);
+ aMax = std::max(aPresent->GetMax(), aMax);
}
theData.myNbFrames = aFrameId;
if( aRangeType != 1 ){
for(long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++) {
if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(theData.myPrs[aFrameId])){
- aPrs->SetRange(theMinVal, theMaxVal);
+ aPrs->SetRange(aMin, aMax);
aPrs->SetOffset(theData.myOffset);
}
}
if (theData.myPrsType == VISU::TISOSURFACE)
for (long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++)
if (VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(theData.myPrs[aFrameId]))
- aPrs->SetSubRange(theMinVal, theMaxVal);
+ aPrs->SetSubRange(aMin, aMax);
}
}
}
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TISOSURFACE: // Iso Surfaces
GeneratePresentations<IsoSurfaces_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TCUTPLANES: // Cut Planes
GeneratePresentations<CutPlanes_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TCUTLINES: // Cut Lines
GeneratePresentations<CutLines_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TPLOT3D: // Plot3d
GeneratePresentations<Plot3D_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TDEFORMEDSHAPE: // Deformed Shape
GeneratePresentations<DeformedShape_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TVECTORS: // Vectors
GeneratePresentations<Vectors_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TSTREAMLINES: // Stream Lines
GeneratePresentations<StreamLines_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TGAUSSPOINTS: // Gauss Points
GeneratePresentations<GaussPoints_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
case VISU::TSCALARMAPONDEFORMEDSHAPE: // Scalar map on deformed shape
GeneratePresentations<ScalarMapOnDeformedShape_i>(myStudy,
aData,
aResult,
isRangeDefined(),
- myMinVal,
- myMaxVal,
- myTimeMin,
- myTimeMax);
+ myTimeMinVal,
+ myTimeMaxVal);
break;
default:
MESSAGE("Not implemented for this presentation type: " << aData.myPrsType);
std::string aSComponentEntry = aSComponent->GetID();
QString aComment;
- aComment.sprintf("myComment=ANIMATION;myType=%d;myMinVal=%g;myMaxVal=%g",
- VISU::TANIMATION,myMinVal,myMaxVal);
+ aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g",
+ VISU::TANIMATION,myTimeMinVal,myTimeMaxVal);
string anEntry = VISU::CreateAttributes(myStudy,aSComponentEntry.c_str(),"","",
GenerateName(),"",aComment,true);
std::string aSComponentEntry = aSComponent->GetID();
QString aComment;
- aComment.sprintf("myComment=ANIMATION;myType=%d;myMinVal=%g;myMaxVal=%g",
- VISU::TANIMATION,myMinVal,myMaxVal);
+ aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g",
+ VISU::TANIMATION,myTimeMinVal,myTimeMaxVal);
_PTR(GenericAttribute) anAttr;
anAttr = aStudyBuilder->FindOrCreateAttribute(aAnimSObject, "AttributeComment");
VISU::Storable::StrToMap(strIn,aMap);
bool isExist;
- myMinVal = VISU::Storable::FindValue(aMap,"myMinVal",&isExist).toDouble();
- myMaxVal = VISU::Storable::FindValue(aMap,"myMaxVal",&isExist).toDouble();
+ myTimeMinVal = VISU::Storable::FindValue(aMap,"myTimeMinVal",&isExist).toDouble();
+ myTimeMaxVal = VISU::Storable::FindValue(aMap,"myTimeMaxVal",&isExist).toDouble();
_PTR(ChildIterator) anIter = myStudy->NewChildIterator(aAnimSObject);
for (anIter->Init(); anIter->More(); anIter->Next()) {
CORBA::Boolean isProportional() { return myProportional; }
void setAnimationRange(CORBA::Double theMin, CORBA::Double theMax)
- { myMaxVal = theMax; myMinVal = theMin; }
+ { myTimeMinVal = theMin; myTimeMaxVal = theMax; }
- CORBA::Double getMinRange() { return myMinVal; }
- CORBA::Double getMaxRange() { return myMaxVal; }
- CORBA::Boolean isRangeDefined() { return !((myMaxVal==0) && (myMinVal == myMaxVal)); }
+ CORBA::Double getMinRange() { return myTimeMinVal; }
+ CORBA::Double getMaxRange() { return myTimeMaxVal; }
+ CORBA::Boolean isRangeDefined() { return !((myTimeMaxVal == 0) && (myTimeMinVal == myTimeMaxVal)); }
void dumpTo(const char* thePath) { myDumpPath = thePath; }
std::string setDumpFormat(const char* theFormat);
private slots:
void onViewDeleted();
-
+
private:
QString myLastError;
bool myCycling;
_PTR(Study) myStudy;
- double myMaxVal, myMinVal;
- double myTimeMin, myTimeMax;
+ double myTimeMinVal, myTimeMaxVal; //!< Range of time stams, set by user
+ double myTimeMin , myTimeMax ; //!< Range of time stams, available for animation
QString myDumpPath;
QString myDumpFormat;
SVTK_ViewWindow* myView;