From 7b9454f8053b968f127bf7981eb05b6749e261f4 Mon Sep 17 00:00:00 2001 From: adv Date: Wed, 30 Oct 2013 05:15:28 +0000 Subject: [PATCH] Empty classes for all geometry objects has been added. --- src/HYDROData/CMakeLists.txt | 12 +++++ src/HYDROData/HYDROData_Channel.cxx | 60 ++++++++++++++++++++++++ src/HYDROData/HYDROData_Channel.h | 63 ++++++++++++++++++++++++++ src/HYDROData/HYDROData_Confluence.cxx | 60 ++++++++++++++++++++++++ src/HYDROData/HYDROData_Confluence.h | 63 ++++++++++++++++++++++++++ src/HYDROData/HYDROData_Digue.cxx | 60 ++++++++++++++++++++++++ src/HYDROData/HYDROData_Digue.h | 63 ++++++++++++++++++++++++++ src/HYDROData/HYDROData_Entity.h | 19 +++++--- src/HYDROData/HYDROData_Iterator.cxx | 24 ++++++++++ src/HYDROData/HYDROData_Obstacle.cxx | 60 ++++++++++++++++++++++++ src/HYDROData/HYDROData_Obstacle.h | 63 ++++++++++++++++++++++++++ src/HYDROData/HYDROData_River.cxx | 60 ++++++++++++++++++++++++ src/HYDROData/HYDROData_River.h | 63 ++++++++++++++++++++++++++ src/HYDROData/HYDROData_Stream.cxx | 60 ++++++++++++++++++++++++ src/HYDROData/HYDROData_Stream.h | 63 ++++++++++++++++++++++++++ 15 files changed, 787 insertions(+), 6 deletions(-) create mode 100644 src/HYDROData/HYDROData_Channel.cxx create mode 100644 src/HYDROData/HYDROData_Channel.h create mode 100644 src/HYDROData/HYDROData_Confluence.cxx create mode 100644 src/HYDROData/HYDROData_Confluence.h create mode 100644 src/HYDROData/HYDROData_Digue.cxx create mode 100644 src/HYDROData/HYDROData_Digue.h create mode 100644 src/HYDROData/HYDROData_Obstacle.cxx create mode 100644 src/HYDROData/HYDROData_Obstacle.h create mode 100644 src/HYDROData/HYDROData_River.cxx create mode 100644 src/HYDROData/HYDROData_River.h create mode 100644 src/HYDROData/HYDROData_Stream.cxx create mode 100644 src/HYDROData/HYDROData_Stream.h diff --git a/src/HYDROData/CMakeLists.txt b/src/HYDROData/CMakeLists.txt index 9308991b..5ef1eb92 100644 --- a/src/HYDROData/CMakeLists.txt +++ b/src/HYDROData/CMakeLists.txt @@ -8,6 +8,9 @@ set(PROJECT_HEADERS HYDROData_Bathymetry.h HYDROData_BSplineOperation.h HYDROData_CalculationCase.h + HYDROData_Channel.h + HYDROData_Confluence.h + HYDROData_Digue.h HYDROData_Document.h HYDROData_Entity.h HYDROData_IAltitudeObject.h @@ -17,10 +20,13 @@ set(PROJECT_HEADERS HYDROData_Lambert93.h HYDROData_NaturalObject.h HYDROData_Object.h + HYDROData_Obstacle.h HYDROData_OperationsFactory.h HYDROData_Polyline.h HYDROData_Region.h + HYDROData_River.h HYDROData_SplitToZonesTool.h + HYDROData_Stream.h HYDROData_Tool.h HYDROData_VisualState.h HYDROData_Zone.h @@ -33,6 +39,9 @@ set(PROJECT_SOURCES HYDROData_Bathymetry.cxx HYDROData_BSplineOperation.cxx HYDROData_CalculationCase.cxx + HYDROData_Channel.cxx + HYDROData_Confluence.cxx + HYDROData_Digue.cxx HYDROData_Document.cxx HYDROData_Entity.cxx HYDROData_IAltitudeObject.cxx @@ -42,10 +51,13 @@ set(PROJECT_SOURCES HYDROData_Lambert93.cxx HYDROData_NaturalObject.cxx HYDROData_Object.cxx + HYDROData_Obstacle.cxx HYDROData_OperationsFactory.cxx HYDROData_Polyline.cxx HYDROData_Region.cxx + HYDROData_River.cxx HYDROData_SplitToZonesTool.cxx + HYDROData_Stream.cxx HYDROData_Tool.cxx HYDROData_VisualState.cxx HYDROData_Zone.cxx diff --git a/src/HYDROData/HYDROData_Channel.cxx b/src/HYDROData/HYDROData_Channel.cxx new file mode 100644 index 00000000..0a1d13bd --- /dev/null +++ b/src/HYDROData/HYDROData_Channel.cxx @@ -0,0 +1,60 @@ + +#include "HYDROData_Channel.h" + +#include "HYDROData_Document.h" + +#include + +#include + +#define PYTHON_CHANNEL_ID "KIND_CHANNEL" + +IMPLEMENT_STANDARD_HANDLE(HYDROData_Channel,HYDROData_ArtificialObject) +IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Channel,HYDROData_ArtificialObject) + + +HYDROData_Channel::HYDROData_Channel() +: HYDROData_ArtificialObject() +{ +} + +HYDROData_Channel::~HYDROData_Channel() +{ +} + +QStringList HYDROData_Channel::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const +{ + QStringList aResList; + + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this ); + if ( aDocument.IsNull() ) + return aResList; + + QString aDocName = aDocument->GetDocPyName(); + QString aChannelName = GetName(); + + aResList << QString( "%1 = %2.CreateObject( %3 );" ) + .arg( aChannelName ).arg( aDocName ).arg( PYTHON_CHANNEL_ID ); + aResList << QString( "%1.SetName( \"%2\" );" ) + .arg( aChannelName ).arg( aChannelName ); + aResList << QString( "" ); + + // TODO + + return aResList; +} + +TopoDS_Shape HYDROData_Channel::GetTopShape() const +{ + // TODO + return getTopShape(); +} + +TopoDS_Shape HYDROData_Channel::GetShape3D() const +{ + // TODO + return getShape3D(); +} + + + diff --git a/src/HYDROData/HYDROData_Channel.h b/src/HYDROData/HYDROData_Channel.h new file mode 100644 index 00000000..fbb35f4a --- /dev/null +++ b/src/HYDROData/HYDROData_Channel.h @@ -0,0 +1,63 @@ + +#ifndef HYDROData_Channel_HeaderFile +#define HYDROData_Channel_HeaderFile + +#include "HYDROData_ArtificialObject.h" + +DEFINE_STANDARD_HANDLE(HYDROData_Channel, HYDROData_ArtificialObject) + +/**\class HYDROData_Channel + * \brief + * + */ +class HYDROData_Channel : public HYDROData_ArtificialObject +{ +protected: + /** + * Enumeration of tags corresponding to the persistent object parameters. + */ + enum DataTag + { + DataTag_First = HYDROData_ArtificialObject::DataTag_First + 100, ///< first tag, to reserve + }; + +public: + DEFINE_STANDARD_RTTI(HYDROData_Channel); + + /** + * Returns the kind of this object. Must be redefined in all objects of known type. + */ + HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_CHANNEL;} + + /** + * Dump object to Python script representation. + */ + 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; + +protected: + + friend class HYDROData_Iterator; + + /** + * Creates new object in the internal data structure. Use higher level objects + * to create objects with real content. + */ + HYDRODATA_EXPORT HYDROData_Channel(); + + /** + * Destructs properties of the object and object itself, removes it from the document. + */ + virtual HYDRODATA_EXPORT ~HYDROData_Channel(); +}; + +#endif diff --git a/src/HYDROData/HYDROData_Confluence.cxx b/src/HYDROData/HYDROData_Confluence.cxx new file mode 100644 index 00000000..7d898574 --- /dev/null +++ b/src/HYDROData/HYDROData_Confluence.cxx @@ -0,0 +1,60 @@ + +#include "HYDROData_Confluence.h" + +#include "HYDROData_Document.h" + +#include + +#include + +#define PYTHON_CONFLUENCE_ID "KIND_CONFLUENCE" + +IMPLEMENT_STANDARD_HANDLE(HYDROData_Confluence,HYDROData_NaturalObject) +IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Confluence,HYDROData_NaturalObject) + + +HYDROData_Confluence::HYDROData_Confluence() +: HYDROData_NaturalObject() +{ +} + +HYDROData_Confluence::~HYDROData_Confluence() +{ +} + +QStringList HYDROData_Confluence::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const +{ + QStringList aResList; + + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this ); + if ( aDocument.IsNull() ) + return aResList; + + QString aDocName = aDocument->GetDocPyName(); + QString aConfluenceName = GetName(); + + aResList << QString( "%1 = %2.CreateObject( %3 );" ) + .arg( aConfluenceName ).arg( aDocName ).arg( PYTHON_CONFLUENCE_ID ); + aResList << QString( "%1.SetName( \"%2\" );" ) + .arg( aConfluenceName ).arg( aConfluenceName ); + aResList << QString( "" ); + + // TODO + + return aResList; +} + +TopoDS_Shape HYDROData_Confluence::GetTopShape() const +{ + // TODO + return getTopShape(); +} + +TopoDS_Shape HYDROData_Confluence::GetShape3D() const +{ + // TODO + return getShape3D(); +} + + + diff --git a/src/HYDROData/HYDROData_Confluence.h b/src/HYDROData/HYDROData_Confluence.h new file mode 100644 index 00000000..b8ef0317 --- /dev/null +++ b/src/HYDROData/HYDROData_Confluence.h @@ -0,0 +1,63 @@ + +#ifndef HYDROData_Confluence_HeaderFile +#define HYDROData_Confluence_HeaderFile + +#include "HYDROData_NaturalObject.h" + +DEFINE_STANDARD_HANDLE(HYDROData_Confluence, HYDROData_NaturalObject) + +/**\class HYDROData_Confluence + * \brief + * + */ +class HYDROData_Confluence : public HYDROData_NaturalObject +{ +protected: + /** + * Enumeration of tags corresponding to the persistent object parameters. + */ + enum DataTag + { + DataTag_First = HYDROData_NaturalObject::DataTag_First + 100, ///< first tag, to reserve + }; + +public: + DEFINE_STANDARD_RTTI(HYDROData_Confluence); + + /** + * Returns the kind of this object. Must be redefined in all objects of known type. + */ + HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_RIVER;} + + /** + * Dump object to Python script representation. + */ + 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; + +protected: + + friend class HYDROData_Iterator; + + /** + * Creates new object in the internal data structure. Use higher level objects + * to create objects with real content. + */ + HYDRODATA_EXPORT HYDROData_Confluence(); + + /** + * Destructs properties of the object and object itself, removes it from the document. + */ + virtual HYDRODATA_EXPORT ~HYDROData_Confluence(); +}; + +#endif diff --git a/src/HYDROData/HYDROData_Digue.cxx b/src/HYDROData/HYDROData_Digue.cxx new file mode 100644 index 00000000..b89a3425 --- /dev/null +++ b/src/HYDROData/HYDROData_Digue.cxx @@ -0,0 +1,60 @@ + +#include "HYDROData_Digue.h" + +#include "HYDROData_Document.h" + +#include + +#include + +#define PYTHON_DIGUE_ID "KIND_DIGUE" + +IMPLEMENT_STANDARD_HANDLE(HYDROData_Digue,HYDROData_ArtificialObject) +IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Digue,HYDROData_ArtificialObject) + + +HYDROData_Digue::HYDROData_Digue() +: HYDROData_ArtificialObject() +{ +} + +HYDROData_Digue::~HYDROData_Digue() +{ +} + +QStringList HYDROData_Digue::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const +{ + QStringList aResList; + + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this ); + if ( aDocument.IsNull() ) + return aResList; + + QString aDocName = aDocument->GetDocPyName(); + QString aDigueName = GetName(); + + aResList << QString( "%1 = %2.CreateObject( %3 );" ) + .arg( aDigueName ).arg( aDocName ).arg( PYTHON_DIGUE_ID ); + aResList << QString( "%1.SetName( \"%2\" );" ) + .arg( aDigueName ).arg( aDigueName ); + aResList << QString( "" ); + + // TODO + + return aResList; +} + +TopoDS_Shape HYDROData_Digue::GetTopShape() const +{ + // TODO + return getTopShape(); +} + +TopoDS_Shape HYDROData_Digue::GetShape3D() const +{ + // TODO + return getShape3D(); +} + + + diff --git a/src/HYDROData/HYDROData_Digue.h b/src/HYDROData/HYDROData_Digue.h new file mode 100644 index 00000000..0b893d66 --- /dev/null +++ b/src/HYDROData/HYDROData_Digue.h @@ -0,0 +1,63 @@ + +#ifndef HYDROData_Digue_HeaderFile +#define HYDROData_Digue_HeaderFile + +#include "HYDROData_ArtificialObject.h" + +DEFINE_STANDARD_HANDLE(HYDROData_Digue, HYDROData_ArtificialObject) + +/**\class HYDROData_Digue + * \brief + * + */ +class HYDROData_Digue : public HYDROData_ArtificialObject +{ +protected: + /** + * Enumeration of tags corresponding to the persistent object parameters. + */ + enum DataTag + { + DataTag_First = HYDROData_ArtificialObject::DataTag_First + 100, ///< first tag, to reserve + }; + +public: + DEFINE_STANDARD_RTTI(HYDROData_Digue); + + /** + * Returns the kind of this object. Must be redefined in all objects of known type. + */ + HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_DIGUE;} + + /** + * Dump object to Python script representation. + */ + 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; + +protected: + + friend class HYDROData_Iterator; + + /** + * Creates new object in the internal data structure. Use higher level objects + * to create objects with real content. + */ + HYDRODATA_EXPORT HYDROData_Digue(); + + /** + * Destructs properties of the object and object itself, removes it from the document. + */ + virtual HYDRODATA_EXPORT ~HYDROData_Digue(); +}; + +#endif diff --git a/src/HYDROData/HYDROData_Entity.h b/src/HYDROData/HYDROData_Entity.h index 0aa6a492..9f2633a2 100644 --- a/src/HYDROData/HYDROData_Entity.h +++ b/src/HYDROData/HYDROData_Entity.h @@ -26,12 +26,19 @@ const ObjectKind KIND_POLYLINE = 2; const ObjectKind KIND_BATHYMETRY = 3; const ObjectKind KIND_ALTITUDE = 4; const ObjectKind KIND_IMMERSIBLE_ZONE = 5; -const ObjectKind KIND_GUIDE_LINE = 6; -const ObjectKind KIND_PROFILE = 7; -const ObjectKind KIND_CALCULATION = 8; -const ObjectKind KIND_ZONE = 9; -const ObjectKind KIND_REGION = 10; -const ObjectKind KIND_VISUAL_STATE = 11; +const ObjectKind KIND_RIVER = 6; +const ObjectKind KIND_STREAM = 7; +const ObjectKind KIND_CONFLUENCE = 8; +const ObjectKind KIND_CHANNEL = 9; +const ObjectKind KIND_OBSTACLE = 10; +const ObjectKind KIND_DIGUE = 11; +const ObjectKind KIND_PROFILE = 12; +const ObjectKind KIND_PROFILEUZ = 13; +const ObjectKind KIND_POLYLINEXY = 14; +const ObjectKind KIND_CALCULATION = 15; +const ObjectKind KIND_ZONE = 16; +const ObjectKind KIND_REGION = 17; +const ObjectKind KIND_VISUAL_STATE = 18; const ObjectKind KIND_LAST = KIND_VISUAL_STATE; DEFINE_STANDARD_HANDLE(HYDROData_Entity, MMgt_TShared) diff --git a/src/HYDROData/HYDROData_Iterator.cxx b/src/HYDROData/HYDROData_Iterator.cxx index 7af624e8..a0965567 100644 --- a/src/HYDROData/HYDROData_Iterator.cxx +++ b/src/HYDROData/HYDROData_Iterator.cxx @@ -4,11 +4,17 @@ #include "HYDROData_AltitudeObject.h" #include "HYDROData_Bathymetry.h" #include "HYDROData_CalculationCase.h" +#include "HYDROData_Channel.h" +#include "HYDROData_Confluence.h" +#include "HYDROData_Digue.h" #include "HYDROData_Image.h" #include "HYDROData_ImmersibleZone.h" +#include "HYDROData_Obstacle.h" #include "HYDROData_Polyline.h" #include "HYDROData_VisualState.h" #include "HYDROData_Region.h" +#include "HYDROData_River.h" +#include "HYDROData_Stream.h" #include "HYDROData_Zone.h" #include @@ -109,6 +115,24 @@ Handle(HYDROData_Entity) HYDROData_Iterator::Object( const TDF_Label& theLabel ) case KIND_IMMERSIBLE_ZONE: aResult = new HYDROData_ImmersibleZone(); break; + case KIND_RIVER: + aResult = new HYDROData_River(); + break; + case KIND_STREAM: + aResult = new HYDROData_Stream(); + break; + case KIND_CONFLUENCE: + aResult = new HYDROData_Confluence(); + break; + case KIND_CHANNEL: + aResult = new HYDROData_Channel(); + break; + case KIND_OBSTACLE: + aResult = new HYDROData_Obstacle(); + break; + case KIND_DIGUE: + aResult = new HYDROData_Digue(); + break; case KIND_CALCULATION: aResult = new HYDROData_CalculationCase(); break; diff --git a/src/HYDROData/HYDROData_Obstacle.cxx b/src/HYDROData/HYDROData_Obstacle.cxx new file mode 100644 index 00000000..957bb7c0 --- /dev/null +++ b/src/HYDROData/HYDROData_Obstacle.cxx @@ -0,0 +1,60 @@ + +#include "HYDROData_Obstacle.h" + +#include "HYDROData_Document.h" + +#include + +#include + +#define PYTHON_OBSTACLE_ID "KIND_OBSTACLE" + +IMPLEMENT_STANDARD_HANDLE(HYDROData_Obstacle,HYDROData_ArtificialObject) +IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Obstacle,HYDROData_ArtificialObject) + + +HYDROData_Obstacle::HYDROData_Obstacle() +: HYDROData_ArtificialObject() +{ +} + +HYDROData_Obstacle::~HYDROData_Obstacle() +{ +} + +QStringList HYDROData_Obstacle::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const +{ + QStringList aResList; + + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this ); + if ( aDocument.IsNull() ) + return aResList; + + QString aDocName = aDocument->GetDocPyName(); + QString anObstacleName = GetName(); + + aResList << QString( "%1 = %2.CreateObject( %3 );" ) + .arg( anObstacleName ).arg( aDocName ).arg( PYTHON_OBSTACLE_ID ); + aResList << QString( "%1.SetName( \"%2\" );" ) + .arg( anObstacleName ).arg( anObstacleName ); + aResList << QString( "" ); + + // TODO + + return aResList; +} + +TopoDS_Shape HYDROData_Obstacle::GetTopShape() const +{ + // TODO + return getTopShape(); +} + +TopoDS_Shape HYDROData_Obstacle::GetShape3D() const +{ + // TODO + return getShape3D(); +} + + + diff --git a/src/HYDROData/HYDROData_Obstacle.h b/src/HYDROData/HYDROData_Obstacle.h new file mode 100644 index 00000000..0a728c0a --- /dev/null +++ b/src/HYDROData/HYDROData_Obstacle.h @@ -0,0 +1,63 @@ + +#ifndef HYDROData_Obstacle_HeaderFile +#define HYDROData_Obstacle_HeaderFile + +#include "HYDROData_ArtificialObject.h" + +DEFINE_STANDARD_HANDLE(HYDROData_Obstacle, HYDROData_ArtificialObject) + +/**\class HYDROData_Obstacle + * \brief + * + */ +class HYDROData_Obstacle : public HYDROData_ArtificialObject +{ +protected: + /** + * Enumeration of tags corresponding to the persistent object parameters. + */ + enum DataTag + { + DataTag_First = HYDROData_ArtificialObject::DataTag_First + 100, ///< first tag, to reserve + }; + +public: + DEFINE_STANDARD_RTTI(HYDROData_Obstacle); + + /** + * Returns the kind of this object. Must be redefined in all objects of known type. + */ + HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_OBSTACLE;} + + /** + * Dump object to Python script representation. + */ + 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; + +protected: + + friend class HYDROData_Iterator; + + /** + * Creates new object in the internal data structure. Use higher level objects + * to create objects with real content. + */ + HYDRODATA_EXPORT HYDROData_Obstacle(); + + /** + * Destructs properties of the object and object itself, removes it from the document. + */ + virtual HYDRODATA_EXPORT ~HYDROData_Obstacle(); +}; + +#endif diff --git a/src/HYDROData/HYDROData_River.cxx b/src/HYDROData/HYDROData_River.cxx new file mode 100644 index 00000000..ca45d158 --- /dev/null +++ b/src/HYDROData/HYDROData_River.cxx @@ -0,0 +1,60 @@ + +#include "HYDROData_River.h" + +#include "HYDROData_Document.h" + +#include + +#include + +#define PYTHON_RIVER_ID "KIND_RIVER" + +IMPLEMENT_STANDARD_HANDLE(HYDROData_River,HYDROData_NaturalObject) +IMPLEMENT_STANDARD_RTTIEXT(HYDROData_River,HYDROData_NaturalObject) + + +HYDROData_River::HYDROData_River() +: HYDROData_NaturalObject() +{ +} + +HYDROData_River::~HYDROData_River() +{ +} + +QStringList HYDROData_River::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const +{ + QStringList aResList; + + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this ); + if ( aDocument.IsNull() ) + return aResList; + + QString aDocName = aDocument->GetDocPyName(); + QString aRiverName = GetName(); + + aResList << QString( "%1 = %2.CreateObject( %3 );" ) + .arg( aRiverName ).arg( aDocName ).arg( PYTHON_RIVER_ID ); + aResList << QString( "%1.SetName( \"%2\" );" ) + .arg( aRiverName ).arg( aRiverName ); + aResList << QString( "" ); + + // TODO + + return aResList; +} + +TopoDS_Shape HYDROData_River::GetTopShape() const +{ + // TODO + return getTopShape(); +} + +TopoDS_Shape HYDROData_River::GetShape3D() const +{ + // TODO + return getShape3D(); +} + + + diff --git a/src/HYDROData/HYDROData_River.h b/src/HYDROData/HYDROData_River.h new file mode 100644 index 00000000..8d5df364 --- /dev/null +++ b/src/HYDROData/HYDROData_River.h @@ -0,0 +1,63 @@ + +#ifndef HYDROData_River_HeaderFile +#define HYDROData_River_HeaderFile + +#include "HYDROData_NaturalObject.h" + +DEFINE_STANDARD_HANDLE(HYDROData_River, HYDROData_NaturalObject) + +/**\class HYDROData_River + * \brief + * + */ +class HYDROData_River : public HYDROData_NaturalObject +{ +protected: + /** + * Enumeration of tags corresponding to the persistent object parameters. + */ + enum DataTag + { + DataTag_First = HYDROData_NaturalObject::DataTag_First + 100, ///< first tag, to reserve + }; + +public: + DEFINE_STANDARD_RTTI(HYDROData_River); + + /** + * Returns the kind of this object. Must be redefined in all objects of known type. + */ + HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_RIVER;} + + /** + * Dump object to Python script representation. + */ + 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; + +protected: + + friend class HYDROData_Iterator; + + /** + * Creates new object in the internal data structure. Use higher level objects + * to create objects with real content. + */ + HYDRODATA_EXPORT HYDROData_River(); + + /** + * Destructs properties of the object and object itself, removes it from the document. + */ + virtual HYDRODATA_EXPORT ~HYDROData_River(); +}; + +#endif diff --git a/src/HYDROData/HYDROData_Stream.cxx b/src/HYDROData/HYDROData_Stream.cxx new file mode 100644 index 00000000..985f6271 --- /dev/null +++ b/src/HYDROData/HYDROData_Stream.cxx @@ -0,0 +1,60 @@ + +#include "HYDROData_Stream.h" + +#include "HYDROData_Document.h" + +#include + +#include + +#define PYTHON_STREAM_ID "KIND_STREAM" + +IMPLEMENT_STANDARD_HANDLE(HYDROData_Stream,HYDROData_NaturalObject) +IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Stream,HYDROData_NaturalObject) + + +HYDROData_Stream::HYDROData_Stream() +: HYDROData_NaturalObject() +{ +} + +HYDROData_Stream::~HYDROData_Stream() +{ +} + +QStringList HYDROData_Stream::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const +{ + QStringList aResList; + + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this ); + if ( aDocument.IsNull() ) + return aResList; + + QString aDocName = aDocument->GetDocPyName(); + QString aStreamName = GetName(); + + aResList << QString( "%1 = %2.CreateObject( %3 );" ) + .arg( aStreamName ).arg( aDocName ).arg( PYTHON_STREAM_ID ); + aResList << QString( "%1.SetName( \"%2\" );" ) + .arg( aStreamName ).arg( aStreamName ); + aResList << QString( "" ); + + // TODO + + return aResList; +} + +TopoDS_Shape HYDROData_Stream::GetTopShape() const +{ + // TODO + return getTopShape(); +} + +TopoDS_Shape HYDROData_Stream::GetShape3D() const +{ + // TODO + return getShape3D(); +} + + + diff --git a/src/HYDROData/HYDROData_Stream.h b/src/HYDROData/HYDROData_Stream.h new file mode 100644 index 00000000..34d70a24 --- /dev/null +++ b/src/HYDROData/HYDROData_Stream.h @@ -0,0 +1,63 @@ + +#ifndef HYDROData_Stream_HeaderFile +#define HYDROData_Stream_HeaderFile + +#include "HYDROData_NaturalObject.h" + +DEFINE_STANDARD_HANDLE(HYDROData_Stream, HYDROData_NaturalObject) + +/**\class HYDROData_Stream + * \brief + * + */ +class HYDROData_Stream : public HYDROData_NaturalObject +{ +protected: + /** + * Enumeration of tags corresponding to the persistent object parameters. + */ + enum DataTag + { + DataTag_First = HYDROData_NaturalObject::DataTag_First + 100, ///< first tag, to reserve + }; + +public: + DEFINE_STANDARD_RTTI(HYDROData_Stream); + + /** + * Returns the kind of this object. Must be redefined in all objects of known type. + */ + HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_STREAM;} + + /** + * Dump object to Python script representation. + */ + 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; + +protected: + + friend class HYDROData_Iterator; + + /** + * Creates new object in the internal data structure. Use higher level objects + * to create objects with real content. + */ + HYDRODATA_EXPORT HYDROData_Stream(); + + /** + * Destructs properties of the object and object itself, removes it from the document. + */ + virtual HYDRODATA_EXPORT ~HYDROData_Stream(); +}; + +#endif -- 2.39.2