]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_ScalarMap_i.hh
Salome HOME
aa0b4644a62662e4946217a76babff6eaa647497
[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     virtual 
81     void 
82     SetLinkColor(const SALOMEDS::Color& theColor);
83
84     virtual 
85     SALOMEDS::Color 
86     GetLinkColor();
87
88     //----------------------------------------------------------------------------
89     virtual 
90     VISU::GaussMetric 
91     GetGaussMetric();
92
93     virtual
94     void
95     SetGaussMetric(VISU::GaussMetric theGaussMetric);
96
97     //----------------------------------------------------------------------------
98     //! Sets initial source geometry
99     virtual
100     void
101     SetSourceGeometry();
102
103     //! Add geometry of mesh as group. \retval the id of added group.
104     virtual 
105     void
106     AddMeshOnGroup(const char* theGroupName);
107     
108     //! Removes all geometries.
109     virtual
110     void
111     RemoveAllGeom();
112
113     //----------------------------------------------------------------------------
114     VISU_ScalarMapPL* 
115     GetSpecificPL() const
116     { 
117       return myScalarMapPL; 
118     }
119
120     virtual CORBA::Boolean IsBarVisible() { return myShowBar; }
121
122     virtual void SetBarVisible(CORBA::Boolean theVisible);
123     
124   protected:
125     //! Redefines VISU_ColoredPrs3d_i::DoSetInput
126     virtual 
127     void
128     DoSetInput(bool theIsInitilizePipe, bool theReInit);
129
130     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
131     virtual
132     void
133     CreatePipeLine(VISU_PipeLine* thePipeLine);
134
135     //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
136     virtual 
137     bool 
138     CheckIsPossible();
139
140   public:
141     /*!
142       Checks staticaly, whether it is possible to create presentation 
143       with the given basic parameters or not.
144     */
145     static
146     size_t
147     IsPossible(Result_i* theResult, 
148                const std::string& theMeshName, 
149                VISU::Entity theEntity,
150                const std::string& theFieldName, 
151                CORBA::Long theTimeStampNumber,
152                bool theIsMemoryCheck);
153
154     //! Redefines VISU_ColoredPrs3d_i::Create
155     virtual
156     Storable* 
157     Create(const std::string& theMeshName, 
158            VISU::Entity theEntity,
159            const std::string& theFieldName, 
160            CORBA::Long theTimeStampNumber);
161
162     virtual 
163     void
164     ToStream(std::ostringstream& theStr);
165
166     static const std::string myComment;
167
168     virtual
169     const char* 
170     GetComment() const;
171
172     virtual
173     QString
174     GenerateName();
175
176     virtual
177     const char* 
178     GetIconName();
179
180     void
181     UpdateIcon();
182
183     virtual 
184     Storable* 
185     Restore(SALOMEDS::SObject_ptr theSObject,
186             const Storable::TRestoringMap& theMap);
187
188     virtual 
189     void
190     SameAs(const Prs3d_i* theOrigin);
191
192     virtual 
193     VISU_Actor* 
194     CreateActor();
195     
196     virtual 
197     VISU_Actor* 
198     CreateActor(bool toSupressShrinking);
199
200     virtual
201     void
202     UpdateActor(VISU_ActorBase* theActor);
203
204     virtual
205     vtkFloatingPointType
206     GetComponentMin(vtkIdType theCompID);
207
208     virtual
209     vtkFloatingPointType
210     GetComponentMax(vtkIdType theCompID);
211
212   private:
213     VISU_ScalarMapPL* myScalarMapPL;
214     SALOMEDS::Color myLinkColor;
215     bool myShowBar;
216   };
217 }
218
219 #endif