*/
double GetMax();
+ /*!
+ * Gets the min boundary of the scalar bar from source data.
+ */
+ double GetSourceMin();
+
+ /*!
+ * Gets the max boundary of the scalar bar from source data.
+ */
+ double GetSourceMax();
+
+ /*!
+ * Defines whether the scalar range corresponds to the source data or not.
+ */
+ boolean IsRangeFixed();
+
/*! \brief Position of the scalar bar.
*
* Sets the position of the scalar bar origin on the screen.
*/
void SetRange(in double theMin, in double theMax);
+ /*!
+ * Sets scalar range that corresponds to the source data.
+ */
+ void SetSourceRange();
+
/*! %Orientation of the scalar bar (to provide backward compatibility). */
enum Orientation {
HORIZONTAL, /*!< Horizontal orientation of the scalar bar.*/
*/
interface ScalarMapOnDeformedShape : ScalarMap {
- /*!
- * Sets the source ranges of pipeline
- */
- void SetSourceRange(in double theMinRange,in double theMaxRange);
- /*!
- * Gets the minimum source range of pipeline
- */
- double GetSourceRangeMin();
- /*!
- * Gets the maximum source range of pipeline
- */
- double GetSourceRangeMax();
-
/*!
* Sets the scale of the presentatable object.
* \param theScale Double value defining the scale of this presentable object.
default:
setLogarithmic(false);
}
- vtkFloatingPointType aRange[2];
- thePrs->GetSpecificPL()->GetSourceRange(aRange);
+ CORBA::Double aRange[2] = {thePrs->GetSourceMin(), thePrs->GetSourceMax()};
Rmin = aRange[0]; Rmax = aRange[1];
setRange( thePrs->GetMin(), thePrs->GetMax(),
/*0.0, 0.0,*/ thePrs->IsRangeFixed() );
{
if ( myScalarMap ) {
if ( RBFrange->isChecked() ) {
- vtkFloatingPointType aRange[2];
int aMode = myScalarMap->GetScalarMode();
myScalarMap->SetScalarMode(theMode);
- myScalarMap->GetSpecificPL()->GetSourceRange(aRange);
+ CORBA::Double aRange[2] = {myScalarMap->GetSourceMin(), myScalarMap->GetSourceMax()};
MinEdit->setText( QString::number( aRange[0] ) );
MaxEdit->setText( QString::number( aRange[1] ) );
myScalarMap->SetScalarMode(aMode);
if(anIsNotCreated)
CreatePipeLine(NULL); // to create proper pipeline
- DoSetInput();
+ DoSetInput(anIsNotCreated);
SetTitle(GetCTitle().c_str());
return anIsNotCreated;
return myScalarMapPL->GetScalarRange()[1];
}
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetRange(CORBA::Double theMin, CORBA::Double theMax)
+{
+ if(theMin > theMax)
+ return;
+ vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
+ GetSpecificPL()->SetScalarRange(aScalarRange);
+ UseFixedRange(true);
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetSourceRange()
+{
+ if(IsTimeStampFixed())
+ GetSpecificPL()->SetSourceRange();
+ else{
+ TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
+ vtkFloatingPointType aScalarRange[2] = {aTMinMax.first, aTMinMax.second};
+ GetSpecificPL()->SetScalarRange(aScalarRange);
+ }
+ UseFixedRange(false);
+}
+
+CORBA::Double
+VISU::ColoredPrs3d_i
+::GetSourceMin()
+{
+ if(IsTimeStampFixed())
+ return myScalarMapPL->GetScalarRange()[0];
+ else{
+ TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
+ return aTMinMax.first;
+ }
+}
+
+CORBA::Double
+VISU::ColoredPrs3d_i
+::GetSourceMax()
+{
+ if(IsTimeStampFixed())
+ return myScalarMapPL->GetScalarRange()[1];
+ else{
+ TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
+ return aTMinMax.second;
+ }
+}
+
+//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
::SetNbColors(CORBA::Long theNbColors)
//----------------------------------------------------------------------------
-bool
+CORBA::Boolean
VISU::ColoredPrs3d_i
::IsRangeFixed()
{
myName = "NoName";
if(theBuildMode == ECreateNew || theBuildMode == ESameAs){
if(!myIsFixedRange)
- myScalarMapPL->SetSourceRange();
+ SetSourceRange();
if(theBuildMode == ECreateNew)
SetTitle(GetCFieldName().c_str());
}
CORBA::Double
GetMax();
+ virtual
+ void
+ SetRange(CORBA::Double theMin, CORBA::Double theMax);
+
+ virtual
+ CORBA::Double
+ GetSourceMin();
+
+ virtual
+ CORBA::Double
+ GetSourceMax();
+
+ virtual
+ void
+ SetSourceRange();
+
+ virtual
+ CORBA::Boolean
+ IsRangeFixed();
+
virtual
void
SetNbColors(CORBA::Long theNbColors);
vtkFloatingPointType theG,
vtkFloatingPointType theB);
- virtual
- bool
- IsRangeFixed();
-
VISU_ScalarMapPL*
GetSpecificPL() const
{
*/
virtual
void
- DoSetInput() = 0;
+ DoSetInput(bool theIsInitilizePipe) = 0;
/*!
The enumeration allow to define what mode should be used for the presentation building.
if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast<ScalarMapOnDeformedShape_i*>(GetServant(anObj).in())){
thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"ScalarMapOnDeformedShapeOnField",theArgumentName,thePrefix);
- theStr<<thePrefix<<aName<<".SetSourceRange("<<aServant->GetSourceRangeMin()<<","<<aServant->GetSourceRangeMax()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetRange("<<aServant->GetMin()<<","<<aServant->GetMax()<<")"<<endl;
theStr<<thePrefix<<aName<<".SetScale("<<aServant->GetScale()<<")"<<endl;
std::string aParam;
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::DoSetInput()
+::DoSetInput(bool theIsInitilizePipe)
{
VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
if(!anInput)
throw std::runtime_error("There is no TimeStamp with the parameters !!!");
GetSpecificPL()->SetGaussPtsIDMapper(aGaussPtsIDMapper);
- GetSpecificPL()->Init();
- GetSpecificPL()->Build();
-
+ if(theIsInitilizePipe){
+ GetSpecificPL()->Init();
+ GetSpecificPL()->Build();
+ }
GetCResult()->MinMaxConnect(this);
}
//! Redefines VISU_ColoredPrs3d_i::DoSetInput
virtual
void
- DoSetInput();
+ DoSetInput(bool theIsInitilizePipe);
//! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
virtual
}
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange)
-{
- vtkFloatingPointType aRange[2];
- aRange[0] = vtkFloatingPointType(theMinRange);
- aRange[1] = vtkFloatingPointType(theMaxRange);
- myScalarMapOnDeformedShapePL->SetScalarRange(aRange);
-}
-
-
-//---------------------------------------------------------------
-CORBA::Double
-VISU::ScalarMapOnDeformedShape_i
-::GetSourceRangeMin()
-{
- vtkFloatingPointType aRange[2];
- myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
- return aRange[0];
-}
-
-
-//---------------------------------------------------------------
-CORBA::Double
-VISU::ScalarMapOnDeformedShape_i
-::GetSourceRangeMax()
-{
- vtkFloatingPointType aRange[2];
- myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
- return aRange[1];
-}
-
-
//---------------------------------------------------------------
void
VISU::ScalarMapOnDeformedShape_i
void
SetColor(const SALOMEDS::Color& theColor);
- virtual
- void
- SetSourceRange(CORBA::Double theMinRange,
- CORBA::Double theMaxRange);
-
- virtual
- CORBA::Double
- GetSourceRangeMin();
-
- virtual
- CORBA::Double
- GetSourceRangeMax();
-
virtual
void
SameAs(const Prs3d_i* theOrigin);
VISU::ScalarMap_i
::SetRange(CORBA::Double theMin, CORBA::Double theMax)
{
- if(theMin > theMax)
- return;
- vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
- GetSpecificPL()->SetScalarRange(aScalarRange);
- UseFixedRange(true);
+ TSuperClass::SetRange(theMin, theMax);
}
+//----------------------------------------------------------------------------
+void
+VISU::ScalarMap_i
+::SetSourceRange()
+{
+ TSuperClass::SetSourceRange();
+}
//----------------------------------------------------------------------------
void
VISU::ScalarMap_i
-::DoSetInput()
+::DoSetInput(bool theIsInitilizePipe)
{
VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
if(!anInput)
throw std::runtime_error("There is no TimeStamp with the parameters !!!");
GetSpecificPL()->SetIDMapper(anIDMapper);
- GetSpecificPL()->Init();
- GetSpecificPL()->Build();
+ if(theIsInitilizePipe){
+ GetSpecificPL()->Init();
+ GetSpecificPL()->Build();
+ }
}
GetSpecificPL()->SetMapScale(theMapScale);
}
-//----------------------------------------------------------------------------
-void
-VISU::ScalarMap_i
-::SetSourceRange()
-{
- GetSpecificPL()->SetSourceRange();
- UseFixedRange(false);
-}
-
//----------------------------------------------------------------------------
VISU_Actor*
VISU::ScalarMap_i
void
SetRange(CORBA::Double theMin, CORBA::Double theMax);
+ virtual
+ void
+ SetSourceRange();
+
+
// To provide backward compatibility
virtual
void
//! Redefines VISU_ColoredPrs3d_i::DoSetInput
virtual
void
- DoSetInput();
+ DoSetInput(bool theIsInitilizePipe);
//! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
virtual
void
SetMapScale(double theMapScale = 1.0);
- virtual
- void
- SetSourceRange();
-
virtual
void
SameAs(const Prs3d_i* theOrigin);