+
+ObjectKind HYDROData_Obstacle::getAltitudeObjectType() const
+{
+ DEBTRACE("HYDROData_Obstacle::getAltitudeObjectType");
+ return KIND_OBSTACLE_ALTITUDE;
+}
+
+void HYDROData_Obstacle::createGroupObjects()
+{
+ TopoDS_Shape anObstacleShape = GetTopShape();
+ if ( !anObstacleShape.IsNull() )
+ {
+ TopTools_SequenceOfShape aWireEdges;
+ HYDROData_ShapesTool::ExploreShapeToShapes( anObstacleShape, TopAbs_EDGE, aWireEdges );
+ if ( !aWireEdges.IsEmpty() )
+ {
+ QString aWireGroupName = GetName() + "_Outer_Wire";
+
+ Handle(HYDROData_ShapesGroup) anExtWireGroup = createGroupObject();
+ anExtWireGroup->SetName( aWireGroupName );
+
+ anExtWireGroup->SetShapes( aWireEdges );
+ }
+ }
+}
+
+void HYDROData_Obstacle::setTranslation( const double theDx,
+ const double theDy,
+ const double theDz )
+{
+ TDF_Label aLabel = myLab.FindChild( DataTag_Translation );
+
+ double aCurDx = theDx;
+ double aCurDy = theDy;
+ double aCurDz = theDz;
+
+ double aPrevDx, aPrevDy, aPrevDz;
+ if ( getTranslation( aPrevDx, aPrevDy, aPrevDz ) )
+ {
+ aCurDx += aPrevDx;
+ aCurDy += aPrevDy;
+ aCurDz += aPrevDz;
+ }
+
+ Handle(TDataStd_RealArray) aCoeffsArray = TDataStd_RealArray::Set( aLabel, 1, 3 );
+ aCoeffsArray->SetValue( 1, aCurDx );
+ aCoeffsArray->SetValue( 2, aCurDy );
+ aCoeffsArray->SetValue( 3, aCurDz );
+}
+
+bool HYDROData_Obstacle::getTranslation( double& theDx, double& theDy, double& theDz ) const
+{
+ theDx = theDy = theDz = 0.0;
+
+ TDF_Label aLabel = myLab.FindChild( DataTag_Translation, false );
+ if ( aLabel.IsNull() )
+ return false;
+
+ Handle(TDataStd_RealArray) aCoeffsArray;
+ if ( !aLabel.FindAttribute( TDataStd_RealArray::GetID(), aCoeffsArray ) )
+ return false;
+
+ theDx = aCoeffsArray->Value( 1 );
+ theDy = aCoeffsArray->Value( 2 );
+ theDz = aCoeffsArray->Value( 3 );
+
+ return true;
+}
+
+void HYDROData_Obstacle::UpdateLocalCS( double theDx, double theDy )
+{
+ Translate( theDx, theDy, 0 );
+}
+