]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh
Salome HOME
Fix for Bug IPAL8945
[modules/visu.git] / src / VISU_I / VISU_ScalarMapOnDeformedShape_i.hh
1 //  VISU OBJECT : interactive object for VISU entities implementation
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 // File:    VISU_ScalarMapOnDeformedShape_i.hh
24 // Author:  Eugeny Nikolaev
25 // Module : VISU
26
27 #ifndef VISU_ScalarMapOnDeformedShape_i_HeaderFile
28 #define VISU_ScalarMapOnDeformedShape_i_HeaderFile
29
30 #include "VISU_ScalarMap_i.hh"
31
32 class VISU_ScalarMapOnDeformedShapePL;
33
34 namespace VISU{
35   
36   //! Class of Scalar Map on Deformed Shape presentation.
37   class ScalarMapOnDeformedShape_i : public virtual POA_VISU::ScalarMapOnDeformedShape,
38                                      public virtual ScalarMap_i
39   {
40     static int myNbPresent;
41     ScalarMapOnDeformedShape_i();
42     ScalarMapOnDeformedShape_i(const ScalarMapOnDeformedShape_i&);
43     
44   public:
45     
46     typedef ScalarMap_i TSuperClass;
47     
48     explicit
49     ScalarMapOnDeformedShape_i(Result_i* theResult,
50                                bool theAddToStudy);
51     explicit
52     ScalarMapOnDeformedShape_i(Result_i* theResult,
53                                SALOMEDS::SObject_ptr theSObject);
54     
55     virtual ~ScalarMapOnDeformedShape_i();
56
57     virtual VISU::VISUType GetType()
58     { 
59       return VISU::TSCALARMAPONDEFORMEDSHAPE;
60     };
61     
62     typedef VISU::ScalarMapOnDeformedShape TInterface;
63     
64     virtual void SetScale(CORBA::Double theScale);
65     virtual CORBA::Double GetScale();
66
67     virtual CORBA::Boolean IsColored() { return myIsColored; }
68     virtual void ShowColored(CORBA::Boolean theColored) { myIsColored = theColored; }
69
70     virtual SALOMEDS::Color GetColor() { return myColor;}
71     virtual void SetColor(const SALOMEDS::Color& theColor) { myColor = theColor;}
72
73     virtual void SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange);
74     virtual CORBA::Double GetSourceRangeMin();
75     virtual CORBA::Double GetSourceRangeMax();
76
77     virtual 
78     void
79     SameAs(const Prs3d_i* theOrigin);
80
81     VISU_ScalarMapOnDeformedShapePL* GetScalarMapOnDeformedShapePL(){ return myScalarMapOnDeformedShapePL;}
82    
83   protected:
84     
85     virtual
86     void
87     DoHook();
88
89     VISU_ScalarMapOnDeformedShapePL *myScalarMapOnDeformedShapePL;
90     SALOMEDS::Color myColor;
91     bool myIsColored;
92     std::string myScalarMeshName;
93     std::string myScalarFieldName;
94     VISU::TEntity myScalarEntity;
95     int myScalarIteration;
96
97   public:
98     static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
99                           const char* theFieldName, int theIteration, int isMemoryCheck = true);
100     virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
101                              const char* theFieldName, int theIteration);
102
103     virtual void ToStream(std::ostringstream& theStr);
104
105     virtual Storable* Restore(const Storable::TRestoringMap& theMap);
106     
107     static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
108                              const std::string& thePrefix, const Storable::TRestoringMap& theMap);
109
110     static const std::string myComment;
111     virtual const char* GetComment() const;
112     virtual QString GenerateName();
113
114     virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
115
116     virtual void UpdateActor(VISU_Actor* theActor) ;
117
118     virtual void SetScalarField(const char* theMeshName,
119                                 const char* theFieldName,
120                                 const int   theIteration,
121                                 const VISU::TEntity  theEntity);
122
123     virtual void SetScalarFieldName(const char* theName);
124     virtual std::string GetScalarFieldName();
125     virtual void SetScalarIteration(const int theValue);
126     virtual int GetScalarIteration();
127     virtual void SetScalarMeshName(const char* theName);
128     virtual std::string GetScalarMeshName();
129     virtual void SetScalarEntity(const VISU::TEntity theValue);
130     virtual VISU::TEntity GetScalarEntity();
131   };
132 }
133 #endif