-//#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
-
- 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;
- }
-
- 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;
-}
-