{
//---------------------------------------------------------------
inline
- TMinMax
+ TMinMax
GetMinMax(VISU::Result_i* theResult,
VISU::PField theField,
vtkIdType theCompID)
{
if(!theResult->IsMinMaxDone())
theResult->GetInput()->BuildMinMax();
-
+
return theField->GetMinMax(theCompID);
}
//---------------------------------------------------------------
struct TSimpleMinMaxController: virtual TVTKMinMaxController
{
- VISU::Result_i* myResult;
- VISU::PField myField;
-
+ VISU::ColoredPrs3d_i* myColoredPrs3d;
+
TSimpleMinMaxController(VISU::ColoredPrs3d_i* theColoredPrs3d):
- myResult(theColoredPrs3d->GetResult()),
- myField(theColoredPrs3d->GetField())
+ myColoredPrs3d(theColoredPrs3d)
{}
-
+
virtual
vtkFloatingPointType
GetComponentMin(vtkIdType theCompID)
{
- if(myField){
- TMinMax aMinMax = GetMinMax(myResult, myField, theCompID);
+ VISU::PField aField = myColoredPrs3d->GetField();
+ if (aField) {
+ VISU::Result_i* aResult = myColoredPrs3d->GetResult();
+ TMinMax aMinMax = GetMinMax(aResult, aField, theCompID);
return aMinMax.first;
}
return TMinMaxController::GetComponentMin(theCompID);
vtkFloatingPointType
GetComponentMax(vtkIdType theCompID)
{
- if(myField){
- TMinMax aMinMax = GetMinMax(myResult, myField, theCompID);
+ VISU::PField aField = myColoredPrs3d->GetField();
+ if (aField) {
+ VISU::Result_i* aResult = myColoredPrs3d->GetResult();
+ TMinMax aMinMax = GetMinMax(aResult, aField, theCompID);
return aMinMax.second;
}
return TMinMaxController::GetComponentMax(theCompID);
}
//---------------------------------------------------------------
-void
+void
VISU::ColoredPrs3d_i
::RemoveFromStudy()
{
TRemoveFromStudy(VISU::ColoredPrs3d_i* theRemovable):
myRemovable(theRemovable)
{}
-
+
virtual
void
Execute()
myFieldName = anOrigin->GetFieldName();
}
Build(-1);
-
+
TSuperClass::SameAs(theOrigin);
-
+
SetScalarMode(anOrigin->GetScalarMode());
SetNbColors(anOrigin->GetNbColors());
SetBarOrientation(anOrigin->GetBarOrientation());
-
+
SetMinMaxController(anOrigin->GetMinMaxController());
if(anOrigin->IsRangeFixed())
SetSize(anOrigin->GetWidth(), anOrigin->GetHeight());
SetLabels(anOrigin->GetLabels());
SetTitle(anOrigin->GetTitle());
-
+
SetBoldTitle(anOrigin->IsBoldTitle());
SetItalicTitle(anOrigin->IsItalicTitle());
SetShadowTitle(anOrigin->IsShadowTitle());
vtkFloatingPointType r,g,b;
anOrigin->GetTitleColor(&r,&g,&b);
SetTitleColor(r,g,b);
-
+
SetBoldLabel(anOrigin->IsBoldLabel());
SetItalicLabel(anOrigin->IsItalicLabel());
SetShadowLabel(anOrigin->IsShadowLabel());
SetLabelColor(r,g,b);
}
}
-
+
void
VISU::ColoredPrs3d_i
-::SameAsParams(const ColoredPrs3d_i* theOrigin,
- const std::string& theMeshName,
+::SameAsParams(const ColoredPrs3d_i* theOrigin,
+ const std::string& theMeshName,
const std::string& theFieldName,
- VISU::Entity theEntity,
+ VISU::Entity theEntity,
int theIteration,
bool theIsFixedRange)
{
int aScalarMode = (const_cast<ColoredPrs3d_i*>(theOrigin))->GetScalarMode();
SameAs(theOrigin);
-
+
myIsFixedRange = theIsFixedRange;
-
+
Build(-1);
-
+
SetScalarMode(aScalarMode); // mkr : IPAL14030
Update();
//----------------------------------------------------------------------------
-CORBA::Long
+CORBA::Long
VISU::ColoredPrs3d_i
::GetScalarMode()
{
void
VISU::ColoredPrs3d_i
-::SetScalarMode(CORBA::Long theScalarMode)
+::SetScalarMode(CORBA::Long theScalarMode)
{
myScalarMapPL->SetScalarMode(theScalarMode);
}
-CORBA::Double
+CORBA::Double
VISU::ColoredPrs3d_i
::GetMin()
{
return myScalarMapPL->GetScalarRange()[0];
}
-CORBA::Double
+CORBA::Double
VISU::ColoredPrs3d_i
::GetMax()
{
//----------------------------------------------------------------------------
bool
VISU::ColoredPrs3d_i
-::IsRangeFixed()
-{
- return myIsFixedRange;
+::IsRangeFixed()
+{
+ return myIsFixedRange;
}
//----------------------------------------------------------------------------
}
//----------------------------------------------------------------------------
-CORBA::Double
+CORBA::Double
VISU::ColoredPrs3d_i
::GetSourceMin()
{
}
//----------------------------------------------------------------------------
-CORBA::Double
+CORBA::Double
VISU::ColoredPrs3d_i
::GetSourceMax()
{
}
//----------------------------------------------------------------------------
-vtkFloatingPointType
+vtkFloatingPointType
VISU::ColoredPrs3d_i
::GetComponentMin(vtkIdType theCompID)
{
}
//----------------------------------------------------------------------------
-vtkFloatingPointType
+vtkFloatingPointType
VISU::ColoredPrs3d_i
::GetComponentMax(vtkIdType theCompID)
{
ProcessVoidEvent(new TEvent(myScalarMapPL, theNbColors));
}
-CORBA::Long
+CORBA::Long
VISU::ColoredPrs3d_i
::GetNbColors()
{
myOrientation = theOrientation;
}
-VISU::ScalarMap::Orientation
+VISU::ScalarMap::Orientation
VISU::ColoredPrs3d_i
-::GetBarOrientation()
+::GetBarOrientation()
{
return myOrientation;
}
void
VISU::ColoredPrs3d_i
-::SetPosition(CORBA::Double X, CORBA::Double Y)
-{
- myPosition[0] = X;
+::SetPosition(CORBA::Double X, CORBA::Double Y)
+{
+ myPosition[0] = X;
myPosition[1] = Y;
}
CORBA::Double
VISU::ColoredPrs3d_i
-::GetPosX()
+::GetPosX()
{
return myPosition[0];
}
CORBA::Double
VISU::ColoredPrs3d_i
-::GetPosY()
-{
+::GetPosY()
+{
return myPosition[1];
}
void
VISU::ColoredPrs3d_i
-::SetSize(CORBA::Double theWidth, CORBA::Double theHeight)
+::SetSize(CORBA::Double theWidth, CORBA::Double theHeight)
{
- myWidth = theWidth;
+ myWidth = theWidth;
myHeight = theHeight;
}
CORBA::Double
VISU::ColoredPrs3d_i
-::GetWidth()
+::GetWidth()
{
return myWidth;
}
CORBA::Double
VISU::ColoredPrs3d_i
-::GetHeight()
-{
+::GetHeight()
+{
return myHeight;
}
CORBA::Long
VISU::ColoredPrs3d_i
-::GetLabels()
-{
+::GetLabels()
+{
return myNumberOfLabels;
}
void
VISU::ColoredPrs3d_i
-::SetTitle(const char* theTitle)
+::SetTitle(const char* theTitle)
{
// mkr : IPAL14030
std::strstream aStream;
}
}
-char*
+char*
VISU::ColoredPrs3d_i
-::GetTitle()
-{
+::GetTitle()
+{
return CORBA::string_dup(myTitle.c_str());
}
bool
VISU::ColoredPrs3d_i
-::IsBoldTitle()
-{
+::IsBoldTitle()
+{
return myIsBoldTitle;
}
bool
VISU::ColoredPrs3d_i
-::IsItalicTitle()
-{
+::IsItalicTitle()
+{
return myIsItalicTitle;
}
void
VISU::ColoredPrs3d_i
::SetItalicTitle(bool isItalic)
-{
+{
myIsItalicTitle = isItalic;
}
bool
VISU::ColoredPrs3d_i
-::IsShadowTitle()
-{
+::IsShadowTitle()
+{
return myIsShadowTitle;
}
void
VISU::ColoredPrs3d_i
::SetShadowTitle(bool isShadow)
-{
+{
myIsShadowTitle = isShadow;
}
void
VISU::ColoredPrs3d_i
-::GetTitleColor(vtkFloatingPointType* theR,
- vtkFloatingPointType* theG,
+::GetTitleColor(vtkFloatingPointType* theR,
+ vtkFloatingPointType* theG,
vtkFloatingPointType* theB)
{
- *theR = myTitleColor[0];
- *theG = myTitleColor[1];
+ *theR = myTitleColor[0];
+ *theG = myTitleColor[1];
*theB = myTitleColor[2];
}
void
VISU::ColoredPrs3d_i
-::SetTitleColor(vtkFloatingPointType theR,
- vtkFloatingPointType theG,
+::SetTitleColor(vtkFloatingPointType theR,
+ vtkFloatingPointType theG,
vtkFloatingPointType theB)
{
- myTitleColor[0] = theR;
- myTitleColor[1] = theG;
- myTitleColor[2] = theB;
+ myTitleColor[0] = theR;
+ myTitleColor[1] = theG;
+ myTitleColor[2] = theB;
}
bool
void
VISU::ColoredPrs3d_i
-::SetBoldLabel(bool isBold)
+::SetBoldLabel(bool isBold)
{
myIsBoldLabel = isBold;
}
bool
VISU::ColoredPrs3d_i
-::IsItalicLabel()
+::IsItalicLabel()
{
return myIsItalicLabel;
}
bool
VISU::ColoredPrs3d_i
-::IsShadowLabel()
+::IsShadowLabel()
{
return myIsShadowLabel;
}
void
VISU::ColoredPrs3d_i
-::GetLabelColor(vtkFloatingPointType* theR,
- vtkFloatingPointType* theG,
+::GetLabelColor(vtkFloatingPointType* theR,
+ vtkFloatingPointType* theG,
vtkFloatingPointType* theB)
{
- *theR = myLabelColor[0];
- *theG = myLabelColor[1];
+ *theR = myLabelColor[0];
+ *theG = myLabelColor[1];
*theB = myLabelColor[2];
}
void
VISU::ColoredPrs3d_i
-::SetLabelColor(vtkFloatingPointType theR,
- vtkFloatingPointType theG,
+::SetLabelColor(vtkFloatingPointType theR,
+ vtkFloatingPointType theG,
vtkFloatingPointType theB)
{
- myLabelColor[0] = theR;
- myLabelColor[1] = theG;
- myLabelColor[2] = theB;
+ myLabelColor[0] = theR;
+ myLabelColor[1] = theG;
+ myLabelColor[2] = theB;
}
//----------------------------------------------------------------------------
/**
* Creates ColoredPrs3d and initialises it from resources
*/
-VISU::Storable*
+VISU::Storable*
VISU::ColoredPrs3d_i
-::Create(const char* theMeshName,
+::Create(const char* theMeshName,
VISU::Entity theEntity,
- const char* theFieldName,
+ const char* theFieldName,
int theIteration)
{
DoHook(); // to create proper pipeline
myTitFontType = VTK_COURIER;
else if ( f.family() == "Times" )
myTitFontType = VTK_TIMES;
-
+
myIsBoldTitle = f.bold();
myIsItalicTitle = f.italic();
myIsShadowTitle = f.underline();
myLblFontType = VTK_COURIER;
else if ( f.family() == "Times" )
myLblFontType = VTK_TIMES;
-
+
myIsBoldLabel = f.bold();
myIsItalicLabel = f.italic();
myIsShadowLabel = f.underline();
return this;
}
-VISU::Storable*
+VISU::Storable*
VISU::ColoredPrs3d_i
::Restore(const Storable::TRestoringMap& theMap)
{
SetScalarMode(VISU::Storable::FindValue(theMap,"myScalarMode").toInt());
SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt());
SetBarOrientation((VISU::ScalarMap::Orientation)VISU::Storable::FindValue(theMap,"myOrientation").toInt());
-
+
myTitle = VISU::Storable::FindValue(theMap,"myTitle").latin1();
myNumberOfLabels = VISU::Storable::FindValue(theMap,"myNumberOfLabels").toInt();
myPosition[0] = VISU::Storable::FindValue(theMap,"myPosition[0]").toDouble();
return this;
}
-void
+void
VISU::ColoredPrs3d_i
::ToStream(std::ostringstream& theStr)
{
//----------------------------------------------------------------------------
-VISU::Storable*
+VISU::Storable*
VISU::ColoredPrs3d_i
::Build(int theRestoring)
{
if(MYDEBUG)
MESSAGE("ColoredPrs3d_i::Build - "<<myFieldName<<"; theRestoring = "<<theRestoring);
SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
- if(myAddToStudy)
+ if(myAddToStudy)
aStudyBuilder->NewCommand(); // There is a transaction
#ifndef _DEXCEPT_
try{
QString aComment;
myName = "NoName";
if(theRestoring <= 0){
- if(theRestoring == 0)
+ if(theRestoring == 0)
myScalarMapPL->Init();
- if(!myIsFixedRange)
+ if(!myIsFixedRange)
myScalarMapPL->SetSourceRange();
const VISU::TValField& aValField = myField->myValField;
const VISU::PValForTime aValForTime = aValField.find(myIteration)->second;
aComment.sprintf("myComment=%s;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
GetComment(),myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
CORBA::String_var anIOR = GetID();
- CreateAttributes(myStudy,anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
+ CreateAttributes(myStudy,anEntry.c_str(),aRefFatherEntry.c_str(),
+ anIOR,myName.c_str(),"",aComment.latin1(),true);
mySObject = myStudy->FindObjectIOR(anIOR);
-
+
// Set icon
if (GetIconName() != 0)
{
throw;
}
#endif
- if(myAddToStudy)
+ if(myAddToStudy)
aStudyBuilder->CommitCommand();
return this;
}
//----------------------------------------------------------------------------
const VISU::PField&
VISU::ColoredPrs3d_i
-::GetField() const
-{
+::GetField() const
+{
return myField;
}
//----------------------------------------------------------------------------
-CORBA::Boolean
+CORBA::Boolean
VISU::ColoredPrs3d_i
::IsTimeStampFixed()
{
//----------------------------------------------------------------------------
const std::string&
VISU::ColoredPrs3d_i
-::GetMeshName() const
-{
+::GetMeshName() const
+{
return myMeshName;
}
VISU::Entity
VISU::ColoredPrs3d_i
-::GetEntity() const
-{
+::GetEntity() const
+{
return VISU::Entity(myEntity);
}
const std::string&
VISU::ColoredPrs3d_i
-::GetFieldName() const
-{
+::GetFieldName() const
+{
return myFieldName;
}
int
VISU::ColoredPrs3d_i
-::GetIteration() const
-{
+::GetIteration() const
+{
return myIteration;
}
VISU_ScalarMapPL*
VISU::ColoredPrs3d_i
::GetScalarMapPL()
-{
+{
return myScalarMapPL;
}