#include "HYDROData_Document.h"
#include "HYDROData_ShapesGroup.h"
+#include "HYDROData_ShapesTool.h"
#include <Basics_Utils.hxx>
#include <HYDROData_Projection.h>
-#define PYTHON_OBSTACLE_ID "KIND_OBSTACLE"
-
IMPLEMENT_STANDARD_HANDLE(HYDROData_Obstacle,HYDROData_ArtificialObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Obstacle,HYDROData_ArtificialObject)
QStringList HYDROData_Obstacle::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
- QStringList aResList;
-
- Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
- if ( aDocument.IsNull() )
- return aResList;
-
- QString aDocName = aDocument->GetDocPyName();
- QString anObstacleName = GetName();
-
- aResList << QString( "%1 = %2.CreateObject( %3 );" )
- .arg( anObstacleName ).arg( aDocName ).arg( PYTHON_OBSTACLE_ID );
- aResList << QString( "%1.SetName( \"%2\" );" )
- .arg( anObstacleName ).arg( anObstacleName );
- aResList << QString( "" );
+ QStringList aResList = dumpObjectCreation( theTreatedObjects );
// TODO
void HYDROData_Obstacle::Update()
{
- HYDROData_Entity::Update();
-
removeGroupObjects();
createGroupObjects();
+ checkAndSetAltitudeObject();
+
+ HYDROData_Entity::Update();
}
TopoDS_Shape HYDROData_Obstacle::GetTopShape() const
if ( !anObstacleShape.IsNull() )
{
TopTools_SequenceOfShape aWireEdges;
-
- TopExp_Explorer anExp( anObstacleShape, TopAbs_EDGE );
- for ( ; anExp.More(); anExp.Next() )
- {
- TopoDS_Edge anEdge = TopoDS::Edge( anExp.Current() );
- if ( anEdge.IsNull() )
- continue;
-
- aWireEdges.Append( anEdge );
- }
-
+ HYDROData_ShapesTool::ExploreShapeToShapes( anObstacleShape, TopAbs_EDGE, aWireEdges );
if ( !aWireEdges.IsEmpty() )
{
- QString aWireGroupName = GetName() + "_External_Wire";
+ QString aWireGroupName = GetName() + "_Outer_Wire";
Handle(HYDROData_ShapesGroup) anExtWireGroup = createGroupObject();
anExtWireGroup->SetName( aWireGroupName );
}
}
+ObjectKind HYDROData_Obstacle::getAltitudeObjectType() const
+{
+ return KIND_OBSTACLE_ALTITUDE;
+}