Salome HOME
Feature #102: Display of Lambert coordinates.
[modules/hydro.git] / src / HYDROCurveCreator / CurveCreator_UtilsICurve.cxx
index 29aa672cbedbe19459a64679c10d81e6abee5710..d8b5d2ded840c5b2d22643040b3f651e08333681 100644 (file)
@@ -82,11 +82,35 @@ void CurveCreator_UtilsICurve::convert( const CurveCreator_ICurve::SectionToPoin
   }
 }
 
-/**
- * Returns whethe the container has the value
- * \param theList a container of values
- * \param theValue a value
- */
+#include "CurveCreator_Curve.hxx"
+void CurveCreator_UtilsICurve::getPoint( const CurveCreator_ICurve* theCurve, const int theISection,
+                                         const int theIPoint, gp_Pnt& thePoint )
+{
+  double anX, anY, aZ;
+  // TODO
+  const CurveCreator_Curve* aCurve = dynamic_cast<const CurveCreator_Curve*>( theCurve );
+  if ( aCurve )
+    aCurve->getCoordinates( theISection, theIPoint, anX, anY, aZ );
+  thePoint = gp_Pnt( anX, anY, aZ);
+}
+
+std::string CurveCreator_UtilsICurve::getUniqSectionName( CurveCreator_ICurve* theCurve )
+{
+  for( int i = 0 ; i < 1000000 ; i++ ){
+    char aBuffer[255];
+    sprintf( aBuffer, "Section_%d", i+1 );
+    std::string aName(aBuffer);
+    int j;
+    for( j = 0 ; j < theCurve->getNbSections() ; j++ ){
+      if( theCurve->getSectionName(j) == aName )
+        break;
+    }
+    if( j == theCurve->getNbSections() )
+      return aName;
+  }
+  return "";
+}
+
 bool CurveCreator_UtilsICurve::contains( const CurveCreator_ICurve::SectionToPointList& theList,
                                          const CurveCreator_ICurve::SectionToPoint& theValue )
 {