Salome HOME
Merging with V7_main branch.
[modules/hydro.git] / src / HYDROCurveCreator / CurveCreator_Curve.cxx
1 // Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // File:        CurveCreator_Curve.cxx
21 // Author:      Sergey KHROMOV
22
23 #include "CurveCreator_Curve.hxx"
24
25 #include "CurveCreator.hxx"
26 #include "CurveCreator_Section.hxx"
27 #include "CurveCreator_Displayer.h"
28
29 #include <AIS_Point.hxx>
30 #include <AIS_Line.hxx>
31 #include <AIS_Shape.hxx>
32 #include <BRepBuilderAPI_MakeEdge.hxx>
33 #include <BRepBuilderAPI_MakeWire.hxx>
34 #include <Geom_CartesianPoint.hxx>
35 #include <gp_Pnt.hxx>
36 #include <gp_Lin.hxx>
37 #include <TopoDS_Edge.hxx>
38 #include <TopoDS_Face.hxx>
39 #include <TopoDS_Wire.hxx>
40 #include <TColgp_HArray1OfPnt.hxx>
41 #include <GeomAPI_Interpolate.hxx>
42
43 #include <stdio.h>
44
45 //=======================================================================
46 // function: Constructor
47 // purpose:
48 //=======================================================================
49 CurveCreator_Curve::CurveCreator_Curve( const CurveCreator::Dimension theDimension )
50 : myIsLocked  (false),
51   myDimension (theDimension),
52   myDisplayer (NULL),
53   myNbUndos   (0),
54   myNbRedos   (0),
55   myUndoDepth (-1),
56   myOpLevel(0)
57 {
58 }
59
60 //=======================================================================
61 // function: Destructor
62 // purpose:
63 //=======================================================================
64 CurveCreator_Curve::~CurveCreator_Curve()
65 {
66   // Delete all allocated data.
67   clear();
68 }
69
70 //=======================================================================
71 // function: getDimension
72 // purpose:
73 //=======================================================================
74 CurveCreator::Dimension CurveCreator_Curve::getDimension() const
75 {
76   return myDimension;
77 }
78
79 //=======================================================================
80 // function: getUniqSectionName
81 // purpose: return unique section name
82 //=======================================================================
83 std::string CurveCreator_Curve::getUniqSectionName() const
84 {
85     for( int i = 0 ; i < 1000000 ; i++ ){
86         char aBuffer[255];
87         sprintf( aBuffer, "Section_%d", i+1 );
88         std::string aName(aBuffer);
89         int j;
90         for( j = 0 ; j < mySections.size() ; j++ ){
91             if( mySections[j]->myName == aName )
92               break;
93         }
94         if( j == mySections.size() )
95             return aName;
96     }
97     return "";
98 }
99
100 //=======================================================================
101 // function: setDisplayer
102 // purpose: set curve changes Displayer
103 //=======================================================================
104 void CurveCreator_Curve::setDisplayer( CurveCreator_Displayer* theDisplayer )
105 {
106   myDisplayer = theDisplayer;
107 }
108
109 //=======================================================================
110 // function: removeDisplayer
111 // purpose: remove the attached Displayer
112 //=======================================================================
113 void CurveCreator_Curve::removeDisplayer()
114 {
115   myDisplayer = NULL;
116 }
117
118 //=======================================================================
119 // function: addDiff
120 // purpose:
121 //=======================================================================
122 bool CurveCreator_Curve::addEmptyDiff()
123 {
124   bool isEnabled = false;
125
126   if (myUndoDepth != 0) {
127     // Forget all Redos after the current one.
128     if (myNbRedos > 0) {
129       myNbRedos = 0;
130       myListDiffs.erase(myCurrenPos, myListDiffs.end());
131     }
132
133     if (myUndoDepth == -1 || myNbUndos < myUndoDepth) {
134       // Increase the number of undos.
135       myNbUndos++;
136     } else {
137       // If there are too many differences, remove the first one.
138       myListDiffs.pop_front();
139     }
140
141     // Add new difference.
142     myListDiffs.push_back(CurveCreator_Diff());
143     myCurrenPos = myListDiffs.end();
144     isEnabled = true;
145   }
146
147   return isEnabled;
148 }
149
150 void CurveCreator_Curve::startOperation()
151 {
152     myOpLevel++;
153 }
154
155 void CurveCreator_Curve::finishOperation()
156 {
157    myOpLevel--;
158 }
159
160 //=======================================================================
161 // function: toICoord
162 // purpose:
163 //=======================================================================
164 int CurveCreator_Curve::toICoord(const int theIPnt) const
165 {
166   return theIPnt * myDimension;
167 }
168
169 std::vector<Handle_AIS_InteractiveObject> CurveCreator_Curve::constructSection( int theISection ) const
170 {
171   std::vector<Handle_AIS_InteractiveObject> aSectionRepresentation;
172
173   CurveCreator::SectionType aSectType = getSectionType( theISection );
174   int aSectSize = getNbPoints( theISection );
175   bool aSectIsClosed = isClosed( theISection );
176
177   if( aSectType == CurveCreator::Polyline )
178   {
179     int iPoint = 0; 
180     for( ; iPoint < ( aSectSize - 1 ) ; iPoint++ ){
181       Handle_AIS_Point anAISPnt = getAISPoint(theISection, iPoint);
182       aSectionRepresentation.push_back( anAISPnt );
183       Handle_AIS_Line aLine = getAISLine( theISection, iPoint, iPoint+1 );
184       aSectionRepresentation.push_back( aLine );
185     }
186     if( aSectSize != 0 ){
187       Handle_AIS_Point anAISPnt = getAISPoint(theISection, iPoint); 
188       aSectionRepresentation.push_back( anAISPnt );
189       if( isClosed(theISection) && ( aSectSize > 1 ) ){
190         Handle_AIS_Line aLine = getAISLine( theISection, iPoint, 0 );
191         aSectionRepresentation.push_back( aLine );
192       }
193     }
194   }
195   else if( aSectType == CurveCreator::Spline )
196   {
197     std::vector<double> aPoints;
198     for( int iPoint = 0; iPoint < aSectSize; iPoint++ )
199     {
200       Handle_AIS_Point anAISPnt = getAISPoint( theISection, iPoint );
201       aSectionRepresentation.push_back( anAISPnt );
202
203       CurveCreator::Coordinates aCoords = getPoint( theISection, iPoint );
204       double aX = aCoords[0];
205       double aY = aCoords[1];
206       double aZ = aCoords[2];
207       aPoints.push_back( aX );
208       aPoints.push_back( aY );
209     }
210
211     if( aSectSize > 1 )
212     {
213       Handle(Geom_BSplineCurve) aBSplineCurve;
214       // fill array for algorithm by the received coordinates
215       int aLen = aPoints.size() / 2;
216       Handle(TColgp_HArray1OfPnt) aHCurvePoints = new TColgp_HArray1OfPnt (1, aLen);
217       std::vector<double>::const_iterator aListIter = aPoints.begin();
218       for (int ind = 1; ind <= aLen; ind++) {
219         gp_Pnt aPnt(gp::Origin());
220         aPnt.SetX(*aListIter);
221         aListIter++;
222         aPnt.SetY(*aListIter);
223         aListIter++;
224         aPnt.SetZ(0);
225         aHCurvePoints->SetValue(ind, aPnt);
226       }
227       // compute BSpline
228       GeomAPI_Interpolate aGBC(aHCurvePoints, aSectIsClosed, gp::Resolution());
229       aGBC.Perform();
230       if (aGBC.IsDone()) {
231         aBSplineCurve = aGBC.Curve();
232       }
233       TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge( aBSplineCurve ).Edge();
234
235       TopoDS_Wire aWire = BRepBuilderAPI_MakeWire( anEdge ).Wire();
236
237       Handle(AIS_Shape) aShape = new AIS_Shape( aWire );
238       aSectionRepresentation.push_back( aShape );
239     }
240   }
241   return aSectionRepresentation;
242 }
243
244 //=======================================================================
245 // function: setUndoDepth
246 // purpose:
247 //=======================================================================
248 void CurveCreator_Curve::setUndoDepth(const int theDepth)
249 {
250   if (theDepth == 0) {
251     // Reset all undo/redo data.
252     myNbUndos = 0;
253     myNbRedos = 0;
254     myListDiffs.clear();
255     myCurrenPos = myListDiffs.end();
256     myUndoDepth = 0;
257   } else if (theDepth == -1) {
258     // There is nothing to do as the depth become unlimited.
259     myUndoDepth = -1;
260   } else if (theDepth > 0) {
261     // The new "real" depth is set.
262     if (theDepth < myNbRedos) {
263       // The new depth is less then number of redos. Remove the latest redos.
264       int aShift = (myNbRedos - theDepth);
265       ListDiff::iterator aFromPos = myListDiffs.end();
266
267       while (aShift--) {
268         aFromPos--;
269       }
270
271       myListDiffs.erase(aFromPos, myListDiffs.end());
272       myNbRedos = theDepth;
273     }
274
275     if (theDepth < myNbUndos + myNbRedos) {
276       // The new depth is less then the total number of differences.
277       // Remove the first undos.
278       int aShift = (myNbUndos + myNbRedos - theDepth);
279       ListDiff::iterator aToPos = myListDiffs.begin();
280
281       while (aShift--) {
282         aToPos++;
283       }
284
285       myListDiffs.erase(myListDiffs.begin(), aToPos);
286       myNbUndos = theDepth - myNbRedos;
287     }
288
289     myUndoDepth = theDepth;
290   }
291 }
292
293 //=======================================================================
294 // function: getUndoDepth
295 // purpose:
296 //=======================================================================
297 int CurveCreator_Curve::getUndoDepth() const
298 {
299   return myUndoDepth;
300 }
301
302 Handle_AIS_Point CurveCreator_Curve::getAISPoint( int theISection, int theIPoint ) const
303 {
304   double anX, anY, aZ;
305   getCoordinates( theISection, theIPoint, anX, anY, aZ );
306   gp_Pnt aPoint( anX, anY, aZ);
307
308   AIS_Point* aPnt = new AIS_Point( new Geom_CartesianPoint(aPoint));
309   return aPnt;
310 }
311
312 Handle_AIS_Line CurveCreator_Curve::getAISLine( int theISection, int theIPoint1, int theIPoint2 ) const
313 {
314   double anX, anY, aZ;
315   getCoordinates( theISection, theIPoint1, anX, anY, aZ );
316   gp_Pnt aPoint1( anX, anY, aZ);
317
318   double anX2, anY2, aZ2;
319   getCoordinates( theISection, theIPoint2, anX2, anY2, aZ2 );
320 //MTN to avoid crash during line construction
321   if( ( anX == anX2 ) && ( anY == anY2 ) && (aZ == aZ2 ) ){
322     aZ2 += 1e-7;
323   }
324
325   gp_Pnt aPoint2( anX2, anY2, aZ2 );
326
327   AIS_Line* aLine = new AIS_Line( new Geom_CartesianPoint(aPoint1), new Geom_CartesianPoint(aPoint2) );
328   return aLine;
329 }
330
331 void CurveCreator_Curve::getCoordinates( int theISection, int theIPoint, double& theX, double& theY, double& theZ ) const
332 {
333   CurveCreator::Coordinates aCoords = getPoint( theISection, theIPoint );
334   theX = aCoords[0];
335   theY = aCoords[1];
336   theZ = 0.;
337   if( getDimension() == CurveCreator::Dim3d ){
338     theZ = aCoords[2];
339   }
340 }
341
342 void CurveCreator_Curve::redisplayCurve()
343 {
344   if( myDisplayer ) {
345     myDisplayer->erase();
346     myDisplayer->display( constructWire() );
347   }
348 }
349
350 /************   Implementation of INTERFACE methods   ************/
351
352 /***********************************************/
353 /***          Undo/Redo methods              ***/
354 /***********************************************/
355
356 //! Get number of available undo operations
357 int CurveCreator_Curve::getNbUndo() const
358 {
359   return myNbUndos;
360 }
361
362 //! Undo previous operation
363 bool CurveCreator_Curve::undo()
364 {
365   bool res = false;
366   if (myNbUndos > 0) {
367     myNbUndos--;
368     myNbRedos++;
369     myCurrenPos--;
370     myCurrenPos->applyUndo(this);
371     res = true;
372   }
373   return res;
374 }
375
376 //! Get number of available redo operations
377 int CurveCreator_Curve::getNbRedo() const
378 {
379   return myNbRedos;
380 }
381
382 //! Redo last previously "undone" operation
383 bool CurveCreator_Curve::redo()
384 {
385   bool res = false;
386   if (myNbRedos > 0) {
387     myCurrenPos->applyRedo(this);
388     myCurrenPos++;
389     myNbRedos--;
390     myNbUndos++;
391     res = true;
392   }
393   return res;
394 }
395
396 /***********************************************/
397 /***           Section methods               ***/
398 /***********************************************/
399 //=======================================================================
400 // function: clear
401 // purpose:
402 //=======================================================================
403 bool CurveCreator_Curve::clear()
404 {
405   // erase curve from the viewer
406   if( myDisplayer )
407     myDisplayer->erase();
408   // Delete all allocated data.
409   int i = 0;
410   const int aNbSections = getNbSections();
411
412   for (; i < aNbSections; i++) {
413     delete mySections[i];
414   }
415
416   mySections.clear();
417   
418   return true;
419 }
420
421 //! Join range of sections to one section (join all sections if -1 is passed in one of arguments)
422 bool CurveCreator_Curve::join( const int theISectionTo, 
423                    const int theISectionFrom )
424 {
425   if (theISectionTo != theISectionFrom) {
426     startOperation();
427     if (addEmptyDiff())
428       myListDiffs.back().init(this, CurveCreator_Operation::Join, theISectionTo, theISectionFrom);
429
430     CurveCreator_Section *aSection1 = mySections.at(theISectionTo);
431     CurveCreator_Section *aSection2 = mySections.at(theISectionFrom);
432
433     aSection1->myPoints.insert(aSection1->myPoints.end(),
434                                aSection2->myPoints.begin(), 
435                                aSection2->myPoints.end());
436
437     removeSection(theISectionFrom);
438     redisplayCurve();
439
440     finishOperation();
441     return true;
442   }
443   return false;
444 }
445
446 //! Get number of sections
447 int CurveCreator_Curve::getNbSections() const
448 {
449   return mySections.size();
450 }
451
452 //=======================================================================
453 // function: addSection
454 // purpose: adds an empty section
455 //=======================================================================
456 int CurveCreator_Curve::addSection
457         (const std::string& theName, const CurveCreator::SectionType theType,
458          const bool theIsClosed)
459 {
460   int resISection = -1;
461   // Set the difference.
462   startOperation();
463   if (addEmptyDiff()) {
464     CurveCreator::Coordinates aCoords; //empty list
465     myListDiffs.back().init(this, CurveCreator_Operation::AddSection,
466                             theName, aCoords, theType, theIsClosed);
467   }
468   CurveCreator_Section *aSection = new CurveCreator_Section;
469
470   std::string aName = theName;
471   if( aName.empty() ){
472       aName = getUniqSectionName();
473   }
474   aSection->myName     = aName;
475   aSection->myType     = theType;
476   aSection->myIsClosed = theIsClosed;
477   mySections.push_back(aSection);
478   redisplayCurve();
479
480   finishOperation();
481   return mySections.size()-1;
482 }
483 //=======================================================================
484 // function: addSection
485 // purpose: adds a section with the given points
486 //=======================================================================
487 int CurveCreator_Curve::addSection
488         (const std::string& theName, const CurveCreator::SectionType theType,
489          const bool theIsClosed, const CurveCreator::Coordinates &thePoints)
490 {
491   int resISection = -1;
492   //// Set the difference.
493   //startOperation();
494   //if (addEmptyDiff()) {
495   //  myListDiffs.back().init(this, CurveCreator_Operation::AddSection,
496   //                          theName, thePoints, theType, theIsClosed);
497   //}
498
499   // create an empty section
500   resISection = addSection(theName, theType, theIsClosed);
501   if( resISection != -1 ) {
502     // attach the given points to created section
503     CurveCreator_Section *aSection = mySections.at(resISection);
504     aSection->myPoints = thePoints;
505   }
506   
507   //finishOperation();
508   return resISection;
509 }
510
511 //! Removes the given sections.
512 bool CurveCreator_Curve::removeSection( const int theISection )
513 {
514   // Set the difference.
515   startOperation();
516   if (addEmptyDiff())
517     myListDiffs.back().init(this, CurveCreator_Operation::RemoveSection, theISection);
518
519   if (theISection == -1) {
520     delete mySections.back();
521     mySections.pop_back();
522   } else {
523     CurveCreator::Sections::iterator anIterRm = mySections.begin() + theISection;
524
525     delete *anIterRm;
526     mySections.erase(anIterRm);
527   }
528   redisplayCurve();
529
530   finishOperation();
531   return true;
532 }
533
534 /**
535  *  Get number of points in specified section or (the total number of points
536  *  in Curve if theISection is equal to -1).
537  */
538 int CurveCreator_Curve::getNbPoints( const int theISection ) const
539 {
540   int aNbCoords = 0;
541
542   if (theISection == -1) {
543     int i = 0;
544     const int aNbSections = getNbSections();
545
546     for (; i < aNbSections; i++) {
547       aNbCoords += mySections[i]->myPoints.size();
548     }
549   } else {
550     aNbCoords = mySections.at(theISection)->myPoints.size();
551   }
552
553   return aNbCoords/myDimension;
554 }
555
556 //! Get "closed" flag of the specified section
557 bool CurveCreator_Curve::isClosed( const int theISection ) const
558 {
559   return mySections.at(theISection)->myIsClosed;
560 }
561
562 /**
563  *  Set "closed" flag of the specified section (all sections if
564  *  \a theISection is -1).
565  */
566 bool CurveCreator_Curve::setClosed( const int theISection, 
567                         const bool theIsClosed )
568 {
569   if (theISection == -1) {
570     int aSize = mySections.size();
571     int i;
572
573     for (i = 0; i < aSize; i++) {
574       mySections[i]->myIsClosed = theIsClosed;
575       redisplayCurve();
576     }
577   } else {
578     mySections.at(theISection)->myIsClosed = theIsClosed;
579     redisplayCurve();
580   }
581   return true;
582 }
583
584 //! Returns specifyed section name
585 std::string CurveCreator_Curve::getSectionName( const int theISection ) const
586 {
587   if( ( theISection >= 0 ) && ( theISection < mySections.size() ))
588     return mySections.at(theISection)->myName;
589   return "";
590 }
591
592 /** Set name of the specified section */
593 bool CurveCreator_Curve::setSectionName
594   ( const int theISection, const std::string& theName )
595 {
596   if( ( theISection >= 0 ) && ( theISection < mySections.size() )){
597     mySections.at(theISection)->myName = theName;
598     return true;
599   }
600   return false;
601 }
602
603 //! Get type of the specified section
604 CurveCreator::SectionType CurveCreator_Curve::getSectionType
605   ( const int theISection ) const
606 {
607   return mySections.at(theISection)->myType;
608 }
609
610 /**
611  *  Set type of the specified section (or all sections
612  *  if \a theISection is -1).
613  */
614 bool CurveCreator_Curve::setSectionType( const int theISection, 
615                                          const CurveCreator::SectionType theType )
616 {
617   if (theISection == -1) {
618     int i = 0;
619     const int aNbSections = getNbSections();
620
621     for (; i < aNbSections; i++) {
622       mySections[i]->myType = theType;
623     }
624     redisplayCurve();
625   } else {
626     if( mySections.at(theISection)->myType != theType ){
627       mySections.at(theISection)->myType = theType;
628       redisplayCurve();
629     }
630   }
631   return true;
632 }
633
634
635 /***********************************************/
636 /***           Point methods                 ***/
637 /***********************************************/
638
639 /**
640  *  Add one point to the specified section starting from the given theIPnt index
641  *  (or at the end of points if \a theIPnt is -1).
642  */
643 bool CurveCreator_Curve::addPoints( const CurveCreator::Coordinates& theCoords,
644                                     const int theISection,
645                                     const int theIPnt )
646 {
647   bool res = false;
648   CurveCreator::Coordinates aCoords = theCoords;
649   // Set the difference.
650   startOperation();
651   if (addEmptyDiff()) {
652     myListDiffs.back().init(this, CurveCreator_Operation::AddPoints,
653                             theCoords, theISection);
654   }
655   CurveCreator_Section *aSection =
656     (theISection == -1 ? mySections.back() : mySections.at(theISection));
657
658   if( aSection ) {
659     int anICoord = ( theIPnt == -1 ? 0 : toICoord(theIPnt) );
660     CurveCreator::Coordinates::iterator anIterPosition = aSection->myPoints.end();
661     if( theIPnt != -1 )
662       anIterPosition = aSection->myPoints.begin() + toICoord(theIPnt);
663     aSection->myPoints.insert(anIterPosition,
664                               theCoords.begin(), theCoords.end());
665     redisplayCurve();
666     res = true;
667   }
668   finishOperation();
669   return res;
670 }
671
672    //! Set coordinates of specified point
673 bool CurveCreator_Curve::setPoint( const int theISection,
674                                    const int theIPnt,
675                                    const CurveCreator::Coordinates& theNewCoords )
676 {
677   // Set the difference.
678   startOperation();
679   if (addEmptyDiff()) {
680     myListDiffs.back().init(this, CurveCreator_Operation::SetCoordinates,
681                             theNewCoords, theISection, theIPnt);
682   }
683
684   bool res = false;
685
686   // Update the curve.
687   if (theNewCoords.size() == myDimension) {
688     CurveCreator_Section *aSection = mySections.at(theISection);
689     int i;
690     for (i = 0; i < myDimension; i++) {
691       aSection->myPoints.at(toICoord(theIPnt) + i) = theNewCoords[i];
692     }
693     redisplayCurve();
694     
695     res = true;
696   }
697
698   finishOperation();
699
700   return res; 
701 }
702
703 //! Remove point with given id
704 bool CurveCreator_Curve::removePoint( const int theISection, const int theIPnt )
705 {
706   bool res = false;
707   // Set the difference.
708   startOperation();
709   if (addEmptyDiff()) {
710     myListDiffs.back().init(this, CurveCreator_Operation::RemovePoints,
711                             theISection, theIPnt, 0);
712   }
713   CurveCreator_Section *aSection = mySections.at(theISection);
714   if( aSection ) {
715     CurveCreator::Coordinates::iterator anIterPosition =
716       aSection->myPoints.begin() + toICoord(theIPnt);
717     aSection->myPoints.erase( anIterPosition );
718     redisplayCurve();
719     res = true;
720   }
721   finishOperation();
722   return res;
723 }
724
725 //=======================================================================
726 // function: getCoordinates
727 // purpose:
728 //=======================================================================
729 CurveCreator::Coordinates CurveCreator_Curve::getPoint( const int theISection,
730                                                         const int theIPnt) const
731 {
732   CurveCreator_Section *aSection = mySections.at(theISection);
733   CurveCreator::Coordinates::const_iterator
734     anIter = aSection->myPoints.begin() + toICoord(theIPnt);
735   CurveCreator::Coordinates aResult(anIter, anIter + myDimension);
736
737   return aResult;
738 }
739
740 //=======================================================================
741 // function: getPoints
742 // purpose:
743 //=======================================================================
744 CurveCreator::Coordinates CurveCreator_Curve::getPoints( const int theISection ) const
745 {
746   return mySections.at(theISection)->myPoints;
747 }
748
749
750 /***********************************************/
751 /***       Presentation methods              ***/
752 /***********************************************/
753 std::vector<Handle_AIS_InteractiveObject> CurveCreator_Curve::constructWire() const
754 {
755   std::vector<Handle_AIS_InteractiveObject> aCurveRepresentation;
756   std::vector<Handle_AIS_InteractiveObject> aSectionObjects;
757   for( int iSection = 0 ; iSection < getNbSections() ; iSection++ ){
758     aSectionObjects = constructSection( iSection );
759     for( int iObject = 0 ; iObject < aSectionObjects.size() ; iObject++ ){
760       aCurveRepresentation.push_back( aSectionObjects.at(iObject) );
761     }
762   }
763   return aCurveRepresentation;
764 }