]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
unified access to shapes
authorasl <asl@opencascade.com>
Wed, 14 Oct 2015 15:02:20 +0000 (18:02 +0300)
committerasl <asl@opencascade.com>
Wed, 14 Oct 2015 15:02:20 +0000 (18:02 +0300)
29 files changed:
src/HYDROData/HYDROData_Channel.cxx
src/HYDROData/HYDROData_Channel.h
src/HYDROData/HYDROData_Confluence.cxx
src/HYDROData/HYDROData_Confluence.h
src/HYDROData/HYDROData_Entity.cxx
src/HYDROData/HYDROData_Entity.h
src/HYDROData/HYDROData_IPolyline.cxx
src/HYDROData/HYDROData_IPolyline.h
src/HYDROData/HYDROData_ImmersibleZone.cxx
src/HYDROData/HYDROData_ImmersibleZone.h
src/HYDROData/HYDROData_LandCover.cxx
src/HYDROData/HYDROData_LandCover.h
src/HYDROData/HYDROData_LandCoverMap.cxx
src/HYDROData/HYDROData_Object.cxx
src/HYDROData/HYDROData_Object.h
src/HYDROData/HYDROData_Obstacle.cxx
src/HYDROData/HYDROData_Obstacle.h
src/HYDROData/HYDROData_Polyline3D.cxx
src/HYDROData/HYDROData_Polyline3D.h
src/HYDROData/HYDROData_PolylineXY.cxx
src/HYDROData/HYDROData_PolylineXY.h
src/HYDROData/HYDROData_Profile.cxx
src/HYDROData/HYDROData_River.cxx
src/HYDROData/HYDROData_River.h
src/HYDROData/HYDROData_ShapesGroup.cxx
src/HYDROData/HYDROData_Stream.cxx
src/HYDROData/HYDROData_Stream.h
src/HYDROData/HYDROData_Zone.cxx
src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx

index c78c5e416bbc3ca0a2b68eb6aff0c92759590bda..33cd9d81e59c84ec059cb4b6a62469634b80a528 100644 (file)
@@ -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 )
index 5b4e694f84496701dff8b14f7ac227f12f2d0060..6707cfea8784883f8743fdfc89b7fe593d6e0130 100644 (file)
@@ -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.
    */
index 12f19b5a60a72396a9123feafc89662c29d55333..7f617c404c64064d19cb71788b376552d8e3b876 100644 (file)
@@ -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
index e5c5dfffb0eb3640651d278d5ad83b11fd6b4a07..ec0ac2fe69c83be78b90521a04b4ec7e8cd10d3b 100644 (file)
@@ -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:
index 2086ccf10f3e8dd03fa9e5f4a360c0e963e81de5..1ff7379a109902a3e447754d168767cdd58d4d15 100644 (file)
 // 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 <HYDROData_Entity.h>
+#include <HYDROData_Document.h>
+#include <HYDROData_Iterator.h>
+#include <HYDROData_Tool.h>
+#include <Standard_GUID.hxx>
 #include <TDataStd_Name.hxx>
 #include <TDataStd_ByteArray.hxx>
 #include <TDataStd_UAttribute.hxx>
-#include <TDataStd_IntegerArray.hxx>
-#include <TDataStd_BooleanArray.hxx>
 #include <TDataStd_Integer.hxx>
-#include <TDataStd_RealArray.hxx>
+#include <TDataStd_IntegerArray.hxx>
 #include <TDataStd_ReferenceList.hxx>
-
 #include <TDF_CopyLabel.hxx>
 #include <TDF_ListIteratorOfLabelList.hxx>
-
+#include <TNaming_Builder.hxx>
+#include <TNaming_NamedShape.hxx>
+#include <TopoDS_Shape.hxx>
 #include <QColor>
-#include <QString>
+#include <QRegExp>
 #include <QStringList>
 #include <QVariant>
 
@@ -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();
+}
index 243a41a271e649ed337e21f73f21441a55de7a51..d7ad12cb87b89ff03442f9c73996c515efb2ddfb 100644 (file)
 #define HYDROData_Entity_HeaderFile
 
 #include "HYDROData.h"
-
 #include <NCollection_Sequence.hxx>
-
 #include <TDF_Label.hxx>
-
 #include <QMap>
 
 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.
index df150b0a83c8525ce4fadbd6f13cec4a6ffc7c5f..62b1e3d32071d94db05faec3f26d9b027189c8e9 100755 (executable)
 #include <TDataStd_ExtStringList.hxx>
 #include <TDataStd_IntegerList.hxx>
 #include <TDataStd_RealList.hxx>
-
 #include <TopoDS_Shape.hxx>
-
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
-
 #include <QColor>
 
 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,
index 5d15d916eb8d27d4d5986827672b61248050305f..c423f30a695cff20f772d30bdd1aba691bd9913f 100644 (file)
@@ -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,
index 8382e12ac270dd00363928312ac52e00084a68e3..6a90bfffeb80e7f1f37fded85d81fcb37d7d2eb2 100644 (file)
@@ -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()
index 82115fc17e8353b8409a2d8da2d9b6ea70f43063..c888645b64d75c980da535b51a426c9f1ee129cd 100644 (file)
@@ -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.
    */
