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