1 // Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "CurveCreator_Widget.h"
21 #include "CurveCreator_TreeView.h"
22 #include "CurveCreator_ICurve.hxx"
23 #include "CurveCreator.hxx"
24 #include "CurveCreator_NewSectionDlg.h"
25 #include "CurveCreator_Utils.h"
26 #include "CurveCreator_UtilsICurve.hxx"
27 #include "CurveCreator_TableView.h"
29 #include <SUIT_Session.h>
30 #include <SUIT_Desktop.h>
31 #include <SUIT_ResourceMgr.h>
32 #include <SUIT_ViewManager.h>
34 #include <OCCViewer_ViewWindow.h>
35 #include <OCCViewer_ViewManager.h>
36 #include <OCCViewer_ViewPort3d.h>
37 #include "OCCViewer_Utilities.h"
39 #include <QHBoxLayout>
40 #include <QVBoxLayout>
44 #include <QToolButton>
48 #include <QMouseEvent>
49 #include <QApplication>
50 #include <QTableWidget>
53 //#define MEASURE_TIME
57 #define START_MEASURE_TIME \
61 #define END_MEASURE_TIME( theMsg ) \
62 double aTime = aTimer.elapsed() * 0.001; \
63 FILE* aFile = fopen( "performance", "a" ); \
64 fprintf( aFile, "%s = %.3lf sec\n", theMsg, aTime ); \
69 #define START_MEASURE_TIME
70 #define END_MEASURE_TIME( theMsg )
79 CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
80 CurveCreator_ICurve *theCurve,
81 const int theActionFlags,
83 int theLocalPointRowLimit )
84 : QWidget(parent), myNewSectionEditor(NULL), myCurve(theCurve), mySection(0),
85 myDragStarted( false ), myDragInteractionStyle( SUIT_ViewModel::STANDARD ),
86 myOCCViewer( 0 ), myLocalPointRowLimit( theLocalPointRowLimit )
88 bool isToEnableClosed = !( theActionFlags & DisableClosedSection );
89 myNewSectionEditor = new CurveCreator_NewSectionDlg( this, isToEnableClosed );
90 myNewSectionEditor->hide();
91 connect( myNewSectionEditor, SIGNAL(addSection()), this, SLOT(onAddNewSection()) );
92 connect( myNewSectionEditor, SIGNAL(modifySection()), this, SLOT(onModifySection()) );
93 connect( myNewSectionEditor, SIGNAL(cancelSection()), this, SLOT(onCancelSection()) );
95 QGroupBox* aSectionGroup = new QGroupBox(tr("Sections"),this);
97 mySectionView = new CurveCreator_TreeView(myCurve, aSectionGroup);
98 mySectionView->setSelectionMode( QTreeView::ExtendedSelection );
99 connect( mySectionView, SIGNAL(selectionChanged()), this, SLOT( onSelectionChanged() ) );
100 connect( mySectionView, SIGNAL(sectionEntered(int)), this, SLOT(onEditSection(int)) );
101 connect( mySectionView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onContextMenu(QPoint)) );
103 myLocalPointView = new CurveCreator_TableView( myCurve, this );
104 connect( myLocalPointView, SIGNAL( cellChanged( int, int ) ),
105 this, SLOT( onCellChanged( int, int ) ) );
107 QToolBar* aTB = new QToolBar(tr("TOOL_BAR_TLT"), aSectionGroup);
108 // QToolButton* anUndoBtn = new QToolButton(aTB);
110 SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
111 QPixmap anUndoPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_UNDO")));
112 QPixmap aRedoPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_REDO")));
113 QPixmap aNewSectionPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_NEW_SECTION")));
114 QPixmap aNewPointPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_NEW_POINT")));
115 QPixmap anEditPointsPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_EDIT_POINTS")));
116 QPixmap aDetectPointsPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_EDIT_POINTS")));
117 QPixmap aPolylinePixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_POLYLINE")));
118 QPixmap aSplinePixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_SPLINE")));
119 QPixmap aRemovePixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_DELETE")));
120 QPixmap aJoinPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_JOIN")));
121 QPixmap aStepUpPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_ARROW_UP")));
122 QPixmap aStepDownPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_ARROW_DOWN")));
124 QAction* anAct = createAction( UNDO_ID, tr("UNDO"), anUndoPixmap, tr("UNDO_TLT"),
125 QKeySequence(Qt::ControlModifier|Qt::Key_Z) );
126 connect(anAct, SIGNAL(triggered()), this, SLOT(onUndo()) );
127 aTB->addAction(anAct);
129 anAct = createAction( REDO_ID, tr("REDO"), aRedoPixmap, tr("REDO_TLT"),
130 QKeySequence(Qt::ControlModifier|Qt::Key_Y) );
131 connect(anAct, SIGNAL(triggered()), this, SLOT(onRedo()) );
132 aTB->addAction(anAct);
136 anAct = createAction( NEW_SECTION_ID, tr("NEW_SECTION"), aNewSectionPixmap, tr("NEW_SECTION_TLT"),
137 QKeySequence(Qt::ControlModifier|Qt::Key_N) );
138 connect(anAct, SIGNAL(triggered()), this, SLOT(onNewSection()) );
139 if ( !(theActionFlags & DisableNewSection) ) {
140 aTB->addAction(anAct);
144 anAct = createAction( ADDITION_MODE_ID, tr("ADDITION_MODE"), aNewPointPixmap, tr("ADDITION_MODE_TLT"),
146 anAct->setCheckable(true);
147 connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onAdditionMode(bool)) );
148 connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
149 aTB->addAction(anAct);
151 anAct = createAction( MODIFICATION_MODE_ID, tr("MODIFICATION_MODE"), anEditPointsPixmap, tr("MODIFICATION_MODE_TLT"),
153 anAct->setCheckable(true);
154 connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onModificationMode(bool)) );
155 connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
156 aTB->addAction(anAct);
158 anAct = createAction( DETECTION_MODE_ID, tr("DETECTION_MODE"), aDetectPointsPixmap, tr("DETECTION_MODE_TLT"),
160 anAct->setCheckable(true);
161 connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onDetectionMode(bool)) );
162 connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
163 if ( !(theActionFlags & DisableDetectionMode) ) {
164 aTB->addAction(anAct);
167 anAct = createAction( CLOSE_SECTIONS_ID, tr("CLOSE_SECTIONS"), QPixmap(), tr("CLOSE_SECTIONS_TLT"),
168 QKeySequence(Qt::ControlModifier|Qt::Key_W) );
169 connect(anAct, SIGNAL(triggered()), this, SLOT(onCloseSections()) );
171 anAct = createAction( UNCLOSE_SECTIONS_ID, tr("UNCLOSE_SECTIONS"), QPixmap(),
172 tr("UNCLOSE_SECTIONS_TLT"), QKeySequence(Qt::ControlModifier|Qt::Key_S) );
173 connect(anAct, SIGNAL(triggered()), this, SLOT(onUncloseSections()) );
175 anAct = createAction( SET_SECTIONS_POLYLINE_ID, tr("SET_SECTIONS_POLYLINE"),
176 aPolylinePixmap, tr("SET_POLYLINE_TLT"),
177 QKeySequence(Qt::ControlModifier|Qt::Key_E) );
178 connect(anAct, SIGNAL(triggered()), this, SLOT(onSetPolyline()) );
180 anAct = createAction( SET_SECTIONS_SPLINE_ID, tr("SET_SECTIONS_SPLINE"), aSplinePixmap,
181 tr("SET_SPLINE_TLT"), QKeySequence(Qt::ControlModifier|Qt::Key_R) );
182 connect(anAct, SIGNAL(triggered()), this, SLOT(onSetSpline()) );
184 anAct = createAction( REMOVE_ID, tr("REMOVE"), aRemovePixmap, tr("REMOVE_TLT"),
185 QKeySequence(Qt::ControlModifier|Qt::Key_Delete ) );
186 connect(anAct, SIGNAL(triggered()), this, SLOT(onRemove()) );
187 aTB->addAction(anAct);
191 anAct = createAction( JOIN_ID, tr("JOIN"), aJoinPixmap, tr("JOIN_TLT"),
192 QKeySequence(Qt::ControlModifier|Qt::Key_Plus ) );
193 connect( anAct, SIGNAL(triggered()), this, SLOT(onJoin()) );
194 aTB->addAction(anAct);
196 anAct = createAction( CLEAR_ALL_ID, tr("CLEAR_ALL"), QPixmap(), tr("CLEAR_ALL_TLT"),
197 QKeySequence(Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Delete ) );
198 connect( anAct, SIGNAL(triggered()), this, SLOT( onClearAll()) );
200 anAct = createAction( JOIN_ALL_ID, tr("JOIN_ALL"), QPixmap(), tr("JOIN_ALL_TLT"),
201 QKeySequence(Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Plus ) );
202 connect( anAct, SIGNAL(triggered()), this, SLOT(onJoinAll()) );
204 QVBoxLayout* aSectLayout = new QVBoxLayout();
205 aSectLayout->setMargin( 5 );
206 aSectLayout->setSpacing( 5 );
207 aSectLayout->addWidget(aTB);
208 aSectLayout->addWidget(mySectionView);
209 aSectLayout->addWidget( myLocalPointView );
210 aSectionGroup->setLayout(aSectLayout);
211 QVBoxLayout* aLay = new QVBoxLayout();
212 aLay->setMargin( 0 );
213 aLay->setSpacing( 5 );
214 // aLay->addLayout(aNameLayout);
215 aLay->addWidget(aSectionGroup);
218 updateActionsStates();
225 void CurveCreator_Widget::setOCCViewer( OCCViewer_Viewer* theViewer )
227 if ( myOCCViewer == theViewer )
231 OCCViewer_ViewManager* aViewManager = dynamic_cast<OCCViewer_ViewManager*>
232 ( myOCCViewer->getViewManager() );
233 disconnect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
234 this, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
235 disconnect( aViewManager, SIGNAL( mouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ),
236 this, SLOT( onMouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ) );
237 disconnect( aViewManager, SIGNAL( mouseMove( SUIT_ViewWindow*, QMouseEvent* ) ),
238 this, SLOT( onMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
239 disconnect( aViewManager, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
240 this, SLOT( onLastViewClosed( SUIT_ViewManager* ) ) );
241 // restore normal mode in the viewer
242 OCCViewer_Utilities::setViewer2DMode( myOCCViewer, OCCViewer_ViewWindow::No2dMode );
243 // all local contexts should be closed if the viewer is not more used
244 setLocalPointContext( false, true );
247 myOCCViewer = theViewer;
249 OCCViewer_ViewManager* aViewManager = dynamic_cast<OCCViewer_ViewManager*>
250 ( myOCCViewer->getViewManager() );
251 connect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
252 this, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
253 connect( aViewManager, SIGNAL( mouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ),
254 this, SLOT( onMouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ) );
255 connect( aViewManager, SIGNAL( mouseMove( SUIT_ViewWindow*, QMouseEvent* ) ),
256 this, SLOT( onMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
257 connect( aViewManager, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
258 this, SLOT( onLastViewClosed( SUIT_ViewManager* ) ) );
259 OCCViewer_Utilities::setViewer2DMode( myOCCViewer, OCCViewer_ViewWindow::XYPlane );
264 * Returns current OCC viewer
266 OCCViewer_Viewer* CurveCreator_Widget::getOCCViewer()
272 * Returns OCC viewer context
274 Handle(AIS_InteractiveContext) CurveCreator_Widget::getAISContext()
276 Handle(AIS_InteractiveContext) aContext;
277 OCCViewer_Viewer* aViewer = getOCCViewer();
279 aContext = aViewer->getAISContext();
285 * Returns OCC viewer view port
287 OCCViewer_ViewPort3d* CurveCreator_Widget::getViewPort()
289 OCCViewer_ViewPort3d* aViewPort = 0;
290 OCCViewer_Viewer* aViewer = getOCCViewer();
292 aViewPort = ((OCCViewer_ViewWindow*)aViewer->getViewManager()->getActiveView())->getViewPort();
298 * Set interaction style in the OCC viewer
299 * \param theStyle a new style
300 * \return the previous style
302 int CurveCreator_Widget::changeInteractionStyle( int theStyle )
304 OCCViewer_Viewer* aViewer = getOCCViewer();
308 int aPrevStyle = aViewer->interactionStyle();
309 aViewer->setInteractionStyle( theStyle );
314 //=======================================================================
316 // purpose: reset the widget viewer, close local context, clear selection
317 //=======================================================================
318 void CurveCreator_Widget::reset()
322 void CurveCreator_Widget::setCurve( CurveCreator_ICurve* theCurve )
325 mySectionView->setCurve( myCurve );
326 myLocalPointView->setCurve( myCurve );
327 updateActionsStates();
331 void CurveCreator_Widget::onSelectionChanged()
333 updateActionsStates();
335 emit selectionChanged();
338 void CurveCreator_Widget::updateActionsStates()
340 QList<ActionId> anEnabledAct;
342 anEnabledAct << NEW_SECTION_ID << MODIFICATION_MODE_ID;
343 if ( removeEnabled() )
344 anEnabledAct << REMOVE_ID;
345 QList<int> aSelSections = mySectionView->getSelectedSections();
346 CurveCreator_TreeView::SelectionType aSelType = mySectionView->getSelectionType();
348 case CurveCreator_TreeView::ST_NOSEL:{
351 case CurveCreator_TreeView::ST_SECTIONS:{
352 /*if( aSelSections[0] > 0 ){
353 anEnabledAct << UP_ID;
355 if( aSelSections.size() == 1 ){
356 anEnabledAct << ADDITION_MODE_ID << DETECTION_MODE_ID;
358 switch ( getActionMode() ) {
362 QList<int> aSelSection = mySectionView->getSelectedSections();
363 if( aSelSection.size() > 0 ){
364 mySection = aSelSection[0];
365 myPointNum = myCurve->getNbPoints(mySection);
369 case ModificationMode: {
370 anEnabledAct << CLOSE_SECTIONS_ID << UNCLOSE_SECTIONS_ID << SET_SECTIONS_POLYLINE_ID << SET_SECTIONS_SPLINE_ID;
371 int aSectCnt = myCurve->getNbSections();
373 anEnabledAct << CLEAR_ALL_ID;
375 anEnabledAct << JOIN_ALL_ID;
376 if( aSelSections.size() > 1 ){
377 anEnabledAct << JOIN_ID;
381 case DetectionMode: {
386 int aSectCnt = myCurve->getNbSections();
388 anEnabledAct << JOIN_ALL_ID;
389 if( aSelSections.size() > 1 )
390 anEnabledAct << JOIN_ID;
396 /*if( aSelSections[ aSelSections.size() - 1 ] < ( myCurve->getNbSections() - 1 ) ){
397 anEnabledAct << DOWN_ID;
401 /*case CurveCreator_TreeView::ST_POINTS_ONE_SECTION:{
402 if( aSelPoints[0].second > 0 ){
403 anEnabledAct << UP_ID;
405 int aLastIndex = aSelPoints.size()-1;
406 int aSect = aSelPoints[0].first;
407 if( aSelPoints[aLastIndex].second < (myCurve->getNbPoints(aSect) - 1)){
408 anEnabledAct << DOWN_ID;
410 if( aSelPoints.size() == 1){
411 anEnabledAct << INSERT_POINT_BEFORE_ID << INSERT_POINT_AFTER_ID;
418 /*int aSelObjsCnt = aSelPoints.size() + aSelSections.size();
419 if( aSelObjsCnt > 0 ){
420 anEnabledAct << REMOVE_ID;
422 if( (myCurve->getNbSections() + myCurve->getNbPoints()) > 0 ){
423 anEnabledAct << REMOVE_ALL_ID;
425 if( myCurve->getNbSections() > 1 ){
426 anEnabledAct << JOIN_ALL_ID;
429 QList<ActionId> anIds = myActionMap.keys();
430 for( int i = 0 ; i < anIds.size() ; i++ ){
431 if( myActionMap.contains(anIds[i]) ){
432 if( anEnabledAct.contains(anIds[i]) ){
433 myActionMap[anIds[i]]->setEnabled(true);
436 myActionMap[anIds[i]]->setEnabled(false);
442 void CurveCreator_Widget::onAdditionMode(bool checked)
447 Handle(AIS_InteractiveContext) aContext = getAISContext();
448 if( !myCurve || aContext.IsNull() )
453 QList<int> aSelSection = mySectionView->getSelectedSections();
454 if( aSelSection.size() > 0 ){
455 mySection = aSelSection[0];
457 // emit subOperationStarted( myNewPointEditor );
460 void CurveCreator_Widget::onModificationMode(bool checked)
462 myLocalPointView->setVisible( checked );
465 void CurveCreator_Widget::onDetectionMode(bool checked)
469 void CurveCreator_Widget::onModeChanged(bool checked)
471 ActionMode aMode = NoneMode;
473 QAction* anAction = (QAction*)sender();
474 switch(myActionMap.key(anAction)) {
475 case ADDITION_MODE_ID:
476 aMode = AdditionMode;
477 if (myActionMap[MODIFICATION_MODE_ID]->isChecked())
478 myActionMap[MODIFICATION_MODE_ID]->trigger();
479 else if (myActionMap[DETECTION_MODE_ID]->isChecked())
480 myActionMap[DETECTION_MODE_ID]->trigger();
482 case MODIFICATION_MODE_ID:
483 aMode = ModificationMode;
484 if (myActionMap[ADDITION_MODE_ID]->isChecked())
485 myActionMap[ADDITION_MODE_ID]->trigger();
486 else if (myActionMap[DETECTION_MODE_ID]->isChecked())
487 myActionMap[DETECTION_MODE_ID]->trigger();
489 case DETECTION_MODE_ID:
490 aMode = DetectionMode;
491 if (myActionMap[ADDITION_MODE_ID]->isChecked())
492 myActionMap[ADDITION_MODE_ID]->trigger();
493 else if (myActionMap[MODIFICATION_MODE_ID]->isChecked())
494 myActionMap[MODIFICATION_MODE_ID]->trigger();
498 updateActionsStates();
500 setLocalPointContext( aMode == ModificationMode, true );
503 void CurveCreator_Widget::onNewSection()
509 myNewSectionEditor->clear();
510 myNewSectionEditor->setEditMode(false);
511 QString aSectName = QString( CurveCreator_UtilsICurve::getUniqSectionName( myCurve ).c_str() );
512 myNewSectionEditor->setSectionParameters(aSectName, true, CurveCreator::Polyline );
513 emit subOperationStarted( myNewSectionEditor, false );
516 void CurveCreator_Widget::onAddNewSection()
520 myCurve->addSection( myNewSectionEditor->getName().toStdString(),
521 myNewSectionEditor->getSectionType(),
522 myNewSectionEditor->isClosed() );
523 mySectionView->sectionAdded( -1 ); // add a new section to the end of list
524 QString aNewName = QString( CurveCreator_UtilsICurve::getUniqSectionName( myCurve ).c_str() );
525 myNewSectionEditor->setSectionName(aNewName);
526 updateActionsStates();
531 void CurveCreator_Widget::onCancelSection()
533 emit subOperationFinished( myNewSectionEditor );
536 QAction* CurveCreator_Widget::createAction( ActionId theId, const QString& theName, const QPixmap& theImage,
537 const QString& theToolTip, const QKeySequence& theShortcut )
539 QAction* anAct = new QAction(theName,this);
540 if( !theImage.isNull() ){
541 anAct->setIcon(theImage);
543 anAct->setShortcut(theShortcut);
544 anAct->setToolTip(theToolTip);
545 myActionMap[theId] = anAct;
549 QAction* CurveCreator_Widget::getAction( ActionId theId )
551 if( myActionMap.contains(theId) )
552 return myActionMap[theId];
556 QAction* CurveCreator_Widget::getAction( ActionMode theMode )
558 ActionId anActionId = NONE_ID;
561 anActionId = ADDITION_MODE_ID;
563 case ModificationMode:
564 anActionId = MODIFICATION_MODE_ID;
567 anActionId = DETECTION_MODE_ID;
572 QAction* anAction = 0;
573 if ( anActionId != NONE_ID && myActionMap.contains( anActionId ) )
574 anAction = myActionMap[anActionId];
578 void CurveCreator_Widget::onEditSection( int theSection )
584 mySection = theSection;
585 QString aSectName = QString::fromStdString( myCurve->getSectionName(theSection));
586 bool isClosed = myCurve->isClosed(theSection);
587 CurveCreator::SectionType aType = myCurve->getSectionType(theSection);
588 myNewSectionEditor->setEditMode(true);
589 myNewSectionEditor->setSectionParameters( aSectName, isClosed, aType );
591 emit subOperationStarted( myNewSectionEditor, true );
594 void CurveCreator_Widget::onModifySection()
598 QString aName = myNewSectionEditor->getName();
599 bool isClosed = myNewSectionEditor->isClosed();
600 CurveCreator::SectionType aSectType = myNewSectionEditor->getSectionType();
601 if( myCurve->getSectionName(mySection) != aName.toStdString() )
602 myCurve->setSectionName( mySection , aName.toStdString() );
604 if( myCurve->getSectionType(mySection) != aSectType )
605 myCurve->setSectionType( mySection, aSectType );
607 if( myCurve->isClosed(mySection) != isClosed )
608 myCurve->setClosed( mySection, isClosed );
609 mySectionView->sectionChanged(mySection);
614 void CurveCreator_Widget::onJoin()
618 QList<int> aSections = mySectionView->getSelectedSections();
619 if( aSections.size() == 0 ){
624 std::list<int> aSectionsToJoin;
625 for( int i = 0; i < aSections.size() ; i++ ){
626 aSectionsToJoin.push_back( aSections[i] );
628 //int aMainSect = aSectionsToJoin.front();
629 //int aMainSectSize = myCurve->getNbPoints(aMainSect);
630 if ( myCurve->join( aSectionsToJoin ) )
632 std::list<int>::const_iterator anIt = aSectionsToJoin.begin(),
633 aLast = aSectionsToJoin.end();
634 // the first section should be skipped. It is not removed, but is modified
636 for ( ; anIt != aLast; anIt++ )
637 mySectionView->sectionsRemoved( *anIt );
640 /* The update for the points of the main section
641 int aNewSectSize = myCurve->getNbPoints(aMainSect);
642 if( aNewSectSize != aMainSectSize )
643 mySectionView->pointsAdded( aMainSect, aMainSectSize, aNewSectSize-aMainSectSize );*/
647 void CurveCreator_Widget::onRemove()
652 switch( getActionMode() ) {
656 case ModificationMode:
664 void CurveCreator_Widget::onClearAll()
670 mySectionView->reset();
671 updateActionsStates();
675 void CurveCreator_Widget::onJoinAll()
681 std::list<int> aSectionsToJoin;
682 for( int i = 0, aNb = myCurve->getNbSections(); i < aNb ; i++ ){
683 aSectionsToJoin.push_back( i );
685 bool aRes = myCurve->join( aSectionsToJoin );
687 mySectionView->reset();
688 updateActionsStates();
692 void CurveCreator_Widget::onUndoSettings()
697 void CurveCreator_Widget::onSetSpline()
702 QList<int> aSelSections = mySectionView->getSelectedSections();
703 for( int i = 0 ; i < aSelSections.size() ; i++ ){
704 myCurve->setSectionType(aSelSections[i], CurveCreator::Spline );
705 mySectionView->sectionChanged(aSelSections[i]);
710 void CurveCreator_Widget::onSetPolyline()
715 QList<int> aSelSections = mySectionView->getSelectedSections();
716 for( int i = 0 ; i < aSelSections.size() ; i++ ){
717 myCurve->setSectionType( aSelSections[i], CurveCreator::Polyline );
718 mySectionView->sectionChanged( aSelSections[i] );
723 void CurveCreator_Widget::onCloseSections()
728 QList<int> aSelSections = mySectionView->getSelectedSections();
729 for( int i = 0 ; i < aSelSections.size() ; i++ ){
730 myCurve->setClosed(aSelSections[i], true);
731 mySectionView->sectionChanged(aSelSections[i]);
736 void CurveCreator_Widget::onUncloseSections()
741 QList<int> aSelSections = mySectionView->getSelectedSections();
742 for( int i = 0 ; i < aSelSections.size() ; i++ ){
743 myCurve->setClosed(aSelSections[i], false);
744 mySectionView->sectionChanged(aSelSections[i]);
749 void CurveCreator_Widget::onUndo()
754 CurveCreator_ICurve::SectionToPointList aPoints;
755 startCurveModification( aPoints, false );
757 finishCurveModification();
758 mySectionView->reset();
761 void CurveCreator_Widget::onRedo()
765 CurveCreator_ICurve::SectionToPointList aPoints;
766 startCurveModification( aPoints, false );
768 finishCurveModification();
769 mySectionView->reset();
772 void CurveCreator_Widget::updateUndoRedo()
776 QAction* anAct = myActionMap[UNDO_ID];
778 if( myCurve->getNbUndo() != 0 ){
779 anAct->setEnabled(true);
782 anAct->setDisabled(true);
785 anAct = myActionMap[REDO_ID];
787 if( myCurve->getNbRedo() != 0 ){
788 anAct->setEnabled(true);
791 anAct->setDisabled(true);
796 void CurveCreator_Widget::onContextMenu( QPoint thePoint )
798 QList<ActionId> aContextActions;
799 aContextActions << CLEAR_ALL_ID << JOIN_ID << JOIN_ALL_ID << SEPARATOR_ID <<
800 CLOSE_SECTIONS_ID << UNCLOSE_SECTIONS_ID << SET_SECTIONS_POLYLINE_ID <<
801 SET_SECTIONS_SPLINE_ID;
802 QPoint aGlPoint = mySectionView->mapToGlobal(thePoint);
804 QList<ActionId> aResAct;
805 for( int i = 0 ; i < aContextActions.size() ; i++ ){
806 if( aContextActions[i] != SEPARATOR_ID ){
807 if( myActionMap.contains(aContextActions[i]) ){
808 QAction* anAct = myActionMap[aContextActions[i]];
809 if( anAct->isEnabled() ){
810 aResAct << aContextActions[i];
816 aResAct << SEPARATOR_ID;
822 QMenu* aMenu = new QMenu(this);
823 for( int i = 0 ; i < aResAct.size() ; i++ ){
824 if( aResAct[i] == SEPARATOR_ID ){
825 aMenu->addSeparator();
828 QAction* anAct = myActionMap[aResAct[i]];
829 aMenu->insertAction(NULL, anAct);
832 aMenu->exec(aGlPoint);
835 QList<int> CurveCreator_Widget::getSelectedSections()
837 return mySectionView->getSelectedSections();
840 void CurveCreator_Widget::setSelectedSections( const QList<int>& theSections )
842 mySectionView->setSelectedSections( theSections );
843 updateActionsStates();
848 * According to the widget state, performs the remove action
850 void CurveCreator_Widget::removeSelected()
856 * Checks whether there are some selection to be removed
858 bool CurveCreator_Widget::removeEnabled()
860 bool isEnabled = getActionMode() == ModificationMode;
862 QList<int> aSelSections = mySectionView->getSelectedSections();
863 CurveCreator_TreeView::SelectionType aSelType = mySectionView->getSelectionType();
864 isEnabled = aSelType == CurveCreator_TreeView::ST_SECTIONS &&
865 aSelSections.size() == 1;
870 void CurveCreator_Widget::setActionMode( const ActionMode& theMode )
872 ActionMode aPrevMode = getActionMode();
873 QAction* aPrevAction = getAction( aPrevMode );
874 QAction* anAction = getAction( theMode );
879 if ( aPrevAction->isChecked() ) {
880 aPrevAction->setChecked( false );
883 if ( aPrevMode == ModificationMode )
884 onModificationMode( false );
885 if ( aPrevMode == AdditionMode )
886 onAdditionMode( false );
888 if ( theMode == AdditionMode )
890 anAction->setChecked( true );
891 onModeChanged( true );
896 case ModificationMode:
906 CurveCreator_Widget::ActionMode CurveCreator_Widget::getActionMode() const
908 ActionMode aMode = NoneMode;
910 if ( myActionMap[ADDITION_MODE_ID]->isChecked() )
911 aMode = AdditionMode;
912 else if ( myActionMap[MODIFICATION_MODE_ID]->isChecked() )
913 aMode = ModificationMode;
914 else if ( myActionMap[DETECTION_MODE_ID]->isChecked() )
915 aMode = DetectionMode;
920 //=================================================================================
921 // function : GeometryGUI::addCoordsByClick()
922 // purpose : Manage mouse press events in Additon mode
923 //=================================================================================
924 void CurveCreator_Widget::addCoordsByClick( QMouseEvent* pe )
926 if (pe->button() != Qt::LeftButton)
929 if ( pe->modifiers() != Qt::ControlModifier ) {
930 Handle(AIS_InteractiveContext) ic = getAISContext();
937 if ( pe->modifiers() == Qt::ShiftModifier )
938 ic->ShiftSelect(); // Append selection
940 ic->Select(); // New selection
943 OCCViewer_ViewPort3d* vp = getViewPort();
944 aPnt = CurveCreator_Utils::ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
946 // set the coordinates into dialog
947 CurveCreator::Coordinates aCoords;
948 aCoords.push_back( aPnt.X() );
949 aCoords.push_back( aPnt.Y() );
950 if ( myCurve->getDimension() == 3 ) {
951 aCoords.push_back( aPnt.Z() );
953 addNewPoint(aCoords);
958 * Manage mouse press events
959 * \param theWindow an owner of the signal
960 * \param theEvent a mouse event
962 void CurveCreator_Widget::onMousePress( SUIT_ViewWindow*, QMouseEvent* theEvent )
964 if ( theEvent->button() != Qt::LeftButton )
967 myPressedX = theEvent->x();
968 myPressedY = theEvent->y();
970 switch( getActionMode() ) {
971 case ModificationMode: {
972 //store initial cursor position for Drag&Drop
973 setDragStarted( true, theEvent->pos() );
977 addCoordsByClick( theEvent );
986 * Manage mouse release events in Modification mode
987 * \param theWindow an owner of the signal
988 * \param theEvent a mouse event
990 void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow*, QMouseEvent* theEvent )
992 if ( getActionMode() != ModificationMode )
995 if ( myDragStarted ) {
996 bool isDragged = myDragged;
997 CurveCreator_ICurve::SectionToPointList aDraggedPoints;
998 QMap<CurveCreator_ICurve::SectionToPoint, std::deque< float > > anInitialDragPointsCoords;
1000 aDraggedPoints = myDragPoints;
1001 anInitialDragPointsCoords = myInitialDragPointsCoords;
1004 setDragStarted( false );
1006 if ( aDraggedPoints.size() > 0 ) {
1007 // Collect old coordinates of the dragged points
1008 CurveCreator_ICurve::SectionToPointCoordsList anOldPoints;
1009 foreach ( const CurveCreator_ICurve::SectionToPoint aSectionToPoint, anInitialDragPointsCoords.keys() ) {
1010 CurveCreator::Coordinates aCoords = anInitialDragPointsCoords.value( aSectionToPoint );
1011 anOldPoints.push_back( std::make_pair( aSectionToPoint, aCoords ) );
1014 if ( myCurve->canPointsBeSorted() ) {
1015 // Add old coordinates of the curve points (except the dragged points) to the list
1016 for( int aSectionId = 0 ; aSectionId < myCurve->getNbSections() ; aSectionId++ ) {
1017 CurveCreator::Coordinates aCoords;
1018 for ( int aPointId = 0, aNb = myCurve->getNbPoints( aSectionId ); aPointId < aNb; aPointId++ ) {
1019 aCoords = myCurve->getPoint( aSectionId, aPointId );
1020 if ( aCoords.size() < 2 ) {
1024 CurveCreator_ICurve::SectionToPoint aSectionToPoint = std::make_pair( aSectionId, aPointId );
1026 if ( !anInitialDragPointsCoords.contains( aSectionToPoint ) ) {
1027 anOldPoints.push_back( std::make_pair( aSectionToPoint, aCoords ) );
1032 // Apply points sorting
1033 CurveCreator_ICurve::SectionToPointList aPoints;
1034 startCurveModification( aPoints, false );
1036 myCurve->setSkipSorting( false );
1038 CurveCreator_ICurve::SectionToPointCoordsList aCoordList;
1039 CurveCreator_ICurve::SectionToPointList::const_iterator anIt = aDraggedPoints.begin(),
1040 aLast = aDraggedPoints.end();
1041 for ( ; anIt != aLast; anIt++ ) {
1042 int aSectionId = anIt->first;
1043 int aPointId = anIt->second;
1044 std::deque<float> aPos = myCurve->getPoint( aSectionId, aPointId );
1046 aCoordList.push_back(
1047 std::make_pair( std::make_pair( aSectionId, aPointId ), aPos ) );
1050 myCurve->setSeveralPoints( aCoordList, false );
1052 finishCurveModification( aDraggedPoints );
1054 // if the drag of some points has happened, restore the drag selection
1056 setSelectedPoints( aDraggedPoints );
1057 END_MEASURE_TIME( "drop" );
1060 // Save drag difference
1061 myCurve->saveCoordDiff( anOldPoints );
1064 else // check whether the segment is clicked an a new point should be added to the segment
1066 int aReleasedX = theEvent->x();
1067 int aReleasedY = theEvent->y();
1068 if ( myPressedX == aReleasedX && myPressedY == aReleasedY )
1069 insertPointToSelectedSegment( aReleasedX, aReleasedY );
1072 // updates the input panel table to show the selected point coordinates
1073 updateLocalPointView();
1078 * Manage mouse move events in Modification mode
1079 * \param theWindow an owner of the signal
1080 * \param theEvent a mouse event
1082 void CurveCreator_Widget::onMouseMove( SUIT_ViewWindow*, QMouseEvent* theEvent )
1084 if ( getActionMode() != ModificationMode || !myDragStarted )
1087 QPoint aPos = theEvent->pos();
1088 if ( (aPos - myDragStartPosition).manhattanLength() < QApplication::startDragDistance() )
1093 moveSelectedPoints( aPos.x(), aPos.y() );
1094 myDragStartPosition = aPos;
1096 END_MEASURE_TIME( "drag" );
1100 * Set zero viewer by the last view closed in
1101 * \param theManager a viewer manager
1103 void CurveCreator_Widget::onLastViewClosed( SUIT_ViewManager* theManager )
1108 void CurveCreator_Widget::onMousePress( QMouseEvent* theEvent )
1110 onMousePress( 0, theEvent );
1113 void CurveCreator_Widget::onMouseRelease( QMouseEvent* theEvent )
1115 onMouseRelease( 0, theEvent );
1118 void CurveCreator_Widget::onMouseMove( QMouseEvent* theEvent )
1120 onMouseMove( 0, theEvent );
1123 void CurveCreator_Widget::onCellChanged( int theRow, int theColumn )
1125 int aCurrSect = myLocalPointView->getSectionId( theRow );
1126 int aPntIndex = myLocalPointView->getPointId( theRow );
1128 if ( aPntIndex < 0 )
1131 CurveCreator_ICurve::SectionToPointList aSelPoints;
1132 startCurveModification( aSelPoints );
1134 double aX = myLocalPointView->item( theRow, 2 )->data( Qt::UserRole ).toDouble();
1135 double anY = myLocalPointView->item( theRow, 3 )->data( Qt::UserRole ).toDouble();
1136 std::deque<float> aChangedPos;
1137 aChangedPos.push_back( aX );
1138 aChangedPos.push_back( anY );
1139 myCurve->setPoint( aCurrSect, aPntIndex, aChangedPos );
1141 finishCurveModification( aSelPoints );
1145 * Removes a selected section from the curve. Updates undo/redo status
1147 void CurveCreator_Widget::removeSection()
1151 QList<int> aSections = mySectionView->getSelectedSections();
1152 for( int i = 0 ; i < aSections.size() ; i++ ){
1153 int aSectNum = aSections[i] - (i);
1154 myCurve->removeSection( aSectNum );
1155 mySectionView->sectionsRemoved( aSectNum );
1157 mySectionView->clearSelection();
1162 * Removes a selected points from the curve. Updates undo/redo status
1164 void CurveCreator_Widget::removePoint()
1166 CurveCreator_ICurve::SectionToPointList aPoints;
1167 getSelectedPoints( aPoints );
1168 if ( aPoints.size() == 0 )
1171 CurveCreator_ICurve::SectionToPointList aSelPoints;
1172 startCurveModification( aSelPoints, false );
1174 myCurve->removeSeveralPoints( aPoints );
1175 finishCurveModification( CurveCreator_ICurve::SectionToPointList() );
1178 void CurveCreator_Widget::addNewPoint(const CurveCreator::Coordinates& theCoords)
1182 QList<int> aSections = mySectionView->getSelectedSections();
1183 if( aSections.size() == 0 ){
1186 int aSection = aSections[0];
1187 myCurve->addPoints(theCoords, aSection); // add to the end of section
1188 mySectionView->pointsAdded( aSection, myCurve->getNbPoints( aSection ) );
1189 updateActionsStates();
1193 void CurveCreator_Widget::insertPointToSelectedSegment( const int theX,
1196 Handle(AIS_InteractiveContext) aContext = getAISContext();
1198 OCCViewer_ViewPort3d* aViewPort = getViewPort();
1199 Handle(V3d_View) aView;
1201 aView = aViewPort->getView();
1203 if ( aContext.IsNull() || aView.IsNull() )
1206 gp_Pnt aPoint1, aPoint2;
1207 Handle(AIS_InteractiveObject) anAISObject = myCurve->getAISObject();
1208 bool isFoundPoint = CurveCreator_Utils::pointOnObject( aView, anAISObject, theX, theY,
1209 aPoint, aPoint1, aPoint2 );
1210 if ( !isFoundPoint )
1213 // insert the point to the model curve
1214 CurveCreator_ICurve::SectionToPointList aSelPoints;
1215 startCurveModification( aSelPoints );
1217 CurveCreator::Coordinates aCoords;
1218 aCoords.push_back( aPoint.X() );
1219 aCoords.push_back( aPoint.Y() );
1221 CurveCreator_ICurve::SectionToPointList aPoints1, aPoints2;
1222 findSectionsToPoints( aPoint1.X(), aPoint1.Y(), aPoints1 );
1223 findSectionsToPoints( aPoint2.X(), aPoint2.Y(), aPoints2 );
1224 CurveCreator_ICurve::SectionToPointList::const_iterator anIt = aPoints1.begin(),
1225 aLast = aPoints1.end();
1226 int aSectionId = -1;
1227 // find the indices of the neighbour point
1228 // there can be a case when a new point is added into two sections
1229 int aPoint1Id = -1, aPoint2Id = -1;
1230 for ( ; anIt != aLast && aSectionId < 0; anIt++ ) {
1231 int aSectionCur = anIt->first;
1232 CurveCreator_ICurve::SectionToPointList::const_iterator anIt2 = aPoints2.begin(),
1233 aLast2 = aPoints2.end();
1234 for ( ; anIt2 != aLast2 && aSectionId < 0; anIt2++ ) {
1235 if ( anIt2->first == aSectionCur ) {
1236 aSectionId = aSectionCur;
1237 aPoint1Id = anIt->second;
1238 aPoint2Id = anIt2->second;
1243 int anInsertPos = -1;
1244 int aLastPoint = myCurve->getNbPoints( aSectionId )-1;
1245 if ( ( aPoint1Id == aLastPoint && aPoint2Id == 0 ) ||
1246 ( aPoint2Id == aLastPoint && aPoint1Id == 0 ) )
1247 anInsertPos = -1; // if the section happens between first and last points
1249 anInsertPos = aPoint1Id < aPoint2Id ? aPoint1Id + 1 : aPoint2Id + 1;
1251 myCurve->addPoints( aCoords, aSectionId, anInsertPos );
1252 mySectionView->pointsAdded( aSectionId, myCurve->getNbPoints( aSectionId ) );
1254 finishCurveModification( aSelPoints );
1256 setSelectedPoints();
1259 void CurveCreator_Widget::moveSelectedPoints( const int theXPosition,
1260 const int theYPosition )
1262 OCCViewer_ViewPort3d* aViewPort = getViewPort();
1266 CurveCreator_ICurve::SectionToPointList aPoints;
1267 startCurveModification( aPoints, false );
1269 gp_Pnt aStartPnt = CurveCreator_Utils::ConvertClickToPoint( myDragStartPosition.x(),
1270 myDragStartPosition.y(),
1271 aViewPort->getView() );
1272 gp_Pnt anEndPnt = CurveCreator_Utils::ConvertClickToPoint( theXPosition, theYPosition,
1273 aViewPort->getView() );
1274 double aXDelta = aStartPnt.X() - anEndPnt.X();
1275 double anYDelta = aStartPnt.Y() - anEndPnt.Y();
1277 CurveCreator_ICurve::SectionToPointCoordsList aCoordList;
1278 std::deque<float> aChangedPos;
1279 CurveCreator_ICurve::SectionToPointList::const_iterator anIt = myDragPoints.begin(),
1280 aLast = myDragPoints.end();
1281 for ( ; anIt != aLast; anIt++ ) {
1282 int aSectionId = anIt->first;
1283 int aPointId = anIt->second;
1284 aChangedPos = myCurve->getPoint( aSectionId, aPointId );
1285 if ( aChangedPos.size() < 2 )
1288 // Remember drag points coordinates
1290 myInitialDragPointsCoords.insert( std::make_pair( aSectionId, aPointId ), aChangedPos );
1293 aChangedPos[0] = aChangedPos[0] - aXDelta;
1294 aChangedPos[1] = aChangedPos[1] - anYDelta;
1296 aCoordList.push_back(
1297 std::make_pair(std::make_pair( aSectionId, aPointId ),
1300 myCurve->setSeveralPoints( aCoordList, false );
1303 finishCurveModification( myDragPoints );
1306 void CurveCreator_Widget::updateLocalPointView()
1308 if ( myDragStarted )
1310 Handle(AIS_InteractiveContext) aContext = getAISContext();
1311 if ( aContext.IsNull() )
1314 CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints );
1315 int aNbPoints = myLocalPoints.size();
1317 bool isRowLimit = aNbPoints > myLocalPointRowLimit;
1318 myLocalPointView->setVisible( getActionMode() == ModificationMode && !isRowLimit );
1320 if ( !isRowLimit ) {
1321 bool isBlocked = myLocalPointView->blockSignals(true);
1323 myLocalPointView->setLocalPointsToTable( myLocalPoints );
1325 myLocalPointView->blockSignals( isBlocked );
1332 void CurveCreator_Widget::setLocalPointContext( const bool theOpen, const bool isUpdateTable )
1334 CurveCreator_Utils::setLocalPointContext( myCurve, getAISContext(), theOpen );
1335 if ( !theOpen && isUpdateTable )
1336 updateLocalPointView();
1340 * Set drag operation started. Save the position and a list of dragged points
1341 * \param theState the drag operation state: started/finished
1342 * \param thePoint the start drag position
1344 void CurveCreator_Widget::setDragStarted( const bool theState, const QPoint& thePoint )
1347 getSelectedPoints( myDragPoints );
1349 myDragStarted = myDragPoints.size();
1350 myDragStartPosition = thePoint;
1351 if ( myDragStarted ) {
1352 // change a viewer interaction style in order to avoid a select rectangle build
1353 myDragInteractionStyle = changeInteractionStyle( SUIT_ViewModel::KEY_FREE );
1354 myCurve->setSkipSorting( true );
1358 if ( myDragStarted )
1359 changeInteractionStyle( myDragInteractionStyle );
1360 myDragStarted = false;
1361 myDragPoints.clear();
1362 myInitialDragPointsCoords.clear();
1367 void CurveCreator_Widget::getSelectedPoints( CurveCreator_ICurve::SectionToPointList& thePoints )
1370 thePoints = myLocalPoints;
1373 void CurveCreator_Widget::setSelectedPoints( const CurveCreator_ICurve::SectionToPointList& thePoints )
1375 if ( myDragStarted )
1377 Handle(AIS_InteractiveContext) aContext = getAISContext();
1378 if ( aContext.IsNull() || !aContext->HasOpenedContext() )
1381 CurveCreator_Utils::setSelectedPoints( aContext, myCurve, thePoints );
1383 updateLocalPointView();
1386 void CurveCreator_Widget::stopActionMode()
1388 setActionMode( NoneMode );
1392 * Get viewer information before perform the curve modification.
1393 * Take a list of selected cuve points an close local context.
1394 * The context should be closed because the curve presentation is
1395 * redisplayed and if it is not closed, when we close the local context
1396 * later, the presentation shown in the local context is disappeared.
1397 * \param thePoints an output list of curve selected points
1398 * \param theFillPoints a flag whether the selection list should be filled
1400 void CurveCreator_Widget::startCurveModification(
1401 CurveCreator_ICurve::SectionToPointList& thePoints,
1402 const bool theFillPoints )
1404 if ( theFillPoints ) {
1406 getSelectedPoints( thePoints );
1408 setLocalPointContext( false );
1412 * Restore the viewer state after the curve modification is done.
1413 * Open local context and select given points inside it.
1414 * \param thePoints a list of curve selected points
1416 void CurveCreator_Widget::finishCurveModification(
1417 const CurveCreator_ICurve::SectionToPointList& thePoints )
1419 if ( getActionMode() == ModificationMode )
1420 setLocalPointContext( true );
1421 setSelectedPoints( thePoints );
1426 * Returns a point index in the model curve by the point coordinates in the viewer
1427 * \param theX the X coordinate of the point
1428 * \param theY the Y coordinate of the point
1430 int CurveCreator_Widget::findLocalPointIndex( int theSectionId, float theX, float theY )
1432 return CurveCreator_UtilsICurve::findLocalPointIndex( myCurve, theSectionId, theX, theY );
1435 void CurveCreator_Widget::findSectionsToPoints( const double theX, const double theY,
1436 CurveCreator_ICurve::SectionToPointList& thePoints )
1438 return CurveCreator_UtilsICurve::findSectionsToPoints( myCurve, theX, theY, thePoints );
1441 void CurveCreator_Widget::convert( const CurveCreator_ICurve::SectionToPointList& thePoints,
1442 QMap<int, QList<int> >& theConvPoints )
1444 return CurveCreator_UtilsICurve::convert( thePoints, theConvPoints );
1448 * Returns whethe the container has the value
1449 * \param theList a container of values
1450 * \param theValue a value
1452 bool CurveCreator_Widget::contains( const CurveCreator_ICurve::SectionToPointList& theList,
1453 const CurveCreator_ICurve::SectionToPoint& theValue ) const
1455 return CurveCreator_UtilsICurve::contains( theList, theValue );