Salome HOME
OCC functionality moving out from the widget
[modules/hydro.git] / src / HYDROCurveCreator / CurveCreator_Curve.cxx
index cab312d69de6ff42e1f9ab33befe6897d88770ca..129520136437240ed6e21fce61cf9ae439a34aad 100644 (file)
@@ -182,58 +182,17 @@ int CurveCreator_Curve::toICoord(const int theIPnt) const
   return theIPnt * myDimension;
 }
 
-//#define USE_COMPOUND
 std::vector<Handle_AIS_InteractiveObject> CurveCreator_Curve::constructSection( int theISection ) const
 {
   std::vector<Handle_AIS_InteractiveObject> aSectionRepresentation;
-  CurveCreator::SectionType aSectType = getSectionType( theISection );
 
-  bool isShapeConstruct = false;
-#ifdef USE_COMPOUND
-  isShapeConstruct = true;
-#else
-  isShapeConstruct = aSectType == CurveCreator::Spline;
-#endif
+  TopoDS_Shape aShape;
+  CurveCreator_Utils::constructShape( this, theISection, aShape, aSectionRepresentation );
 
-  if ( isShapeConstruct ) {
-    TopoDS_Shape aShape;
-    CurveCreator_Utils::constructShape( this, theISection, aShape );
-    AIS_Shape* anAISShape = new AIS_Shape( aShape );
-    //aShape->SetSelectionMode( AIS_Shape::SelectionMode( (TopAbs_ShapeEnum)TopAbs_VERTEX ) );
-    aSectionRepresentation.push_back( anAISShape );
-    if ( aSectType != CurveCreator::Spline )
-      return aSectionRepresentation;
-  }
+  AIS_Shape* anAISShape = new AIS_Shape( aShape );
+  //aShape->SetSelectionMode( AIS_Shape::SelectionMode( (TopAbs_ShapeEnum)TopAbs_VERTEX ) );
+  aSectionRepresentation.push_back( anAISShape );
 
-  int aPointSize = getNbPoints( theISection );
-  bool aSectIsClosed = isClosed( theISection );
-  if( aSectType == CurveCreator::Polyline )
-  {
-    int iPoint = 0; 
-    for( ; iPoint < ( aPointSize - 1 ) ; iPoint++ ){
-      Handle_AIS_Point anAISPnt = getAISPoint(theISection, iPoint);
-      aSectionRepresentation.push_back( anAISPnt );
-      Handle_AIS_Line aLine = getAISLine( theISection, iPoint, iPoint+1 );
-      aSectionRepresentation.push_back( aLine );
-    }
-    if( aPointSize != 0 ){
-      Handle_AIS_Point anAISPnt = getAISPoint(theISection, iPoint); 
-      aSectionRepresentation.push_back( anAISPnt );
-      if( isClosed(theISection) && ( aPointSize > 1 ) ){
-        Handle_AIS_Line aLine = getAISLine( theISection, iPoint, 0 );
-        aSectionRepresentation.push_back( aLine );
-      }
-    }
-  }
-  else if( aSectType == CurveCreator::Spline )
-  {
-    std::vector<double> aPoints;
-    for( int iPoint = 0; iPoint < aPointSize; iPoint++ )
-    {
-      Handle_AIS_Point anAISPnt = getAISPoint( theISection, iPoint );
-      aSectionRepresentation.push_back( anAISPnt );
-    }
-  }
   return aSectionRepresentation;
 }
 
@@ -335,6 +294,7 @@ void CurveCreator_Curve::getCoordinates( int theISection, int theIPoint, double&
   }
 }
 
+//#define USE_COMPOUND
 void CurveCreator_Curve::redisplayCurve()
 {
   if( myDisplayer ) {