Salome HOME
8f647e2735929bf1109b4b912c302dfa960c2bbc
[modules/visu.git] / src / VISU_I / VISU_DeformedShapeAndScalarMap_i.hh
1 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //  VISU OBJECT : interactive object for VISU entities implementation
21 // File:    VISU_DeformedShapeAndScalarMap_i.hh
22 // Author:  Eugeny Nikolaev
23 // Module : VISU
24 //
25 #ifndef VISU_DeformedShapeAndScalarMap_i_HeaderFile
26 #define VISU_DeformedShapeAndScalarMap_i_HeaderFile
27
28 #include "VISU_ScalarMap_i.hh"
29
30 class VISU_DeformedShapeAndScalarMapPL;
31
32 namespace VISU
33 {
34   //----------------------------------------------------------------------------  
35   //! Class of Scalar Map on Deformed Shape presentation.
36   class VISU_I_EXPORT DeformedShapeAndScalarMap_i : public virtual POA_VISU::DeformedShapeAndScalarMap,
37                                                     public virtual ScalarMap_i
38   {
39     static int myNbPresent;
40     DeformedShapeAndScalarMap_i(const DeformedShapeAndScalarMap_i&);
41     
42   public:
43     //----------------------------------------------------------------------------     
44     typedef ScalarMap_i TSuperClass;
45     typedef VISU::DeformedShapeAndScalarMap TInterface;
46         
47     explicit
48     DeformedShapeAndScalarMap_i(EPublishInStudyMode thePublishInStudyModep);
49     
50     virtual
51     ~DeformedShapeAndScalarMap_i();
52
53     virtual
54     VISU::VISUType
55     GetType()
56     { 
57       return VISU::TDEFORMEDSHAPEANDSCALARMAP;
58     }
59     
60     virtual 
61     void
62     SetScale(CORBA::Double theScale);
63
64     virtual
65     CORBA::Double 
66     GetScale();
67
68     virtual 
69     void
70     SameAs(const Prs3d_i* theOrigin);
71
72     VISU_DeformedShapeAndScalarMapPL* 
73     GetSpecificPL()
74     { 
75       return myDeformedShapeAndScalarMapPL;
76     }
77    
78   protected:
79     //! Redefines VISU_ColoredPrs3d_i::SetField
80     virtual
81     void
82     SetField(VISU::PField theField);
83
84     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
85     virtual
86     void
87     CreatePipeLine(VISU_PipeLine* thePipeLine);
88
89     //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
90     virtual 
91     bool 
92     CheckIsPossible();
93
94   public:
95     //! Redefines VISU_ColoredPrs3d_i::IsPossible
96     static
97     size_t
98     IsPossible(Result_i* theResult, 
99                const std::string& theMeshName, 
100                VISU::Entity theEntity,
101                const std::string& theFieldName, 
102                CORBA::Long theTimeStampNumber,
103                bool theIsMemoryCheck);
104
105     //! Redefines VISU_ColoredPrs3d_i::IsPossible
106     virtual
107     Storable* 
108     Create(const std::string& theMeshName, 
109            VISU::Entity theEntity,
110            const std::string& theFieldName, 
111            CORBA::Long theTimeStampNumber);
112
113     //! Redefines VISU_ColoredPrs3d_i::ToStream
114     virtual
115     void
116     ToStream(std::ostringstream& theStr);
117
118     //! Redefines VISU_ColoredPrs3d_i::Restore
119     virtual
120     Storable* 
121     Restore(SALOMEDS::SObject_ptr theSObject,
122             const Storable::TRestoringMap& theMap);
123     
124     static const std::string myComment;
125
126     virtual
127     const char* 
128     GetComment() const;
129
130     virtual
131     QString 
132     GenerateName();
133
134     virtual
135     const char* 
136     GetIconName();
137     
138     virtual
139     VISU_Actor* 
140     CreateActor();
141
142     virtual
143     void
144     UpdateActor(VISU_Actor* theActor) ;
145
146     virtual 
147     void
148     SetScalarField(VISU::Entity theEntity,
149                    const char* theFieldName,
150                    CORBA::Long theTimeStampNumber);
151
152     virtual
153     VISU::Entity
154     GetScalarEntity();
155
156     virtual
157     char* 
158     GetScalarFieldName();
159
160     virtual
161     CORBA::Long
162     GetScalarTimeStampNumber();
163
164     virtual 
165     VISU::PField
166     GetScalarField();
167
168   private:
169     VISU_DeformedShapeAndScalarMapPL *myDeformedShapeAndScalarMapPL;
170
171     PField myScalarField;
172     VISU::Entity myScalarEntity;
173     std::string myScalarFieldName;
174     CORBA::Long myScalarTimeStampNumber;
175   };
176 }
177 #endif