Salome HOME
porting on Linux
[modules/hydro.git] / src / HYDROData / HYDROData_LandCover.h
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #ifndef HYDROData_LANDCOVER_HeaderFile
20 #define HYDROData_LANDCOVER_HeaderFile
21
22 #include <HYDROData_Entity.h>
23
24 DEFINE_STANDARD_HANDLE( HYDROData_LandCover, HYDROData_Entity )
25
26 class TopoDS_Shape;
27
28 class HYDROData_LandCover : public HYDROData_Entity
29 {
30 protected:
31   friend class HYDROData_Iterator;
32
33   enum DataTag
34   {
35     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
36     DataTag_Shape,                                         ///< the shape presentation of the land cover   
37     DataTag_StricklerType,                                 ///< the type corresponding to types in the Strickler tables 
38     DataTag_Polylines,                                     ///< the set of reference polylines
39     DataTag_FillingColor,                                  ///< filling color of the land cover presentation
40     DataTag_BorderColor                                    ///< border color of the land cover presentation
41   };
42
43   HYDRODATA_EXPORT HYDROData_LandCover();
44   HYDRODATA_EXPORT ~HYDROData_LandCover();
45
46 public:
47   DEFINE_STANDARD_RTTI( HYDROData_LandCover );
48
49   /**
50    */
51   HYDRODATA_EXPORT virtual const ObjectKind GetKind() const;
52
53   /**
54    * Dump object to Python script representation.
55    */
56   HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
57
58   /**
59    * Returns the list of all reference objects of this object.
60    */
61   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
62
63   /**
64    * Update the shape presentation of the land cover.
65    * Call this method whenever you made changes for land cover polylines.
66    */
67   HYDRODATA_EXPORT virtual void Update();
68
69   /**
70    * Checks that object has 2D presentation. Reimlemented to return true.
71    */
72   HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
73
74   /**
75    * Set Strickler type for the land cover.
76    */
77   HYDRODATA_EXPORT virtual void SetStricklerType( const QString& theType );
78
79   /**
80    * Returns Strickler type for the land cover.
81    */
82   HYDRODATA_EXPORT virtual QString GetStricklerType() const;
83
84   /**
85    * Set reference polyline objects for the land cover.
86    */
87   HYDRODATA_EXPORT virtual void SetPolylines( const HYDROData_SequenceOfObjects& thePolylines );
88
89   /**
90    * Returns all reference polyline objects of the land cover.
91    */
92   HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetPolylines() const;
93
94   /**
95    * Returns the shape presentation of the land cover.
96    */
97   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
98
99   /**
100    * Sets filling color for land cover.
101    */
102   HYDRODATA_EXPORT virtual void SetFillingColor( const QColor& theColor );
103
104   /**
105    * Returns filling color of land cover.
106    */
107   HYDRODATA_EXPORT virtual QColor GetFillingColor() const;
108
109    /**
110    * Sets border color for land cover.
111    */
112   HYDRODATA_EXPORT virtual void SetBorderColor( const QColor& theColor );
113
114   /**
115    * Returns border color of land cover.
116    */
117   HYDRODATA_EXPORT virtual QColor GetBorderColor() const;
118
119   /**
120    * Returns default filling color for new land cover.
121    */
122   HYDRODATA_EXPORT static QColor DefaultFillingColor();
123
124   /**
125    * Returns default border color for new land cover.
126    */
127   HYDRODATA_EXPORT static QColor DefaultBorderColor();
128
129 protected:
130   /**
131    * Sets the shape presentation of the land cover.
132    */
133   HYDRODATA_EXPORT virtual void setShape( const TopoDS_Shape& theShape );
134
135   /**
136    * Removes the shape from data label of the land cover object.
137    */
138   HYDRODATA_EXPORT virtual void removeShape();
139
140   /**
141    * Build the shape presentation of the land cover.
142    */
143   HYDRODATA_EXPORT virtual TopoDS_Shape buildShape() const;
144 };
145
146 #endif