-#include "VISU_Result_i.hh"
-//#include "VISU_Convertor.hxx"
-#include "Handle_SALOME_InteractiveObject.hxx"
-
-class VISU_Extractor;
-class VISU_FieldTransform;
-class VISU_Actor;
-
-class vtkDataSetMapper;
-class vtkDataSet;
-class vtkProperty;
-
-class vtkWarpVector;
-class vtkContourFilter;
-class vtkAppendPolyData;
-
-class vtkGlyph3D;
-class vtkHedgeHog;
-class vtkPolyDataSource;
-class vtkStreamLine;
-
-
-namespace VISU{
- struct TField;
- //==============================================================================
- class PrsObject_i : public virtual POA_VISU::PrsObject,
- public virtual Storable
- {
- PrsObject_i(const PrsObject_i&);
-
- public:
- PrsObject_i(SALOMEDS::Study_ptr theStudy) :
- myStudy(SALOMEDS::Study::_duplicate(theStudy)) {};
- virtual ~PrsObject_i() {}
-
- protected:
- string myName;
- SALOMEDS::Study_var myStudy;
-
- public:
- virtual const char* GetName() const { return myName.c_str();}
- const SALOMEDS::Study_var& GetStudyDocument() const { return myStudy;}
- QString GetEntry();
- };
-
-
- //==============================================================================
- class Prs3d_i : public virtual PrsObject_i
- {
- Prs3d_i();
- Prs3d_i(const Prs3d_i&);
- public:
- Prs3d_i(Result_i* theResult);
- virtual void SameAs(const Prs3d_i* theOrigin);
- virtual ~Prs3d_i();
-
- typedef vtkDataSetMapper MapperType;
- typedef vtkDataSet DataType;
-
- virtual const float* GetColor() const { return myColorRGB;}
- virtual void SetColor(const float* theRGB){
- myColor.R = myColorRGB[0] = theRGB[0];
- myColor.G = myColorRGB[1] = theRGB[1];
- myColor.B = myColorRGB[2] = theRGB[2];
- }
-
-
- protected:
- Result_i* myResult;
- MapperType *myMapper;
- float myBounds[6];
- float myColorRGB[3];
- struct SALOMEDS::Color myColor;
-
- bool myAddToStudy;
-
- public:
- virtual void Update();
- virtual const char* GetComment() const = 0;
- virtual QString GenerateName() = 0;
- virtual Storable* Restore(const Storable::TRestoringMap& theMap, int theBuilding = true)
- throw(std::logic_error&);
- virtual void ToStream(ostrstream& theStr);
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
- MapperType* GetMapper() const { return myMapper;}
- Result_i* GetResult() const { return myResult; }
- };
-
-
- //==============================================================================
- class Mesh_i : public virtual POA_VISU::Mesh,
- public virtual Prs3d_i
- {
- static int myNbPresent;
- Mesh_i();
- Mesh_i(const Mesh_i&);
- public:
- Mesh_i(Result_i* theResult);
- virtual void SameAs(const Mesh_i* theOrigin);
- virtual ~Mesh_i();
- virtual VISU::VISUType GetType() { return VISU::TMESH;};
-
- virtual void SetCellColor(const SALOMEDS::Color& theColor) { myCellColor = theColor;}
- virtual SALOMEDS::Color GetCellColor() { return myCellColor;}
-
- virtual void SetNodeColor(const SALOMEDS::Color& theColor) { myNodeColor = theColor;}
- virtual SALOMEDS::Color GetNodeColor() { return myNodeColor;}
-
- virtual void SetLinkColor(const SALOMEDS::Color& theColor) { myLinkColor = theColor;}
- virtual SALOMEDS::Color GetLinkColor() { return myLinkColor;}
-
- virtual void SetPresentationType(VISU::PresentationType theType) { myPresentType = theType;}
- virtual PresentationType GetPresentationType() { return myPresentType;}
-
- typedef VISU::Mesh InterfaceType;
- typedef vtkUnstructuredGridReader InputType;
-
- protected:
- Storable* Build(int theRestoring);
-
- InputType *myInput;
- VISU::VISUType myType;
- string myMeshName;
- int myEntity;
- string mySubMeshName;
- struct SALOMEDS::Color myCellColor, myNodeColor, myLinkColor;
- VISU::PresentationType myPresentType;
-
- public:
- virtual Storable* Create(const char* theMeshName, int theEntity);
- virtual Storable* Create(const char* theMeshName, int theEntity, const char* theFamilyName);
- virtual Storable* Create(const char* theMeshName, const char* theGroupName);
- virtual Storable* Restore(const Storable::TRestoringMap& theMap, int theBuilding = true)
- throw(std::logic_error&);
- virtual void ToStream(ostrstream& theStr);
- static const string myComment;
- virtual const char* GetComment() const;
- virtual QString GenerateName();
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
- virtual InputType* GetInput() const { return myInput;}
- };
- Storable* MeshRestore(SALOMEDS::SObject_ptr theSObject,
- const string& thePrefix, const Storable::TRestoringMap& theMap)
- throw(std::logic_error&);
-
-
- //==============================================================================
- class ScalarMap_i : public virtual POA_VISU::ScalarMap,
- public virtual Prs3d_i
- {
- static int myNbPresent;
- ScalarMap_i();
- ScalarMap_i(const ScalarMap_i&);
-
- public:
- ScalarMap_i(Result_i* theResult, bool theAddToStudy = true);
- virtual void SameAs(const ScalarMap_i* theOrigin);
- virtual ~ScalarMap_i();
-
- virtual VISU::VISUType GetType() { return VISU::TSCALARMAP;};
-
- virtual void SetScalarMode(CORBA::Long theScalarMode);
- virtual CORBA::Long GetScalarMode() { return myScalarMode;}
-
- virtual void SetScaling(VISU::Scaling theScaling);
- virtual VISU::Scaling GetScaling();
-
- virtual void SetRange(CORBA::Double theMin, CORBA::Double theMax);
- virtual CORBA::Double GetMin() { return myScalarRange[0];}
- virtual CORBA::Double GetMax() { return myScalarRange[1];}
-
- virtual void SetOrientation(VISU::ScalarMap::Orientation theOrientation) {
- myOrientation = theOrientation;
- }
- virtual VISU::ScalarMap::Orientation GetOrientation() { 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 SetNbColors(CORBA::Long theNbColors) { myNumberOfColors = theNbColors;}
- virtual CORBA::Long GetNbColors() { return myNumberOfColors;}
-
- 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 void CalculateRange();
- virtual bool isRangeFixed() { return myIsFixedRange; }
-
- virtual double GetIteration() { return myIteration; }
-
- typedef VISU::ScalarMap InterfaceType;
- typedef VISU_Extractor InputType;
-
- protected:
- Storable* Build(int theRestoring);
- virtual DataType* DoHook(int theRestoring);
-
- InputType *myInput;
-
- string myMeshName;
- int myEntity;
- string myFieldName;
- int myScalarMode;
- double myIteration;
- VISU_FieldTransform *myFieldTransform;
- const TField* myField;
-
- float myScalarRange[2];
- bool myIsFixedRange;
- VISU::Scaling myScaling;