Salome HOME
Debug visu.py; add visu_split_views.py as example of view parameters management
[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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
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   class Mesh_i : public virtual POA_VISU::Mesh,
36                  public virtual Prs3d_i
37   {
38     static int myNbPresent;
39     Mesh_i();
40     Mesh_i(const Mesh_i&);
41   public:
42     explicit
43     Mesh_i(Result_i* theResult);
44     explicit
45     Mesh_i(Result_i* theResult,
46            SALOMEDS::SObject_ptr theSObject);
47     virtual void SameAs(const Mesh_i* theOrigin);
48     virtual ~Mesh_i();
49     virtual void RemoveFromStudy();
50
51     virtual VISU::VISUType GetType() { return VISU::TMESH;};
52
53     virtual void SetCellColor(const SALOMEDS::Color& theColor) { myCellColor = theColor;}
54     virtual SALOMEDS::Color GetCellColor() { return myCellColor;}
55
56     virtual void SetNodeColor(const SALOMEDS::Color& theColor) { myNodeColor = theColor;}
57     virtual SALOMEDS::Color GetNodeColor() { return myNodeColor;}
58
59     virtual void SetLinkColor(const SALOMEDS::Color& theColor) { myLinkColor = theColor;}
60     virtual SALOMEDS::Color GetLinkColor() { return myLinkColor;}
61
62     virtual void SetPresentationType(VISU::PresentationType theType) { myPresentType = theType;}
63     virtual PresentationType GetPresentationType() { return myPresentType;}
64
65     typedef VISU::Mesh TInterface;
66     VISU_MeshPL* GetMeshPL(){ return myMeshPL;}
67
68   protected:
69     Storable* Build(int theRestoring);
70
71     VISU_MeshPL* myMeshPL;
72
73     // std::string myMeshName; move it to Prs3d_i
74     int myEntity;//jfa IPAL9284: TEntity myEntity;
75     std::string mySubMeshName;
76     VISU::VISUType myType;
77
78     VISU::PresentationType myPresentType;
79     struct SALOMEDS::Color myCellColor, myNodeColor, myLinkColor;
80
81   public:
82     static int IsPossible(Result_i* theResult, const char* theMeshName,
83                           Entity theEntity, const char* theFamilyName = "");
84     virtual Storable* Create(const char* theMeshName, Entity theEntity, const char* theFamilyName = "");
85
86     static int IsPossible(Result_i* theResult, const char* theMeshName, const char* theGroupName);
87     virtual Storable* Create(const char* theMeshName, const char* theGroupName);
88
89     const std::string& GetMeshName() const { return myMeshName;}
90     VISU::Entity GetEntity() const { return VISU::Entity(myEntity);}
91     const string& GetSubMeshName() const { return mySubMeshName;}
92
93     virtual void ToStream(std::ostringstream& theStr);
94
95     virtual const char* GetComment() const;
96     static const std::string myComment;
97     virtual QString GenerateName();
98
99     virtual Storable* Restore(const Storable::TRestoringMap& theMap);
100
101     virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
102
103     virtual void UpdateActor(VISU_Actor* theActor);
104   };
105 }
106
107 #endif