index 278f42c5f38fcc2f830c31bc84c440de00240b72..4423c83fb60c915184a97e41bb6446e1716c6886 100644 (file)
@@ -24,8 +24,6 @@
 #include <BRepBuilderAPI_MakeFace.hxx>
 #include <BRepBuilderAPI_MakeWire.hxx>
 #include <TDataStd_AsciiString.hxx>
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Wire.hxx>
@@ -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()
index 289e4bff1820b2778bac1190edd3312d107335c6..8df5e5161d7a0e5e5ae1b7a55050de9e8b11bbb7 100644 (file)
@@ -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:
 
index 02c73ba80cb2fd315c7340c545074bf153ecf11a..0c347add1b7e9ce7bec8b212380d2f801d2fe169 100644 (file)
@@ -28,8 +28,6 @@
 #include <BRepAlgoAPI_Fuse.hxx>
 #include <BRepBuilderAPI_MakeFace.hxx>
 #include <NCollection_IndexedMap.hxx>
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Compound.hxx>
 #include <TopoDS_Face.hxx>
@@ -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 );
 }
 
 /**
index 13a01102c7432feda98ec458a2dce7c3b885f832..95d0efeb7166607a71f7c693594dbd0a604af5f7 100644 (file)
 #include "HYDROData_Tool.h"
 #include "HYDROData_Iterator.h"
 #include "HYDROData_IAltitudeObject.h"
-
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
-
 #include <TopoDS_Shape.hxx>
 #include <TDataStd_Integer.hxx>
 
@@ -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
index 520a70ab3515a41ea4d248f438fc6c70d821ae74..4f582fd981b0f76bebad2131abb89d89b0f5dffe 100644 (file)
@@ -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
index 1eeb8a8371a7b0701eea90e1f899a15d39f090fd..43f468e595139339c7739c453e768cc686760f47 100644 (file)
@@ -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 );
index a7b875651554b0c42d2ad1be52d6f18525459584..c0ac58221d3ebf5c23fbe38c175b43e57b20fd9f 100644 (file)
@@ -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.
    */
index 67098e95e274235ccb83efbfa17e14121e35af3c..73545b0f2a4e34f26cee926f13b036d983c6df87 100644 (file)
@@ -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();
index aa4520ff3beba6f85cbf5b0b516a9a38931fb1bf..c7d6cd0432c11ede80e0f710ab90055ca5b8f2f8 100644 (file)
@@ -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.
index a3942aff049e9b8022b344bd456cb28351ce3a52..807c8c3fccedbf1dc0aac89b2eb91d21dde63d05 100755 (executable)
@@ -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<TCollection_AsciiString>&           theSectNames,
                            NCollection_Sequence<HYDROData_PolylineXY::SectionType>& 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
index 4e70f42bbc06fb1e882f03cac022ba4b141f0cd9..57ff8cadb614bc2054971431ea672e2cbae36f6c 100644 (file)
@@ -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.
    */
index 2649e2b04a26c032477e1ae1af2d364c4f337b7b..f78b4cbc18cc941b7776b071fdab644b662c9539 100755 (executable)
@@ -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;
index 2bb5cef767d311822810ed892643bf54772fab89..085a9127c711e742715f97f9ab683d3955930779 100644 (file)
@@ -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
index 5be072343dda99ce05e2ae8bbfabd7008d75dc54..dee7d62484e84e286b78f23adc81bf0ef33124e3 100644 (file)
@@ -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;
index 3501522148c06f9bad65239ca0433896b1e9c665..f7f597a3c240ebd4733e7456373ad3a0f0bfaac5 100644 (file)
 //
 
 #include "HYDROData_ShapesGroup.h"
-
 #include "HYDROData_ShapesTool.h"
 
+#include <BRepBuilderAPI_MakeShape.hxx>
 #include <TDF_ChildIDIterator.hxx>
+#include <TNaming_Builder.hxx>
+#include <TNaming_NamedShape.hxx>
 
 #include <TopoDS.hxx>
 #include <TopoDS_Edge.hxx>
 
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
-
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
-
-#include <BRepBuilderAPI_MakeShape.hxx>
-
 #include <ShapeUpgrade_UnifySameDomain.hxx>
 
 IMPLEMENT_STANDARD_HANDLE(HYDROData_ShapesGroup,HYDROData_Entity)
index 242310905264fab10a71851065867906ac382c1d..b5b58b698b433b4bb6d54c67fa038605f5f9e024 100644 (file)
@@ -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 )
 {
index fd4ffca5f1784e6741e632ade6f93e980a9087a0..1aa0b30feb8c72352c8da78a12013b51f9503dc6 100644 (file)
@@ -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.
index c6e3da1af9650fb148aa9bdd0946e87c38a3cd7d..c25176912fb24c039206acfa0bc9434c38ae546f 100644 (file)
 #include "HYDROData_Document.h"
 #include "HYDROData_NaturalObject.h"
 #include "HYDROData_LandCover.h"
-
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
-
-#include <TopoDS_Shape.hxx>
-
 #include <QStringList>
-
 #include <TDataStd_Integer.hxx>
+#include <TopoDS_Shape.hxx>
 
 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
index 6b026e90349e3693d935514f2b18808b5a64e80a..ef7afcfc247fb567cedcf74017082e28f615742c 100644 (file)
@@ -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() )
         {