Salome HOME
refs #640: correct width for non-georeferenced profile
[modules/hydro.git] / src / HYDROData / HYDROData_PolylineXY.cxx
index 608e5b9510bfa9f2fc2bac174e1e58249b5419f7..37559e3f3a43775ac7c1ef4a4c9501e839f5c9e2 100755 (executable)
@@ -495,7 +495,7 @@ void HYDROData_PolylineXY::Update()
   NCollection_Sequence<bool>                              aSectClosures;
   GetSections( aSectNames, aSectTypes, aSectClosures );
 
-  BRepBuilderAPI_MakeWire aMakeWire;
+  //BRepBuilderAPI_MakeWire aMakeWire;
 
   TopTools_ListOfShape aSectionWiresList;
 
@@ -521,7 +521,7 @@ void HYDROData_PolylineXY::Update()
     TopoDS_Wire aSectionWire = BuildWire( aSectionType, anIsSectionClosed, aPoints );
     if ( !aSectionWire.IsNull() ) {
       aSectionWiresList.Append( aSectionWire );
-      aMakeWire.Add( aSectionWire );
+      //aMakeWire.Add( aSectionWire );
     }
   }
 // all input wires in the <aSectionWiresList>
@@ -1080,6 +1080,11 @@ HYDROData_PolylineXY::PointsList HYDROData_PolylineXY::GetPoints( const int theS
 {
   PointsList aResList;
 
+  if( IsCustom() )
+  {
+    //TODO: make interpolation to fill the list
+  }
   Handle(TDataStd_RealList) aListX, aListY;
   getPointsLists( theSectionIndex, aListX, aListY, false );
   if ( aListX.IsNull() || aListY.IsNull() || aListX->IsEmpty() )
@@ -1174,3 +1179,14 @@ void HYDROData_PolylineXY::Transform( const QTransform& theTrsf )
   Update();
 }
 
+bool HYDROData_PolylineXY::IsCustom() const
+{
+  bool isNull = getPolylineShape().IsNull();
+  int aNbPoints = 0;
+
+  //TODO: to check if there is no points
+  //for( int i=0, n=NbSections(); i<n; i++ )
+  //  aNbPoints += NbPoints( i );
+
+  return !isNull && aNbPoints == 0;
+}