{
}
+HYDROData_SequenceOfObjects HYDROData_Object::GetAllReferenceObjects() const
+{
+ HYDROData_SequenceOfObjects aResSeq = HYDROData_Entity::GetAllReferenceObjects();
+
+ Handle(HYDROData_Bathymetry) aRefBathymetry = GetBathymetry();
+ if ( !aRefBathymetry.IsNull() )
+ aResSeq.Append( aRefBathymetry );
+
+ return aResSeq;
+}
+
void HYDROData_Object::SetTopShape( const TopoDS_Shape& theShape )
{
TNaming_Builder aBuilder( myLab.FindChild( DataTag_TopShape ) );
aBuilder.Generated( theShape );
}
+void HYDROData_Object::Update()
+{
+ removeTopShape();
+ removeShape3D();
+ SetToUpdate( false );
+}
+
void HYDROData_Object::SetBathymetry( const Handle(HYDROData_Bathymetry)& theBathymetry )
{
SetReferenceObject( theBathymetry, DataTag_Bathymetry );
TopoDS_Shape HYDROData_Object::getTopShape() const
{
- Handle(TNaming_NamedShape) aNamedShape;
- if( myLab.FindChild( DataTag_TopShape ).FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
- return aNamedShape->Get();
+ 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
{
- Handle(TNaming_NamedShape) aNamedShape;
- if( myLab.FindChild( DataTag_Shape3D ).FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
- return aNamedShape->Get();
+ 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 )
{
return SetColor( theColor, DataTag_FillingColor );