return theField->GetMinMax(theCompID);
}
+ //---------------------------------------------------------------
+ void
+ TMinMaxController
+ ::UpdateReference(ColoredPrs3d_i* theFromPrs3, ColoredPrs3d_i* theToPrs3d)
+ {}
+
+
//---------------------------------------------------------------
vtkFloatingPointType
TMinMaxController
struct TSimpleMinMaxController: virtual TVTKMinMaxController
{
VISU::Result_i* myResult;
- VISU::PField myField;
+ VISU::ColoredPrs3d_i* myColoredPrs3d;
TSimpleMinMaxController(VISU::ColoredPrs3d_i* theColoredPrs3d):
myResult(theColoredPrs3d->GetCResult()),
- myField(theColoredPrs3d->GetField())
+ myColoredPrs3d(theColoredPrs3d)
{}
+ ~TSimpleMinMaxController()
+ {}
+
virtual
vtkFloatingPointType
GetComponentMin(vtkIdType theCompID)
{
- if(myField){
- TMinMax aMinMax = GetMinMax(myResult, myField, theCompID);
+ if ( VISU::PField aField = myColoredPrs3d->GetScalarField() ) {
+ TMinMax aMinMax = GetMinMax(myResult, aField, theCompID);
return aMinMax.first;
}
return TMinMaxController::GetComponentMin(theCompID);
vtkFloatingPointType
GetComponentMax(vtkIdType theCompID)
{
- if(myField){
- TMinMax aMinMax = GetMinMax(myResult, myField, theCompID);
+ if ( VISU::PField aField = myColoredPrs3d->GetScalarField() ) {
+ TMinMax aMinMax = GetMinMax(myResult, aField, theCompID);
return aMinMax.second;
}
return TMinMaxController::GetComponentMax(theCompID);
//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
-::SetMinMaxController(const VISU::PMinMaxController& theController)
+::SetMinMaxController( const VISU::PMinMaxController& theController )
{
myMinMaxController = theController;
}
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetMinMaxController( VISU::ColoredPrs3d_i* theOrigin )
+{
+ VISU::PMinMaxController aController = theOrigin->GetMinMaxController();
+ aController->UpdateReference( theOrigin, this );
+
+ SetMinMaxController( aController );
+}
+
+
//----------------------------------------------------------------------------
CORBA::Long
VISU::ColoredPrs3d_i
TSuperClass::SameAs(theOrigin);
- CORBA::Long aNbComp = GetField()->myNbComp;
- CORBA::Long anOriginNbComp = anOrigin->GetField()->myNbComp;
+ CORBA::Long aNbComp = GetScalarField()->myNbComp;
+ CORBA::Long anOriginNbComp = anOrigin->GetScalarField()->myNbComp;
if(anOriginNbComp < aNbComp)
SetScalarMode(0);
else
SetBarOrientation(anOrigin->GetBarOrientation());
- SetMinMaxController(anOrigin->GetMinMaxController());
+ SetMinMaxController( anOrigin );
if(anOrigin->IsRangeFixed())
SetRange(anOrigin->GetMin(), anOrigin->GetMax());
VISU::ColoredPrs3d_i
::SetScalarMode(CORBA::Long theScalarMode)
{
- CORBA::Long aNbComp = GetField()->myNbComp;
+ CORBA::Long aNbComp = GetScalarField()->myNbComp;
if(aNbComp == 1)
theScalarMode = 1;
else if(theScalarMode > aNbComp)
if ( aMinMaxController ) {
myResult = aMinMaxController->GetComponentMin( myCompID );
} else {
- VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myCompID );
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID );
myResult = aTMinMax.first;
}
}
if ( aMinMaxController ) {
myResult = aMinMaxController->GetComponentMax( myCompID );
} else {
- VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myCompID );
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetScalarField()->GetMinMax( myCompID );
myResult = aTMinMax.second;
}
}
aRestoringMap["myEntityId"] = QString::number(GetEntity());
aRestoringMap["myFieldName"] = GetCFieldName();
aRestoringMap["myTimeStampId"] = QString::number(GetTimeStampNumber());
- aRestoringMap["myNumComponent"] = QString::number(GetField()->myNbComp);
+ aRestoringMap["myNumComponent"] = QString::number(GetScalarField()->myNbComp);
std::string anEntry = GetCResult()->GetEntry(aRestoringMap);
if(anEntry == "")
throw std::runtime_error("There is no Entry for binding the presentation !!!");
GetEntity(),
GetCFieldName().c_str(),
GetTimeStampNumber(),
- GetField()->myNbComp);
+ GetScalarField()->myNbComp);
CORBA::String_var anIOR = GetID();
CreateAttributes(GetStudyDocument(),
anEntry,
//------------------------------------------------------------------------
struct TCompositeMinMaxController : virtual TVTKMinMaxController
{
- typedef std::vector<VISU::PMinMaxController> TMinMaxContainer;
+ typedef ColoredPrs3d_i* TKey;
+ typedef std::map< TKey, VISU::PMinMaxController > TMinMaxContainer;
TMinMaxContainer myMinMaxContainer;
void
- AddController(VISU::PMinMaxController theMinMaxController)
+ AddController(ColoredPrs3d_i* theReference,
+ VISU::PMinMaxController theMinMaxController)
{
- myMinMaxContainer.push_back(theMinMaxController);
+ myMinMaxContainer[ TKey( theReference ) ] = theMinMaxController;
+ }
+
+ virtual
+ void
+ UpdateReference(ColoredPrs3d_i* theFromPrs3, ColoredPrs3d_i* theToPrs3d)
+ {
+ TMinMaxContainer::iterator anIter = myMinMaxContainer.find( TKey( theFromPrs3 ) );
+ if ( anIter != myMinMaxContainer.end() ) {
+ myMinMaxContainer.erase( anIter );
+ myMinMaxContainer[ TKey( theToPrs3d ) ] = VISU::CreateDefaultMinMaxController( theToPrs3d );
+ }
}
virtual
GetComponentMin(vtkIdType theCompID)
{
vtkFloatingPointType aMin = TMinMaxController::GetComponentMin(theCompID);
- if(!myMinMaxContainer.empty()){
- for(size_t anId = 0; anId < myMinMaxContainer.size(); anId++){
- VISU::PMinMaxController aMinMaxController = myMinMaxContainer[anId];
+ if ( !myMinMaxContainer.empty() ) {
+ TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin();
+ for(; anIter != myMinMaxContainer.end(); anIter++){
+ VISU::PMinMaxController aMinMaxController = anIter->second;
aMin = std::min(aMin, aMinMaxController->GetComponentMin(theCompID));
}
}
GetComponentMax(vtkIdType theCompID)
{
vtkFloatingPointType aMax = TMinMaxController::GetComponentMax(theCompID);
- if(!myMinMaxContainer.empty()){
- for(size_t anId = 0; anId < myMinMaxContainer.size(); anId++){
- VISU::PMinMaxController aMinMaxController = myMinMaxContainer[anId];
+ if ( !myMinMaxContainer.empty() ) {
+ TMinMaxContainer::const_iterator anIter = myMinMaxContainer.begin();
+ for(; anIter != myMinMaxContainer.end(); anIter++){
+ VISU::PMinMaxController aMinMaxController = anIter->second;
aMax = std::max(aMax, aMinMaxController->GetComponentMax(theCompID));
}
}
if ( myAnimationMode == VISU::Animation::PARALLEL ) {
FieldData& aFieldData = getFieldData(theFieldNum);
VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0];
- aMinMaxController->AddController(VISU::CreateDefaultMinMaxController(aPrs3d));
+ aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) );
} else {
for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) {
FieldData& aFieldData = getFieldData(aFieldId);
VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0];
- aMinMaxController->AddController(VISU::CreateDefaultMinMaxController(aPrs3d));
+ aMinMaxController->AddController( aPrs3d, VISU::CreateDefaultMinMaxController( aPrs3d ) );
}
}