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