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