2 #ifndef HYDROData_Obstacle_HeaderFile
3 #define HYDROData_Obstacle_HeaderFile
5 #include "HYDROData_ArtificialObject.h"
7 DEFINE_STANDARD_HANDLE(HYDROData_Obstacle, HYDROData_ArtificialObject)
9 /**\class HYDROData_Obstacle
13 class HYDROData_Obstacle : public HYDROData_ArtificialObject
17 * Enumeration of tags corresponding to the persistent object parameters.
21 DataTag_First = HYDROData_ArtificialObject::DataTag_First + 100, ///< first tag, to reserve
22 DataTag_GeomObjectEntry, ///< study entry of the imported GEOM object
23 DataTag_FilePath ///< imported file path
27 DEFINE_STANDARD_RTTI(HYDROData_Obstacle);
30 * Returns the kind of this object. Must be redefined in all objects of known type.
32 HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_OBSTACLE;}
35 * Dump object to Python script representation.
37 HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
40 * Update the immersible zone object.
41 * Call this method whenever you made changes for object data.
43 HYDRODATA_EXPORT virtual void Update();
46 * Returns the top shape of the object.
48 HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const;
51 * Returns the 3d shape of the object.
53 HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const;
56 * Returns default filling color for new obstacle.
58 HYDRODATA_EXPORT static QColor DefaultFillingColor();
61 * Returns default border color for new obstacle.
63 HYDRODATA_EXPORT static QColor DefaultBorderColor();
67 * Sets the 3d shape of the object.
69 HYDRODATA_EXPORT virtual void SetShape3D( const TopoDS_Shape& theShape );
74 * Imports shape from file containing geometrical object and sets this
75 * shape as the obstacle shape.
76 * The supported file types:
81 * \param theFilePath the path to file
82 * \return \c true if file has been successfully read
84 HYDRODATA_EXPORT virtual bool ImportFromFile( const QString& theFilePath );
87 * Stores the file path of the imported file.
88 * \param theFilePath file path
90 HYDRODATA_EXPORT void SetFilePath(const QString& theFilePath);
93 * Returns the imported file path.
95 HYDRODATA_EXPORT QString GetFilePath() const;
99 * Imports shape from IOR.
100 * \param theIOR the IOR of Geom object
101 * \return \c true if shape has been successfully imported
103 HYDRODATA_EXPORT virtual bool ImportFromGeomIOR( const TCollection_AsciiString& theIOR );
106 * Stores the study entry of the imported GEOM object.
107 * \param theEntry GEOM object entry
109 HYDRODATA_EXPORT void SetGeomObjectEntry( const TCollection_AsciiString& theEntry );
112 * Returns the imported GEOM object entry.
114 HYDRODATA_EXPORT TCollection_AsciiString GetGeomObjectEntry() const;
119 * Returns default filling color for new object.
121 HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
124 * Returns default border color for new object.
126 HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
129 * Returns the type of child altitude object.
130 * Reimplemented to create obstacle altitude object.
132 HYDRODATA_EXPORT virtual ObjectKind getAltitudeObjectType() const;
137 * Create all necessary child group objects.
139 HYDRODATA_EXPORT void createGroupObjects();
143 friend class HYDROData_Iterator;
146 * Creates new object in the internal data structure. Use higher level objects
147 * to create objects with real content.
149 HYDRODATA_EXPORT HYDROData_Obstacle();
152 * Destructs properties of the object and object itself, removes it from the document.
154 virtual HYDRODATA_EXPORT ~HYDROData_Obstacle();
158 * Imports shape from the BREP file.
159 * \param theFilePath the path to file
160 * \return shape as TopoDS_Shape (null shape if import was failed)
162 TopoDS_Shape ImportBREP( const QString& theFilePath ) const;
165 * Imports shape from the IGES file.
166 * \param theFilePath the path to file
167 * \return shape as TopoDS_Shape (null shape if import was failed)
169 TopoDS_Shape ImportIGES( const QString& theFilePath ) const;
172 * Imports shape from the STEP file.
173 * \param theFilePath the path to file
174 * \return shape as TopoDS_Shape (null shape if import was failed)
176 TopoDS_Shape ImportSTEP( const QString& theFilePath ) const;