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.
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.
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
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef HYDROData_Channel_HeaderFile
20 #define HYDROData_Channel_HeaderFile
22 #include "HYDROData_ArtificialObject.h"
24 #include <TopoDS_Face.hxx>
25 #include <TopoDS_Wire.hxx>
27 class Handle(HYDROData_Polyline3D);
28 class Handle(HYDROData_Profile);
29 class TopTools_SequenceOfShape;
30 class TopTools_ListOfShape;
32 DEFINE_STANDARD_HANDLE(HYDROData_Channel, HYDROData_ArtificialObject)
34 /**\class HYDROData_Channel
38 class HYDROData_Channel : public HYDROData_ArtificialObject
46 TopoDS_Wire myLeftBank;
47 TopoDS_Wire myRightBank;
54 * Enumeration of tags corresponding to the persistent object parameters.
58 DataTag_First = HYDROData_ArtificialObject::DataTag_First + 100, ///< first tag, to reserve
66 DEFINE_STANDARD_RTTI(HYDROData_Channel);
71 * Creates the presentations(2D and 3D) by given guide line and profile.
73 HYDRODATA_EXPORT static bool CreatePresentations( const Handle(HYDROData_Polyline3D)& theGuideLine,
74 const Handle(HYDROData_Profile)& theProfile,
75 PrsDefinition& thePrs );
80 * Returns the kind of this object. Must be redefined in all objects of known type.
82 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_CHANNEL;}
85 * Dump object to Python script representation.
87 HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
90 * Returns the list of all reference objects of this object.
92 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
95 * Returns the top shape of the object.
97 HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
100 * Returns the 3d shape of the object.
102 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
105 // * Returns the left bank of the object.
107 // HYDRODATA_EXPORT virtual TopoDS_Wire GetLeftBank() const;
110 * Update the shape presentations of stream.
111 * Call this method whenever you made changes for channel data.
113 HYDRODATA_EXPORT virtual void Update();
116 * Checks that object has 2D presentation. Reimlemented to retun true.
118 HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
121 * Returns default filling color for new channel.
123 HYDRODATA_EXPORT static QColor DefaultFillingColor();
126 * Returns default border color for new channel.
128 HYDRODATA_EXPORT static QColor DefaultBorderColor();
132 // Public methods to work with Channel
135 * Sets reference guide line object for channel.
137 HYDRODATA_EXPORT virtual bool SetGuideLine( const Handle(HYDROData_Polyline3D)& theGuideLine );
140 * Returns reference guide line object of channel.
142 HYDRODATA_EXPORT virtual Handle(HYDROData_Polyline3D) GetGuideLine() const;
145 * Remove reference guide line object from channel.
147 HYDRODATA_EXPORT virtual void RemoveGuideLine();
151 * Sets reference profile object for channel.
153 HYDRODATA_EXPORT virtual bool SetProfile( const Handle(HYDROData_Profile)& theProfile );
156 * Returns reference profile object of channel.
158 HYDRODATA_EXPORT virtual Handle(HYDROData_Profile) GetProfile() const;
161 * Remove reference profile object from channel.
163 HYDRODATA_EXPORT virtual void RemoveProfile();
169 * Returns default filling color for new object.
171 HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
174 * Returns default border color for new object.
176 HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
179 * Returns the type of child altitude object.
180 * Reimplemented to create chanel altitude object.
182 HYDRODATA_EXPORT virtual ObjectKind getAltitudeObjectType() const;
186 friend class HYDROData_Iterator;
189 * Creates new object in the internal data structure. Use higher level objects
190 * to create objects with real content.
192 HYDRODATA_EXPORT HYDROData_Channel();
195 * Destructs properties of the object and object itself, removes it from the document.
197 virtual HYDRODATA_EXPORT ~HYDROData_Channel();