#include "HYDROData_Bathymetry.h"
#include "HYDROData_DummyObject3D.h"
+#include "HYDROData_ShapesGroup.h"
#include "HYDROData_Iterator.h"
#include <TNaming_Builder.hxx>
{
}
+void HYDROData_Object::Update()
+{
+ HYDROData_Entity::Update();
+ removeTopShape();
+ removeShape3D();
+ removeGroupObjects();
+}
+
HYDROData_SequenceOfObjects HYDROData_Object::GetAllReferenceObjects() const
{
HYDROData_SequenceOfObjects aResSeq = HYDROData_Entity::GetAllReferenceObjects();
HYDROData_Iterator::CreateObject( aChildLabel, KIND_DUMMY_3D );
}
-void HYDROData_Object::Update()
+HYDROData_SequenceOfObjects HYDROData_Object::GetGroups() const
{
- HYDROData_Entity::Update();
- removeTopShape();
- removeShape3D();
+ return GetReferenceObjects( DataTag_EdgesGroup );
}
bool HYDROData_Object::SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry )
SetToUpdate( true );
}
-TopoDS_Shape HYDROData_Object::getTopShape() const
-{
- 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();
-}
-
-void HYDROData_Object::removeTopShape()
-{
- 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();
-}
-
void HYDROData_Object::SetFillingColor( const QColor& theColor )
{
SetColor( theColor, DataTag_FillingColor );
return DefaultBorderColor();
}
+Handle(HYDROData_ShapesGroup) HYDROData_Object::createGroupObject()
+{
+ TDF_Label aNewLab = myLab.FindChild( DataTag_EdgesGroup ).NewChild();
+
+ Handle(HYDROData_ShapesGroup) aNewGroup =
+ Handle(HYDROData_ShapesGroup)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_SHAPES_GROUP ) );
+ AddReferenceObject( aNewGroup, DataTag_EdgesGroup );
+
+ return aNewGroup;
+}
+
+void HYDROData_Object::createGroupObjects()
+{
+}
+
+void HYDROData_Object::removeGroupObjects()
+{
+ TDF_Label aLabel = myLab.FindChild( DataTag_EdgesGroup, false );
+ if ( !aLabel.IsNull() )
+ aLabel.ForgetAllAttributes();
+}
+
+TopoDS_Shape HYDROData_Object::getTopShape() const
+{
+ 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();
+}
+
+void HYDROData_Object::removeTopShape()
+{
+ 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();
+}
+