]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_Mesh_i.hh
Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[modules/visu.git] / src / VISU_I / VISU_Mesh_i.hh
1 //  VISU OBJECT : interactive object for VISU entities implementation
2 //
3 //  Copyright (C) 2003  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 //  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 Mesh_i : public virtual POA_VISU::Mesh,
37                  public virtual Prs3d_i
38   {
39     static int myNbPresent;
40     Mesh_i();
41     Mesh_i(const Mesh_i&);
42
43   public:
44     typedef Prs3d_i TSuperClass;
45
46     explicit
47     Mesh_i(Result_i* theResult);
48
49     explicit
50     Mesh_i(Result_i* theResult,
51            SALOMEDS::SObject_ptr theSObject);
52
53     virtual void SameAs(const Prs3d_i* theOrigin);
54     virtual ~Mesh_i();
55     virtual void RemoveFromStudy();
56
57     virtual VISU::VISUType GetType() { return VISU::TMESH;};
58
59     virtual void SetCellColor(const SALOMEDS::Color& theColor) { myCellColor = theColor;}
60     virtual SALOMEDS::Color GetCellColor() { return myCellColor;}
61
62     virtual void SetNodeColor(const SALOMEDS::Color& theColor) { myNodeColor = theColor;}
63     virtual SALOMEDS::Color GetNodeColor() { return myNodeColor;}
64
65     virtual void SetLinkColor(const SALOMEDS::Color& theColor) { myLinkColor = theColor;}
66     virtual SALOMEDS::Color GetLinkColor() { return myLinkColor;}
67
68     virtual void SetPresentationType(VISU::PresentationType theType) { myPresentType = theType;}
69     virtual PresentationType GetPresentationType() { return myPresentType;}
70
71     typedef VISU::Mesh TInterface;
72     VISU_MeshPL* GetMeshPL(){ return myMeshPL;}
73
74   protected:
75     Storable* Build(int theRestoring);
76
77     VISU_MeshPL* myMeshPL;
78
79     // std::string myMeshName; move it to Prs3d_i
80     int myEntity;//jfa IPAL9284: TEntity myEntity;
81     std::string mySubMeshName;
82     VISU::VISUType myType;
83
84     VISU::PresentationType myPresentType;
85     struct SALOMEDS::Color myCellColor, myNodeColor, myLinkColor;
86
87   public:
88     static int IsPossible(Result_i* theResult, const char* theMeshName,
89                           Entity theEntity, const char* theFamilyName = "");
90     virtual Storable* Create(const char* theMeshName, Entity theEntity, const char* theFamilyName = "");
91
92     static int IsPossible(Result_i* theResult, const char* theMeshName, const char* theGroupName);
93     virtual Storable* Create(const char* theMeshName, const char* theGroupName);
94
95     const std::string& GetMeshName() const { return myMeshName;}
96     VISU::Entity GetEntity() const { return VISU::Entity(myEntity);}
97     const string& GetSubMeshName() const { return mySubMeshName;}
98
99     virtual void ToStream(std::ostringstream& theStr);
100
101     virtual const char* GetComment() const;
102     static const std::string myComment;
103     virtual QString GenerateName();
104
105     virtual Storable* Restore(const Storable::TRestoringMap& theMap);
106
107     virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
108
109     virtual void UpdateActor(VISU_Actor* theActor);
110   };
111 }
112
113 #endif