]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_ScalarMap_i.hh
Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/visu.git] / src / VISU_I / VISU_ScalarMap_i.hh
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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 //  VISU OBJECT : interactive object for VISU entities implementation
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     virtual CORBA::Boolean IsBarVisible() { return myShowBar; }
103
104     virtual void SetBarVisible(CORBA::Boolean theVisible);
105     
106   protected:
107     //! Redefines VISU_ColoredPrs3d_i::DoSetInput
108     virtual 
109     void
110     DoSetInput(bool theIsInitilizePipe, bool theReInit);
111
112     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
113     virtual
114     void
115     CreatePipeLine(VISU_PipeLine* thePipeLine);
116
117     //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
118     virtual 
119     bool 
120     CheckIsPossible();
121
122   public:
123     /*!
124       Checks staticaly, whether it is possible to create presentation 
125       with the given basic parameters or not.
126     */
127     static
128     size_t
129     IsPossible(Result_i* theResult, 
130                const std::string& theMeshName, 
131                VISU::Entity theEntity,
132                const std::string& theFieldName, 
133                CORBA::Long theTimeStampNumber,
134                bool theIsMemoryCheck);
135
136     //! Redefines VISU_ColoredPrs3d_i::Create
137     virtual
138     Storable* 
139     Create(const std::string& theMeshName, 
140            VISU::Entity theEntity,
141            const std::string& theFieldName, 
142            CORBA::Long theTimeStampNumber);
143
144     virtual 
145     void
146     ToStream(std::ostringstream& theStr);
147
148     static const std::string myComment;
149
150     virtual
151     const char* 
152     GetComment() const;
153
154     virtual
155     QString
156     GenerateName();
157
158     virtual
159     const char* 
160     GetIconName();
161
162     void
163     UpdateIcon();
164
165     virtual 
166     Storable* 
167     Restore(SALOMEDS::SObject_ptr theSObject,
168             const Storable::TRestoringMap& theMap);
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_ActorBase* theActor);
185
186     virtual
187     vtkFloatingPointType
188     GetComponentMin(vtkIdType theCompID);
189
190     virtual
191     vtkFloatingPointType
192     GetComponentMax(vtkIdType theCompID);
193
194   private:
195     VISU_ScalarMapPL* myScalarMapPL;
196     bool myShowBar;
197   };
198 }
199
200 #endif