]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_ColoredPrs3dHolder_i.hh
Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / VISU_I / VISU_ColoredPrs3dHolder_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_ColoredPrs3dHolder_i.hxx
25 //  Author : Oleg UVAROV
26 //  Module : VISU
27 //
28 #ifndef VISU_ColoredPrs3dHolder_i_HeaderFile
29 #define VISU_ColoredPrs3dHolder_i_HeaderFile
30
31 #include "VISU_I.hxx"
32 #include "VISU_PrsObject_i.hh"
33
34 #include "SALOME_GenericObj_i.hh"
35
36 namespace VISU
37 {
38   class ColoredPrs3d_i;
39   class ColoredPrs3dCache_i;
40
41   /*!
42    * Interface of 3d presentation's holder, which represents colored 3d presentations,
43    * created on fields. It is publishing in the object browser in a separate folder
44    * and can be controled by viewer's slider.
45    */
46   class VISU_I_EXPORT ColoredPrs3dHolder_i : public virtual POA_VISU::ColoredPrs3dHolder,
47                                public virtual SALOME::GenericObj_i,
48                                public virtual PrsObject_i
49   {
50     ColoredPrs3dHolder_i();
51     ColoredPrs3dHolder_i(const ColoredPrs3dHolder_i&);
52
53     friend class ColoredPrs3dCache_i;
54   public:
55     //----------------------------------------------------------------------------
56     //! A constructor to create an instance of the class
57     explicit
58     ColoredPrs3dHolder_i(VISU::ColoredPrs3dCache_i& theCache);
59
60     virtual
61     ~ColoredPrs3dHolder_i();
62
63     //----------------------------------------------------------------------------
64     //! Apply input parameters to last visited presentation in the cache.
65     virtual
66     CORBA::Boolean 
67     Apply(VISU::ColoredPrs3d_ptr thePrs3d,
68           const VISU::ColoredPrs3dHolder::BasicInput& theInput,
69           VISU::View3D_ptr theView3D);
70
71     //----------------------------------------------------------------------------
72     //! Gets the last visited presentation in the cache.
73     VISU::ColoredPrs3d_i*
74     GetPrs3dDevice();
75
76     //! Gets the last visited presentation in the cache.
77     virtual
78     VISU::ColoredPrs3d_ptr
79     GetDevice();
80
81     //----------------------------------------------------------------------------
82     //! Gets TimeStampsRange information from the last visited presentation.
83     virtual
84     VISU::ColoredPrs3dHolder::TimeStampsRange*
85     GetTimeStampsRange();
86
87     //----------------------------------------------------------------------------
88     //! Gets input parameters of the last visited presentation.
89     VISU::ColoredPrs3dHolder::BasicInput*
90     GetBasicInput();
91
92     //----------------------------------------------------------------------------
93     //! Gets a ColoredPrs3dCache, to which the holder belongs
94     VISU::ColoredPrs3dCache_ptr
95     GetCache();
96
97     //----------------------------------------------------------------------------
98     //! Gets memory size actually used by the holder (Mb).
99     virtual
100     CORBA::Float
101     GetMemorySize();
102
103     //----------------------------------------------------------------------------
104     virtual 
105     VISU::VISUType 
106     GetType() 
107     { 
108       return VISU::TCOLOREDPRS3DHOLDER; 
109     }
110
111     virtual 
112     VISU::VISUType
113     GetPrsType();
114
115     //----------------------------------------------------------------------------
116     virtual
117     void
118     RemoveFromStudy();
119
120     virtual
121     const char*
122     GetComment() const;
123
124     virtual
125     void
126     ToStream(std::ostringstream&);
127
128     static
129     Storable*
130     StorableEngine(SALOMEDS::SObject_ptr theSObject,
131                    const Storable::TRestoringMap& theMap,
132                    const std::string& thePrefix,
133                    CORBA::Boolean theIsMultiFile);
134
135     virtual
136     QString 
137     GenerateName();
138
139   public:
140     static const std::string myComment;
141
142     //----------------------------------------------------------------------------
143   private:
144     void
145     PublishInStudy(const std::string& theName, 
146                    const std::string& theIconName, 
147                    const std::string& theComment);
148
149     VISU::ColoredPrs3dCache_i& myCache;
150     static int myNbHolders;
151   };
152 }
153
154 #endif