Salome HOME
de7e3142660d62f0fd47ed31a684b73826208a87
[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     VISU::PresentationType 
96     GetPresentationType();
97
98
99     virtual void SetShrink(CORBA::Boolean toShrink);
100
101     virtual CORBA::Boolean IsShrank();
102
103     VISU_MeshPL* GetSpecificPL() const
104     { 
105       return myMeshPL;
106     }
107
108   protected:
109     Storable* 
110     Build(int theRestoring);
111
112     VISU_MeshPL* myMeshPL;
113
114     int myEntity;//jfa IPAL9284: TEntity myEntity;
115     std::string mySubMeshName;
116     VISU::VISUType myType;
117
118     VISU::PresentationType myPresentType;
119     SALOMEDS::Color myCellColor;
120     SALOMEDS::Color myNodeColor;
121     SALOMEDS::Color myLinkColor;
122     bool myIsShrank;
123
124   public:
125     static 
126     size_t
127     IsPossible(VISU::Result_i* theResult, 
128                const std::string& theMeshName,
129                VISU::Entity theEntity, 
130                const std::string& theFamilyName = "");
131     virtual 
132     Storable* 
133     Create(VISU::Result_i* theResult, 
134            const std::string& theMeshName, 
135            VISU::Entity theEntity, 
136            const std::string& theFamilyName = "");
137
138     static 
139     size_t
140     IsPossible(VISU::Result_i* theResult, 
141                const std::string& theMeshName, 
142                const std::string& theGroupName);
143     virtual 
144     Storable* 
145     Create(VISU::Result_i* theResult, 
146            const std::string& theMeshName, 
147            const std::string& theGroupName);
148
149     VISU::Entity
150     GetEntity() const;
151
152     const std::string& 
153     GetSubMeshName() const;
154
155     virtual
156     void
157     ToStream(std::ostringstream& theStr);
158
159     virtual
160     const char* 
161     GetComment() const;
162
163     static const std::string myComment;
164
165     virtual
166     QString
167     GenerateName();
168
169     virtual
170     Storable* 
171     Restore(SALOMEDS::SObject_ptr theSObject,
172             const Storable::TRestoringMap& theMap);
173
174     static 
175     Storable* 
176     StorableEngine(SALOMEDS::SObject_ptr theSObject,
177                    const Storable::TRestoringMap& theMap,
178                    const std::string& thePrefix,
179                    CORBA::Boolean theIsMultiFile);
180     
181     virtual
182     VISU_Actor* 
183     CreateActor();
184
185     virtual
186     void 
187     UpdateActor(VISU_ActorBase* theActor);
188   };
189 }
190
191 #endif