Salome HOME
Merge from PortingMED3 07Apr11
[modules/visu.git] / src / VISU_I / VISU_ScalarMap_i.hh
1 //  Copyright (C) 2007-2010  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
23 //  VISU OBJECT : interactive object for VISU entities implementation
24 //  File   : VISU_PrsObject_i.hxx
25 //  Author : Alexey PETROV
26 //  Module : VISU
27 //
28 #ifndef VISU_ScalarMap_i_HeaderFile
29 #define VISU_ScalarMap_i_HeaderFile
30
31 #include "VISU_ColoredPrs3d_i.hh"
32
33 #include <string>
34 #include <set>
35
36 class VISU_ScalarMapPL;
37
38 namespace VISU
39 {
40   //============================================================================
41   class VISU_I_EXPORT ScalarMap_i : public virtual POA_VISU::ScalarMap,
42                                     public virtual ColoredPrs3d_i
43   {
44     static int myNbPresent;
45     ScalarMap_i(const ScalarMap_i&);
46
47   public:
48         //----------------------------------------------------------------------------
49     typedef ColoredPrs3d_i TSuperClass;
50     typedef VISU::ScalarMap TInterface;
51
52     explicit
53     ScalarMap_i(EPublishInStudyMode thePublishInStudyModep);
54
55     virtual
56     ~ScalarMap_i();
57
58     virtual
59     VISU::VISUType 
60     GetType() 
61     { 
62       return VISU::TSCALARMAP;
63     }
64
65     //----------------------------------------------------------------------------
66     //! Gets memory size actually used by the presentation (Mb).
67     virtual
68     CORBA::Float
69     GetMemorySize();
70
71     //----------------------------------------------------------------------------
72     virtual 
73     VISU::Scaling 
74     GetScaling();
75
76     virtual
77     void
78     SetScaling(VISU::Scaling theScaling);
79
80     //----------------------------------------------------------------------------
81     virtual 
82     void 
83     SetLinkColor(const SALOMEDS::Color& theColor);
84
85     virtual 
86     SALOMEDS::Color 
87     GetLinkColor();
88
89     //----------------------------------------------------------------------------
90     virtual 
91     VISU::GaussMetric 
92     GetGaussMetric();
93
94     virtual
95     void
96     SetGaussMetric(VISU::GaussMetric theGaussMetric);
97
98     //----------------------------------------------------------------------------
99     //! Sets initial source geometry
100     virtual
101     void
102     SetSourceGeometry();
103
104     //! Add geometry of mesh as group. \retval the id of added group.
105     virtual 
106     void
107     AddMeshOnGroup(const char* theGroupName);
108     
109     //! Removes all geometries.
110     virtual
111     void
112     RemoveAllGeom();
113
114     //----------------------------------------------------------------------------
115     VISU_ScalarMapPL* 
116     GetSpecificPL() const
117     { 
118       return myScalarMapPL; 
119     }
120
121     virtual CORBA::Boolean IsBarVisible() { return myShowBar; }
122
123     virtual void SetBarVisible(CORBA::Boolean theVisible);
124     
125   protected:
126     //! Redefines VISU_ColoredPrs3d_i::DoSetInput
127     virtual 
128     void
129     DoSetInput(bool theIsInitilizePipe, bool theReInit);
130
131     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
132     virtual
133     void
134     CreatePipeLine(VISU_PipeLine* thePipeLine);
135
136     //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
137     virtual 
138     bool 
139     CheckIsPossible();
140
141   public:
142     /*!
143       Checks staticaly, whether it is possible to create presentation 
144       with the given basic parameters or not.
145     */
146     static
147     size_t
148     IsPossible(Result_i* theResult, 
149                const std::string& theMeshName, 
150                VISU::Entity theEntity,
151                const std::string& theFieldName, 
152                CORBA::Long theTimeStampNumber,
153                bool theIsMemoryCheck);
154
155     //! Redefines VISU_ColoredPrs3d_i::Create
156     virtual
157     Storable* 
158     Create(const std::string& theMeshName, 
159            VISU::Entity theEntity,
160            const std::string& theFieldName, 
161            CORBA::Long theTimeStampNumber);
162
163     virtual 
164     void
165     ToStream(std::ostringstream& theStr);
166
167     static const std::string myComment;
168
169     virtual
170     const char* 
171     GetComment() const;
172
173     virtual
174     QString
175     GenerateName();
176
177     virtual
178     const char* 
179     GetIconName();
180
181     void
182     UpdateIcon();
183
184     virtual 
185     Storable* 
186     Restore(SALOMEDS::SObject_ptr theSObject,
187             const Storable::TRestoringMap& theMap);
188
189     virtual 
190     void
191     SameAs(const Prs3d_i* theOrigin);
192
193     virtual 
194     VISU_Actor* 
195     CreateActor();
196     
197     virtual 
198     VISU_Actor* 
199     CreateActor(bool toSupressShrinking);
200
201     virtual
202     void
203     UpdateActor(VISU_ActorBase* theActor);
204
205     virtual
206     vtkFloatingPointType
207     GetComponentMin(vtkIdType theCompID);
208
209     virtual
210     vtkFloatingPointType
211     GetComponentMax(vtkIdType theCompID);
212
213   private:
214     VISU_ScalarMapPL* myScalarMapPL;
215     SALOMEDS::Color myLinkColor;
216     bool myShowBar;
217   };
218 }
219
220 #endif