return GetComponentMax(GetScalarMode());
}
+
+//----------------------------------------------------------------------------
+struct TGetComponentMin: public SALOME_Event
+{
+ VISU::ColoredPrs3d_i* myColoredPrs3d;
+ vtkIdType myCompID;
+
+ typedef CORBA::Double TResult;
+ TResult myResult;
+
+ TGetComponentMin( VISU::ColoredPrs3d_i* theColoredPrs3d,
+ vtkIdType theCompID ):
+ myColoredPrs3d( theColoredPrs3d ),
+ myCompID( theCompID )
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
+ if ( aMinMaxController ) {
+ myResult = aMinMaxController->GetComponentMin( myCompID );
+ } else {
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myCompID );
+ myResult = aTMinMax.first;
+ }
+ }
+};
+
+
//----------------------------------------------------------------------------
CORBA::Double
VISU::ColoredPrs3d_i
::GetComponentMin(vtkIdType theCompID)
{
- if(PMinMaxController aMinMaxController = GetMinMaxController())
- return aMinMaxController->GetComponentMin(theCompID);
-
- TMinMax aTMinMax = GetField()->GetMinMax(theCompID);
- return aTMinMax.first;
+ return ProcessEvent( new TGetComponentMin( this, theCompID ) );
}
+//----------------------------------------------------------------------------
+struct TGetComponentMax: public SALOME_Event
+{
+ VISU::ColoredPrs3d_i* myColoredPrs3d;
+ vtkIdType myCompID;
+
+ typedef CORBA::Double TResult;
+ TResult myResult;
+
+ TGetComponentMax( VISU::ColoredPrs3d_i* theColoredPrs3d,
+ vtkIdType theCompID ):
+ myColoredPrs3d( theColoredPrs3d ),
+ myCompID( theCompID )
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
+ if ( aMinMaxController ) {
+ myResult = aMinMaxController->GetComponentMax( myCompID );
+ } else {
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myCompID );
+ myResult = aTMinMax.second;
+ }
+ }
+};
+
+
//----------------------------------------------------------------------------
vtkFloatingPointType
VISU::ColoredPrs3d_i
::GetComponentMax(vtkIdType theCompID)
{
- if(PMinMaxController aMinMaxController = GetMinMaxController())
- return aMinMaxController->GetComponentMax(theCompID);
-
- TMinMax aTMinMax = GetField()->GetMinMax(theCompID);
- return aTMinMax.second;
+ return ProcessEvent( new TGetComponentMax( this, theCompID ) );
}
//----------------------------------------------------------------------------
aScalarBarCtrl->SetRangeLocal(aRange);
}
- TMinMax aTMinMax(-VTK_LARGE_FLOAT,VTK_LARGE_FLOAT);
bool anIsMinMaxDone = IsGlobalRangeDefined();
- if(anIsMinMaxDone)
- aTMinMax = GetField()->GetMinMax(GetScalarMode());
aScalarBarCtrl->SetGlobalRangeIsDefined(anIsMinMaxDone);
+
+ TMinMax aTMinMax( GetComponentMin( GetScalarMode() ),
+ GetComponentMax( GetScalarMode() ));
aScalarBarCtrl->SetRangeGlobal(aTMinMax.first, aTMinMax.second);
VISU_ScalarBarCtrl::EMode aScalarBarMode = VISU_ScalarBarCtrl::eGlobal;
UseFixedRange(false);
}
+
+//----------------------------------------------------------------------------
+struct TGetSourceMin: public SALOME_Event
+{
+ VISU::GaussPoints_i* myColoredPrs3d;
+
+ typedef CORBA::Double TResult;
+ TResult myResult;
+
+ TGetSourceMin( VISU::GaussPoints_i* theColoredPrs3d ):
+ myColoredPrs3d( theColoredPrs3d )
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ if ( myColoredPrs3d->IsTimeStampFixed() || myColoredPrs3d->GetIsActiveLocalScalarBar() ) {
+ vtkFloatingPointType aRange[2];
+ myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
+ myResult = aRange[0];
+ }else{
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode() );
+ myResult = aTMinMax.first;
+ }
+ }
+};
+
+
+//----------------------------------------------------------------------------
CORBA::Double
VISU::GaussPoints_i
::GetSourceMin()
{
- if(IsTimeStampFixed() || GetIsActiveLocalScalarBar()){
- vtkFloatingPointType aRange[2];
- GetSpecificPL()->GetSourceRange(aRange);
- return aRange[0];
- }else{
- TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
- return aTMinMax.first;
- }
+ return ProcessEvent( new TGetSourceMin( this ) );
}
+
+//----------------------------------------------------------------------------
+struct TGetSourceMax: public SALOME_Event
+{
+ VISU::GaussPoints_i* myColoredPrs3d;
+
+ typedef CORBA::Double TResult;
+ TResult myResult;
+
+ TGetSourceMax( VISU::GaussPoints_i* theColoredPrs3d ):
+ myColoredPrs3d( theColoredPrs3d )
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ if ( myColoredPrs3d->IsTimeStampFixed() || myColoredPrs3d->GetIsActiveLocalScalarBar() ) {
+ vtkFloatingPointType aRange[2];
+ myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
+ myResult = aRange[1];
+ }else{
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode() );
+ myResult = aTMinMax.second;
+ }
+ }
+};
+
+
+//----------------------------------------------------------------------------
CORBA::Double
VISU::GaussPoints_i
::GetSourceMax()
{
- if(IsTimeStampFixed() || GetIsActiveLocalScalarBar()){
- vtkFloatingPointType aRange[2];
- GetSpecificPL()->GetSourceRange(aRange);
- return aRange[1];
- }else{
- TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
- return aTMinMax.second;
- }
+ return ProcessEvent( new TGetSourceMax( this ) );
}