Salome HOME
#refs 522 (very draft) //import only
[modules/hydro.git] / src / HYDROData / HYDROData_ImmersibleZone.h
1 // Copyright (C) 2007-2015  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, or (at your option) any later version.
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 #ifndef HYDROData_ImmersibleZone_HeaderFile
24 #define HYDROData_ImmersibleZone_HeaderFile
25
26 #include <HYDROData_NaturalObject.h>
27
28 DEFINE_STANDARD_HANDLE(HYDROData_ImmersibleZone, HYDROData_NaturalObject)
29
30 class Handle(HYDROData_PolylineXY);
31
32 /**\class HYDROData_ImmersibleZone
33  * \brief 
34  *
35  */
36 class HYDROData_ImmersibleZone : public HYDROData_NaturalObject
37 {
38 protected:
39   /**
40    * Enumeration of tags corresponding to the persistent object parameters.
41    */
42   enum DataTag
43   {
44     DataTag_First = HYDROData_NaturalObject::DataTag_First + 100, ///< first tag, to reserve
45     DataTag_Polyline,     ///< reference polyline
46 };
47
48 public:
49   DEFINE_STANDARD_RTTI(HYDROData_ImmersibleZone);
50
51   /**
52    * Returns the kind of this object. Must be redefined in all objects of known type.
53    */
54   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_IMMERSIBLE_ZONE;}
55
56   /**
57    * Dump object to Python script representation.
58    */
59   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
60
61   /**
62    * Returns the list of all reference objects of this object.
63    */
64   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
65
66   /**
67    * Update the immersible zone object.
68    * Call this method whenever you made changes for object data.
69    */
70   HYDRODATA_EXPORT virtual void Update();
71
72   /**
73    * Checks that object has 2D presentation. Reimlemented to retun true.
74    */
75   HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
76
77   /**
78    * Returns the top shape of the object.
79    */
80   HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
81
82   /**
83    * Returns the 3d shape of the object.
84    */
85   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
86
87   /**
88    * Returns default filling color for new zone.
89    */
90   HYDRODATA_EXPORT static QColor DefaultFillingColor();
91
92   /**
93    * Returns default border color for new zone.
94    */
95   HYDRODATA_EXPORT static QColor DefaultBorderColor();
96
97   /**
98    * Sets reference polyline object for zone.
99    */
100   HYDRODATA_EXPORT virtual void SetPolyline( const Handle(HYDROData_PolylineXY)& thePolyline );
101
102   /**
103    * Returns reference polyline object of zone.
104    */
105   HYDRODATA_EXPORT virtual Handle(HYDROData_PolylineXY) GetPolyline() const;
106
107   /**
108    * Remove reference polyline object of zone.
109    */
110   HYDRODATA_EXPORT virtual void RemovePolyline();
111
112   HYDRODATA_EXPORT TopoDS_Shape generateTopShape() const;
113   HYDRODATA_EXPORT static TopoDS_Shape generateTopShape( const Handle(HYDROData_PolylineXY)& );
114
115 protected:
116
117   /**
118    * Returns default filling color for new object.
119    */
120   HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
121
122   /**
123    * Returns default border color for new object.
124    */
125   HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
126
127 private:
128
129   /**
130    * Create all necessary child group objects.
131    */
132   HYDRODATA_EXPORT void createGroupObjects();
133
134 protected:
135
136   friend class HYDROData_Iterator;
137
138   /**
139    * Creates new object in the internal data structure. Use higher level objects 
140    * to create objects with real content.
141    */
142   HYDRODATA_EXPORT HYDROData_ImmersibleZone();
143
144   /**
145    * Destructs properties of the object and object itself, removes it from the document.
146    */
147   virtual HYDRODATA_EXPORT ~HYDROData_ImmersibleZone();
148 };
149
150 #endif