From: asl Date: Wed, 14 Oct 2015 15:02:20 +0000 (+0300) Subject: unified access to shapes X-Git-Tag: v1.5~120 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=254bc4b391a60c6a0c49435711d48071be58f761;p=modules%2Fhydro.git unified access to shapes --- diff --git a/src/HYDROData/HYDROData_Channel.cxx b/src/HYDROData/HYDROData_Channel.cxx index c78c5e41..33cd9d81 100644 --- a/src/HYDROData/HYDROData_Channel.cxx +++ b/src/HYDROData/HYDROData_Channel.cxx @@ -114,16 +114,6 @@ HYDROData_SequenceOfObjects HYDROData_Channel::GetAllReferenceObjects() const return aResSeq; } -TopoDS_Shape HYDROData_Channel::GetTopShape() const -{ - return getTopShape(); -} - -TopoDS_Shape HYDROData_Channel::GetShape3D() const -{ - return getShape3D(); -} - bool HYDROData_Channel::CreatePresentations( const Handle(HYDROData_Polyline3D)& theGuideLine, const Handle(HYDROData_Profile)& theProfile, PrsDefinition& thePrs ) diff --git a/src/HYDROData/HYDROData_Channel.h b/src/HYDROData/HYDROData_Channel.h index 5b4e694f..6707cfea 100644 --- a/src/HYDROData/HYDROData_Channel.h +++ b/src/HYDROData/HYDROData_Channel.h @@ -90,16 +90,6 @@ public: */ HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const; - /** - * Returns the top shape of the object. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const; - - /** - * Returns the 3d shape of the object. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const; - /** * Returns the left edge of the channel. */ diff --git a/src/HYDROData/HYDROData_Confluence.cxx b/src/HYDROData/HYDROData_Confluence.cxx index 12f19b5a..7f617c40 100644 --- a/src/HYDROData/HYDROData_Confluence.cxx +++ b/src/HYDROData/HYDROData_Confluence.cxx @@ -51,18 +51,6 @@ QStringList HYDROData_Confluence::DumpToPython( MapOfTreatedObjects& theTreatedO return aResList; } -TopoDS_Shape HYDROData_Confluence::GetTopShape() const -{ - // TODO - return getTopShape(); -} - -TopoDS_Shape HYDROData_Confluence::GetShape3D() const -{ - // TODO - return getShape3D(); -} - void HYDROData_Confluence::UpdateLocalCS( double theDx, double theDy ) { //TODO diff --git a/src/HYDROData/HYDROData_Confluence.h b/src/HYDROData/HYDROData_Confluence.h index e5c5dfff..ec0ac2fe 100644 --- a/src/HYDROData/HYDROData_Confluence.h +++ b/src/HYDROData/HYDROData_Confluence.h @@ -51,16 +51,6 @@ public: */ HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const; - /** - * Returns the top shape of the object. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const; - - /** - * Returns the 3d shape of the object. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const; - HYDRODATA_EXPORT virtual void UpdateLocalCS( double theDx, double theDy ); protected: diff --git a/src/HYDROData/HYDROData_Entity.cxx b/src/HYDROData/HYDROData_Entity.cxx index 2086ccf1..1ff7379a 100644 --- a/src/HYDROData/HYDROData_Entity.cxx +++ b/src/HYDROData/HYDROData_Entity.cxx @@ -16,25 +16,24 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#include "HYDROData_Entity.h" - -#include "HYDROData_Iterator.h" -#include "HYDROData_Tool.h" - +#include +#include +#include +#include +#include #include #include #include -#include -#include #include -#include +#include #include - #include #include - +#include +#include +#include #include -#include +#include #include #include @@ -697,3 +696,21 @@ void HYDROData_Entity::findPythonReferenceObject( MapOfTreatedObjects& theTreate .arg( aDocument->GetDocPyName() ) .arg( GetName() ); } + +void HYDROData_Entity::SetShape( int theTag, const TopoDS_Shape& theShape ) +{ + TNaming_Builder aBuilder( myLab.FindChild( theTag ) ); + aBuilder.Generated( theShape ); +} + +TopoDS_Shape HYDROData_Entity::GetShape( int theTag ) const +{ + TDF_Label aShapeLabel = myLab.FindChild( theTag, false ); + if ( !aShapeLabel.IsNull() ) + { + Handle(TNaming_NamedShape) aNamedShape; + if ( aShapeLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) ) + return aNamedShape->Get(); + } + return TopoDS_Shape(); +} diff --git a/src/HYDROData/HYDROData_Entity.h b/src/HYDROData/HYDROData_Entity.h index 243a41a2..d7ad12cb 100644 --- a/src/HYDROData/HYDROData_Entity.h +++ b/src/HYDROData/HYDROData_Entity.h @@ -20,11 +20,8 @@ #define HYDROData_Entity_HeaderFile #include "HYDROData.h" - #include - #include - #include class QColor; @@ -33,6 +30,7 @@ class QVariant; class QStringList; class Handle(TDataStd_ReferenceList); class Handle_HYDROData_Entity; +class TopoDS_Shape; ///! Kind of an object in a document typedef int ObjectKind; @@ -424,7 +422,9 @@ protected: Handle(TDataStd_ReferenceList) getReferenceList( const int theTag, const bool theIsCreate ) const; - + + void SetShape( int theTag, const TopoDS_Shape& theShape ); + TopoDS_Shape GetShape( int theTag ) const; protected: /// Array of pointers to the properties of this object; index in this array is returned by \a AddProperty. diff --git a/src/HYDROData/HYDROData_IPolyline.cxx b/src/HYDROData/HYDROData_IPolyline.cxx index df150b0a..62b1e3d3 100755 --- a/src/HYDROData/HYDROData_IPolyline.cxx +++ b/src/HYDROData/HYDROData_IPolyline.cxx @@ -24,12 +24,7 @@ #include #include #include - #include - -#include -#include - #include IMPLEMENT_STANDARD_HANDLE(HYDROData_IPolyline, HYDROData_Entity) @@ -64,29 +59,19 @@ int HYDROData_IPolyline::NbPoints( const int theSectionIndex ) const return GetPoints( theSectionIndex ).Length(); } -TopoDS_Shape HYDROData_IPolyline::getPolylineShape() const +TopoDS_Shape HYDROData_IPolyline::GetShape() const { - TDF_Label aShapeLabel = myLab.FindChild( DataTag_PolylineShape, false ); - if ( !aShapeLabel.IsNull() ) - { - Handle(TNaming_NamedShape) aNamedShape; - if ( aShapeLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) ) - return aNamedShape->Get(); - } - return TopoDS_Shape(); + return HYDROData_Entity::GetShape( DataTag_PolylineShape ); } -void HYDROData_IPolyline::setPolylineShape( const TopoDS_Shape& theShape ) +void HYDROData_IPolyline::SetShape( const TopoDS_Shape& theShape ) { - TNaming_Builder aBuilder( myLab.FindChild( DataTag_PolylineShape ) ); - aBuilder.Generated( theShape ); + HYDROData_Entity::SetShape( DataTag_PolylineShape, theShape ); } -void HYDROData_IPolyline::removePolylineShape() +void HYDROData_IPolyline::RemovePolylineShape() { - TDF_Label aShapeLabel = myLab.FindChild( DataTag_PolylineShape, false ); - if ( !aShapeLabel.IsNull() ) - aShapeLabel.ForgetAllAttributes(); + SetShape( TopoDS_Shape() ); } void HYDROData_IPolyline::getSectionsLists( Handle(TDataStd_ExtStringList)& theNamesList, diff --git a/src/HYDROData/HYDROData_IPolyline.h b/src/HYDROData/HYDROData_IPolyline.h index 5d15d916..c423f30a 100644 --- a/src/HYDROData/HYDROData_IPolyline.h +++ b/src/HYDROData/HYDROData_IPolyline.h @@ -78,13 +78,6 @@ public: HYDRODATA_EXPORT static QColor DefaultWireColor(); public: - - /** - * Returns the 3D presentation of all points. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const = 0; - - /** * Returns number of sections. */ @@ -197,14 +190,11 @@ public: */ HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1, bool IsConvertToGlobal = false ) const = 0; -protected: - - TopoDS_Shape getPolylineShape() const; - - void setPolylineShape( const TopoDS_Shape& theShape ); - - void removePolylineShape(); + TopoDS_Shape GetShape() const; + void SetShape( const TopoDS_Shape& theShape ); +protected: + void RemovePolylineShape(); void getSectionsLists( Handle(TDataStd_ExtStringList)& theNamesList, Handle(TDataStd_IntegerList)& theTypesList, diff --git a/src/HYDROData/HYDROData_ImmersibleZone.cxx b/src/HYDROData/HYDROData_ImmersibleZone.cxx index 8382e12a..6a90bfff 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.cxx +++ b/src/HYDROData/HYDROData_ImmersibleZone.cxx @@ -88,11 +88,6 @@ HYDROData_SequenceOfObjects HYDROData_ImmersibleZone::GetAllReferenceObjects() c return aResSeq; } -TopoDS_Shape HYDROData_ImmersibleZone::GetTopShape() const -{ - return getTopShape(); -} - void HYDROData_ImmersibleZone::Update() { HYDROData_NaturalObject::Update(); @@ -236,7 +231,7 @@ void HYDROData_ImmersibleZone::createGroupObjects() TopoDS_Shape HYDROData_ImmersibleZone::GetShape3D() const { - return getTopShape(); + return GetTopShape(); } QColor HYDROData_ImmersibleZone::DefaultFillingColor() diff --git a/src/HYDROData/HYDROData_ImmersibleZone.h b/src/HYDROData/HYDROData_ImmersibleZone.h index 82115fc1..c888645b 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.h +++ b/src/HYDROData/HYDROData_ImmersibleZone.h @@ -70,11 +70,6 @@ public: */ HYDRODATA_EXPORT virtual bool IsHas2dPrs() const; - /** - * Returns the top shape of the object. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const; - /** * Returns the 3d shape of the object. */ diff --git a/src/HYDROData/HYDROData_LandCover.cxx b/src/HYDROData/HYDROData_LandCover.cxx index 278f42c5..4423c83f 100644 --- a/src/HYDROData/HYDROData_LandCover.cxx +++ b/src/HYDROData/HYDROData_LandCover.cxx @@ -24,8 +24,6 @@ #include #include #include -#include -#include #include #include #include @@ -127,7 +125,7 @@ void HYDROData_LandCover::Update() TCollection_AsciiString anErrorMsg; TopoDS_Shape aResShape = buildShape( GetPolylines(), anErrorMsg ); - setShape( aResShape ); + SetShape( aResShape ); } void HYDROData_LandCover::SetPolylines( const HYDROData_SequenceOfObjects& thePolylines ) @@ -143,18 +141,7 @@ HYDROData_SequenceOfObjects HYDROData_LandCover::GetPolylines() const TopoDS_Shape HYDROData_LandCover::GetShape() const { - TopoDS_Shape aShape; - - TDF_Label aLabel = myLab.FindChild( DataTag_Shape, false ); - if ( !aLabel.IsNull() ) - { - Handle(TNaming_NamedShape) aNamedShape; - if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) ) { - aShape = aNamedShape->Get(); - } - } - - return aShape; + return HYDROData_Entity::GetShape( DataTag_Shape ); } void HYDROData_LandCover::SetFillingColor( const QColor& theColor ) @@ -187,10 +174,9 @@ QColor HYDROData_LandCover::DefaultBorderColor() return QColor( Qt::transparent ); } -void HYDROData_LandCover::setShape( const TopoDS_Shape& theShape ) +void HYDROData_LandCover::SetShape( const TopoDS_Shape& theShape ) { - TNaming_Builder aBuilder( myLab.FindChild( DataTag_Shape ) ); - aBuilder.Generated( theShape ); + HYDROData_Entity::SetShape( DataTag_Shape, theShape ); } void HYDROData_LandCover::removeShape() diff --git a/src/HYDROData/HYDROData_LandCover.h b/src/HYDROData/HYDROData_LandCover.h index 289e4bff..8df5e516 100644 --- a/src/HYDROData/HYDROData_LandCover.h +++ b/src/HYDROData/HYDROData_LandCover.h @@ -135,7 +135,7 @@ public: /** * Sets the shape presentation of the land cover. */ - HYDRODATA_EXPORT virtual void setShape( const TopoDS_Shape& theShape ); + HYDRODATA_EXPORT virtual void SetShape( const TopoDS_Shape& theShape ); protected: diff --git a/src/HYDROData/HYDROData_LandCoverMap.cxx b/src/HYDROData/HYDROData_LandCoverMap.cxx index 02c73ba8..0c347add 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@ -28,8 +28,6 @@ #include #include #include -#include -#include #include #include #include @@ -314,14 +312,7 @@ bool HYDROData_LandCoverMap::Merge( const TopTools_ListOfShape& theFaces, const */ TopoDS_Shape HYDROData_LandCoverMap::GetShape() const { - TDF_Label aLabel = myLab.FindChild( DataTag_Shape, false ); - if ( !aLabel.IsNull() ) - { - Handle(TNaming_NamedShape) aNamedShape; - if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) ) - return aNamedShape->Get(); - } - return TopoDS_Shape(); + return HYDROData_Entity::GetShape( DataTag_Shape ); } /** @@ -330,8 +321,7 @@ TopoDS_Shape HYDROData_LandCoverMap::GetShape() const */ void HYDROData_LandCoverMap::SetShape( const TopoDS_Shape& theShape ) { - TNaming_Builder aBuilder( myLab.FindChild( DataTag_Shape ) ); - aBuilder.Generated( theShape ); + HYDROData_Entity::SetShape( DataTag_Shape, theShape ); } /** diff --git a/src/HYDROData/HYDROData_Object.cxx b/src/HYDROData/HYDROData_Object.cxx index 13a01102..95d0efeb 100644 --- a/src/HYDROData/HYDROData_Object.cxx +++ b/src/HYDROData/HYDROData_Object.cxx @@ -23,10 +23,6 @@ #include "HYDROData_Tool.h" #include "HYDROData_Iterator.h" #include "HYDROData_IAltitudeObject.h" - -#include -#include - #include #include @@ -75,9 +71,9 @@ void HYDROData_Object::SetName( const QString& theName ) void HYDROData_Object::Update() { - removeTopShape(); - removeShape3D(); - removeGroupObjects(); + RemoveTopShape(); + RemoveShape3D(); + RemoveGroupObjects(); checkAndSetAltitudeObject(); HYDROData_Entity::Update(); } @@ -104,19 +100,26 @@ void HYDROData_Object::SetToUpdate( bool theFlag ) void HYDROData_Object::SetTopShape( const TopoDS_Shape& theShape ) { - TNaming_Builder aBuilder( myLab.FindChild( DataTag_TopShape ) ); - aBuilder.Generated( theShape ); + HYDROData_Entity::SetShape( DataTag_TopShape, theShape ); +} + +TopoDS_Shape HYDROData_Object::GetTopShape() const +{ + return HYDROData_Entity::GetShape( DataTag_TopShape ); } void HYDROData_Object::SetShape3D( const TopoDS_Shape& theShape ) { - TNaming_Builder aBuilder( myLab.FindChild( DataTag_Shape3D ) ); - aBuilder.Generated( theShape ); - + HYDROData_Entity::SetShape( DataTag_Shape3D, theShape ); // Check the object 3D existance checkAndSetObject3D(); } +TopoDS_Shape HYDROData_Object::GetShape3D() const +{ + return HYDROData_Entity::GetShape( DataTag_Shape3D ); +} + Handle(HYDROData_DummyObject3D) HYDROData_Object::GetObject3D() const { Handle(HYDROData_DummyObject3D) anObject; @@ -332,51 +335,21 @@ Handle(HYDROData_ShapesGroup) HYDROData_Object::createGroupObject() return aNewGroup; } -void HYDROData_Object::removeGroupObjects() +void HYDROData_Object::RemoveGroupObjects() { TDF_Label aLabel = myLab.FindChild( DataTag_EdgesGroup, false ); if ( !aLabel.IsNull() ) aLabel.ForgetAllAttributes(); } -TopoDS_Shape HYDROData_Object::getTopShape() const +void HYDROData_Object::RemoveTopShape() { - TDF_Label aLabel = myLab.FindChild( DataTag_TopShape, false ); - if ( !aLabel.IsNull() ) - { - Handle(TNaming_NamedShape) aNamedShape; - if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) ) - return aNamedShape->Get(); - } - - return TopoDS_Shape(); + HYDROData_Entity::SetShape( DataTag_TopShape, TopoDS_Shape() ); } -void HYDROData_Object::removeTopShape() +void HYDROData_Object::RemoveShape3D() { - TDF_Label aLabel = myLab.FindChild( DataTag_TopShape, false ); - if ( !aLabel.IsNull() ) - aLabel.ForgetAllAttributes(); -} - -TopoDS_Shape HYDROData_Object::getShape3D() const -{ - TDF_Label aLabel = myLab.FindChild( DataTag_Shape3D, false ); - if ( !aLabel.IsNull() ) - { - Handle(TNaming_NamedShape) aNamedShape; - if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) ) - return aNamedShape->Get(); - } - - return TopoDS_Shape(); -} - -void HYDROData_Object::removeShape3D() -{ - TDF_Label aLabel = myLab.FindChild( DataTag_Shape3D, false ); - if ( !aLabel.IsNull() ) - aLabel.ForgetAllAttributes(); + HYDROData_Entity::SetShape( DataTag_Shape3D, TopoDS_Shape() ); } bool HYDROData_Object::IsSubmersible() const diff --git a/src/HYDROData/HYDROData_Object.h b/src/HYDROData/HYDROData_Object.h index 520a70ab..4f582fd9 100644 --- a/src/HYDROData/HYDROData_Object.h +++ b/src/HYDROData/HYDROData_Object.h @@ -87,7 +87,7 @@ public: /** * Returns the top shape of the object. */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const = 0; + HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const; /** * Sets the 3d shape of the object. @@ -97,9 +97,8 @@ public: /** * Returns the 3d shape of the object. */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const = 0; + HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const; - /** * Returns reference object which represent the 3D shape of object. */ @@ -231,29 +230,17 @@ protected: /** * Remove all child group objects. */ - HYDRODATA_EXPORT virtual void removeGroupObjects(); - - - /** - * Retrieve the top shape of the object from data label. - */ - HYDRODATA_EXPORT TopoDS_Shape getTopShape() const; + HYDRODATA_EXPORT virtual void RemoveGroupObjects(); /** * Removes the top shape from data label of the object. */ - HYDRODATA_EXPORT void removeTopShape(); - - - /** - * Retrieve the 3d shape of the object from data label. - */ - HYDRODATA_EXPORT TopoDS_Shape getShape3D() const; + HYDRODATA_EXPORT void RemoveTopShape(); /** * Removes the 3d shape from data label of the object. */ - HYDRODATA_EXPORT void removeShape3D(); + HYDRODATA_EXPORT void RemoveShape3D(); }; #endif diff --git a/src/HYDROData/HYDROData_Obstacle.cxx b/src/HYDROData/HYDROData_Obstacle.cxx index 1eeb8a83..43f468e5 100644 --- a/src/HYDROData/HYDROData_Obstacle.cxx +++ b/src/HYDROData/HYDROData_Obstacle.cxx @@ -123,7 +123,7 @@ QStringList HYDROData_Obstacle::DumpToPython( MapOfTreatedObjects& theTreatedObj void HYDROData_Obstacle::Update() { - removeGroupObjects(); + RemoveGroupObjects(); createGroupObjects(); checkAndSetAltitudeObject(); @@ -135,16 +135,6 @@ bool HYDROData_Obstacle::IsHas2dPrs() const return true; } -TopoDS_Shape HYDROData_Obstacle::GetTopShape() const -{ - return getTopShape(); -} - -TopoDS_Shape HYDROData_Obstacle::GetShape3D() const -{ - return getShape3D(); -} - void HYDROData_Obstacle::SetShape3D( const TopoDS_Shape& theShape ) { TopoDS_Face aShape2d = HYDROData_Projection::MakeProjection( theShape ); diff --git a/src/HYDROData/HYDROData_Obstacle.h b/src/HYDROData/HYDROData_Obstacle.h index a7b87565..c0ac5822 100644 --- a/src/HYDROData/HYDROData_Obstacle.h +++ b/src/HYDROData/HYDROData_Obstacle.h @@ -67,16 +67,6 @@ public: */ HYDRODATA_EXPORT virtual bool IsHas2dPrs() const; - /** - * Returns the top shape of the object. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const; - - /** - * Returns the 3d shape of the object. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const; - /** * Returns default filling color for new obstacle. */ diff --git a/src/HYDROData/HYDROData_Polyline3D.cxx b/src/HYDROData/HYDROData_Polyline3D.cxx index 67098e95..73545b0f 100644 --- a/src/HYDROData/HYDROData_Polyline3D.cxx +++ b/src/HYDROData/HYDROData_Polyline3D.cxx @@ -137,16 +137,6 @@ HYDROData_SequenceOfObjects HYDROData_Polyline3D::GetAllReferenceObjects() const return aResSeq; } -TopoDS_Shape HYDROData_Polyline3D::GetTopShape() const -{ - return getTopShape(); -} - -TopoDS_Shape HYDROData_Polyline3D::GetShape3D() const -{ - return getShape3D(); -} - void HYDROData_Polyline3D::Update() { HYDROData_Object::Update(); diff --git a/src/HYDROData/HYDROData_Polyline3D.h b/src/HYDROData/HYDROData_Polyline3D.h index aa4520ff..c7d6cd04 100644 --- a/src/HYDROData/HYDROData_Polyline3D.h +++ b/src/HYDROData/HYDROData_Polyline3D.h @@ -68,16 +68,6 @@ public: */ HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const; - /** - * Returns the top shape of the object. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const; - - /** - * Returns the 3d shape of the object. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const; - /** * Update the shape presentations of stream. * Call this method whenever you made changes for stream data. diff --git a/src/HYDROData/HYDROData_PolylineXY.cxx b/src/HYDROData/HYDROData_PolylineXY.cxx index a3942aff..807c8c3f 100755 --- a/src/HYDROData/HYDROData_PolylineXY.cxx +++ b/src/HYDROData/HYDROData_PolylineXY.cxx @@ -248,17 +248,6 @@ TCollection_AsciiString HYDROData_PolylineXY::GetGeomObjectEntry() const return aRes; } -TopoDS_Shape HYDROData_PolylineXY::GetShape() const -{ - return getPolylineShape(); -} - -bool HYDROData_PolylineXY::SetShape( const TopoDS_Shape& theShape ) -{ - setPolylineShape( theShape ); - return true; -} - bool convertEdgeToSection( const TopoDS_Edge& theEdge, NCollection_Sequence& theSectNames, NCollection_Sequence& theSectTypes, @@ -405,7 +394,7 @@ bool HYDROData_PolylineXY::ImportShape( const TopoDS_Shape& theShape ) if( aProj.IsDone() ) aResult = aProj.Shape(); - setPolylineShape( aResult ); + SetShape( aResult ); } setEditable( anIsCanBeImported ); @@ -568,7 +557,7 @@ void HYDROData_PolylineXY::Update() aResult = mkWire.Wire(); } - setPolylineShape( aResult ); + SetShape( aResult ); } bool HYDROData_PolylineXY::IsHas2dPrs() const @@ -1190,7 +1179,7 @@ void HYDROData_PolylineXY::Transform( const QTransform& theTrsf ) bool HYDROData_PolylineXY::IsCustom() const { - bool isNull = getPolylineShape().IsNull(); + bool isNull = GetShape().IsNull(); int aNbPoints = 0; //TODO: to check if there is no points diff --git a/src/HYDROData/HYDROData_PolylineXY.h b/src/HYDROData/HYDROData_PolylineXY.h index 4e70f42b..57ff8cad 100644 --- a/src/HYDROData/HYDROData_PolylineXY.h +++ b/src/HYDROData/HYDROData_PolylineXY.h @@ -124,12 +124,6 @@ public: public: - /** - * Returns the 2D presentation of all points. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const; - HYDRODATA_EXPORT bool SetShape( const TopoDS_Shape& theShape ); - /** * Returns the 3D presentation of all points. */ diff --git a/src/HYDROData/HYDROData_Profile.cxx b/src/HYDROData/HYDROData_Profile.cxx index 2649e2b0..f78b4cbc 100755 --- a/src/HYDROData/HYDROData_Profile.cxx +++ b/src/HYDROData/HYDROData_Profile.cxx @@ -163,7 +163,7 @@ TopoDS_Shape HYDROData_Profile::GetTopShape() const TopoDS_Shape HYDROData_Profile::GetShape3D() const { - TopoDS_Shape aShape = getShape3D(); + TopoDS_Shape aShape = HYDROData_Object::GetShape3D(); if( aShape.IsNull() ) aShape = CreateProfileWire( true ); return aShape; diff --git a/src/HYDROData/HYDROData_River.cxx b/src/HYDROData/HYDROData_River.cxx index 2bb5cef7..085a9127 100644 --- a/src/HYDROData/HYDROData_River.cxx +++ b/src/HYDROData/HYDROData_River.cxx @@ -62,18 +62,6 @@ bool HYDROData_River::IsHas2dPrs() const return true; } -TopoDS_Shape HYDROData_River::GetTopShape() const -{ - // TODO - return getTopShape(); -} - -TopoDS_Shape HYDROData_River::GetShape3D() const -{ - // TODO - return getShape3D(); -} - void HYDROData_River::UpdateLocalCS( double theDx, double theDy ) { //TODO diff --git a/src/HYDROData/HYDROData_River.h b/src/HYDROData/HYDROData_River.h index 5be07234..dee7d624 100644 --- a/src/HYDROData/HYDROData_River.h +++ b/src/HYDROData/HYDROData_River.h @@ -64,16 +64,6 @@ public: */ HYDRODATA_EXPORT virtual bool IsHas2dPrs() const; - /** - * Returns the top shape of the object. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const; - - /** - * Returns the 3d shape of the object. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const; - protected: friend class HYDROData_Iterator; diff --git a/src/HYDROData/HYDROData_ShapesGroup.cxx b/src/HYDROData/HYDROData_ShapesGroup.cxx index 35015221..f7f597a3 100644 --- a/src/HYDROData/HYDROData_ShapesGroup.cxx +++ b/src/HYDROData/HYDROData_ShapesGroup.cxx @@ -17,22 +17,18 @@ // #include "HYDROData_ShapesGroup.h" - #include "HYDROData_ShapesTool.h" +#include #include +#include +#include #include #include #include #include - -#include -#include - -#include - #include IMPLEMENT_STANDARD_HANDLE(HYDROData_ShapesGroup,HYDROData_Entity) diff --git a/src/HYDROData/HYDROData_Stream.cxx b/src/HYDROData/HYDROData_Stream.cxx index 24231090..b5b58b69 100644 --- a/src/HYDROData/HYDROData_Stream.cxx +++ b/src/HYDROData/HYDROData_Stream.cxx @@ -145,16 +145,6 @@ HYDROData_SequenceOfObjects HYDROData_Stream::GetAllReferenceObjects() const return aResSeq; } -TopoDS_Shape HYDROData_Stream::GetTopShape() const -{ - return getTopShape(); -} - -TopoDS_Shape HYDROData_Stream::GetShape3D() const -{ - return getShape3D(); -} - Handle(Geom_BSplineCurve) HYDROData_Stream::buildInterpolationCurve( const Handle(TColgp_HArray1OfPnt)& theArrayOfPnt ) { diff --git a/src/HYDROData/HYDROData_Stream.h b/src/HYDROData/HYDROData_Stream.h index fd4ffca5..1aa0b30f 100644 --- a/src/HYDROData/HYDROData_Stream.h +++ b/src/HYDROData/HYDROData_Stream.h @@ -107,16 +107,6 @@ public: */ HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetAllReferenceObjects() const; - /** - * Returns the top shape of the object. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetTopShape() const; - - /** - * Returns the 3d shape of the object. - */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetShape3D() const; - /** * Update the profiles order and shape presentations of stream. * Call this method whenever you made changes for stream data. diff --git a/src/HYDROData/HYDROData_Zone.cxx b/src/HYDROData/HYDROData_Zone.cxx index c6e3da1a..c2517691 100644 --- a/src/HYDROData/HYDROData_Zone.cxx +++ b/src/HYDROData/HYDROData_Zone.cxx @@ -23,15 +23,9 @@ #include "HYDROData_Document.h" #include "HYDROData_NaturalObject.h" #include "HYDROData_LandCover.h" - -#include -#include - -#include - #include - #include +#include IMPLEMENT_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Zone, HYDROData_Entity) @@ -74,21 +68,12 @@ HYDROData_SequenceOfObjects HYDROData_Zone::GetAllReferenceObjects() const void HYDROData_Zone::SetShape( const TopoDS_Shape& theShape ) { - TNaming_Builder aBuilder( myLab.FindChild( DataTag_Shape ) ); - aBuilder.Generated( theShape ); + HYDROData_Entity::SetShape( DataTag_Shape, theShape ); } TopoDS_Shape HYDROData_Zone::GetShape() const { - TDF_Label aLabel = myLab.FindChild( DataTag_Shape, false ); - if ( !aLabel.IsNull() ) - { - Handle(TNaming_NamedShape) aNamedShape; - if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) ) - return aNamedShape->Get(); - } - - return TopoDS_Shape(); + return HYDROData_Entity::GetShape( DataTag_Shape ); } bool HYDROData_Zone::IsMergingNeed() const diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx index 6b026e90..ef7afcfc 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx @@ -163,7 +163,7 @@ bool HYDROGUI_ImportLandCoverOp::processApply( int& theUpdateFlags, aLC->SetFillingColor( HYDROData_LandCover::DefaultFillingColor() ); aLC->SetBorderColor( HYDROData_LandCover::DefaultBorderColor() ); - aLC->setShape(aResShape); + aLC->SetShape(aResShape); aLC->Show(); //erasePreview(); @@ -247,7 +247,7 @@ void HYDROGUI_ImportLandCoverOp::onFileSelected() { TopoDS_Face aFace = TopoDS::Face(aFaces.Value( i )); - aLC->setShape( aFace ); + aLC->SetShape( aFace ); if ( aViewManager && !aCtx.IsNull() ) {