#include <TopoDS_Shape.hxx>
+#include <QColor>
+
IMPLEMENT_STANDARD_HANDLE(HYDROData_Object,HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Object,HYDROData_Entity)
{
}
+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 );
+}
+
+QColor HYDROData_Object::GetFillingColor() const
+{
+ return GetColor( DefaultFillingColor(), DataTag_FillingColor );
+}
+
+void HYDROData_Object::SetBorderColor( const QColor& theColor )
+{
+ return SetColor( theColor, DataTag_BorderColor );
+}
+
+QColor HYDROData_Object::GetBorderColor() const
+{
+ return GetColor( DefaultBorderColor(), DataTag_BorderColor );
+}
+
+QColor HYDROData_Object::DefaultFillingColor()
+{
+ return QColor( Qt::yellow );
+}
+
+QColor HYDROData_Object::DefaultBorderColor()
+{
+ return QColor( Qt::transparent );
+}
\ No newline at end of file