From a079934858ab030e4c64d72d4e4e944a4a609fd6 Mon Sep 17 00:00:00 2001 From: adv Date: Tue, 17 Dec 2013 11:27:59 +0000 Subject: [PATCH] Groups has been changed from edges to shapes storing --- src/HYDROData/CMakeLists.txt | 8 +- src/HYDROData/HYDROData_CalculationCase.cxx | 28 +++--- src/HYDROData/HYDROData_CalculationCase.h | 10 +-- src/HYDROData/HYDROData_EdgesGroup.cxx | 89 ------------------- src/HYDROData/HYDROData_Entity.h | 2 +- src/HYDROData/HYDROData_Iterator.cxx | 8 +- src/HYDROData/HYDROData_Object.cxx | 8 +- src/HYDROData/HYDROData_Object.h | 4 +- src/HYDROData/HYDROData_Obstacle.cxx | 8 +- src/HYDROData/HYDROData_ShapesGroup.cxx | 86 ++++++++++++++++++ ...a_EdgesGroup.h => HYDROData_ShapesGroup.h} | 35 ++++---- .../HYDROData_SplittedEdgesGroup.cxx | 16 ---- src/HYDROData/HYDROData_SplittedEdgesGroup.h | 49 ---------- .../HYDROData_SplittedShapesGroup.cxx | 16 ++++ src/HYDROData/HYDROData_SplittedShapesGroup.h | 48 ++++++++++ src/HYDROGUI/HYDROGUI_CalculationOp.cxx | 8 +- src/HYDROGUI/HYDROGUI_DataModel.cxx | 6 +- 17 files changed, 211 insertions(+), 218 deletions(-) delete mode 100644 src/HYDROData/HYDROData_EdgesGroup.cxx create mode 100644 src/HYDROData/HYDROData_ShapesGroup.cxx rename src/HYDROData/{HYDROData_EdgesGroup.h => HYDROData_ShapesGroup.h} (58%) delete mode 100644 src/HYDROData/HYDROData_SplittedEdgesGroup.cxx delete mode 100644 src/HYDROData/HYDROData_SplittedEdgesGroup.h create mode 100644 src/HYDROData/HYDROData_SplittedShapesGroup.cxx create mode 100644 src/HYDROData/HYDROData_SplittedShapesGroup.h diff --git a/src/HYDROData/CMakeLists.txt b/src/HYDROData/CMakeLists.txt index e8840cd2..a3aff835 100644 --- a/src/HYDROData/CMakeLists.txt +++ b/src/HYDROData/CMakeLists.txt @@ -13,7 +13,6 @@ set(PROJECT_HEADERS HYDROData_Digue.h HYDROData_Document.h HYDROData_DummyObject3D.h - HYDROData_EdgesGroup.h HYDROData_Entity.h HYDROData_IAltitudeObject.h HYDROData_Image.h @@ -32,7 +31,8 @@ set(PROJECT_HEADERS HYDROData_Projection.h HYDROData_Region.h HYDROData_River.h - HYDROData_SplittedEdgesGroup.h + HYDROData_ShapesGroup.h + HYDROData_SplittedShapesGroup.h HYDROData_SplitToZonesTool.h HYDROData_Stream.h HYDROData_Tool.h @@ -52,7 +52,6 @@ set(PROJECT_SOURCES HYDROData_Digue.cxx HYDROData_Document.cxx HYDROData_DummyObject3D.cxx - HYDROData_EdgesGroup.cxx HYDROData_Entity.cxx HYDROData_IAltitudeObject.cxx HYDROData_Image.cxx @@ -71,7 +70,8 @@ set(PROJECT_SOURCES HYDROData_Projection.cxx HYDROData_Region.cxx HYDROData_River.cxx - HYDROData_SplittedEdgesGroup.cxx + HYDROData_ShapesGroup.cxx + HYDROData_SplittedShapesGroup.cxx HYDROData_SplitToZonesTool.cxx HYDROData_Stream.cxx HYDROData_Tool.cxx diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index f8d25eb7..4439850a 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -4,12 +4,12 @@ #include "HYDROData_ArtificialObject.h" #include "HYDROData_Bathymetry.h" #include "HYDROData_Document.h" -#include "HYDROData_EdgesGroup.h" +#include "HYDROData_ShapesGroup.h" #include "HYDROData_Iterator.h" #include "HYDROData_NaturalObject.h" #include "HYDROData_PolylineXY.h" #include "HYDROData_SplitToZonesTool.h" -#include "HYDROData_SplittedEdgesGroup.h" +#include "HYDROData_SplittedShapesGroup.h" #include "HYDROData_Region.h" #include "HYDROData_Tool.h" #include "HYDROData_Zone.h" @@ -98,8 +98,8 @@ void HYDROData_CalculationCase::SetName( const QString& theName ) anIter.Init( aGroups ); for ( ; anIter.More(); anIter.Next() ) { - Handle(HYDROData_SplittedEdgesGroup) aGroup = - Handle(HYDROData_SplittedEdgesGroup)::DownCast( anIter.Value() ); + Handle(HYDROData_SplittedShapesGroup) aGroup = + Handle(HYDROData_SplittedShapesGroup)::DownCast( anIter.Value() ); if ( aGroup.IsNull() ) continue; @@ -204,7 +204,7 @@ void HYDROData_CalculationCase::Update() QString aRegsPref = CALCULATION_REGIONS_PREF; QString aZonesPref = CALCULATION_ZONES_PREF; - QMap aSplittedEdgesGroupsMap; + QMap aSplittedEdgesGroupsMap; // Create result regions for case, by default one zone for one region HYDROData_SplitToZonesTool::SplitDataListIterator anIter( aSplitedObjects ); @@ -244,15 +244,14 @@ void HYDROData_CalculationCase::Update() else if ( aSplitData.Type == HYDROData_SplitToZonesTool::SplitData::Data_Edge ) { // Create new edges group - if ( aSplitData.ObjectNames.isEmpty() || - aSplitData.Shape.IsNull() || aSplitData.Shape.ShapeType() != TopAbs_EDGE ) + if ( aSplitData.ObjectNames.isEmpty() || aSplitData.Shape.IsNull() ) continue; QString anObjName = aSplitData.ObjectNames.first(); if ( anObjName.isEmpty() ) continue; - Handle(HYDROData_SplittedEdgesGroup) aSplittedGroup; + Handle(HYDROData_SplittedShapesGroup) aSplittedGroup; if ( !aSplittedEdgesGroupsMap.contains( anObjName ) ) { aSplittedGroup = addNewSplittedGroup(); @@ -270,8 +269,7 @@ void HYDROData_CalculationCase::Update() if ( aSplittedGroup.IsNull() ) continue; - TopoDS_Edge anEdge = TopoDS::Edge( aSplitData.Shape ); - aSplittedGroup->AddEdge( anEdge ); + aSplittedGroup->AddShape( aSplitData.Shape ); } } } @@ -316,7 +314,7 @@ void HYDROData_CalculationCase::RemoveGeometryObjects() SetToUpdate( true ); } -bool HYDROData_CalculationCase::AddGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup ) +bool HYDROData_CalculationCase::AddGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup ) { if ( theGroup.IsNull() ) return false; @@ -337,7 +335,7 @@ HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetGeometryGroups() const return GetReferenceObjects( DataTag_GeometryGroup ); } -void HYDROData_CalculationCase::RemoveGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup ) +void HYDROData_CalculationCase::RemoveGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup ) { if ( theGroup.IsNull() ) return; @@ -766,12 +764,12 @@ Handle(HYDROData_Region) HYDROData_CalculationCase::addNewRegion() return aNewRegion; } -Handle(HYDROData_SplittedEdgesGroup) HYDROData_CalculationCase::addNewSplittedGroup() +Handle(HYDROData_SplittedShapesGroup) HYDROData_CalculationCase::addNewSplittedGroup() { TDF_Label aNewLab = myLab.FindChild( DataTag_SplittedGroups ).NewChild(); - Handle(HYDROData_SplittedEdgesGroup) aNewGroup = - Handle(HYDROData_SplittedEdgesGroup)::DownCast( + Handle(HYDROData_SplittedShapesGroup) aNewGroup = + Handle(HYDROData_SplittedShapesGroup)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_SPLITTED_GROUP ) ); AddReferenceObject( aNewGroup, DataTag_SplittedGroups ); diff --git a/src/HYDROData/HYDROData_CalculationCase.h b/src/HYDROData/HYDROData_CalculationCase.h index 30d61d53..ed719a93 100644 --- a/src/HYDROData/HYDROData_CalculationCase.h +++ b/src/HYDROData/HYDROData_CalculationCase.h @@ -19,8 +19,8 @@ class Handle(HYDROData_Object); class Handle(HYDROData_Region); class Handle(HYDROData_Zone); class Handle(HYDROData_PolylineXY); -class Handle(HYDROData_EdgesGroup); -class Handle(HYDROData_SplittedEdgesGroup); +class Handle(HYDROData_ShapesGroup); +class Handle(HYDROData_SplittedShapesGroup); DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity) @@ -114,7 +114,7 @@ public: /** * Add new one reference geometry group for calculation case. */ - HYDRODATA_EXPORT virtual bool AddGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup ); + HYDRODATA_EXPORT virtual bool AddGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup ); /** * Returns all reference geometry groups of calculation case. @@ -124,7 +124,7 @@ public: /** * Removes reference geometry group from calculation case. */ - HYDRODATA_EXPORT virtual void RemoveGeometryGroup( const Handle(HYDROData_EdgesGroup)& theGroup ); + HYDRODATA_EXPORT virtual void RemoveGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup ); /** * Removes all reference geometry groups from calculation case. @@ -242,7 +242,7 @@ private: /** * Add new one splitted edges group for calculation case. */ - HYDRODATA_EXPORT virtual Handle(HYDROData_SplittedEdgesGroup) addNewSplittedGroup(); + HYDRODATA_EXPORT virtual Handle(HYDROData_SplittedShapesGroup) addNewSplittedGroup(); /** * Returns shell containing faces which correspond to regions. diff --git a/src/HYDROData/HYDROData_EdgesGroup.cxx b/src/HYDROData/HYDROData_EdgesGroup.cxx deleted file mode 100644 index 2b30ae85..00000000 --- a/src/HYDROData/HYDROData_EdgesGroup.cxx +++ /dev/null @@ -1,89 +0,0 @@ - -#include "HYDROData_EdgesGroup.h" - -#include - -#include -#include - -#include -#include - -IMPLEMENT_STANDARD_HANDLE(HYDROData_EdgesGroup,HYDROData_Entity) -IMPLEMENT_STANDARD_RTTIEXT(HYDROData_EdgesGroup,HYDROData_Entity) - -HYDROData_EdgesGroup::HYDROData_EdgesGroup() -: HYDROData_Entity() -{ -} - -HYDROData_EdgesGroup::~HYDROData_EdgesGroup() -{ -} - -bool HYDROData_EdgesGroup::CanBeUpdated() const -{ - return false; -} - -bool HYDROData_EdgesGroup::CanRemove() -{ - return false; -} - -void HYDROData_EdgesGroup::AddEdge( const TopoDS_Edge& theEdge ) -{ - if ( theEdge.IsNull() ) - return; - - TDF_Label aNewLab = myLab.FindChild( DataTag_Edge ).NewChild(); - - TNaming_Builder aBuilder( aNewLab ); - aBuilder.Generated( theEdge ); -} - -void HYDROData_EdgesGroup::SetEdges( const HYDROData_SequenceOfEdges& theEdges ) -{ - RemoveEdges(); - - for ( int i = 1, n = theEdges.Length(); i <= n; ++i ) - { - const TopoDS_Edge& anEdge = theEdges.Value( i ); - AddEdge( anEdge ); - } -} - -HYDROData_SequenceOfEdges HYDROData_EdgesGroup::GetEdges() const -{ - HYDROData_SequenceOfEdges aResSeq; - - TDF_Label aLabel = myLab.FindChild( DataTag_Edge, false ); - if ( aLabel.IsNull() ) - return aResSeq; - - TDF_ChildIDIterator aChildIt( aLabel, TNaming_NamedShape::GetID() ); - for ( ; aChildIt.More(); aChildIt.Next() ) - { - Handle(TNaming_NamedShape) aNamedShape = - Handle(TNaming_NamedShape)::DownCast( aChildIt.Value() ); - if ( aNamedShape.IsNull() ) - continue; - - TopoDS_Shape aStoredShape = aNamedShape->Get(); - if ( aStoredShape.IsNull() || aStoredShape.ShapeType() != TopAbs_EDGE ) - continue; - - TopoDS_Edge aStoredEdge = TopoDS::Edge( aStoredShape ); - aResSeq.Append( aStoredEdge ); - } - - return aResSeq; -} - -void HYDROData_EdgesGroup::RemoveEdges() -{ - TDF_Label aLabel = myLab.FindChild( DataTag_Edge, false ); - if ( !aLabel.IsNull() ) - aLabel.ForgetAllAttributes(); -} - diff --git a/src/HYDROData/HYDROData_Entity.h b/src/HYDROData/HYDROData_Entity.h index c1a5fccc..9bf5894b 100644 --- a/src/HYDROData/HYDROData_Entity.h +++ b/src/HYDROData/HYDROData_Entity.h @@ -42,7 +42,7 @@ const ObjectKind KIND_VISUAL_STATE = 18; const ObjectKind KIND_ARTIFICIAL_OBJECT = 19; const ObjectKind KIND_NATURAL_OBJECT = 20; const ObjectKind KIND_DUMMY_3D = 21; -const ObjectKind KIND_EDGES_GROUP = 22; +const ObjectKind KIND_SHAPES_GROUP = 22; const ObjectKind KIND_SPLITTED_GROUP = 23; const ObjectKind KIND_LAST = KIND_SPLITTED_GROUP; diff --git a/src/HYDROData/HYDROData_Iterator.cxx b/src/HYDROData/HYDROData_Iterator.cxx index f0fa49b2..ae37a417 100644 --- a/src/HYDROData/HYDROData_Iterator.cxx +++ b/src/HYDROData/HYDROData_Iterator.cxx @@ -8,7 +8,7 @@ #include "HYDROData_Confluence.h" #include "HYDROData_DummyObject3D.h" #include "HYDROData_Digue.h" -#include "HYDROData_EdgesGroup.h" +#include "HYDROData_ShapesGroup.h" #include "HYDROData_Image.h" #include "HYDROData_ImmersibleZone.h" #include "HYDROData_Obstacle.h" @@ -19,7 +19,7 @@ #include "HYDROData_VisualState.h" #include "HYDROData_Region.h" #include "HYDROData_River.h" -#include "HYDROData_SplittedEdgesGroup.h" +#include "HYDROData_SplittedShapesGroup.h" #include "HYDROData_Stream.h" #include "HYDROData_Zone.h" @@ -126,8 +126,8 @@ Handle(HYDROData_Entity) HYDROData_Iterator::Object( const TDF_Label& theLabel ) case KIND_ZONE: aResult = new HYDROData_Zone(); break; case KIND_VISUAL_STATE: aResult = new HYDROData_VisualState(); break; case KIND_DUMMY_3D: aResult = new HYDROData_DummyObject3D(); break; - case KIND_EDGES_GROUP: aResult = new HYDROData_EdgesGroup(); break; - case KIND_SPLITTED_GROUP: aResult = new HYDROData_SplittedEdgesGroup();break; + case KIND_SHAPES_GROUP: aResult = new HYDROData_ShapesGroup(); break; + case KIND_SPLITTED_GROUP: aResult = new HYDROData_SplittedShapesGroup();break; default: break; } diff --git a/src/HYDROData/HYDROData_Object.cxx b/src/HYDROData/HYDROData_Object.cxx index 14304d78..7dfbe813 100644 --- a/src/HYDROData/HYDROData_Object.cxx +++ b/src/HYDROData/HYDROData_Object.cxx @@ -3,7 +3,7 @@ #include "HYDROData_Bathymetry.h" #include "HYDROData_DummyObject3D.h" -#include "HYDROData_EdgesGroup.h" +#include "HYDROData_ShapesGroup.h" #include "HYDROData_Iterator.h" #include @@ -177,12 +177,12 @@ QColor HYDROData_Object::getDefaultBorderColor() const return DefaultBorderColor(); } -Handle(HYDROData_EdgesGroup) HYDROData_Object::createGroupObject() +Handle(HYDROData_ShapesGroup) HYDROData_Object::createGroupObject() { TDF_Label aNewLab = myLab.FindChild( DataTag_EdgesGroup ).NewChild(); - Handle(HYDROData_EdgesGroup) aNewGroup = - Handle(HYDROData_EdgesGroup)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_EDGES_GROUP ) ); + Handle(HYDROData_ShapesGroup) aNewGroup = + Handle(HYDROData_ShapesGroup)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_SHAPES_GROUP ) ); AddReferenceObject( aNewGroup, DataTag_EdgesGroup ); return aNewGroup; diff --git a/src/HYDROData/HYDROData_Object.h b/src/HYDROData/HYDROData_Object.h index 3bf31fe1..e20e4789 100644 --- a/src/HYDROData/HYDROData_Object.h +++ b/src/HYDROData/HYDROData_Object.h @@ -10,7 +10,7 @@ DEFINE_STANDARD_HANDLE(HYDROData_Object, HYDROData_Entity) class TopoDS_Shape; class Handle(HYDROData_Bathymetry); class Handle(HYDROData_DummyObject3D); -class Handle(HYDROData_EdgesGroup); +class Handle(HYDROData_ShapesGroup); /**\class HYDROData_Object * \brief The base class for all geometrical objects in the HYDRO module. @@ -170,7 +170,7 @@ protected: /** * Create new one child group object. */ - HYDRODATA_EXPORT virtual Handle(HYDROData_EdgesGroup) createGroupObject(); + HYDRODATA_EXPORT virtual Handle(HYDROData_ShapesGroup) createGroupObject(); /** * Create all necessary child group objects. diff --git a/src/HYDROData/HYDROData_Obstacle.cxx b/src/HYDROData/HYDROData_Obstacle.cxx index 76480bd1..adf6b6da 100644 --- a/src/HYDROData/HYDROData_Obstacle.cxx +++ b/src/HYDROData/HYDROData_Obstacle.cxx @@ -2,7 +2,7 @@ #include "HYDROData_Obstacle.h" #include "HYDROData_Document.h" -#include "HYDROData_EdgesGroup.h" +#include "HYDROData_ShapesGroup.h" #include @@ -353,7 +353,7 @@ void HYDROData_Obstacle::createGroupObjects() TopoDS_Shape anObstacleShape = GetTopShape(); if ( !anObstacleShape.IsNull() ) { - HYDROData_SequenceOfEdges aWireEdges; + TopTools_SequenceOfShape aWireEdges; TopExp_Explorer anExp( anObstacleShape, TopAbs_EDGE ); for ( ; anExp.More(); anExp.Next() ) @@ -369,10 +369,10 @@ void HYDROData_Obstacle::createGroupObjects() { QString aWireGroupName = GetName() + "_External_Wire"; - Handle(HYDROData_EdgesGroup) anExtWireGroup = createGroupObject(); + Handle(HYDROData_ShapesGroup) anExtWireGroup = createGroupObject(); anExtWireGroup->SetName( aWireGroupName ); - anExtWireGroup->SetEdges( aWireEdges ); + anExtWireGroup->SetShapes( aWireEdges ); } } } diff --git a/src/HYDROData/HYDROData_ShapesGroup.cxx b/src/HYDROData/HYDROData_ShapesGroup.cxx new file mode 100644 index 00000000..1ef3ad95 --- /dev/null +++ b/src/HYDROData/HYDROData_ShapesGroup.cxx @@ -0,0 +1,86 @@ + +#include "HYDROData_ShapesGroup.h" + +#include + +#include +#include + +#include +#include + +IMPLEMENT_STANDARD_HANDLE(HYDROData_ShapesGroup,HYDROData_Entity) +IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ShapesGroup,HYDROData_Entity) + +HYDROData_ShapesGroup::HYDROData_ShapesGroup() +: HYDROData_Entity() +{ +} + +HYDROData_ShapesGroup::~HYDROData_ShapesGroup() +{ +} + +bool HYDROData_ShapesGroup::CanBeUpdated() const +{ + return false; +} + +bool HYDROData_ShapesGroup::CanRemove() +{ + return false; +} + +void HYDROData_ShapesGroup::AddShape( const TopoDS_Shape& theShape ) +{ + if ( theShape.IsNull() ) + return; + + TDF_Label aNewLab = myLab.FindChild( DataTag_Shape ).NewChild(); + + TNaming_Builder aBuilder( aNewLab ); + aBuilder.Generated( theShape ); +} + +void HYDROData_ShapesGroup::SetShapes( const TopTools_SequenceOfShape& theShapes ) +{ + RemoveShapes(); + + for ( int i = 1, n = theShapes.Length(); i <= n; ++i ) + { + const TopoDS_Shape& aShape = theShapes.Value( i ); + AddShape( aShape ); + } +} + +void HYDROData_ShapesGroup::GeShapes( TopTools_SequenceOfShape& theShapes ) const +{ + theShapes.Clear(); + + TDF_Label aLabel = myLab.FindChild( DataTag_Shape, false ); + if ( aLabel.IsNull() ) + return; + + TDF_ChildIDIterator aChildIt( aLabel, TNaming_NamedShape::GetID() ); + for ( ; aChildIt.More(); aChildIt.Next() ) + { + Handle(TNaming_NamedShape) aNamedShape = + Handle(TNaming_NamedShape)::DownCast( aChildIt.Value() ); + if ( aNamedShape.IsNull() ) + continue; + + TopoDS_Shape aStoredShape = aNamedShape->Get(); + if ( aStoredShape.IsNull() ) + continue; + + theShapes.Append( aStoredShape ); + } +} + +void HYDROData_ShapesGroup::RemoveShapes() +{ + TDF_Label aLabel = myLab.FindChild( DataTag_Shape, false ); + if ( !aLabel.IsNull() ) + aLabel.ForgetAllAttributes(); +} + diff --git a/src/HYDROData/HYDROData_EdgesGroup.h b/src/HYDROData/HYDROData_ShapesGroup.h similarity index 58% rename from src/HYDROData/HYDROData_EdgesGroup.h rename to src/HYDROData/HYDROData_ShapesGroup.h index 4fadbdb6..1bf55323 100644 --- a/src/HYDROData/HYDROData_EdgesGroup.h +++ b/src/HYDROData/HYDROData_ShapesGroup.h @@ -1,20 +1,19 @@ -#ifndef HYDROData_EdgesGroup_HeaderFile -#define HYDROData_EdgesGroup_HeaderFile +#ifndef HYDROData_ShapesGroup_HeaderFile +#define HYDROData_ShapesGroup_HeaderFile #include -class TopoDS_Edge; +#include -DEFINE_STANDARD_HANDLE(HYDROData_EdgesGroup, HYDROData_Entity) +class TopoDS_Shape; -typedef NCollection_Sequence HYDROData_SequenceOfEdges; +DEFINE_STANDARD_HANDLE(HYDROData_ShapesGroup, HYDROData_Entity) -/**\class HYDROData_EdgesGroup - * \brief The artificial objects are objects created or planned for creation by human. - * +/**\class HYDROData_ShapesGroup + * \brief Class that stores/retreives the sequence of shapes. */ -class HYDROData_EdgesGroup : public HYDROData_Entity +class HYDROData_ShapesGroup : public HYDROData_Entity { protected: /** @@ -23,16 +22,16 @@ protected: enum DataTag { DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve - DataTag_Edge, ///< reference edges + DataTag_Shape, ///< reference edges }; public: - DEFINE_STANDARD_RTTI(HYDROData_EdgesGroup); + DEFINE_STANDARD_RTTI(HYDROData_ShapesGroup); /** * Returns the kind of this object. Must be redefined in all objects of known type. */ - HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_EDGES_GROUP; } + HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_SHAPES_GROUP; } /** * Returns flag indicating that object is updateble or not. @@ -50,22 +49,22 @@ public: /** * Add new one edge for the group. */ - HYDRODATA_EXPORT virtual void AddEdge( const TopoDS_Edge& theEdge ); + HYDRODATA_EXPORT virtual void AddShape( const TopoDS_Shape& theShape ); /** * Sets new sequence of edges for the group. */ - HYDRODATA_EXPORT virtual void SetEdges( const HYDROData_SequenceOfEdges& theEdges ); + HYDRODATA_EXPORT virtual void SetShapes( const TopTools_SequenceOfShape& theShapes ); /** * Returns all edges of the group. */ - HYDRODATA_EXPORT virtual HYDROData_SequenceOfEdges GetEdges() const; + HYDRODATA_EXPORT virtual void GeShapes( TopTools_SequenceOfShape& theShapes ) const; /** * Removes all edges from the group. */ - HYDRODATA_EXPORT virtual void RemoveEdges(); + HYDRODATA_EXPORT virtual void RemoveShapes(); protected: @@ -76,12 +75,12 @@ protected: * Creates new object in the internal data structure. Use higher level objects * to create objects with real content. */ - HYDRODATA_EXPORT HYDROData_EdgesGroup(); + HYDRODATA_EXPORT HYDROData_ShapesGroup(); /** * Destructs properties of the object and object itself, removes it from the document. */ - virtual HYDRODATA_EXPORT ~HYDROData_EdgesGroup(); + virtual HYDRODATA_EXPORT ~HYDROData_ShapesGroup(); }; #endif diff --git a/src/HYDROData/HYDROData_SplittedEdgesGroup.cxx b/src/HYDROData/HYDROData_SplittedEdgesGroup.cxx deleted file mode 100644 index 92a54e94..00000000 --- a/src/HYDROData/HYDROData_SplittedEdgesGroup.cxx +++ /dev/null @@ -1,16 +0,0 @@ - -#include "HYDROData_SplittedEdgesGroup.h" - -IMPLEMENT_STANDARD_HANDLE(HYDROData_SplittedEdgesGroup,HYDROData_EdgesGroup) -IMPLEMENT_STANDARD_RTTIEXT(HYDROData_SplittedEdgesGroup,HYDROData_EdgesGroup) - -HYDROData_SplittedEdgesGroup::HYDROData_SplittedEdgesGroup() -: HYDROData_EdgesGroup() -{ -} - -HYDROData_SplittedEdgesGroup::~HYDROData_SplittedEdgesGroup() -{ -} - - diff --git a/src/HYDROData/HYDROData_SplittedEdgesGroup.h b/src/HYDROData/HYDROData_SplittedEdgesGroup.h deleted file mode 100644 index e62cadbf..00000000 --- a/src/HYDROData/HYDROData_SplittedEdgesGroup.h +++ /dev/null @@ -1,49 +0,0 @@ - -#ifndef HYDROData_SplittedEdgesGroup_HeaderFile -#define HYDROData_SplittedEdgesGroup_HeaderFile - -#include - -DEFINE_STANDARD_HANDLE(HYDROData_SplittedEdgesGroup, HYDROData_EdgesGroup) - - -/**\class HYDROData_SplittedEdgesGroup - * \brief The artificial objects are objects created or planned for creation by human. - * - */ -class HYDROData_SplittedEdgesGroup : public HYDROData_EdgesGroup -{ -protected: - /** - * Enumeration of tags corresponding to the persistent object parameters. - */ - enum DataTag - { - DataTag_First = HYDROData_EdgesGroup::DataTag_First + 100 ///< first tag, to reserve - }; - -public: - DEFINE_STANDARD_RTTI(HYDROData_SplittedEdgesGroup); - - /** - * Returns the kind of this object. Must be redefined in all objects of known type. - */ - HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_SPLITTED_GROUP; } - -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_SplittedEdgesGroup(); - - /** - * Destructs properties of the object and object itself, removes it from the document. - */ - virtual HYDRODATA_EXPORT ~HYDROData_SplittedEdgesGroup(); -}; - -#endif diff --git a/src/HYDROData/HYDROData_SplittedShapesGroup.cxx b/src/HYDROData/HYDROData_SplittedShapesGroup.cxx new file mode 100644 index 00000000..41c14f22 --- /dev/null +++ b/src/HYDROData/HYDROData_SplittedShapesGroup.cxx @@ -0,0 +1,16 @@ + +#include "HYDROData_SplittedShapesGroup.h" + +IMPLEMENT_STANDARD_HANDLE(HYDROData_SplittedShapesGroup,HYDROData_ShapesGroup) +IMPLEMENT_STANDARD_RTTIEXT(HYDROData_SplittedShapesGroup,HYDROData_ShapesGroup) + +HYDROData_SplittedShapesGroup::HYDROData_SplittedShapesGroup() +: HYDROData_ShapesGroup() +{ +} + +HYDROData_SplittedShapesGroup::~HYDROData_SplittedShapesGroup() +{ +} + + diff --git a/src/HYDROData/HYDROData_SplittedShapesGroup.h b/src/HYDROData/HYDROData_SplittedShapesGroup.h new file mode 100644 index 00000000..fd32749d --- /dev/null +++ b/src/HYDROData/HYDROData_SplittedShapesGroup.h @@ -0,0 +1,48 @@ + +#ifndef HYDROData_SplittedShapesGroup_HeaderFile +#define HYDROData_SplittedShapesGroup_HeaderFile + +#include + +DEFINE_STANDARD_HANDLE(HYDROData_SplittedShapesGroup, HYDROData_ShapesGroup) + + +/**\class HYDROData_SplittedShapesGroup + * \brief Class that stores/retreives the sequence of splitted shapes. + */ +class HYDROData_SplittedShapesGroup : public HYDROData_ShapesGroup +{ +protected: + /** + * Enumeration of tags corresponding to the persistent object parameters. + */ + enum DataTag + { + DataTag_First = HYDROData_ShapesGroup::DataTag_First + 100 ///< first tag, to reserve + }; + +public: + DEFINE_STANDARD_RTTI(HYDROData_SplittedShapesGroup); + + /** + * Returns the kind of this object. Must be redefined in all objects of known type. + */ + HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_SPLITTED_GROUP; } + +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_SplittedShapesGroup(); + + /** + * Destructs properties of the object and object itself, removes it from the document. + */ + virtual HYDRODATA_EXPORT ~HYDROData_SplittedShapesGroup(); +}; + +#endif diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx index 7b0bcaa3..e12aa5fc 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx @@ -31,7 +31,7 @@ #include "HYDROGUI_Region.h" #include -#include +#include #include #include #include @@ -788,7 +788,7 @@ void HYDROGUI_CalculationOp::setAvailableGroups() HYDROData_SequenceOfObjects aGroups = anObj->GetGroups(); for( int aGIndex = 1, aGLength = aGroups.Length(); aGIndex <= aGLength; aGIndex++ ) { - Handle_HYDROData_EdgesGroup aGroup = Handle_HYDROData_EdgesGroup::DownCast( aGroups.Value( aGIndex ) ); + Handle_HYDROData_ShapesGroup aGroup = Handle_HYDROData_ShapesGroup::DownCast( aGroups.Value( aGIndex ) ); aGroupsNames.append( aGroup->GetName() ); } } @@ -811,7 +811,7 @@ void HYDROGUI_CalculationOp::onAddGroups() QStringList anAddedList; for (int i = 0; i < aSelectedList.length(); i++) { - Handle(HYDROData_EdgesGroup) aGroup = Handle(HYDROData_EdgesGroup)::DownCast( + Handle(HYDROData_ShapesGroup) aGroup = Handle(HYDROData_ShapesGroup)::DownCast( HYDROGUI_Tool::FindObjectByName( module(), aSelectedList.at( i ) ) ); if ( aGroup.IsNull() ) continue; @@ -840,7 +840,7 @@ void HYDROGUI_CalculationOp::onRemoveGroups() for (int i = 0; i < aSelectedList.length(); i++) { - Handle(HYDROData_EdgesGroup) aGroup = Handle(HYDROData_EdgesGroup)::DownCast( + Handle(HYDROData_ShapesGroup) aGroup = Handle(HYDROData_ShapesGroup)::DownCast( HYDROGUI_Tool::FindObjectByName( module(), aSelectedList.at(i) ) ); if ( aGroup.IsNull() ) continue; diff --git a/src/HYDROGUI/HYDROGUI_DataModel.cxx b/src/HYDROGUI/HYDROGUI_DataModel.cxx index 084fab39..1fb7a1cc 100644 --- a/src/HYDROGUI/HYDROGUI_DataModel.cxx +++ b/src/HYDROGUI/HYDROGUI_DataModel.cxx @@ -72,7 +72,7 @@ // #define DEB_GROUPS 1 #ifdef DEB_GROUPS -#include +#include #endif static HYDROData_SequenceOfObjects myCopyingObjects; @@ -735,8 +735,8 @@ void HYDROGUI_DataModel::buildObjectTree( SUIT_DataObject* theParent, HYDROData_SequenceOfObjects::Iterator anIter( anObjGroups ); for ( ; anIter.More(); anIter.Next() ) { - Handle(HYDROData_EdgesGroup) anObjGroup = - Handle(HYDROData_EdgesGroup)::DownCast( anIter.Value() ); + Handle(HYDROData_ShapesGroup) anObjGroup = + Handle(HYDROData_ShapesGroup)::DownCast( anIter.Value() ); if( !anObjGroup.IsNull() && !anObjGroup->IsRemoved() ) createObject( aGroupsSect, anObjGroup, aGuiObj->entry(), false ); } -- 2.39.2