Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[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     virtual const VISU::PField&
82     GetField() const;
83
84     VISU_ScalarMapOnDeformedShapePL* GetScalarMapOnDeformedShapePL(){ return myScalarMapOnDeformedShapePL;}
85    
86   protected:
87     
88     virtual
89     void
90     DoHook();
91
92     VISU_ScalarMapOnDeformedShapePL *myScalarMapOnDeformedShapePL;
93     SALOMEDS::Color myColor;
94     bool myIsColored;
95     std::string myScalarMeshName;
96     std::string myScalarFieldName;
97     VISU::TEntity myScalarEntity;
98     int myScalarIteration;
99     PField myScalarField;
100
101   public:
102     static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
103                           const char* theFieldName, int theIteration, int isMemoryCheck = true);
104     virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
105                              const char* theFieldName, int theIteration);
106
107     virtual void ToStream(std::ostringstream& theStr);
108
109     virtual Storable* Restore(const Storable::TRestoringMap& theMap);
110     
111     static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
112                              const std::string& thePrefix, const Storable::TRestoringMap& theMap);
113
114     static const std::string myComment;
115     virtual const char* GetComment() const;
116     virtual QString GenerateName();
117
118     virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
119
120     virtual void UpdateActor(VISU_Actor* theActor) ;
121
122     virtual void SetScalarField(const char* theMeshName,
123                                 const char* theFieldName,
124                                 const int   theIteration,
125                                 const VISU::TEntity  theEntity);
126     
127     virtual void SetScalarField(const char* theMeshName,
128                                 const char* theFieldName,
129                                 const long  theIteration,
130                                 const VISU::Entity  theEntity);
131
132     virtual void SetScalarFieldName(const char* theName);
133     virtual std::string GetScalarFieldName();
134     virtual void SetScalarIteration(const int theValue);
135     virtual int GetScalarIteration();
136     virtual void SetScalarMeshName(const char* theName);
137     virtual std::string GetScalarMeshName();
138     virtual void SetScalarEntity(const VISU::TEntity theValue);
139     virtual VISU::TEntity GetScalarEntity();
140     virtual void SetScalarEEntity(const VISU::Entity theValue);
141     virtual VISU::Entity GetScalarEEntity();
142   };
143 }
144 #endif