]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
#refs 585: the method IsCustom()
authorasl <asl@opencascade.com>
Tue, 30 Jun 2015 06:44:25 +0000 (09:44 +0300)
committerasl <asl@opencascade.com>
Tue, 30 Jun 2015 06:44:25 +0000 (09:44 +0300)
src/HYDROData/HYDROData_PolylineXY.cxx
src/HYDROData/HYDROData_PolylineXY.h

index ab34af79f43deed24ab133afe4d9a5b132fd7bec..8071d35cb837a8e5a0c7d6007e9c7e6c62dde749 100755 (executable)
@@ -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,12 @@ void HYDROData_PolylineXY::Transform( const QTransform& theTrsf )
   Update();
 }
 
+bool HYDROData_PolylineXY::IsCustom() const
+{
+  bool isNull = getPolylineShape().IsNull();
+  int aNbPoints = 0;
+  for( int i=0, n=NbSections(); i<n; i++ )
+    aNbPoints += NbPoints( i );
+
+  return !isNull && aNbPoints == 0;
+}
index 3036097263f0ea5ff25c87eed0c64c0346253816..c088b987d3659dcd5d2ceddb9599ce270080765d 100644 (file)
@@ -83,6 +83,8 @@ public:
    */
   HYDRODATA_EXPORT static QColor DefaultWireColor();
 
+  HYDRODATA_EXPORT bool IsCustom() const;
+
 public:
 
   /**