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 HYDROData_Polyline3D;
28 class HYDROData_Profile;
30 /**\class HYDROData_Channel
34 class HYDROData_Channel : public HYDROData_ArtificialObject
42 TopoDS_Shape myLeftBank;
43 TopoDS_Shape myRightBank;
45 TopoDS_Shape myOutlet;
50 * Enumeration of tags corresponding to the persistent object parameters.
54 DataTag_First = HYDROData_ArtificialObject::DataTag_First + 100, ///< first tag, to reserve
61 DEFINE_STANDARD_RTTIEXT(HYDROData_Channel, HYDROData_ArtificialObject);
66 * Creates the presentations(2D and 3D) by given guide line and profile.
68 HYDRODATA_EXPORT static bool CreatePresentations( const Handle(HYDROData_Polyline3D)& theGuideLine,
69 const Handle(HYDROData_Profile)& theProfile,
70 PrsDefinition& thePrs,
71 double theEquiDistance );
76 * Returns the kind of this object. Must be redefined in all objects of known type.
78 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_CHANNEL;}
81 * Dump object to Python script representation.
83 HYDRODATA_EXPORT virtual QStringList DumpToPython( const QString& thePyScriptPath,
84 MapOfTreatedObjects& theTreatedObjects ) const;
87 * Returns the list of all reference objects of this object.
89 HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const;
92 * Returns the left edge of the channel.
94 HYDRODATA_EXPORT virtual TopoDS_Shape GetLeftShape() const;
97 * Returns the right edge of the channel.
99 HYDRODATA_EXPORT virtual TopoDS_Shape GetRightShape() const;
102 * Update the shape presentations of stream.
103 * Call this method whenever you made changes for channel data.
105 HYDRODATA_EXPORT virtual void Update();
108 * Checks that object has 2D presentation. Reimlemented to retun true.
110 HYDRODATA_EXPORT virtual bool IsHas2dPrs() const;
113 * Returns default filling color for new channel.
115 HYDRODATA_EXPORT virtual QColor DefaultFillingColor() const;
118 * Returns default border color for new channel.
120 HYDRODATA_EXPORT virtual QColor DefaultBorderColor() const;
124 // Public methods to work with Channel
127 * Sets reference guide line object for channel.
129 HYDRODATA_EXPORT virtual bool SetGuideLine( const Handle(HYDROData_Polyline3D)& theGuideLine );
132 * Returns reference guide line object of channel.
134 HYDRODATA_EXPORT virtual Handle(HYDROData_Polyline3D) GetGuideLine() const;
137 * Remove reference guide line object from channel.
139 HYDRODATA_EXPORT virtual void RemoveGuideLine();
143 * Sets reference profile object for channel.
145 HYDRODATA_EXPORT virtual bool SetProfile( const Handle(HYDROData_Profile)& theProfile );
148 * Returns reference profile object of channel.
150 HYDRODATA_EXPORT virtual Handle(HYDROData_Profile) GetProfile() const;
153 * Remove reference profile object from channel.
155 HYDRODATA_EXPORT virtual void RemoveProfile();
157 HYDRODATA_EXPORT void SetEquiDistance( double );
158 HYDRODATA_EXPORT double GetEquiDistance() const;
162 * Returns the type of child altitude object.
163 * Reimplemented to create chanel altitude object.
165 HYDRODATA_EXPORT virtual ObjectKind getAltitudeObjectType() const;
169 friend class HYDROData_Iterator;
172 * Creates new object in the internal data structure. Use higher level objects
173 * to create objects with real content.
175 HYDRODATA_EXPORT HYDROData_Channel();
178 * Destructs properties of the object and object itself, removes it from the document.
180 virtual HYDRODATA_EXPORT ~HYDROData_Channel();