]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_Mesh_i.hh
Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / VISU_I / VISU_Mesh_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_Mesh_i_HeaderFile
29 #define VISU_Mesh_i_HeaderFile
30
31 #include "VISU_Prs3d_i.hh"
32
33 class VISU_MeshPL;
34
35 namespace VISU
36 {
37   class VISU_I_EXPORT Mesh_i : public virtual POA_VISU::Mesh,
38                  public virtual Prs3d_i
39   {
40     static int myNbPresent;
41     Mesh_i(const Mesh_i&);
42
43   public:
44     typedef Prs3d_i TSuperClass;
45     typedef VISU::Mesh TInterface;
46
47     Mesh_i();
48
49     virtual
50     ~Mesh_i();
51
52     virtual
53     void
54     SameAs(const Prs3d_i* theOrigin);
55
56     virtual
57     void
58     RemoveFromStudy();
59
60     virtual
61     VISU::VISUType 
62     GetType() 
63     { 
64       return VISU::TMESH;
65     }
66
67     virtual 
68     void 
69     SetCellColor(const SALOMEDS::Color& theColor);
70
71     virtual 
72     SALOMEDS::Color 
73     GetCellColor();
74
75     virtual 
76     void 
77     SetNodeColor(const SALOMEDS::Color& theColor);
78
79     virtual 
80     SALOMEDS::Color 
81     GetNodeColor();
82
83     virtual 
84     void 
85     SetLinkColor(const SALOMEDS::Color& theColor);
86
87     virtual 
88     SALOMEDS::Color 
89     GetLinkColor();
90
91     virtual 
92     void
93     SetPresentationType(VISU::PresentationType theType);
94
95     virtual 
96     void
97     SetQuadratic2DPresentationType(VISU::Quadratic2DPresentationType theType);
98
99     virtual 
100     VISU::Quadratic2DPresentationType
101     GetQuadratic2DPresentationType();
102
103     virtual
104     VISU::PresentationType 
105     GetPresentationType();
106
107
108     virtual void SetShrink(CORBA::Boolean toShrink);
109
110     virtual CORBA::Boolean IsShrank();
111
112     VISU_MeshPL* GetSpecificPL() const
113     { 
114       return myMeshPL;
115     }
116
117   protected:
118     Storable* 
119     Build(int theRestoring);
120
121     VISU_MeshPL* myMeshPL;
122
123     int myEntity;//jfa IPAL9284: TEntity myEntity;
124     std::string mySubMeshName;
125     VISU::VISUType myType;
126
127     VISU::PresentationType              myPresentType;
128     VISU::Quadratic2DPresentationType   my2DQuadPrsType;
129     SALOMEDS::Color myCellColor;
130     SALOMEDS::Color myNodeColor;
131     SALOMEDS::Color myLinkColor;
132     bool myIsShrank;
133
134   public:
135     static 
136     size_t
137     IsPossible(VISU::Result_i* theResult, 
138                const std::string& theMeshName,
139                VISU::Entity theEntity, 
140                const std::string& theFamilyName = "");
141     virtual 
142     Storable* 
143     Create(VISU::Result_i* theResult, 
144            const std::string& theMeshName, 
145            VISU::Entity theEntity, 
146            const std::string& theFamilyName = "");
147
148     static 
149     size_t
150     IsPossible(VISU::Result_i* theResult, 
151                const std::string& theMeshName, 
152                const std::string& theGroupName);
153     virtual 
154     Storable* 
155     Create(VISU::Result_i* theResult, 
156            const std::string& theMeshName, 
157            const std::string& theGroupName);
158
159     VISU::Entity
160     GetEntity() const;
161
162     const std::string& 
163     GetSubMeshName() const;
164
165     virtual
166     void
167     ToStream(std::ostringstream& theStr);
168
169     virtual
170     const char* 
171     GetComment() const;
172
173     static const std::string myComment;
174
175     virtual
176     QString
177     GenerateName();
178
179     virtual
180     Storable* 
181     Restore(SALOMEDS::SObject_ptr theSObject,
182             const Storable::TRestoringMap& theMap);
183
184     static 
185     Storable* 
186     StorableEngine(SALOMEDS::SObject_ptr theSObject,
187                    const Storable::TRestoringMap& theMap,
188                    const std::string& thePrefix,
189                    CORBA::Boolean theIsMultiFile);
190     
191     virtual
192     VISU_Actor* 
193     CreateActor();
194
195     virtual
196     void 
197     UpdateActor(VISU_ActorBase* theActor);
198   };
199 }
200
201 #endif