]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_ScalarMap_i.hh
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/visu.git] / src / VISU_I / VISU_ScalarMap_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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //
23 //  File   : VISU_PrsObject_i.hxx
24 //  Author : Alexey PETROV
25 //  Module : VISU
26
27 #ifndef VISU_ScalarMap_i_HeaderFile
28 #define VISU_ScalarMap_i_HeaderFile
29
30 #include "VISU_ColoredPrs3d_i.hh"
31
32 #include <string>
33 #include <set>
34
35 class VISU_ScalarMapPL;
36
37 namespace VISU
38 {
39   //============================================================================
40   class VISU_I_EXPORT ScalarMap_i : public virtual POA_VISU::ScalarMap,
41                                     public virtual ColoredPrs3d_i
42   {
43     static int myNbPresent;
44     ScalarMap_i(const ScalarMap_i&);
45
46   public:
47         //----------------------------------------------------------------------------
48     typedef ColoredPrs3d_i TSuperClass;
49     typedef VISU::ScalarMap TInterface;
50
51     explicit
52     ScalarMap_i(EPublishInStudyMode thePublishInStudyModep);
53
54     virtual
55     ~ScalarMap_i();
56
57     virtual
58     VISU::VISUType 
59     GetType() 
60     { 
61       return VISU::TSCALARMAP;
62     }
63
64     //----------------------------------------------------------------------------
65     //! Gets memory size actually used by the presentation (Mb).
66     virtual
67     CORBA::Float
68     GetMemorySize();
69
70     //----------------------------------------------------------------------------
71     virtual 
72     VISU::Scaling 
73     GetScaling();
74
75     virtual
76     void
77     SetScaling(VISU::Scaling theScaling);
78
79     //----------------------------------------------------------------------------
80     //! Sets initial source geometry
81     virtual
82     void
83     SetSourceGeometry();
84
85     //! Add geometry of mesh as group. \retval the id of added group.
86     virtual 
87     void
88     AddMeshOnGroup(const char* theGroupName);
89     
90     //! Removes all geometries.
91     virtual
92     void
93     RemoveAllGeom();
94
95     //----------------------------------------------------------------------------
96     VISU_ScalarMapPL* 
97     GetSpecificPL() const
98     { 
99       return myScalarMapPL; 
100     }
101     
102   protected:
103     //! Redefines VISU_ColoredPrs3d_i::DoSetInput
104     virtual 
105     void
106     DoSetInput(bool theIsInitilizePipe, bool theReInit);
107
108     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
109     virtual
110     void
111     CreatePipeLine(VISU_PipeLine* thePipeLine);
112
113     //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
114     virtual 
115     bool 
116     CheckIsPossible();
117
118   public:
119     /*!
120       Checks staticaly, whether it is possible to create presentation 
121       with the given basic parameters or not.
122     */
123     static
124     size_t
125     IsPossible(Result_i* theResult, 
126                const std::string& theMeshName, 
127                VISU::Entity theEntity,
128                const std::string& theFieldName, 
129                CORBA::Long theTimeStampNumber,
130                bool theIsMemoryCheck);
131
132     //! Redefines VISU_ColoredPrs3d_i::Create
133     virtual
134     Storable* 
135     Create(const std::string& theMeshName, 
136            VISU::Entity theEntity,
137            const std::string& theFieldName, 
138            CORBA::Long theTimeStampNumber);
139
140     virtual 
141     void
142     ToStream(std::ostringstream& theStr);
143
144     static const std::string myComment;
145
146     virtual
147     const char* 
148     GetComment() const;
149
150     virtual
151     QString
152     GenerateName();
153
154     virtual
155     const char* 
156     GetIconName();
157
158     void
159     UpdateIcon();
160
161     virtual 
162     Storable* 
163     Restore(SALOMEDS::SObject_ptr theSObject,
164             const Storable::TRestoringMap& theMap);
165
166     virtual
167     void
168     SetMapScale(double theMapScale = 1.0);
169
170     virtual 
171     void
172     SameAs(const Prs3d_i* theOrigin);
173
174     virtual 
175     VISU_Actor* 
176     CreateActor();
177     
178     virtual 
179     VISU_Actor* 
180     CreateActor(bool toSupressShrinking);
181
182     virtual
183     void
184     UpdateActor(VISU_Actor* theActor);
185
186   private:
187     VISU_ScalarMapPL* myScalarMapPL;
188   };
189 }
190
191 #endif