#include "HYDROData_Obstacle.h"
#include "HYDROData_Document.h"
+#include "HYDROData_Tool.h"
+#include "HYDROData_ShapesGroup.h"
#include <Basics_Utils.hxx>
#include <Interface_Static.hxx>
+#include <TopoDS.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
+#include <TopoDS_Edge.hxx>
#include <TDataStd_AsciiString.hxx>
return aResList;
}
+void HYDROData_Obstacle::Update()
+{
+ HYDROData_Entity::Update();
+
+ removeGroupObjects();
+ createGroupObjects();
+}
+
TopoDS_Shape HYDROData_Obstacle::GetTopShape() const
{
- // TODO
return getTopShape();
}
TopoDS_Shape HYDROData_Obstacle::GetShape3D() const
{
- // TODO
return getShape3D();
}
+void HYDROData_Obstacle::SetShape3D( const TopoDS_Shape& theShape )
+{
+ TopoDS_Face aShape2d = HYDROData_Projection::MakeProjection( theShape );
+ HYDROData_ArtificialObject::SetShape3D( theShape );
+ HYDROData_ArtificialObject::SetTopShape( aShape2d );
+}
+
QColor HYDROData_Obstacle::DefaultFillingColor()
{
return QColor( Qt::yellow );
return QColor( Qt::transparent );
}
-QColor HYDROData_Obstacle::getDefaultFillingColor() const
-{
- return DefaultFillingColor();
-}
-
-QColor HYDROData_Obstacle::getDefaultBorderColor() const
-{
- return DefaultBorderColor();
-}
-
bool HYDROData_Obstacle::ImportFromFile( const QString& theFilePath )
{
// Check the file existence
return aResShape;
}
-void HYDROData_Obstacle::SetShape3D( const TopoDS_Shape& theShape )
+QColor HYDROData_Obstacle::getDefaultFillingColor() const
{
- TopoDS_Face aShape2d = HYDROData_Projection::MakeProjection( theShape );
- HYDROData_ArtificialObject::SetShape3D( theShape );
- HYDROData_ArtificialObject::SetTopShape( aShape2d );
+ return DefaultFillingColor();
}
+
+QColor HYDROData_Obstacle::getDefaultBorderColor() const
+{
+ return DefaultBorderColor();
+}
+
+void HYDROData_Obstacle::createGroupObjects()
+{
+ TopoDS_Shape anObstacleShape = GetTopShape();
+ if ( !anObstacleShape.IsNull() )
+ {
+ TopTools_SequenceOfShape aWireEdges;
+ HYDROData_Tool::ExploreShapeToShapes( anObstacleShape, TopAbs_EDGE, aWireEdges );
+ if ( !aWireEdges.IsEmpty() )
+ {
+ QString aWireGroupName = GetName() + "_Outer_Wire";
+
+ Handle(HYDROData_ShapesGroup) anExtWireGroup = createGroupObject();
+ anExtWireGroup->SetName( aWireGroupName );
+
+ anExtWireGroup->SetShapes( aWireEdges );
+ }
+ }
+}
+
+
+
+