PresentationType GetPresentationType();
};
+
//-------------------------------------------------------
- /*! \brief Interface of the %Scalar Map
+ /*! \brief Basic Interface for the %Colored 3D Presentations
*
* This interface is responsable for coloring of 3D field presentations
* according the scalar values applied to different cells.
* bar is displayed along with each colored field presentation and serves for
* consulting the correspondance between colors and data values.
*/
- interface ScalarMap : Prs3d {
+ interface ColoredPrd3d : Prs3d {
/*! Sets the method of coloring of the elements composing a 3D presentation.
*/
void SetScalarMode(in long theScalarMode);
*/
long GetScalarMode();
- /*!
- * Sets the type of scaling of the values reflected by the scalar bar.
- * \param theScaling The value of this parameter is taken from the <VAR>Scaling</VAR> enumeration.
- */
- void SetScaling(in Scaling theScaling);
-
- /*!
- * Gets the type of scaling of the values reflected by this presentation.
- */
- Scaling GetScaling();
-
- /*!
- * Sets scalar range - min and max boundaries of the scalar bar.
- * \param theMin Min boundary of the scalar bar.
- * \param theMax Max boundary of the scalar bar.
- */
- void SetRange(in double theMin, in double theMax);
-
- /*!
- * Gets the min boundary of the scalar bar.
- */
- double GetMin();
-
- /*!
- * Gets the max boundary of the scalar bar.
- */
- double GetMax();
-
/*! %Orientation of the scalar bar. */
- enum Orientation {
+ enum ScalarBarOrientation {
HORIZONTAL, /*!< Horizontal orientation of the scalar bar.*/
VERTICAL /*!< Vertical orientation of the scalar bar.*/
};
* \param theOrientation This parameter defines the orientation of the scalar bar.
* It is taken from the <VAR>Orientaton</VAR> enumeration.
*/
- void SetBarOrientation(in Orientation theOrientation);
+ void SetScalarBarOrientation(in ScalarBarOrientation theOrientation);
/*!
* Gets the type of orientation of the scalar bar.
*/
- Orientation GetBarOrientation();
+ ScalarBarOrientation GetScalarBarOrientation();
/*! \brief Position of the scalar bar.
*
string GetTitle();
};
+
+ //-------------------------------------------------------
+ /*! \brief Interface of the %Scalar Map
+ *
+ * This interface is responsable for coloring of 3D field presentations
+ * according the scalar values applied to different cells.
+ * As well it contains presentation parameters of the scalar bar. The scalar
+ * bar is displayed along with each colored field presentation and serves for
+ * consulting the correspondance between colors and data values.
+ */
+ interface ScalarMap : ColoredPrd3d {
+ /*!
+ * Sets the type of scaling of the values reflected by the scalar bar.
+ * \param theScaling The value of this parameter is taken from the <VAR>Scaling</VAR> enumeration.
+ */
+ void SetScaling(in Scaling theScaling);
+
+ /*!
+ * Gets the type of scaling of the values reflected by this presentation.
+ */
+ Scaling GetScaling();
+
+ /*!
+ * Sets scalar range - min and max boundaries of the scalar bar.
+ * \param theMin Min boundary of the scalar bar.
+ * \param theMax Max boundary of the scalar bar.
+ */
+ void SetRange(in double theMin, in double theMax);
+
+ /*!
+ * Gets the min boundary of the scalar bar.
+ */
+ double GetMin();
+
+ /*!
+ * Gets the max boundary of the scalar bar.
+ */
+ double GetMax();
+
+ /*! %Orientation of the scalar bar (to provide backward compatibility). */
+ enum Orientation {
+ HORIZONTAL, /*!< Horizontal orientation of the scalar bar.*/
+ VERTICAL /*!< Vertical orientation of the scalar bar.*/
+ };
+
+ /*!
+ * Sets the type of orientation of the scalar bar (to provide backward compatibility).
+ * \param theOrientation This parameter defines the orientation of the scalar bar.
+ * It is taken from the <VAR>Orientaton</VAR> enumeration.
+ */
+ void SetBarOrientation(in Orientation theOrientation);
+
+ /*!
+ * Gets the type of orientation of the scalar bar (to provide backward compatibility).
+ */
+ Orientation GetBarOrientation();
+ };
+
//-------------------------------------------------------
/*! \brief Gauss Points presentation interface
*
* Presentation parameters of the Gauss Points presentation.
*/
//-------------------------------------------------------
- interface GaussPoints : ScalarMap {
+ interface GaussPoints : ColoredPrd3d {
};
/*! \brief Deformed shape presentation interface
mySphereSourceSelected(vtkSphereSource::New()),
mySphereActorSelected(vtkActor::New()),
myCellSource(vtkUnstructuredGrid::New()),
- myCellActor(vtkActor::New())
+ myCellActor(vtkActor::New()),
+ myScalarBarCtrl(VISU_ScalarBarCtrl::New()),
+ myBarVisibility(true)
{
if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::VISU_GaussPtsAct - this = "<<this);
myCellActor->GetProperty()->SetAmbient(1.0);
myCellActor->GetProperty()->SetDiffuse(0.0);
myCellActor->GetProperty()->SetRepresentationToWireframe();
- mySBCtrl=VISU_ScalarBarCtrl::New();
- mySBCtrl->Delete();
- mySBCtrl->SetMode(0);
- mySBCtrl->SetRangeGlobal(0.,10.);
- mySBCtrl->SetOrientationToHorizontal();
- mySBCtrl->GetScalarBarActor(0)->SetTitle("GLB");
- mySBCtrl->GetScalarBarActor(1)->SetTitle("LOC");
-
- myScalarBar->SetVisibility(0);
+
+ myScalarBarCtrl->Delete();
+ myScalarBarCtrl->SetMode(0);
+ myScalarBarCtrl->SetRangeGlobal(0.,10.);
+ myScalarBarCtrl->SetOrientationToHorizontal();
+ myScalarBarCtrl->GetScalarBarActor(0)->SetTitle("GLB");
+ myScalarBarCtrl->GetScalarBarActor(1)->SetTitle("LOC");
}
VISU_GaussPtsAct
theRenderer->AddActor(myCellActor.GetPointer());
myCursorPyramid->AddToRender(theRenderer);
- mySBCtrl->AddToRender(theRenderer);
+ myScalarBarCtrl->AddToRender(theRenderer);
}
void
theRenderer->RemoveActor(myCellActor.GetPointer());
myCursorPyramid->RemoveFromRender(theRenderer);
- mySBCtrl->RemoveFromRender(theRenderer);
+ myScalarBarCtrl->RemoveFromRender(theRenderer);
}
void
::SetVisibility(int theMode)
{
Superclass::SetVisibility(theMode);
+ myScalarBarCtrl->SetBarVisibility(theMode && myBarVisibility);
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct
+::SetBarVisibility(bool theMode)
+{
+ myBarVisibility = theMode;
+ myScalarBarCtrl->SetBarVisibility(theMode);
+}
+
+bool
+VISU_GaussPtsAct
+::GetBarVisibility()
+{
+ return myBarVisibility;
+}
+
+VISU_ScalarBarCtrl*
+VISU_GaussPtsAct
+::GetScalarBarCtrl()
+{
+ return myScalarBarCtrl.GetPointer();
}
//----------------------------------------------------------------------------
return bRet;
}
-//==================================================================
-// function : SetBarVisibility
-// purpose :
-//==================================================================
-void VISU_GaussPtsAct::SetBarVisibility(bool theMode)
-{
- myBarVisibility = theMode;
- mySBCtrl->SetBarVisibility(myBarVisibility);
- //VISU_ScalarMapAct::SetBarVisibility(theMode);
-}
-
-//==================================================================
-// function : GetScalarBarCtrl
-// purpose :
-//==================================================================
-VISU_ScalarBarCtrl* VISU_GaussPtsAct::GetScalarBarCtrl()
-{
- return mySBCtrl.GetPointer();
-}
-
//==============================================================================
vtkStandardNewMacro(VISU_GaussPtsAct1);
#ifndef VISU_GaussPtsAct_HeaderFile
#define VISU_GaussPtsAct_HeaderFile
-#include "VISU_ScalarMapAct.h"
+#include "VISU_Actor.h"
#include "VISU_GaussPtsActorFactory.h"
#include <vtkSmartPointer.h>
class vtkCallbackCommand;
class VISU_ScalarBarCtrl;
+
+//============================================================================
class VTKOCC_EXPORT VISU_OutsideCursorSettings : public vtkObject
{
public:
float Color[3];
};
-//----------------------------------------------------------------------------
-class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_ScalarMapAct
+
+//============================================================================
+class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
{
public:
- vtkTypeMacro(VISU_GaussPtsAct,VISU_ScalarMapAct);
+ vtkTypeMacro(VISU_GaussPtsAct,VISU_Actor);
typedef vtkSmartPointer<VISU_GaussPtsDeviceActor> PDeviceActor;
static
void
SetVisibility(int theMode);
+ VISU_ScalarBarCtrl*
+ GetScalarBarCtrl();
+
+ void
+ SetBarVisibility(bool theMode);
+
+ bool
+ GetBarVisibility();
+
virtual
void
SetImplicitFunctionWidget(VISU_ImplicitFunctionWidget* theWidget);
SVTK_SelectionEvent* theSelectionEvent,
bool theIsHighlight);
- virtual void SetBarVisibility(bool theMode);
- VISU_ScalarBarCtrl* GetScalarBarCtrl();
-
protected:
//----------------------------------------------------------------------------
VISU_GaussPtsAct();
vtkSmartPointer<vtkUnstructuredGrid> myCellSource;
vtkSmartPointer<vtkActor> myCellActor;
- vtkSmartPointer<VISU_ScalarBarCtrl> mySBCtrl;
+
+ bool myBarVisibility;
+ vtkSmartPointer<VISU_ScalarBarCtrl> myScalarBarCtrl;
vtkSmartPointer<VISU_OutsideCursorSettings> myOutsideCursorSettings;
};
{
myVerX = 0.01; myVerY = 0.10; myVerW = 0.10; myVerH = 0.80;
myHorX = 0.20; myHorY = 0.01; myHorW = 0.60; myHorH = 0.12;
- Imin = 0.0; Imax = 0.0; /*Fmin = 0.0; Fmax = 0.0;*/ Rmin = 0.0; Rmax = 0.0;
+ Imin = 0.0; Imax = 0.0;
myRangeMode = -1;
setSpacing(6);
thePrs->GetPosY(),
thePrs->GetWidth(),
thePrs->GetHeight(),
- thePrs->GetBarOrientation());
+ thePrs->GetScalarBarOrientation());
bool bicolor = thePrs->GetGaussPointsPL()->GetBicolor();
BicolorButton->setChecked( bicolor );
LabelLabel->setEnabled( !bicolor );
LabelSpin->setEnabled( !bicolor );
- float aRange[2];
- thePrs->GetGaussPointsPL()->GetSourceRange(aRange);
- Rmin = aRange[0]; Rmax = aRange[1];
setScalarBarData( thePrs->GetNbColors(), thePrs->GetLabels() );
// Update myModeCombo
thePrs->SetScalarMode(myModeCombo->currentItem());
thePrs->SetPosition(XSpin->value(), YSpin->value());
thePrs->SetSize(WidthSpin->value(), HeightSpin->value());
- thePrs->SetBarOrientation((RBvert->isChecked())? VISU::ScalarMap::VERTICAL : VISU::ScalarMap::HORIZONTAL);
+ thePrs->SetScalarBarOrientation((RBvert->isChecked())? VISU::ColoredPrd3d::VERTICAL : VISU::ColoredPrd3d::HORIZONTAL);
thePrs->SetIsActiveLocalScalarBar(myRBLocal->isChecked());
thePrs->SetIsDispGlobalScalarBar(myCBDisplayed->isChecked());
- thePrs->SetSourceRange();
thePrs->SetNbColors(ColorSpin->value());
thePrs->SetLabels(LabelSpin->value());
QRadioButton* myRBLocal;
QCheckBox* myCBDisplayed;
- double Imin, Imax, /* Fmin, Fmax,*/ Rmin, Rmax;
+ double Imin, Imax;
double myHorX, myHorY, myHorW, myHorH;
double myVerX, myVerY, myVerW, myVerH;
int myRangeMode;
LIB_SRC = \
VISUConfig.cc \
- VISU_Gen_i.cc \
- VISU_Result_i.cc \
VISU_PrsObject_i.cc \
- VISU_Table_i.cc \
VISU_Prs3d_i.cc \
- VISU_Mesh_i.cc \
+ VISU_ColoredPrs3d_i.cc \
VISU_ScalarMap_i.cc \
+ VISU_GaussPoints_i.cc \
VISU_IsoSurfaces_i.cc \
VISU_DeformedShape_i.cc \
VISU_Plot3D_i.cc \
VISU_CutLines_i.cc \
VISU_Vectors_i.cc \
VISU_StreamLines_i.cc \
- VISU_GaussPoints_i.cc \
+ VISU_Mesh_i.cc \
+ VISU_Table_i.cc \
+ VISU_Gen_i.cc \
+ VISU_Result_i.cc \
VISU_ViewManager_i.cc \
VISU_View_i.cc \
VISU_TimeAnimation.cxx \
VISU_Table_i.hh \
VISU_Prs3d_i.hh \
VISU_Mesh_i.hh \
+ VISU_ColoredPrs3d_i.hh \
VISU_ScalarMap_i.hh \
VISU_IsoSurfaces_i.hh \
VISU_DeformedShape_i.hh \
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+// File : VISU_PrsObject_i.cxx
+// Author : Alexey PETROV
+// Module : VISU
+
+#include "VISU_ColoredPrs3d_i.hh"
+
+#include "VISU_ScalarMapPL.hxx"
+#include "VISU_Result_i.hh"
+#include "VISU_Convertor.hxx"
+
+#include "SUIT_ResourceMgr.h"
+
+#include <vtkMapper.h>
+
+using namespace VISU;
+using namespace std;
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+static int INCMEMORY = 4;
+
+
+//============================================================================
+VISU::ColoredPrs3d_i::
+ColoredPrs3d_i(Result_i* theResult,
+ bool theAddToStudy) :
+ PrsObject_i(theResult->GetStudyDocument()),
+ Prs3d_i(theResult,theAddToStudy),
+ myScalarMapPL(NULL),
+ myIsFixedRange(false)
+{}
+
+VISU::ColoredPrs3d_i::
+ColoredPrs3d_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject) :
+ PrsObject_i(theResult->GetStudyDocument()),
+ Prs3d_i(theResult,theSObject),
+ myScalarMapPL(NULL),
+ myIsFixedRange(false)
+{}
+
+VISU::ColoredPrs3d_i
+::~ColoredPrs3d_i()
+{}
+
+void
+VISU::ColoredPrs3d_i
+::RemoveFromStudy()
+{
+ TSuperClass::RemoveFromStudy();
+ VISU::RemoveFromStudy(mySObject,false);
+}
+
+void
+VISU::ColoredPrs3d_i
+::SameAs(const ColoredPrs3d_i* theOrigin)
+{
+ DoHook();
+
+ TSuperClass::SameAs(theOrigin);
+
+ ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(theOrigin);
+
+ myField = anOrigin->GetField();
+ myMeshName = myField->myMeshName;
+ myEntity = myField->myEntity;
+ myIteration = anOrigin->GetIteration();
+ myFieldName = anOrigin->GetFieldName();
+
+ SetScalarMode(anOrigin->GetScalarMode());
+ SetNbColors(anOrigin->GetNbColors());
+ SetScalarBarOrientation(anOrigin->GetScalarBarOrientation());
+
+ SetPosition(anOrigin->GetPosX(), anOrigin->GetPosY());
+ SetSize(anOrigin->GetWidth(), anOrigin->GetHeight());
+ SetLabels(anOrigin->GetLabels());
+ SetTitle(anOrigin->GetTitle());
+
+ SetBoldTitle(anOrigin->IsBoldTitle());
+ SetItalicTitle(anOrigin->IsItalicTitle());
+ SetShadowTitle(anOrigin->IsShadowTitle());
+ SetTitFontType(anOrigin->GetTitFontType());
+ float r,g,b;
+ anOrigin->GetTitleColor(&r,&g,&b);
+ SetTitleColor(r,g,b);
+
+ SetBoldLabel(anOrigin->IsBoldLabel());
+ SetItalicLabel(anOrigin->IsItalicLabel());
+ SetShadowLabel(anOrigin->IsShadowLabel());
+ SetLblFontType(anOrigin->GetLblFontType());
+ anOrigin->GetLabelColor(&r,&g,&b);
+ SetLabelColor(r,g,b);
+}
+
+void
+VISU::ColoredPrs3d_i
+::SameAsParams(const ColoredPrs3d_i* theOrigin)
+{
+ int anIteration = GetIteration();
+ SameAs(theOrigin);
+ myIteration = anIteration;
+
+ Build(-1);
+ Update();
+}
+
+
+//----------------------------------------------------------------------------
+CORBA::Long
+VISU::ColoredPrs3d_i
+::GetScalarMode()
+{
+ return myScalarMapPL->GetScalarMode();
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetScalarMode(CORBA::Long theScalarMode)
+{
+ myScalarMapPL->SetScalarMode(theScalarMode);
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetNbColors(CORBA::Long theNbColors)
+{
+ myScalarMapPL->SetNbColors(theNbColors);
+}
+
+CORBA::Long
+VISU::ColoredPrs3d_i
+::GetNbColors()
+{
+ return myScalarMapPL->GetNbColors();
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetScalarBarOrientation(VISU::ColoredPrd3d::ScalarBarOrientation theOrientation)
+{
+ myOrientation = theOrientation;
+}
+
+VISU::ColoredPrd3d::ScalarBarOrientation
+VISU::ColoredPrs3d_i
+::GetScalarBarOrientation()
+{
+ return myOrientation;
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetPosition(CORBA::Double X, CORBA::Double Y)
+{
+ myPosition[0] = X;
+ myPosition[1] = Y;
+}
+
+CORBA::Double
+VISU::ColoredPrs3d_i
+::GetPosX()
+{
+ return myPosition[0];
+}
+
+CORBA::Double
+VISU::ColoredPrs3d_i
+::GetPosY()
+{
+ return myPosition[1];
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetSize(CORBA::Double theWidth, CORBA::Double theHeight)
+{
+ myWidth = theWidth;
+ myHeight = theHeight;
+}
+
+CORBA::Double
+VISU::ColoredPrs3d_i
+::GetWidth()
+{
+ return myWidth;
+}
+
+CORBA::Double
+VISU::ColoredPrs3d_i
+::GetHeight()
+{
+ return myHeight;
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetLabels(CORBA::Long theNbLabels)
+{
+ myNumberOfLabels = theNbLabels;
+}
+
+CORBA::Long
+VISU::ColoredPrs3d_i
+::GetLabels()
+{
+ return myNumberOfLabels;
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetTitle(const char* theName)
+{
+ myTitle = theName;
+}
+
+char*
+VISU::ColoredPrs3d_i
+::GetTitle()
+{
+ return CORBA::string_dup(myTitle.c_str());
+}
+
+bool
+VISU::ColoredPrs3d_i
+::IsBoldTitle()
+{
+ return myIsBoldTitle;
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetBoldTitle(bool isBold)
+{
+ myIsBoldTitle = isBold;
+}
+
+bool
+VISU::ColoredPrs3d_i
+::IsItalicTitle()
+{
+ return myIsItalicTitle;
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetItalicTitle(bool isItalic)
+{
+ myIsItalicTitle = isItalic;
+}
+
+bool
+VISU::ColoredPrs3d_i
+::IsShadowTitle()
+{
+ return myIsShadowTitle;
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetShadowTitle(bool isShadow)
+{
+ myIsShadowTitle = isShadow;
+}
+
+int
+VISU::ColoredPrs3d_i
+::GetTitFontType()
+{
+ return myTitFontType;
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetTitFontType(int theType)
+{
+ myTitFontType = theType;
+}
+
+void
+VISU::ColoredPrs3d_i
+::GetTitleColor(float* theR, float* theG, float* theB)
+{
+ *theR = myTitleColor[0];
+ *theG = myTitleColor[1];
+ *theB = myTitleColor[2];
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetTitleColor(float theR, float theG, float theB)
+{
+ myTitleColor[0] = theR;
+ myTitleColor[1] = theG;
+ myTitleColor[2] = theB;
+}
+
+bool
+VISU::ColoredPrs3d_i
+::IsBoldLabel()
+{
+ return myIsBoldLabel;
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetBoldLabel(bool isBold)
+{
+ myIsBoldLabel = isBold;
+}
+
+bool
+VISU::ColoredPrs3d_i
+::IsItalicLabel()
+{
+ return myIsItalicLabel;
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetItalicLabel(bool isItalic)
+{
+ myIsItalicLabel = isItalic;
+}
+
+bool
+VISU::ColoredPrs3d_i
+::IsShadowLabel()
+{
+ return myIsShadowLabel;
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetShadowLabel(bool isShadow)
+{
+ myIsShadowLabel = isShadow;
+}
+
+int
+VISU::ColoredPrs3d_i
+::GetLblFontType()
+{
+ return myLblFontType;
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetLblFontType(int theType)
+{
+ myLblFontType = theType;
+}
+
+void
+VISU::ColoredPrs3d_i
+::GetLabelColor(float* theR, float* theG, float* theB)
+{
+ *theR = myLabelColor[0];
+ *theG = myLabelColor[1];
+ *theB = myLabelColor[2];
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetLabelColor(float theR, float theG, float theB)
+{
+ myLabelColor[0] = theR;
+ myLabelColor[1] = theG;
+ myLabelColor[2] = theB;
+}
+
+
+//----------------------------------------------------------------------------
+/**
+ * Creates ColoredPrs3d and initialises it from resources
+ */
+VISU::Storable*
+VISU::ColoredPrs3d_i
+::Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theIteration)
+{
+ DoHook();
+
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+
+ int aScalarMode = aResourceMgr->integerValue("VISU", "scalar_bar_mode", 0);
+ SetScalarMode(aScalarMode);
+
+ int aNumberOfColors = aResourceMgr->integerValue( "VISU", "scalar_bar_num_colors", 64 );
+ SetNbColors(aNumberOfColors);
+
+ // Orientation
+ int anOrientation = aResourceMgr->integerValue("VISU", "scalar_bar_orientation", 0);
+ if(anOrientation == 1)
+ myOrientation = VISU::ColoredPrd3d::HORIZONTAL;
+ else
+ myOrientation = VISU::ColoredPrd3d::VERTICAL;
+
+ // Scalar Bar origin
+ QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" );
+
+ float aXorigin = (myOrientation == VISU::ColoredPrd3d::VERTICAL) ? 0.01 : 0.2;
+ aXorigin = aResourceMgr->doubleValue("VISU", propertyName + "x", aXorigin);
+ myPosition[0] = aXorigin;
+
+ float aYorigin = (myOrientation == VISU::ColoredPrd3d::VERTICAL) ? 0.1 : 0.012;
+ aYorigin = aResourceMgr->doubleValue("VISU", propertyName + "y", aYorigin);
+ myPosition[1] = aYorigin;
+
+ // Scalar Bar size
+ myWidth = (myOrientation == VISU::ColoredPrd3d::VERTICAL)? 0.1 : 0.6;
+ myWidth = aResourceMgr->doubleValue("VISU", propertyName + "width", myWidth);
+
+ myHeight = (myOrientation == VISU::ColoredPrd3d::VERTICAL)? 0.8:0.12;
+ myHeight = aResourceMgr->doubleValue("VISU", propertyName + "height", myHeight);
+
+ // Nb of Labels
+ myNumberOfLabels = aResourceMgr->integerValue( "VISU", "scalar_bar_num_labels", 5 );
+
+ // Fonts properties definition
+ myIsBoldTitle = myIsItalicTitle = myIsShadowTitle = true;
+ myTitFontType = VTK_ARIAL;
+
+ if(aResourceMgr->hasValue( "VISU", "scalar_bar_title_font" )){
+ QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_title_font" );
+ if ( f.family() == "Arial" )
+ myTitFontType = VTK_ARIAL;
+ else if ( f.family() == "Courier" )
+ myTitFontType = VTK_COURIER;
+ else if ( f.family() == "Times" )
+ myTitFontType = VTK_TIMES;
+
+ myIsBoldTitle = f.bold();
+ myIsItalicTitle = f.italic();
+ myIsShadowTitle = f.underline();
+ }
+
+ QColor aTextColor = aResourceMgr->colorValue( "VISU", "scalar_bar_title_color", QColor( 255, 255, 255 ) );
+
+ myTitleColor[0] = aTextColor.red() / 255;
+ myTitleColor[1] = aTextColor.green() / 255;
+ myTitleColor[2] = aTextColor.blue() / 255;
+
+ myIsBoldLabel = myIsItalicLabel = myIsShadowLabel = true;
+ myLblFontType = VTK_ARIAL;
+
+ if( aResourceMgr->hasValue( "VISU", "scalar_bar_label_font" )){
+ QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_label_font" );
+ if ( f.family() == "Arial" )
+ myLblFontType = VTK_ARIAL;
+ else if ( f.family() == "Courier" )
+ myLblFontType = VTK_COURIER;
+ else if ( f.family() == "Times" )
+ myLblFontType = VTK_TIMES;
+
+ myIsBoldLabel = f.bold();
+ myIsItalicLabel = f.italic();
+ myIsShadowLabel = f.underline();
+ }
+
+ QColor aLabelColor = aResourceMgr->colorValue( "VISU", "scalar_bar_label_color", QColor( 255, 255, 255 ) );
+
+ myLabelColor[0] = aLabelColor.red() / 255;
+ myLabelColor[1] = aLabelColor.green() / 255;
+ myLabelColor[2] = aLabelColor.blue() / 255;
+
+ myMeshName = theMeshName;
+ myEntity = (VISU::TEntity)theEntity;
+ myFieldName =theFieldName;
+ myIteration = theIteration;
+
+ return Build(false);
+}
+
+VISU::Storable*
+VISU::ColoredPrs3d_i
+::Restore(const Storable::TRestoringMap& theMap)
+{
+ DoHook();
+
+ TSuperClass::Restore(theMap);
+
+ SetScalarMode(VISU::Storable::FindValue(theMap,"myScalarMode").toInt());
+ SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt());
+ SetScalarBarOrientation((VISU::ColoredPrd3d::ScalarBarOrientation)VISU::Storable::FindValue(theMap,"myOrientation").toInt());
+
+ myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
+ myEntity = (VISU::TEntity)VISU::Storable::FindValue(theMap,"myEntity").toInt();
+ myFieldName = VISU::Storable::FindValue(theMap,"myFieldName").latin1();
+ myIteration = VISU::Storable::FindValue(theMap,"myIteration").toInt();
+
+ myTitle = VISU::Storable::FindValue(theMap,"myTitle").latin1();
+ myNumberOfLabels = VISU::Storable::FindValue(theMap,"myNumberOfLabels").toInt();
+ myPosition[0] = VISU::Storable::FindValue(theMap,"myPosition[0]").toDouble();
+ myPosition[1] = VISU::Storable::FindValue(theMap,"myPosition[1]").toDouble();
+ myWidth = VISU::Storable::FindValue(theMap,"myWidth").toDouble();
+ myHeight = VISU::Storable::FindValue(theMap,"myHeight").toDouble();
+
+ myTitFontType = VISU::Storable::FindValue(theMap,"myTitFontType").toInt();
+ myIsBoldTitle = VISU::Storable::FindValue(theMap,"myIsBoldTitle").toInt();
+ myIsItalicTitle = VISU::Storable::FindValue(theMap,"myIsItalicTitle").toInt();
+ myIsShadowTitle = VISU::Storable::FindValue(theMap,"myIsShadowTitle").toInt();
+ myTitleColor[0] = VISU::Storable::FindValue(theMap,"myTitleColor[0]").toFloat();
+ myTitleColor[1] = VISU::Storable::FindValue(theMap,"myTitleColor[1]").toFloat();
+ myTitleColor[2] = VISU::Storable::FindValue(theMap,"myTitleColor[2]").toFloat();
+
+ myLblFontType = VISU::Storable::FindValue(theMap,"myLblFontType").toInt();
+ myIsBoldLabel = VISU::Storable::FindValue(theMap,"myIsBoldLabel").toInt();
+ myIsItalicLabel = VISU::Storable::FindValue(theMap,"myIsItalicLabel").toInt();
+ myIsShadowLabel = VISU::Storable::FindValue(theMap,"myIsShadowLabel").toInt();
+ myLabelColor[0] = VISU::Storable::FindValue(theMap,"myLabelColor[0]").toFloat();
+ myLabelColor[1] = VISU::Storable::FindValue(theMap,"myLabelColor[1]").toFloat();
+ myLabelColor[2] = VISU::Storable::FindValue(theMap,"myLabelColor[2]").toFloat();
+
+ myAddToStudy = false; //SRN Added 21/06/2003 SAL2983: to avoid addition of the new ScalarMap to study.
+
+ return Build(true);
+}
+
+void
+VISU::ColoredPrs3d_i
+::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
+
+ Storable::DataToStream( theStr, "myScalarMode", int(GetScalarMode()) );
+ Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
+ Storable::DataToStream( theStr, "myOrientation", myOrientation );
+
+ Storable::DataToStream( theStr, "myMeshName", myMeshName.c_str() );
+ Storable::DataToStream( theStr, "myEntity", myEntity );
+ Storable::DataToStream( theStr, "myFieldName", myFieldName.c_str() );
+ Storable::DataToStream( theStr, "myIteration", myIteration );
+
+ Storable::DataToStream( theStr, "myTitle", myTitle.c_str() );
+ Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
+ Storable::DataToStream( theStr, "myPosition[0]", myPosition[0] );
+ Storable::DataToStream( theStr, "myPosition[1]", myPosition[1] );
+ Storable::DataToStream( theStr, "myWidth", myWidth );
+ Storable::DataToStream( theStr, "myHeight", myHeight );
+
+ Storable::DataToStream( theStr, "myTitFontType", myTitFontType );
+ Storable::DataToStream( theStr, "myIsBoldTitle", myIsBoldTitle );
+ Storable::DataToStream( theStr, "myIsItalicTitle", myIsItalicTitle );
+ Storable::DataToStream( theStr, "myIsShadowTitle", myIsShadowTitle );
+ Storable::DataToStream( theStr, "myTitleColor[0]", myTitleColor[0] );
+ Storable::DataToStream( theStr, "myTitleColor[1]", myTitleColor[1] );
+ Storable::DataToStream( theStr, "myTitleColor[2]", myTitleColor[2] );
+
+ Storable::DataToStream( theStr, "myLblFontType", myLblFontType );
+ Storable::DataToStream( theStr, "myIsBoldLabel", myIsBoldLabel );
+ Storable::DataToStream( theStr, "myIsItalicLabel", myIsItalicLabel );
+ Storable::DataToStream( theStr, "myIsShadowLabel", myIsShadowLabel );
+ Storable::DataToStream( theStr, "myLabelColor[0]", myLabelColor[0] );
+ Storable::DataToStream( theStr, "myLabelColor[1]", myLabelColor[1] );
+ Storable::DataToStream( theStr, "myLabelColor[2]", myLabelColor[2] );
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::DoHook()
+{
+ if(MYDEBUG) MESSAGE("ColoredPrs3d_i::DoHook() - "<<myPipeLine);
+ if(!myPipeLine){
+ myPipeLine = VISU_ScalarMapPL::New();
+ myPipeLine->GetMapper()->SetScalarVisibility(1);
+ }
+ myScalarMapPL = dynamic_cast<VISU_ScalarMapPL*>(myPipeLine);
+}
+
+//----------------------------------------------------------------------------
+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)
+ aStudyBuilder->NewCommand(); // There is a transaction
+ try{
+ DoSetInput(myResult);
+ QString aComment;
+ myName = "NoName";
+ if(theRestoring <= 0){
+ if(theRestoring == 0) myScalarMapPL->Init();
+ if(!myIsFixedRange) myScalarMapPL->SetSourceRange();
+ const VISU::TValField& aValField = myField->myValField;
+ const VISU::PValForTime aValForTime = aValField.find(myIteration)->second;
+ aComment.sprintf("%s %s",myFieldName.c_str(),VISU_Convertor::GenerateName(aValForTime->myTime).c_str());
+ if (theRestoring == 0) myTitle = aComment.simplifyWhiteSpace().latin1();
+ }
+ if(myAddToStudy){
+ myName = GenerateName().latin1();
+ aComment.sprintf("myComment=TIMESTAMP;myType=%d;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
+ VISU::TTIMESTAMP,myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
+ string aResultEntry = myResult->GetEntry();
+ string aRefFatherEntry = myResult->GetRefFatherEntry();
+ string anEntry = myResult->GetEntry(aComment.latin1());
+ if(anEntry == "") throw std::runtime_error("There is no Entry for binding the presentation !!!");
+ 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);
+ mySObject = myStudy->FindObjectIOR(anIOR);
+ }
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ return NULL;
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ return NULL;
+ }
+ if(myAddToStudy)
+ aStudyBuilder->CommitCommand();
+ return this;
+}
+
+
+//----------------------------------------------------------------------------
+const VISU::PField&
+VISU::ColoredPrs3d_i
+::GetField() const
+{
+ return myField;
+}
+
+const std::string&
+VISU::ColoredPrs3d_i
+::GetMeshName() const
+{
+ return myMeshName;
+}
+
+VISU::Entity
+VISU::ColoredPrs3d_i
+::GetEntity() const
+{
+ return VISU::Entity(myEntity);
+}
+
+const std::string&
+VISU::ColoredPrs3d_i
+::GetFieldName() const
+{
+ return myFieldName;
+}
+
+int
+VISU::ColoredPrs3d_i
+::GetIteration() const
+{
+ return myIteration;
+}
+
+VISU_ScalarMapPL*
+VISU::ColoredPrs3d_i
+::GetScalarMapPL()
+{
+ return myScalarMapPL;
+}
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+// File : VISU_PrsObject_i.hxx
+// Author : Alexey PETROV
+// Module : VISU
+
+#ifndef VISU_ColoredPrs3d_i_HeaderFile
+#define VISU_ColoredPrs3d_i_HeaderFile
+
+#include "VISU_Prs3d_i.hh"
+
+class VISU_ScalarMapPL;
+
+namespace VISU
+{
+ //============================================================================
+ class ColoredPrs3d_i : public virtual POA_VISU::ColoredPrd3d,
+ public virtual Prs3d_i
+ {
+ ColoredPrs3d_i();
+ ColoredPrs3d_i(const ColoredPrs3d_i&);
+ public:
+ //----------------------------------------------------------------------------
+ typedef Prs3d_i TSuperClass;
+
+ explicit
+ ColoredPrs3d_i(Result_i* theResult,
+ bool theAddToStudy);
+ explicit
+ ColoredPrs3d_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject);
+
+ virtual
+ ~ColoredPrs3d_i();
+
+ virtual
+ void
+ RemoveFromStudy();
+
+ //----------------------------------------------------------------------------
+ virtual
+ CORBA::Long
+ GetScalarMode();
+
+ virtual
+ void
+ SetScalarMode(CORBA::Long theScalarMode);
+
+ virtual
+ void
+ SetNbColors(CORBA::Long theNbColors);
+
+ virtual
+ CORBA::Long
+ GetNbColors();
+
+ virtual
+ void
+ SetScalarBarOrientation(VISU::ColoredPrd3d::ScalarBarOrientation theOrientation);
+
+ virtual
+ VISU::ColoredPrd3d::ScalarBarOrientation
+ GetScalarBarOrientation();
+
+ virtual
+ void
+ SetPosition(CORBA::Double X, CORBA::Double Y);
+
+ virtual
+ CORBA::Double
+ GetPosX();
+
+ virtual
+ CORBA::Double
+ GetPosY();
+
+ virtual
+ void
+ SetSize(CORBA::Double theWidth, CORBA::Double theHeight);
+
+ virtual
+ CORBA::Double
+ GetWidth();
+
+ virtual
+ CORBA::Double
+ GetHeight();
+
+ virtual
+ void
+ SetLabels(CORBA::Long theNbLabels);
+
+ virtual
+ CORBA::Long
+ GetLabels();
+
+ virtual
+ void
+ SetTitle(const char* theName);
+
+ virtual
+ char*
+ GetTitle();
+
+ //----------------------------------------------------------------------------
+ protected:
+ VISU::ColoredPrd3d::ScalarBarOrientation myOrientation;
+ std::string myTitle;
+ int myNumberOfLabels;
+ float myPosition[2], myWidth, myHeight;
+
+ public:
+ //----------------------------------------------------------------------------
+ virtual
+ Storable*
+ Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theIteration);
+
+ virtual
+ Storable*
+ Restore(const Storable::TRestoringMap& theMap);
+
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
+
+ virtual
+ void
+ SameAs(const ColoredPrs3d_i* theOrigin);
+
+ /*!
+ * \brief Works like SameAs() method, but keep myIteration value unchanged.
+ *
+ * Is used in VISU_TimeAnimation class implementation.
+ */
+ void
+ SameAsParams(const ColoredPrs3d_i* theOrigin);
+
+ const VISU::PField&
+ GetField() const;
+
+ const std::string&
+ GetMeshName() const;
+
+ VISU::Entity
+ GetEntity() const;
+
+ const std::string&
+ GetFieldName() const;
+
+ int
+ GetIteration() const;
+
+ VISU_ScalarMapPL*
+ GetScalarMapPL();
+
+ virtual
+ bool
+ IsBoldTitle();
+
+ virtual
+ void
+ SetBoldTitle(bool isBold);
+
+ virtual
+ bool
+ IsItalicTitle();
+
+ virtual
+ void
+ SetItalicTitle(bool isItalic);
+
+ virtual
+ bool
+ IsShadowTitle();
+
+ virtual
+ void
+ SetShadowTitle(bool isShadow);
+
+ virtual
+ int
+ GetTitFontType();
+
+ virtual
+ void
+ SetTitFontType(int theType);
+
+ virtual
+ void
+ GetTitleColor(float* theR, float* theG, float* theB);
+
+ virtual
+ void
+ SetTitleColor(float theR, float theG, float theB);
+
+ virtual
+ bool
+ IsBoldLabel();
+
+ virtual
+ void
+ SetBoldLabel(bool isBold);
+
+ virtual
+ bool
+ IsItalicLabel();
+
+ virtual
+ void
+ SetItalicLabel(bool isItalic);
+
+ virtual
+ bool
+ IsShadowLabel();
+
+ virtual
+ void
+ SetShadowLabel(bool isShadow);
+
+ virtual
+ int
+ GetLblFontType();
+
+ virtual
+ void
+ SetLblFontType(int theType);
+
+ virtual
+ void
+ GetLabelColor(float* theR, float* theG, float* theB);
+
+ virtual
+ void
+ SetLabelColor(float theR, float theG, float theB);
+
+ //----------------------------------------------------------------------------
+ protected:
+ PField myField;
+ TEntity myEntity;
+ std::string myFieldName;
+ int myIteration;
+
+ //Font management
+ bool myIsBoldTitle;
+ bool myIsItalicTitle;
+ bool myIsShadowTitle;
+ int myTitFontType;
+ float myTitleColor[3];
+
+ bool myIsBoldLabel;
+ bool myIsItalicLabel;
+ bool myIsShadowLabel;
+ int myLblFontType;
+ float myLabelColor[3];
+
+ VISU_ScalarMapPL* myScalarMapPL;
+ bool myIsFixedRange;
+
+ virtual
+ void
+ DoSetInput(Result_i* theResult) = 0;
+
+ Storable*
+ Build(int theRestoring);
+
+ virtual
+ void
+ DoHook();
+ };
+
+}
+
+#endif
bool theAddToStudy) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theAddToStudy),
+ ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
myCutLinesPL(NULL)
-{
-}
+{}
VISU::CutLines_i::
SALOMEDS::SObject_ptr theSObject) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theSObject),
+ ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
myCutLinesPL(NULL)
{
bool theAddToStudy) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theAddToStudy),
+ ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
myCutPlanesPL(NULL)
-{
-}
+{}
VISU::CutPlanes_i::
SALOMEDS::SObject_ptr theSObject) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theSObject),
+ ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
myCutPlanesPL(NULL)
-{
-}
+{}
void VISU::CutPlanes_i::SameAs(const CutPlanes_i* theOrigin){
bool theAddToStudy) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theAddToStudy),
+ ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
myDeformedShapePL(NULL)
{
SALOMEDS::SObject_ptr theSObject) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theSObject),
+ ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
myDeformedShapePL(NULL)
{
// Module :
#include "VISU_GaussPoints_i.hh"
+#include "VISU_ScalarMap_i.hh"
#include "VISU_Result_i.hh"
#include "VISU_GaussPtsAct.h"
//----------------------------------------------------------------------------
VISU::GaussPoints_i::
GaussPoints_i(Result_i* theResult,
- bool theAddToStudy) :
+ bool theAddToStudy) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theAddToStudy),
- ScalarMap_i(theResult,theAddToStudy),
+ ColoredPrs3d_i(theResult,theAddToStudy),
myGaussPointsPL(NULL),
myIsColored(true),
myColor(Qt::blue),
SALOMEDS::SObject_ptr theSObject) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theSObject),
- ScalarMap_i(theResult,theSObject),
+ ColoredPrs3d_i(theResult,theSObject),
myGaussPointsPL(NULL),
myIsColored(true),
myColor(Qt::blue),
//----------------------------------------------------------------------------
VISU::Storable*
VISU::GaussPoints_i
-::Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration)
+::Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theIteration)
{
- VISU::ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+ TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
VISU::GaussPoints_i
::Restore(const Storable::TRestoringMap& theMap)
{
- DoHook();
- return VISU::ScalarMap_i::Restore(theMap);
+ TSuperClass::Restore(theMap);
+
+ return this;
}
VISU::GaussPoints_i
::ToStream(std::ostringstream& theStr)
{
- VISU::ScalarMap_i::ToStream(theStr);
+ TSuperClass::ToStream(theStr);
}
VISU::GaussPoints_i
::DoSetInput(Result_i* theResult)
{
- if(theResult->GetInput() == NULL)
+ VISU::Result_i::TInput* anInput = theResult->GetInput();
+ if(!anInput)
throw std::runtime_error("Mesh_i::Build - theResult->GetInput() == NULL !!!");
- myField = theResult->GetInput()->GetField(myMeshName,myEntity,myFieldName);
- if(myField == NULL)
+ myField = anInput->GetField(myMeshName,myEntity,myFieldName);
+ if(!myField)
throw std::runtime_error("There is no Field with the parameters !!!");
VISU::PGaussPtsIDMapper aGaussPtsIDMapper =
- theResult->GetInput()->GetTimeStampOnGaussPts(myMeshName,myEntity,myFieldName,myIteration);
+ anInput->GetTimeStampOnGaussPts(myMeshName,myEntity,myFieldName,myIteration);
if(!aGaussPtsIDMapper)
throw std::runtime_error("There is no TimeStamp with the parameters !!!");
myGaussPointsPL = dynamic_cast<VISU_GaussPointsPL*>(myPipeLine);
- ScalarMap_i::DoHook();
+ TSuperClass::DoHook();
}
const Handle(SALOME_InteractiveObject)& theIO)
{
try{
- VISU::Prs3d_i::CreateActor(theActor,theIO);
+ TSuperClass::CreateActor(theActor,theIO);
theActor->GetPipeLine()->Delete();
theActor->SetRepresentation(VTK_POINTS);
UpdateActor(theActor);
}
//----------------------------------------------------------------------------
-void VISU::GaussPoints_i::UpdateActor(VISU_Actor* theActor)
+void
+VISU::GaussPoints_i
+::UpdateActor(VISU_Actor* theActor)
{
+ TSuperClass::UpdateActor(theActor);
if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
if(GetIsColored()){
anActor->SetBarVisibility(true);
myColor.green() / 255.0,
myColor.blue() / 255.0);
}
- //
- VISU_ScalarBarCtrl *aSBCtrl = anActor->GetScalarBarCtrl();
- //
- // Ranges
- float *pRange=myScalarMapPL->GetBarTable()->GetRange();
- //
-
- VISU::TField *pField=myField.get();
- vtkIdType aIndexOfComponent=(vtkIdType)GetScalarMode();
- TMinMax aTMinMax=pField->GetMinMax(aIndexOfComponent);
- aSBCtrl->SetRangeGlobal(aTMinMax.first, aTMinMax.second);
-
- /* Stub for testing
- {
- float dR;
- //
- dR=0.5*(pRange[1]-pRange[0]);
- aSBCtrl->SetRangeGlobal (pRange[0]-dR, pRange[1]+dR);
- }
- */
- aSBCtrl->SetRangeLocal (pRange);
- aSBCtrl->SetOrientation(myOrientation);
- //
- // Mode
- int iSBMode;
- //
- if (myIsActiveLocalScalarBar) {
- iSBMode=1;
- }
- else {
- if (myIsDispGlobalScalarBar) {
- iSBMode=2;
- }
- else {
- iSBMode=0;
- aSBCtrl->SetRangeGlobal(pRange);
+ if(VISU_ScalarBarCtrl *aScalarBarCtrl = anActor->GetScalarBarCtrl()){
+ vtkIdType aScalarMode = GetScalarMode();
+ TMinMax aTMinMax = myField->GetMinMax(aScalarMode);
+ float *aRange = myScalarMapPL->GetBarTable()->GetRange();
+
+ aScalarBarCtrl->SetRangeGlobal(aTMinMax.first, aTMinMax.second);
+ aScalarBarCtrl->SetRangeLocal(aRange);
+
+ aScalarBarCtrl->SetOrientation(myOrientation);
+
+ int aScalarBarMode;
+ if(myIsActiveLocalScalarBar){
+ aScalarBarMode = 1;
+ }else{
+ if(myIsDispGlobalScalarBar){
+ aScalarBarMode = 2;
+ }else{
+ aScalarBarMode = 0;
+ aScalarBarCtrl->SetRangeGlobal(aRange);
+ }
}
- }
- aSBCtrl->SetMode(iSBMode);
- //
- // Position
- aSBCtrl->SetWidth(myWidth);
- aSBCtrl->SetHeight(myHeight);
- aSBCtrl->SetPosition(myPosition);
- //
- // Bicolor
- bool bBicolor=GetGaussPointsPL()->GetBicolor();
- aSBCtrl->SetBicolor(bBicolor);
- //
- aSBCtrl->Update();
- //
- for (int i=0; i<2; ++i) {
- vtkScalarBarActor *aScalarBar = aSBCtrl->GetScalarBarActor(i);
-
- aScalarBar->SetTitle(myTitle.c_str());
+ aScalarBarCtrl->SetMode(aScalarBarMode);
- aScalarBar->SetNumberOfLabels(myNumberOfLabels);
+ // Position
+ aScalarBarCtrl->SetWidth(myWidth);
+ aScalarBarCtrl->SetHeight(myHeight);
+ aScalarBarCtrl->SetPosition(myPosition);
+
+ // Bicolor
+ bool anIsBicolor = GetGaussPointsPL()->GetBicolor();
+ aScalarBarCtrl->SetBicolor(anIsBicolor);
+
+ aScalarBarCtrl->Update();
- vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
- aTitleProp->SetFontFamily(myTitFontType);
- aTitleProp->SetColor(myTitleColor);
- (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
- (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
- (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
+ for(int i = 0; i < 2; ++i){
+ vtkScalarBarActor *aScalarBar = aScalarBarCtrl->GetScalarBarActor(i);
+ aScalarBar->SetTitle(myTitle.c_str());
+ aScalarBar->SetNumberOfLabels(myNumberOfLabels);
- vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
- aLabelProp->SetFontFamily(myLblFontType);
- aLabelProp->SetColor(myLabelColor);
- (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
- (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
- (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
-
- aScalarBar->Modified();
+ vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
+ aTitleProp->SetFontFamily(myTitFontType);
+ aTitleProp->SetColor(myTitleColor);
+ (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
+ (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
+ (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
+
+ vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
+ aLabelProp->SetFontFamily(myLblFontType);
+ aLabelProp->SetColor(myLabelColor);
+ (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
+ (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
+ (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
+
+ aScalarBar->Modified();
+ }
}
- //
- VISU::ScalarMap_i::UpdateActor(theActor);
}
}
anImageData->Delete();
}
}
+
+
//----------------------------------------------------------------------------
-void VISU::GaussPoints_i::SetIsActiveLocalScalarBar(const bool theFlag){
- myIsActiveLocalScalarBar=theFlag;
+void
+VISU::GaussPoints_i
+::SetIsActiveLocalScalarBar(const bool theFlag)
+{
+ myIsActiveLocalScalarBar = theFlag;
}
-//----------------------------------------------------------------------------
-bool VISU::GaussPoints_i::GetIsActiveLocalScalarBar()const {
+
+bool
+VISU::GaussPoints_i
+::GetIsActiveLocalScalarBar() const
+{
return myIsActiveLocalScalarBar;
}
-//----------------------------------------------------------------------------
-void VISU::GaussPoints_i::SetIsDispGlobalScalarBar(const bool theFlag){
+
+void
+VISU::GaussPoints_i
+::SetIsDispGlobalScalarBar(const bool theFlag)
+{
myIsDispGlobalScalarBar=theFlag;
}
-//----------------------------------------------------------------------------
-bool VISU::GaussPoints_i::GetIsDispGlobalScalarBar()const {
+
+bool
+VISU::GaussPoints_i
+::GetIsDispGlobalScalarBar() const
+{
return myIsDispGlobalScalarBar;
}
#ifndef VISU_GaussPoints_i_HeaderFile
#define VISU_GaussPoints_i_HeaderFile
-#include "VISU_ScalarMap_i.hh"
+#include "VISU_ColoredPrs3d_i.hh"
#include "VISU_GaussPtsActorFactory.h"
class VISU_GaussPointsPL;
{
class GaussPoints_i : public virtual POA_VISU::GaussPoints,
public virtual VISU::TGaussPtsActorFactory,
- public virtual ScalarMap_i
+ public virtual ColoredPrs3d_i
{
static int myNbPresent;
GaussPoints_i();
GaussPoints_i(const GaussPoints_i&);
public:
+ //----------------------------------------------------------------------------
+ typedef ColoredPrs3d_i TSuperClass;
+
explicit
GaussPoints_i(Result_i* theResult,
bool theAddToStudy);
bool theAddToStudy) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theAddToStudy),
+ ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
myIsoSurfacesPL(NULL)
-{
-}
+{}
VISU::IsoSurfaces_i::
SALOMEDS::SObject_ptr theSObject) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theSObject),
+ ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
myIsoSurfacesPL(NULL)
-{
-}
+{}
void VISU::IsoSurfaces_i::SameAs(const IsoSurfaces_i* theOrigin) {
const string VISU::Plot3D_i::myComment = "PLOT3D";
const char* VISU::Plot3D_i::GetComment() const { return myComment.c_str(); }
-VISU::Plot3D_i::Plot3D_i (Result_i* theResult, bool theAddToStudy)
- : PrsObject_i(theResult->GetStudyDocument()),
- Prs3d_i(theResult,theAddToStudy),
- ScalarMap_i(theResult,theAddToStudy),
- myPlot3DPL(NULL)
-{
-}
+VISU::Plot3D_i
+::Plot3D_i(Result_i* theResult,
+ bool theAddToStudy) :
+ PrsObject_i(theResult->GetStudyDocument()),
+ Prs3d_i(theResult,theAddToStudy),
+ ColoredPrs3d_i(theResult,theAddToStudy),
+ ScalarMap_i(theResult,theAddToStudy),
+ myPlot3DPL(NULL)
+{}
-VISU::Plot3D_i::Plot3D_i (Result_i* theResult, SALOMEDS::SObject_ptr theSObject)
- : PrsObject_i(theResult->GetStudyDocument()),
- Prs3d_i(theResult,theSObject),
- ScalarMap_i(theResult,theSObject),
- myPlot3DPL(NULL)
-{
-}
+VISU::Plot3D_i
+::Plot3D_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject) :
+ PrsObject_i(theResult->GetStudyDocument()),
+ Prs3d_i(theResult,theSObject),
+ ColoredPrs3d_i(theResult,theSObject),
+ ScalarMap_i(theResult,theSObject),
+ myPlot3DPL(NULL)
+{}
void VISU::Plot3D_i::SameAs (const Plot3D_i* theOrigin)
{
//----------------------------------------------------------------------------
VISU::Prs3d_i
::Prs3d_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
+ SALOMEDS::SObject_ptr theSObject) :
PrsObject_i(theResult->GetStudyDocument()),
mySObject(SALOMEDS::SObject::_duplicate(theSObject)),
myActorCollection(vtkActorCollection::New()),
VISU::Prs3d_i
::Prs3d_i(Result_i* theResult,
- bool theAddToStudy) :
+ bool theAddToStudy) :
PrsObject_i(theResult->GetStudyDocument()),
myActorCollection(vtkActorCollection::New()),
mySObject(SALOMEDS::SObject::_nil()),
static int INCMEMORY = 4;
-int VISU::ScalarMap_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//============================================================================
+int
+VISU::ScalarMap_i
+::IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName, int theIteration, int isMemoryCheck)
{
try{
float aSize = INCMEMORY*
return 0;
}
-int VISU::ScalarMap_i::myNbPresent = 0;
-QString VISU::ScalarMap_i::GenerateName() { return VISU::GenerateName("ScalarMap",myNbPresent++);}
+//----------------------------------------------------------------------------
+int
+VISU::ScalarMap_i
+::myNbPresent = 0;
+
+QString
+VISU::ScalarMap_i
+::GenerateName()
+{
+ return VISU::GenerateName("ScalarMap",myNbPresent++);
+}
+
+const string
+VISU::ScalarMap_i
+::myComment = "SCALARMAP";
+
+const char*
+VISU::ScalarMap_i
+::GetComment() const {
+ return myComment.c_str();
+}
+
-const string VISU::ScalarMap_i::myComment = "SCALARMAP";
-const char* VISU::ScalarMap_i::GetComment() const { return myComment.c_str();}
+//----------------------------------------------------------------------------
VISU::ScalarMap_i::
ScalarMap_i(Result_i* theResult,
bool theAddToStudy) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theAddToStudy),
- myScalarMapPL(NULL)
-{
-}
-
+ ColoredPrs3d_i(theResult,theAddToStudy)
+{}
VISU::ScalarMap_i::
ScalarMap_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theSObject),
- myScalarMapPL(NULL)
-{
-}
-
+ ColoredPrs3d_i(theResult,theSObject)
+{}
-void VISU::ScalarMap_i::RemoveFromStudy()
-{
- VISU::Prs3d_i::RemoveFromStudy();
- VISU::RemoveFromStudy(mySObject,false);
-}
+VISU::ScalarMap_i
+::~ScalarMap_i()
+{}
-void VISU::ScalarMap_i::SameAs(const ScalarMap_i* theOrigin)
+//----------------------------------------------------------------------------
+void
+VISU::ScalarMap_i
+::SameAs(const ScalarMap_i* theOrigin)
{
- ScalarMap_i* aScalarMap = const_cast<ScalarMap_i*>(theOrigin);
- DoHook();
- VISU::Prs3d_i::SameAs(aScalarMap);
- myField = aScalarMap->GetField();
- myMeshName = myField->myMeshName;
- myEntity = myField->myEntity;
- myIteration = aScalarMap->GetIteration();
- myFieldName = aScalarMap->GetFieldName();
-
- SetScalarMode(aScalarMap->GetScalarMode());
-
- SetRange(aScalarMap->GetMin(), aScalarMap->GetMax());
- myIsFixedRange = aScalarMap->IsRangeFixed();
-
- SetScaling(aScalarMap->GetScaling());
-
- SetBarOrientation(aScalarMap->GetBarOrientation());
- SetPosition(aScalarMap->GetPosX(), aScalarMap->GetPosY());
- SetSize(aScalarMap->GetWidth(), aScalarMap->GetHeight());
- SetNbColors(aScalarMap->GetNbColors());
- SetLabels(aScalarMap->GetLabels());
- SetTitle(aScalarMap->GetTitle());
-
- SetBoldTitle(aScalarMap->IsBoldTitle());
- SetItalicTitle(aScalarMap->IsItalicTitle());
- SetShadowTitle(aScalarMap->IsShadowTitle());
- SetTitFontType(aScalarMap->GetTitFontType());
- float r,g,b;
- aScalarMap->GetTitleColor(&r,&g,&b);
- SetTitleColor(r,g,b);
-
- SetBoldLabel(aScalarMap->IsBoldLabel());
- SetItalicLabel(aScalarMap->IsItalicLabel());
- SetShadowLabel(aScalarMap->IsShadowLabel());
- SetLblFontType(aScalarMap->GetLblFontType());
- aScalarMap->GetLabelColor(&r,&g,&b);
- SetLabelColor(r,g,b);
+ TSuperClass::SameAs(theOrigin);
- Build(-1);
- Update();
-}
+ ScalarMap_i* anOrigin = const_cast<ScalarMap_i*>(theOrigin);
+
+ SetRange(anOrigin->GetMin(), anOrigin->GetMax());
+ myIsFixedRange = anOrigin->IsRangeFixed();
-void VISU::ScalarMap_i::SameAsParams (const ScalarMap_i* theOrigin)
-{
- int time = GetIteration();
- SameAs(theOrigin);
- myIteration = time;
+ SetScaling(anOrigin->GetScaling());
- //??Build(true);
Build(-1);
Update();
}
+//----------------------------------------------------------------------------
/**
* Creates Scalar Map and initialises it from resources
*/
-VISU::Storable* VISU::ScalarMap_i::Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration)
+VISU::Storable*
+VISU::ScalarMap_i
+::Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theIteration)
{
- DoHook();
+ TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- int aScalarMode = aResourceMgr->integerValue("VISU", "scalar_bar_mode", 0);
- SetScalarMode(aScalarMode);
-
- // Orientation
- int orient = aResourceMgr->integerValue("VISU", "scalar_bar_orientation", 0);
- if (orient == 1)
- myOrientation = VISU::ScalarMap::HORIZONTAL;
- else
- myOrientation = VISU::ScalarMap::VERTICAL;
-
- // Scalar Bar origin
- QString propertyName = QString( "scalar_bar_%1_" ).arg( orient == 0 ? "vertical" : "horizontal" );
-
- float aXorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.01 : 0.2;
- aXorigin = aResourceMgr->doubleValue("VISU", propertyName + "x", aXorigin);
- myPosition[0] = aXorigin;
-
- float aYorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.1 : 0.012;
- aYorigin = aResourceMgr->doubleValue("VISU", propertyName + "y", aYorigin);
- myPosition[1] = aYorigin;
-
- // Scalar Bar size
- myWidth = (myOrientation == VISU::ScalarMap::VERTICAL)? 0.1 : 0.6;
- myWidth = aResourceMgr->doubleValue("VISU", propertyName + "width", myWidth);
-
- myHeight = (myOrientation == VISU::ScalarMap::VERTICAL)? 0.8:0.12;
- myHeight = aResourceMgr->doubleValue("VISU", propertyName + "height", myHeight);
-
- // Nb of Colors
- int aNumberOfColors = aResourceMgr->integerValue( "VISU", "scalar_bar_num_colors", 64 );
- SetNbColors(aNumberOfColors);
-
- // Nb of Labels
- myNumberOfLabels = aResourceMgr->integerValue( "VISU", "scalar_bar_num_labels", 5 );
-
// Scalar Range
- int rangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0);
- myIsFixedRange = (rangeType == 1) ? true : false;
-
- if (myIsFixedRange)
- {
- float aMin = aResourceMgr->doubleValue("VISU", "scalar_range_min", 0);
- float aMax = aResourceMgr->doubleValue("VISU", "scalar_range_max", 0);
- SetRange(aMin,aMax);
- }
+ int aRangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0);
+ myIsFixedRange = (aRangeType == 1) ? true : false;
+
+ if(myIsFixedRange){
+ float aMin = aResourceMgr->doubleValue("VISU", "scalar_range_min", 0);
+ float aMax = aResourceMgr->doubleValue("VISU", "scalar_range_max", 0);
+ SetRange(aMin,aMax);
+ }
bool isLog = aResourceMgr->booleanValue("VISU", "scalar_bar_logarithmic", false);
else
SetScaling(VISU::LINEAR);
- // Fonts properties definition
- myIsBoldTitle = myIsItalicTitle = myIsShadowTitle = true;
- myTitFontType = VTK_ARIAL;
-
- if ( aResourceMgr->hasValue( "VISU", "scalar_bar_title_font" ) )
- {
- QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_title_font" );
-
- if ( f.family() == "Arial" )
- myTitFontType = VTK_ARIAL;
- else if ( f.family() == "Courier" )
- myTitFontType = VTK_COURIER;
- else if ( f.family() == "Times" )
- myTitFontType = VTK_TIMES;
-
- myIsBoldTitle = f.bold();
- myIsItalicTitle = f.italic();
- myIsShadowTitle = f.underline();
- }
-
- QColor aTextColor = aResourceMgr->colorValue( "VISU", "scalar_bar_title_color", QColor( 255, 255, 255 ) );
-
- myTitleColor[0] = aTextColor.red() / 255;
- myTitleColor[1] = aTextColor.green() / 255;
- myTitleColor[2] = aTextColor.blue() / 255;
-
- ///
-
- myIsBoldLabel = myIsItalicLabel = myIsShadowLabel = true;
- myLblFontType = VTK_ARIAL;
-
- if ( aResourceMgr->hasValue( "VISU", "scalar_bar_label_font" ) )
- {
- QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_label_font" );
-
- if ( f.family() == "Arial" )
- myLblFontType = VTK_ARIAL;
- else if ( f.family() == "Courier" )
- myLblFontType = VTK_COURIER;
- else if ( f.family() == "Times" )
- myLblFontType = VTK_TIMES;
-
- myIsBoldLabel = f.bold();
- myIsItalicLabel = f.italic();
- myIsShadowLabel = f.underline();
- }
-
- QColor aLabelColor = aResourceMgr->colorValue( "VISU", "scalar_bar_label_color", QColor( 255, 255, 255 ) );
-
- myLabelColor[0] = aLabelColor.red() / 255;
- myLabelColor[1] = aLabelColor.green() / 255;
- myLabelColor[2] = aLabelColor.blue() / 255;
-
-
- myMeshName = theMeshName;
- myEntity = (VISU::TEntity)theEntity;
- myFieldName =theFieldName;
- myIteration = theIteration;
-
- return Build(false);
+ return this;
}
-
-VISU::Storable* VISU::ScalarMap_i::Restore(const Storable::TRestoringMap& theMap)
+VISU::Storable*
+VISU::ScalarMap_i
+::Restore(const Storable::TRestoringMap& theMap)
{
- DoHook();
- myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
- myEntity = (VISU::TEntity)VISU::Storable::FindValue(theMap,"myEntity").toInt();
- myFieldName = VISU::Storable::FindValue(theMap,"myFieldName").latin1();
- myIteration = VISU::Storable::FindValue(theMap,"myIteration").toInt();
+ TSuperClass::Restore(theMap);
- SetScalarMode(VISU::Storable::FindValue(theMap,"myScalarMode").toInt());
SetScaling(VISU::Scaling(VISU::Storable::FindValue(theMap,"myScaling").toInt()));
+
float aMin = VISU::Storable::FindValue(theMap,"myScalarRange[0]").toDouble();
float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
SetRange(aMin,aMax);
+
myIsFixedRange = VISU::Storable::FindValue(theMap,"myIsFixedRange").toInt();
- myTitle = VISU::Storable::FindValue(theMap,"myTitle").latin1();
- myOrientation = (VISU::ScalarMap::Orientation)VISU::Storable::FindValue(theMap,"myOrientation").toInt();
- SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt());
- myNumberOfLabels = VISU::Storable::FindValue(theMap,"myNumberOfLabels").toInt();
- myPosition[0] = VISU::Storable::FindValue(theMap,"myPosition[0]").toDouble();
- myPosition[1] = VISU::Storable::FindValue(theMap,"myPosition[1]").toDouble();
- myWidth = VISU::Storable::FindValue(theMap,"myWidth").toDouble();
- myHeight = VISU::Storable::FindValue(theMap,"myHeight").toDouble();
-
- myTitFontType = VISU::Storable::FindValue(theMap,"myTitFontType").toInt();
- myIsBoldTitle = VISU::Storable::FindValue(theMap,"myIsBoldTitle").toInt();
- myIsItalicTitle = VISU::Storable::FindValue(theMap,"myIsItalicTitle").toInt();
- myIsShadowTitle = VISU::Storable::FindValue(theMap,"myIsShadowTitle").toInt();
- myTitleColor[0] = VISU::Storable::FindValue(theMap,"myTitleColor[0]").toFloat();
- myTitleColor[1] = VISU::Storable::FindValue(theMap,"myTitleColor[1]").toFloat();
- myTitleColor[2] = VISU::Storable::FindValue(theMap,"myTitleColor[2]").toFloat();
-
- myLblFontType = VISU::Storable::FindValue(theMap,"myLblFontType").toInt();
- myIsBoldLabel = VISU::Storable::FindValue(theMap,"myIsBoldLabel").toInt();
- myIsItalicLabel = VISU::Storable::FindValue(theMap,"myIsItalicLabel").toInt();
- myIsShadowLabel = VISU::Storable::FindValue(theMap,"myIsShadowLabel").toInt();
- myLabelColor[0] = VISU::Storable::FindValue(theMap,"myLabelColor[0]").toFloat();
- myLabelColor[1] = VISU::Storable::FindValue(theMap,"myLabelColor[1]").toFloat();
- myLabelColor[2] = VISU::Storable::FindValue(theMap,"myLabelColor[2]").toFloat();
-
- Prs3d_i::Restore(theMap);
- myAddToStudy = false; //SRN Added 21/06/2003 SAL2983: to avoid addition of the new ScalarMap to study.
- return Build(true);
+ return this;
}
+void
+VISU::ScalarMap_i
+::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
-void VISU::ScalarMap_i::ToStream(std::ostringstream& theStr){
- Prs3d_i::ToStream(theStr);
-
- Storable::DataToStream( theStr, "myMeshName", myMeshName.c_str() );
- Storable::DataToStream( theStr, "myEntity", myEntity );
- Storable::DataToStream( theStr, "myFieldName", myFieldName.c_str() );
- Storable::DataToStream( theStr, "myIteration", myIteration );
-
- Storable::DataToStream( theStr, "myScalarMode", int(GetScalarMode()) );
Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
Storable::DataToStream( theStr, "myIsFixedRange", myIsFixedRange );
Storable::DataToStream( theStr, "myScaling", GetScaling() );
-
- Storable::DataToStream( theStr, "myTitle", myTitle.c_str() );
- Storable::DataToStream( theStr, "myOrientation", myOrientation );
- Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
- Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
- Storable::DataToStream( theStr, "myPosition[0]", myPosition[0] );
- Storable::DataToStream( theStr, "myPosition[1]", myPosition[1] );
- Storable::DataToStream( theStr, "myWidth", myWidth );
- Storable::DataToStream( theStr, "myHeight", myHeight );
-
- Storable::DataToStream( theStr, "myTitFontType", myTitFontType );
- Storable::DataToStream( theStr, "myIsBoldTitle", myIsBoldTitle );
- Storable::DataToStream( theStr, "myIsItalicTitle", myIsItalicTitle );
- Storable::DataToStream( theStr, "myIsShadowTitle", myIsShadowTitle );
- Storable::DataToStream( theStr, "myTitleColor[0]", myTitleColor[0] );
- Storable::DataToStream( theStr, "myTitleColor[1]", myTitleColor[1] );
- Storable::DataToStream( theStr, "myTitleColor[2]", myTitleColor[2] );
-
- Storable::DataToStream( theStr, "myLblFontType", myLblFontType );
- Storable::DataToStream( theStr, "myIsBoldLabel", myIsBoldLabel );
- Storable::DataToStream( theStr, "myIsItalicLabel", myIsItalicLabel );
- Storable::DataToStream( theStr, "myIsShadowLabel", myIsShadowLabel );
- Storable::DataToStream( theStr, "myLabelColor[0]", myLabelColor[0] );
- Storable::DataToStream( theStr, "myLabelColor[1]", myLabelColor[1] );
- Storable::DataToStream( theStr, "myLabelColor[2]", myLabelColor[2] );
}
-CORBA::Long VISU::ScalarMap_i::GetScalarMode(){
- return myScalarMapPL->GetScalarMode();
-}
-void VISU::ScalarMap_i::SetScalarMode(CORBA::Long theScalarMode) {
- myScalarMapPL->SetScalarMode(theScalarMode);
+//----------------------------------------------------------------------------
+void
+VISU::ScalarMap_i
+::SetBarOrientation(VISU::ScalarMap::Orientation theOrientation)
+{
+ SetScalarBarOrientation((VISU::ColoredPrd3d::ScalarBarOrientation)theOrientation);
}
+VISU::ScalarMap::Orientation
+VISU::ScalarMap_i
+::GetBarOrientation()
+{
+ return (VISU::ScalarMap::Orientation)GetScalarBarOrientation();
+}
-VISU::Scaling VISU::ScalarMap_i::GetScaling(){
+VISU::Scaling
+VISU::ScalarMap_i
+::GetScaling()
+{
return VISU::Scaling(myScalarMapPL->GetScaling());
}
-void VISU::ScalarMap_i::SetScaling(VISU::Scaling theScaling){
+
+void
+VISU::ScalarMap_i
+::SetScaling(VISU::Scaling theScaling)
+{
myScalarMapPL->SetScaling(theScaling);
}
-
-void VISU::ScalarMap_i::SetRange(CORBA::Double theMin, CORBA::Double theMax){
- if(theMin > theMax) return;
+void
+VISU::ScalarMap_i
+::SetRange(CORBA::Double theMin, CORBA::Double theMax)
+{
+ if(theMin > theMax)
+ return;
float aScalarRange[2] = {theMin, theMax};
myScalarMapPL->SetScalarRange(aScalarRange);
myIsFixedRange = true;
}
-CORBA::Double VISU::ScalarMap_i::GetMin(){
+CORBA::Double
+VISU::ScalarMap_i
+::GetMin()
+{
return myScalarMapPL->GetScalarRange()[0];
}
-CORBA::Double VISU::ScalarMap_i::GetMax(){
+CORBA::Double
+VISU::ScalarMap_i
+::GetMax()
+{
return myScalarMapPL->GetScalarRange()[1];
}
-void VISU::ScalarMap_i::SetNbColors(CORBA::Long theNbColors){
- myScalarMapPL->SetNbColors(theNbColors);
-}
-
-CORBA::Long VISU::ScalarMap_i::GetNbColors(){
- return myScalarMapPL->GetNbColors();
-}
-
-
-VISU::ScalarMap_i::~ScalarMap_i(){}
-
-
-VISU::Storable* VISU::ScalarMap_i::Build(int theRestoring){
- if(MYDEBUG)
- MESSAGE("ScalarMap_i::Build - "<<myFieldName<<"; theRestoring = "<<theRestoring);
- SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
- if(myAddToStudy) aStudyBuilder->NewCommand(); // There is a transaction
- try{
- DoSetInput(myResult);
- QString aComment;
- myName = "NoName";
- if(theRestoring <= 0){
- if(theRestoring == 0) myScalarMapPL->Init();
- if(!myIsFixedRange) myScalarMapPL->SetSourceRange();
- const VISU::TValField& aValField = myField->myValField;
- const VISU::PValForTime aValForTime = aValField.find(myIteration)->second;
- aComment.sprintf("%s %s",myFieldName.c_str(),VISU_Convertor::GenerateName(aValForTime->myTime).c_str());
- if (theRestoring == 0) myTitle = aComment.simplifyWhiteSpace().latin1();
- }
- if(myAddToStudy){
- myName = GenerateName().latin1();
- aComment.sprintf("myComment=TIMESTAMP;myType=%d;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
- VISU::TTIMESTAMP,myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
- string aResultEntry = myResult->GetEntry();
- string aRefFatherEntry = myResult->GetRefFatherEntry();
- string anEntry = myResult->GetEntry(aComment.latin1());
- if(anEntry == "") throw std::runtime_error("There is no Entry for binding the presentation !!!");
- 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);
- mySObject = myStudy->FindObjectIOR(anIOR);
- }
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- return NULL;
- }catch(...){
- INFOS("Unknown exception was occured!");
- return NULL;
- }
- if(myAddToStudy) aStudyBuilder->CommitCommand();
- return this;
-}
-
-
-void VISU::ScalarMap_i::DoSetInput(Result_i* theResult){
- if(theResult->GetInput() == NULL)
+//----------------------------------------------------------------------------
+void
+VISU::ScalarMap_i
+::DoSetInput(Result_i* theResult)
+{
+ VISU::Result_i::TInput* anInput = theResult->GetInput();
+ if(!anInput)
throw std::runtime_error("Mesh_i::Build - theResult->GetInput() == NULL !!!");
- myField = theResult->GetInput()->GetField(myMeshName,myEntity,myFieldName);
- if(myField == NULL)
+ myField = anInput->GetField(myMeshName,myEntity,myFieldName);
+ if(!myField)
throw std::runtime_error("There is no Field with the parameters !!!");
VISU::PIDMapper anIDMapper =
- theResult->GetInput()->GetTimeStampOnMesh(myMeshName,myEntity,myFieldName,myIteration);
+ anInput->GetTimeStampOnMesh(myMeshName,myEntity,myFieldName,myIteration);
if(!anIDMapper)
throw std::runtime_error("There is no TimeStamp with the parameters !!!");
myScalarMapPL->Build();
}
+void
+VISU::ScalarMap_i
+::Update()
+{
+ TSuperClass::Update();
+}
+
-void VISU::ScalarMap_i::DoHook(){
- if(MYDEBUG) MESSAGE("ScalarMap_i::DoHook() - "<<myPipeLine);
- if(!myPipeLine) {
- myPipeLine = VISU_ScalarMapPL::New();
- myPipeLine->GetMapper()->SetScalarVisibility(1);
- }
- myScalarMapPL = dynamic_cast<VISU_ScalarMapPL*>(myPipeLine);
+//----------------------------------------------------------------------------
+void
+VISU::ScalarMap_i
+::SetMapScale(double theMapScale)
+{
+ myScalarMapPL->SetMapScale(theMapScale);
}
-void VISU::ScalarMap_i::Update() {
- VISU::Prs3d_i::Update();
+bool
+VISU::ScalarMap_i
+::IsRangeFixed()
+{
+ return myIsFixedRange;
}
-void VISU::ScalarMap_i::SetMapScale(double theMapScale){
- myScalarMapPL->SetMapScale(theMapScale);
+void
+VISU::ScalarMap_i
+::SetSourceRange()
+{
+ myScalarMapPL->SetSourceRange();
+ myIsFixedRange = false;
}
+//----------------------------------------------------------------------------
VISU_Actor*
VISU::ScalarMap_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
VISU_ScalarMapAct* anActor = VISU_ScalarMapAct::New();
try{
- VISU::Prs3d_i::CreateActor(anActor,theIO);
+ TSuperClass::CreateActor(anActor,theIO);
anActor->SetBarVisibility(true);
anActor->SetRepresentation(2);
UpdateActor(anActor);
return anActor;
}
-void VISU::ScalarMap_i::UpdateActor(VISU_Actor* theActor) {
+void
+VISU::ScalarMap_i
+::UpdateActor(VISU_Actor* theActor)
+{
+ TSuperClass::UpdateActor(theActor);
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
- VISU::Prs3d_i::UpdateActor(theActor);
VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
aScalarBar->SetLookupTable(myScalarMapPL->GetBarTable());
aScalarBar->SetTitle(myTitle.c_str());
aScalarBar->Modified();
}
}
-
-
-void VISU::ScalarMap_i::SetSourceRange(){
- myScalarMapPL->SetSourceRange();
- myIsFixedRange = false;
-}
#ifndef VISU_ScalarMap_i_HeaderFile
#define VISU_ScalarMap_i_HeaderFile
-#include "VISU_Prs3d_i.hh"
+#include "VISU_ColoredPrs3d_i.hh"
-class VISU_ScalarMapPL;
-namespace VISU{
+namespace VISU
+{
+ //============================================================================
class ScalarMap_i : public virtual POA_VISU::ScalarMap,
- public virtual Prs3d_i
+ public virtual ColoredPrs3d_i
{
static int myNbPresent;
ScalarMap_i();
ScalarMap_i(const ScalarMap_i&);
public:
+ //----------------------------------------------------------------------------
+ typedef ColoredPrs3d_i TSuperClass;
+
explicit
ScalarMap_i(Result_i* theResult,
bool theAddToStudy);
explicit
ScalarMap_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual void SameAs(const ScalarMap_i* theOrigin);
- virtual ~ScalarMap_i();
- virtual void RemoveFromStudy();
-
- virtual VISU::VISUType GetType() { return VISU::TSCALARMAP;};
-
- virtual CORBA::Long GetScalarMode();
- virtual void SetScalarMode(CORBA::Long theScalarMode);
-
- virtual VISU::Scaling GetScaling();
- virtual void SetScaling(VISU::Scaling theScaling);
-
- virtual void SetRange(CORBA::Double theMin, CORBA::Double theMax);
- virtual CORBA::Double GetMin();
- virtual CORBA::Double GetMax();
-
- virtual void SetNbColors(CORBA::Long theNbColors);
- virtual CORBA::Long GetNbColors();
-
- virtual void SetBarOrientation(VISU::ScalarMap::Orientation theOrientation){
- myOrientation = theOrientation;
+ virtual
+ ~ScalarMap_i();
+
+ virtual
+ VISU::VISUType
+ GetType()
+ {
+ return VISU::TSCALARMAP;
}
- virtual VISU::ScalarMap::Orientation GetBarOrientation() { return myOrientation;}
-
- virtual void SetPosition(CORBA::Double X, CORBA::Double Y) { myPosition[0] = X; myPosition[1] = Y;}
- virtual CORBA::Double GetPosX() { return myPosition[0];}
- virtual CORBA::Double GetPosY() { return myPosition[1];}
-
- virtual void SetSize(CORBA::Double theWidth, CORBA::Double theHeight) {
- myWidth = theWidth; myHeight = theHeight;
- }
- virtual CORBA::Double GetWidth() { return myWidth;}
- virtual CORBA::Double GetHeight() { return myHeight;}
-
- virtual void SetLabels(CORBA::Long theNbLabels) { myNumberOfLabels = theNbLabels;}
- virtual CORBA::Long GetLabels() { return myNumberOfLabels;}
-
- virtual void SetTitle(const char* theName) { myTitle = theName;}
- virtual char* GetTitle() { return CORBA::string_dup(myTitle.c_str());}
-
- virtual bool IsBoldTitle() { return myIsBoldTitle;}
- virtual void SetBoldTitle(bool isBold) { myIsBoldTitle = isBold;}
-
- virtual bool IsItalicTitle() { return myIsItalicTitle;}
- virtual void SetItalicTitle(bool isItalic) { myIsItalicTitle = isItalic;}
- virtual bool IsShadowTitle() { return myIsShadowTitle;}
- virtual void SetShadowTitle(bool isShadow) { myIsShadowTitle = isShadow;}
-
- virtual int GetTitFontType() { return myTitFontType;}
- virtual void SetTitFontType(int theType) { myTitFontType = theType;}
+ virtual
+ VISU::Scaling
+ GetScaling();
- virtual void GetTitleColor(float* theR, float* theG, float* theB)
- {*theR = myTitleColor[0]; *theG = myTitleColor[1]; *theB = myTitleColor[2];}
- virtual void SetTitleColor(float theR, float theG, float theB)
- {myTitleColor[0] = theR; myTitleColor[1] = theG; myTitleColor[2] = theB; }
+ virtual
+ void
+ SetScaling(VISU::Scaling theScaling);
- /////
- virtual bool IsBoldLabel() { return myIsBoldLabel;}
- virtual void SetBoldLabel(bool isBold) { myIsBoldLabel = isBold;}
+ virtual
+ void
+ SetRange(CORBA::Double theMin, CORBA::Double theMax);
- virtual bool IsItalicLabel() { return myIsItalicLabel;}
- virtual void SetItalicLabel(bool isItalic) { myIsItalicLabel = isItalic;}
+ virtual
+ CORBA::Double
+ GetMin();
- virtual bool IsShadowLabel() { return myIsShadowLabel;}
- virtual void SetShadowLabel(bool isShadow) {myIsShadowLabel = isShadow;}
+ virtual
+ CORBA::Double
+ GetMax();
- virtual int GetLblFontType() { return myLblFontType;}
- virtual void SetLblFontType(int theType) { myLblFontType = theType;}
+ // To provide backward compatibility
+ virtual
+ void
+ SetBarOrientation(VISU::ScalarMap::Orientation theOrientation);
- virtual void GetLabelColor(float* theR, float* theG, float* theB)
- {*theR = myLabelColor[0]; *theG = myLabelColor[1]; *theB = myLabelColor[2];}
- virtual void SetLabelColor(float theR, float theG, float theB)
- {myLabelColor[0] = theR; myLabelColor[1] = theG; myLabelColor[2] = theB; }
+ virtual
+ VISU::ScalarMap::Orientation
+ GetBarOrientation();
typedef VISU::ScalarMap TInterface;
- VISU_ScalarMapPL* GetScalarMapPL(){ return myScalarMapPL;}
-
- /*!
- * \brief Works like SameAs() method, but keep myIteration value unchanged.
- *
- * Is used in VISU_TimeAnimation class implementation.
- */
- void SameAsParams (const ScalarMap_i* theOrigin);
protected:
- Storable* Build(int theRestoring);
- virtual void DoSetInput(Result_i* theResult);
- virtual void DoHook();
-
- VISU_ScalarMapPL* myScalarMapPL;
- PField myField;
-
- // std::string myMeshName; move it to Prs3d_i
- TEntity myEntity;
- std::string myFieldName;
- int myIteration;
-
- bool myIsFixedRange;
-
- std::string myTitle;
- int myNumberOfLabels;
- float myPosition[2], myWidth, myHeight;
- VISU::ScalarMap::Orientation myOrientation;
-
- //Font management
- bool myIsBoldTitle;
- bool myIsItalicTitle;
- bool myIsShadowTitle;
- int myTitFontType;
- float myTitleColor[3];
-
- bool myIsBoldLabel;
- bool myIsItalicLabel;
- bool myIsShadowLabel;
- int myLblFontType;
- float myLabelColor[3];
+ virtual
+ void
+ DoSetInput(Result_i* theResult);
public:
- static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck = true);
- virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration);
-
- const std::string& GetMeshName() const { return myMeshName;}
- VISU::Entity GetEntity() const { return VISU::Entity(myEntity);}
- const string& GetFieldName() const { return myFieldName;}
- int GetIteration() const { return myIteration;}
+ static
+ int
+ IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theIteration,
+ int isMemoryCheck = true);
+ virtual
+ Storable*
+ Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theIteration);
- virtual void ToStream(std::ostringstream& theStr);
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
static const std::string myComment;
- virtual const char* GetComment() const;
- virtual QString GenerateName();
- virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+ virtual
+ const char*
+ GetComment() const;
- static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
- const std::string& thePrefix, const Storable::TRestoringMap& theMap);
+ virtual
+ QString
+ GenerateName();
- virtual void Update() ;
- virtual void SetMapScale(double theMapScale = 1.0);
+ virtual
+ Storable*
+ Restore(const Storable::TRestoringMap& theMap);
+
+ static
+ Storable*
+ Restore(SALOMEDS::SObject_ptr theSObject,
+ const std::string& thePrefix,
+ const Storable::TRestoringMap& theMap);
+
+ virtual
+ void
+ Update() ;
- const VISU::PField GetField() const { return myField;}
+ virtual
+ void
+ SetMapScale(double theMapScale = 1.0);
- virtual bool IsRangeFixed() { return myIsFixedRange; }
- virtual void SetSourceRange();
+ virtual
+ bool
+ IsRangeFixed();
- virtual int GetIteration() { return myIteration; }
+ virtual
+ void
+ SetSourceRange();
+
+ virtual
+ void
+ SameAs(const ScalarMap_i* theOrigin);
virtual
VISU_Actor*
CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
- virtual void UpdateActor(VISU_Actor* theActor) ;
+ virtual
+ void
+ UpdateActor(VISU_Actor* theActor);
};
}
bool theAddToStudy) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theAddToStudy),
+ ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
DeformedShape_i(theResult,theAddToStudy),
myStreamLinesPL(NULL),
SALOMEDS::SObject_ptr theSObject) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theSObject),
+ ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
DeformedShape_i(theResult,theSObject),
myStreamLinesPL(NULL),
bool theAddToStudy) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theAddToStudy),
+ ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
DeformedShape_i(theResult,theAddToStudy),
myVectorsPL(NULL)
SALOMEDS::SObject_ptr theSObject) :
PrsObject_i(theResult->GetStudyDocument()),
Prs3d_i(theResult,theSObject),
+ ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
DeformedShape_i(theResult,theSObject),
myVectorsPL(NULL)