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,
82 const QStringList& theCoordTitles,
84 int theLocalPointRowLimit )
85 : QWidget(parent), myNewSectionEditor(NULL), myCurve(theCurve), mySection(0),
86 myDragStarted( false ), myDragInteractionStyle( SUIT_ViewModel::STANDARD ),
87 myOCCViewer( 0 ), myLocalPointRowLimit( theLocalPointRowLimit )
89 bool isToEnableClosed = !( theActionFlags & DisableClosedSection );
90 myNewSectionEditor = new CurveCreator_NewSectionDlg( this, isToEnableClosed );
91 myNewSectionEditor->hide();
92 connect( myNewSectionEditor, SIGNAL(addSection()), this, SLOT(onAddNewSection()) );
93 connect( myNewSectionEditor, SIGNAL(modifySection()), this, SLOT(onModifySection()) );
94 connect( myNewSectionEditor, SIGNAL(cancelSection()), this, SLOT(onCancelSection()) );
96 QGroupBox* aSectionGroup = new QGroupBox(tr("Sections"),this);
98 mySectionView = new CurveCreator_TreeView(myCurve, aSectionGroup);
99 mySectionView->setSelectionMode( QTreeView::ExtendedSelection );
100 connect( mySectionView, SIGNAL(selectionChanged()), this, SLOT( onSelectionChanged() ) );
101 connect( mySectionView, SIGNAL(sectionEntered(int)), this, SLOT(onEditSection(int)) );
102 connect( mySectionView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onContextMenu(QPoint)) );
104 myLocalPointView = new CurveCreator_TableView( myCurve, this, theCoordTitles );
105 connect( myLocalPointView, SIGNAL( cellChanged( int, int ) ),
106 this, SLOT( onCellChanged( int, int ) ) );
108 QToolBar* aTB = new QToolBar(tr("TOOL_BAR_TLT"), aSectionGroup);
109 // QToolButton* anUndoBtn = new QToolButton(aTB);
111 SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
112 QPixmap anUndoPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_UNDO")));
113 QPixmap aRedoPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_REDO")));
114 QPixmap aNewSectionPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_NEW_SECTION")));
115 QPixmap aNewPointPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_NEW_POINT")));
116 QPixmap anEditPointsPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_EDIT_POINTS")));
117 QPixmap aDetectPointsPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_EDIT_POINTS")));
118 QPixmap aPolylinePixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_POLYLINE")));
119 QPixmap aSplinePixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_SPLINE")));
120 QPixmap aRemovePixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_DELETE")));
121 QPixmap aJoinPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_JOIN")));
122 QPixmap aStepUpPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_ARROW_UP")));
123 QPixmap aStepDownPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_ARROW_DOWN")));
125 QAction* anAct = createAction( UNDO_ID, tr("UNDO"), anUndoPixmap, tr("UNDO_TLT"),
126 QKeySequence(Qt::ControlModifier|Qt::Key_Z) );
127 connect(anAct, SIGNAL(triggered()), this, SLOT(onUndo()) );
128 aTB->addAction(anAct);
130 anAct = createAction( REDO_ID, tr("REDO"), aRedoPixmap, tr("REDO_TLT"),
131 QKeySequence(Qt::ControlModifier|Qt::Key_Y) );
132 connect(anAct, SIGNAL(triggered()), this, SLOT(onRedo()) );
133 aTB->addAction(anAct);
137 anAct = createAction( NEW_SECTION_ID, tr("NEW_SECTION"), aNewSectionPixmap, tr("NEW_SECTION_TLT"),
138 QKeySequence(Qt::ControlModifier|Qt::Key_N) );
139 connect(anAct, SIGNAL(triggered()), this, SLOT(onNewSection()) );
140 if ( !(theActionFlags & DisableNewSection) ) {
141 aTB->addAction(anAct);
145 anAct = createAction( ADDITION_MODE_ID, tr("ADDITION_MODE"), aNewPointPixmap, tr("ADDITION_MODE_TLT"),
147 anAct->setCheckable(true);
148 connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onAdditionMode(bool)) );
149 connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
150 aTB->addAction(anAct);
152 anAct = createAction( MODIFICATION_MODE_ID, tr("MODIFICATION_MODE"), anEditPointsPixmap, tr("MODIFICATION_MODE_TLT"),
154 anAct->setCheckable(true);
155 connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onModificationMode(bool)) );
156 connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
157 aTB->addAction(anAct);
159 anAct = createAction( DETECTION_MODE_ID, tr("DETECTION_MODE"), aDetectPointsPixmap, tr("DETECTION_MODE_TLT"),
161 anAct->setCheckable(true);
162 connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onDetectionMode(bool)) );
163 connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
164 if ( !(theActionFlags & DisableDetectionMode) ) {
165 aTB->addAction(anAct);
168 anAct = createAction( CLOSE_SECTIONS_ID, tr("CLOSE_SECTIONS"), QPixmap(), tr("CLOSE_SECTIONS_TLT"),
169 QKeySequence(Qt::ControlModifier|Qt::Key_W) );
170 connect(anAct, SIGNAL(triggered()), this, SLOT(onCloseSections()) );
172 anAct = createAction( UNCLOSE_SECTIONS_ID, tr("UNCLOSE_SECTIONS"), QPixmap(),
173 tr("UNCLOSE_SECTIONS_TLT"), QKeySequence(Qt::ControlModifier|Qt::Key_S) );
174 connect(anAct, SIGNAL(triggered()), this, SLOT(onUncloseSections()) );
176 anAct = createAction( SET_SECTIONS_POLYLINE_ID, tr("SET_SECTIONS_POLYLINE"),
177 aPolylinePixmap, tr("SET_POLYLINE_TLT"),
178 QKeySequence(Qt::ControlModifier|Qt::Key_E) );
179 connect(anAct, SIGNAL(triggered()), this, SLOT(onSetPolyline()) );
181 anAct = createAction( SET_SECTIONS_SPLINE_ID, tr("SET_SECTIONS_SPLINE"), aSplinePixmap,
182 tr("SET_SPLINE_TLT"), QKeySequence(Qt::ControlModifier|Qt::Key_R) );
183 connect(anAct, SIGNAL(triggered()), this, SLOT(onSetSpline()) );
185 anAct = createAction( REMOVE_ID, tr("REMOVE"), aRemovePixmap, tr("REMOVE_TLT"),
186 QKeySequence(Qt::ControlModifier|Qt::Key_Delete ) );
187 connect(anAct, SIGNAL(triggered()), this, SLOT(onRemove()) );
188 aTB->addAction(anAct);
192 anAct = createAction( JOIN_ID, tr("JOIN"), aJoinPixmap, tr("JOIN_TLT"),
193 QKeySequence(Qt::ControlModifier|Qt::Key_Plus ) );
194 connect( anAct, SIGNAL(triggered()), this, SLOT(onJoin()) );
195 aTB->addAction(anAct);
197 anAct = createAction( CLEAR_ALL_ID, tr("CLEAR_ALL"), QPixmap(), tr("CLEAR_ALL_TLT"),
198 QKeySequence(Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Delete ) );
199 connect( anAct, SIGNAL(triggered()), this, SLOT( onClearAll()) );
201 anAct = createAction( JOIN_ALL_ID, tr("JOIN_ALL"), QPixmap(), tr("JOIN_ALL_TLT"),
202 QKeySequence(Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Plus ) );
203 connect( anAct, SIGNAL(triggered()), this, SLOT(onJoinAll()) );
205 QVBoxLayout* aSectLayout = new QVBoxLayout();
206 aSectLayout->setMargin( 5 );
207 aSectLayout->setSpacing( 5 );
208 aSectLayout->addWidget(aTB);
209 aSectLayout->addWidget(mySectionView);
210 aSectLayout->addWidget( myLocalPointView );
211 aSectionGroup->setLayout(aSectLayout);
212 QVBoxLayout* aLay = new QVBoxLayout();
213 aLay->setMargin( 0 );
214 aLay->setSpacing( 5 );
215 // aLay->addLayout(aNameLayout);
216 aLay->addWidget(aSectionGroup);
219 updateActionsStates();
226 void CurveCreator_Widget::setOCCViewer( OCCViewer_Viewer* theViewer )
228 if ( myOCCViewer == theViewer )
232 OCCViewer_ViewManager* aViewManager = dynamic_cast<OCCViewer_ViewManager*>
233 ( myOCCViewer->getViewManager() );
234 disconnect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
235 this, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
236 disconnect( aViewManager, SIGNAL( mouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ),
237 this, SLOT( onMouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ) );
238 disconnect( aViewManager, SIGNAL( mouseMove( SUIT_ViewWindow*, QMouseEvent* ) ),
239 this, SLOT( onMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
240 disconnect( aViewManager, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
241 this, SLOT( onLastViewClosed( SUIT_ViewManager* ) ) );
242 // restore normal mode in the viewer
243 OCCViewer_Utilities::setViewer2DMode( myOCCViewer, OCCViewer_ViewWindow::No2dMode );
244 // all local contexts should be closed if the viewer is not more used
245 setLocalPointContext( false, true );
248 myOCCViewer = theViewer;
250 OCCViewer_ViewManager* aViewManager = dynamic_cast<OCCViewer_ViewManager*>
251 ( myOCCViewer->getViewManager() );
252 connect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
253 this, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
254 connect( aViewManager, SIGNAL( mouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ),
255 this, SLOT( onMouseRelease( SUIT_ViewWindow*, QMouseEvent* ) ) );
256 connect( aViewManager, SIGNAL( mouseMove( SUIT_ViewWindow*, QMouseEvent* ) ),
257 this, SLOT( onMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
258 connect( aViewManager, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
259 this, SLOT( onLastViewClosed( SUIT_ViewManager* ) ) );
260 OCCViewer_Utilities::setViewer2DMode( myOCCViewer, OCCViewer_ViewWindow::XYPlane );
265 * Returns current OCC viewer
267 OCCViewer_Viewer* CurveCreator_Widget::getOCCViewer()
273 * Returns OCC viewer context
275 Handle(AIS_InteractiveContext) CurveCreator_Widget::getAISContext()
277 Handle(AIS_InteractiveContext) aContext;
278 OCCViewer_Viewer* aViewer = getOCCViewer();
280 aContext = aViewer->getAISContext();
286 * Returns OCC viewer view port
288 OCCViewer_ViewPort3d* CurveCreator_Widget::getViewPort()
290 OCCViewer_ViewPort3d* aViewPort = 0;
291 OCCViewer_Viewer* aViewer = getOCCViewer();
293 aViewPort = ((OCCViewer_ViewWindow*)aViewer->getViewManager()->getActiveView())->getViewPort();
299 * Set interaction style in the OCC viewer
300 * \param theStyle a new style
301 * \return the previous style
303 int CurveCreator_Widget::changeInteractionStyle( int theStyle )
305 OCCViewer_Viewer* aViewer = getOCCViewer();
309 int aPrevStyle = aViewer->interactionStyle();
310 aViewer->setInteractionStyle( theStyle );
315 //=======================================================================
317 // purpose: reset the widget viewer, close local context, clear selection
318 //=======================================================================
319 void CurveCreator_Widget::reset()
323 void CurveCreator_Widget::setCurve( CurveCreator_ICurve* theCurve )
326 mySectionView->setCurve( myCurve );
327 myLocalPointView->setCurve( myCurve );
328 updateActionsStates();
332 void CurveCreator_Widget::onSelectionChanged()
334 updateActionsStates();
336 emit selectionChanged();
339 void CurveCreator_Widget::updateActionsStates()
341 QList<ActionId> anEnabledAct;
343 anEnabledAct << NEW_SECTION_ID << MODIFICATION_MODE_ID;
344 if ( removeEnabled() )
345 anEnabledAct << REMOVE_ID;
346 QList<int> aSelSections = mySectionView->getSelectedSections();
347 CurveCreator_TreeView::SelectionType aSelType = mySectionView->getSelectionType();
349 case CurveCreator_TreeView::ST_NOSEL:{
352 case CurveCreator_TreeView::ST_SECTIONS:{
353 /*if( aSelSections[0] > 0 ){
354 anEnabledAct << UP_ID;
356 if( aSelSections.size() == 1 ){
357 anEnabledAct << ADDITION_MODE_ID << DETECTION_MODE_ID;
359 switch ( getActionMode() ) {
363 QList<int> aSelSection = mySectionView->getSelectedSections();
364 if( aSelSection.size() > 0 ){
365 mySection = aSelSection[0];
366 myPointNum = myCurve->getNbPoints(mySection);
370 case ModificationMode: {
371 if ( myNewSectionEditor->isEnableClosed() )
372 anEnabledAct << CLOSE_SECTIONS_ID << UNCLOSE_SECTIONS_ID;
373 anEnabledAct << SET_SECTIONS_POLYLINE_ID << SET_SECTIONS_SPLINE_ID;
374 int aSectCnt = myCurve->getNbSections();
376 anEnabledAct << CLEAR_ALL_ID;
378 anEnabledAct << JOIN_ALL_ID;
379 if( aSelSections.size() > 1 ){
380 anEnabledAct << JOIN_ID;
384 case DetectionMode: {
389 int aSectCnt = myCurve->getNbSections();
391 anEnabledAct << JOIN_ALL_ID;
392 if( aSelSections.size() > 1 )
393 anEnabledAct << JOIN_ID;
399 /*if( aSelSections[ aSelSections.size() - 1 ] < ( myCurve->getNbSections() - 1 ) ){
400 anEnabledAct << DOWN_ID;
404 /*case CurveCreator_TreeView::ST_POINTS_ONE_SECTION:{
405 if( aSelPoints[0].second > 0 ){
406 anEnabledAct << UP_ID;
408 int aLastIndex = aSelPoints.size()-1;
409 int aSect = aSelPoints[0].first;
410 if( aSelPoints[aLastIndex].second < (myCurve->getNbPoints(aSect) - 1)){
411 anEnabledAct << DOWN_ID;
413 if( aSelPoints.size() == 1){
414 anEnabledAct << INSERT_POINT_BEFORE_ID << INSERT_POINT_AFTER_ID;
421 /*int aSelObjsCnt = aSelPoints.size() + aSelSections.size();
422 if( aSelObjsCnt > 0 ){
423 anEnabledAct << REMOVE_ID;
425 if( (myCurve->getNbSections() + myCurve->getNbPoints()) > 0 ){
426 anEnabledAct << REMOVE_ALL_ID;
428 if( myCurve->getNbSections() > 1 ){
429 anEnabledAct << JOIN_ALL_ID;
432 QList<ActionId> anIds = myActionMap.keys();
433 for( int i = 0 ; i < anIds.size() ; i++ ){
434 if( myActionMap.contains(anIds[i]) ){
435 if( anEnabledAct.contains(anIds[i]) ){
436 myActionMap[anIds[i]]->setEnabled(true);
439 myActionMap[anIds[i]]->setEnabled(false);
445 void CurveCreator_Widget::onAdditionMode(bool checked)
450 Handle(AIS_InteractiveContext) aContext = getAISContext();
451 if( !myCurve || aContext.IsNull() )
456 QList<int> aSelSection = mySectionView->getSelectedSections();
457 if( aSelSection.size() > 0 ){
458 mySection = aSelSection[0];
460 // emit subOperationStarted( myNewPointEditor );
463 void CurveCreator_Widget::onModificationMode(bool checked)
465 myLocalPointView->setVisible( checked );
468 void CurveCreator_Widget::onDetectionMode(bool checked)
472 void CurveCreator_Widget::onModeChanged(bool checked)
474 ActionMode aMode = NoneMode;
476 QAction* anAction = (QAction*)sender();
477 switch(myActionMap.key(anAction)) {
478 case ADDITION_MODE_ID:
479 aMode = AdditionMode;
480 if (myActionMap[MODIFICATION_MODE_ID]->isChecked())
481 myActionMap[MODIFICATION_MODE_ID]->trigger();
482 else if (myActionMap[DETECTION_MODE_ID]->isChecked())
483 myActionMap[DETECTION_MODE_ID]->trigger();
485 case MODIFICATION_MODE_ID:
486 aMode = ModificationMode;
487 if (myActionMap[ADDITION_MODE_ID]->isChecked())
488 myActionMap[ADDITION_MODE_ID]->trigger();
489 else if (myActionMap[DETECTION_MODE_ID]->isChecked())
490 myActionMap[DETECTION_MODE_ID]->trigger();
492 case DETECTION_MODE_ID:
493 aMode = DetectionMode;
494 if (myActionMap[ADDITION_MODE_ID]->isChecked())
495 myActionMap[ADDITION_MODE_ID]->trigger();
496 else if (myActionMap[MODIFICATION_MODE_ID]->isChecked())
497 myActionMap[MODIFICATION_MODE_ID]->trigger();
501 updateActionsStates();
503 setLocalPointContext( aMode == ModificationMode, true );
506 void CurveCreator_Widget::onNewSection()
512 myNewSectionEditor->clear();
513 myNewSectionEditor->setEditMode(false);
514 QString aSectName = QString( CurveCreator_UtilsICurve::getUniqSectionName( myCurve ).c_str() );
515 myNewSectionEditor->setSectionParameters(aSectName, true, CurveCreator::Polyline );
516 emit subOperationStarted( myNewSectionEditor, false );
519 void CurveCreator_Widget::onAddNewSection()
523 myCurve->addSection( myNewSectionEditor->getName().toStdString(),
524 myNewSectionEditor->getSectionType(),
525 myNewSectionEditor->isClosed() );
526 mySectionView->sectionAdded( -1 ); // add a new section to the end of list
527 QString aNewName = QString( CurveCreator_UtilsICurve::getUniqSectionName( myCurve ).c_str() );
528 myNewSectionEditor->setSectionName(aNewName);
529 updateActionsStates();
534 void CurveCreator_Widget::onCancelSection()
536 emit subOperationFinished( myNewSectionEditor );
539 QAction* CurveCreator_Widget::createAction( ActionId theId, const QString& theName, const QPixmap& theImage,
540 const QString& theToolTip, const QKeySequence& theShortcut )
542 QAction* anAct = new QAction(theName,this);
543 if( !theImage.isNull() ){
544 anAct->setIcon(theImage);
546 anAct->setShortcut(theShortcut);
547 anAct->setToolTip(theToolTip);
548 myActionMap[theId] = anAct;
552 QAction* CurveCreator_Widget::getAction( ActionId theId )
554 if( myActionMap.contains(theId) )
555 return myActionMap[theId];
559 QAction* CurveCreator_Widget::getAction( ActionMode theMode )
561 ActionId anActionId = NONE_ID;
564 anActionId = ADDITION_MODE_ID;
566 case ModificationMode:
567 anActionId = MODIFICATION_MODE_ID;
570 anActionId = DETECTION_MODE_ID;
575 QAction* anAction = 0;
576 if ( anActionId != NONE_ID && myActionMap.contains( anActionId ) )
577 anAction = myActionMap[anActionId];
581 void CurveCreator_Widget::onEditSection( int theSection )
587 mySection = theSection;
588 QString aSectName = QString::fromStdString( myCurve->getSectionName(theSection));
589 bool isClosed = myCurve->isClosed(theSection);
590 CurveCreator::SectionType aType = myCurve->getSectionType(theSection);
591 myNewSectionEditor->setEditMode(true);
592 myNewSectionEditor->setSectionParameters( aSectName, isClosed, aType );
594 emit subOperationStarted( myNewSectionEditor, true );
597 void CurveCreator_Widget::onModifySection()
601 QString aName = myNewSectionEditor->getName();
602 bool isClosed = myNewSectionEditor->isClosed();
603 CurveCreator::SectionType aSectType = myNewSectionEditor->getSectionType();
604 if( myCurve->getSectionName(mySection) != aName.toStdString() )
605 myCurve->setSectionName( mySection , aName.toStdString() );
607 if( myCurve->getSectionType(mySection) != aSectType )
608 myCurve->setSectionType( mySection, aSectType );
610 if( myCurve->isClosed(mySection) != isClosed )
611 myCurve->setClosed( mySection, isClosed );
612 mySectionView->sectionChanged(mySection);
617 void CurveCreator_Widget::onJoin()
621 QList<int> aSections = mySectionView->getSelectedSections();
622 if( aSections.size() == 0 ){
627 std::list<int> aSectionsToJoin;
628 for( int i = 0; i < aSections.size() ; i++ ){
629 aSectionsToJoin.push_back( aSections[i] );
631 //int aMainSect = aSectionsToJoin.front();
632 //int aMainSectSize = myCurve->getNbPoints(aMainSect);
633 if ( myCurve->join( aSectionsToJoin ) )
635 std::list<int>::const_iterator anIt = aSectionsToJoin.begin(),
636 aLast = aSectionsToJoin.end();
637 // the first section should be skipped. It is not removed, but is modified
639 for ( ; anIt != aLast; anIt++ )
640 mySectionView->sectionsRemoved( *anIt );
643 /* The update for the points of the main section
644 int aNewSectSize = myCurve->getNbPoints(aMainSect);
645 if( aNewSectSize != aMainSectSize )
646 mySectionView->pointsAdded( aMainSect, aMainSectSize, aNewSectSize-aMainSectSize );*/
650 void CurveCreator_Widget::onRemove()
655 switch( getActionMode() ) {
659 case ModificationMode:
667 void CurveCreator_Widget::onClearAll()
673 mySectionView->reset();
674 updateActionsStates();
678 void CurveCreator_Widget::onJoinAll()
684 std::list<int> aSectionsToJoin;
685 for( int i = 0, aNb = myCurve->getNbSections(); i < aNb ; i++ ){
686 aSectionsToJoin.push_back( i );
688 bool aRes = myCurve->join( aSectionsToJoin );
690 mySectionView->reset();
691 updateActionsStates();
695 void CurveCreator_Widget::onUndoSettings()
700 void CurveCreator_Widget::onSetSpline()
705 QList<int> aSelSections = mySectionView->getSelectedSections();
706 for( int i = 0 ; i < aSelSections.size() ; i++ ){
707 myCurve->setSectionType(aSelSections[i], CurveCreator::Spline );
708 mySectionView->sectionChanged(aSelSections[i]);
713 void CurveCreator_Widget::onSetPolyline()
718 QList<int> aSelSections = mySectionView->getSelectedSections();
719 for( int i = 0 ; i < aSelSections.size() ; i++ ){
720 myCurve->setSectionType( aSelSections[i], CurveCreator::Polyline );
721 mySectionView->sectionChanged( aSelSections[i] );
726 void CurveCreator_Widget::onCloseSections()
731 QList<int> aSelSections = mySectionView->getSelectedSections();
732 for( int i = 0 ; i < aSelSections.size() ; i++ ){
733 myCurve->setClosed(aSelSections[i], true);
734 mySectionView->sectionChanged(aSelSections[i]);
739 void CurveCreator_Widget::onUncloseSections()
744 QList<int> aSelSections = mySectionView->getSelectedSections();
745 for( int i = 0 ; i < aSelSections.size() ; i++ ){
746 myCurve->setClosed(aSelSections[i], false);
747 mySectionView->sectionChanged(aSelSections[i]);
752 void CurveCreator_Widget::onUndo()
757 CurveCreator_ICurve::SectionToPointList aPoints;
758 startCurveModification( aPoints, false );
760 finishCurveModification();
761 mySectionView->reset();
764 void CurveCreator_Widget::onRedo()
768 CurveCreator_ICurve::SectionToPointList aPoints;
769 startCurveModification( aPoints, false );
771 finishCurveModification();
772 mySectionView->reset();
775 void CurveCreator_Widget::updateUndoRedo()
779 QAction* anAct = myActionMap[UNDO_ID];
781 if( myCurve->getNbUndo() != 0 ){
782 anAct->setEnabled(true);
785 anAct->setDisabled(true);
788 anAct = myActionMap[REDO_ID];
790 if( myCurve->getNbRedo() != 0 ){
791 anAct->setEnabled(true);
794 anAct->setDisabled(true);
799 void CurveCreator_Widget::onContextMenu( QPoint thePoint )
801 QList<ActionId> aContextActions;
802 aContextActions << CLEAR_ALL_ID << JOIN_ID << JOIN_ALL_ID << SEPARATOR_ID <<
803 CLOSE_SECTIONS_ID << UNCLOSE_SECTIONS_ID << SET_SECTIONS_POLYLINE_ID <<
804 SET_SECTIONS_SPLINE_ID;
805 QPoint aGlPoint = mySectionView->mapToGlobal(thePoint);
807 QList<ActionId> aResAct;
808 for( int i = 0 ; i < aContextActions.size() ; i++ ){
809 if( aContextActions[i] != SEPARATOR_ID ){
810 if( myActionMap.contains(aContextActions[i]) ){
811 QAction* anAct = myActionMap[aContextActions[i]];
812 if( anAct->isEnabled() ){
813 aResAct << aContextActions[i];
819 aResAct << SEPARATOR_ID;
825 QMenu* aMenu = new QMenu(this);
826 for( int i = 0 ; i < aResAct.size() ; i++ ){
827 if( aResAct[i] == SEPARATOR_ID ){
828 aMenu->addSeparator();
831 QAction* anAct = myActionMap[aResAct[i]];
832 aMenu->insertAction(NULL, anAct);
835 aMenu->exec(aGlPoint);
838 QList<int> CurveCreator_Widget::getSelectedSections()
840 return mySectionView->getSelectedSections();
843 void CurveCreator_Widget::setSelectedSections( const QList<int>& theSections )
845 mySectionView->setSelectedSections( theSections );
846 updateActionsStates();
851 * According to the widget state, performs the remove action
853 void CurveCreator_Widget::removeSelected()
859 * Checks whether there are some selection to be removed
861 bool CurveCreator_Widget::removeEnabled()
863 bool isEnabled = getActionMode() == ModificationMode;
865 QList<int> aSelSections = mySectionView->getSelectedSections();
866 CurveCreator_TreeView::SelectionType aSelType = mySectionView->getSelectionType();
867 isEnabled = aSelType == CurveCreator_TreeView::ST_SECTIONS &&
868 aSelSections.size() == 1;
873 void CurveCreator_Widget::setActionMode( const ActionMode& theMode )
875 ActionMode aPrevMode = getActionMode();
876 QAction* aPrevAction = getAction( aPrevMode );
877 QAction* anAction = getAction( theMode );
882 if ( aPrevAction->isChecked() ) {
883 aPrevAction->setChecked( false );
886 if ( aPrevMode == ModificationMode )
887 onModificationMode( false );
888 if ( aPrevMode == AdditionMode )
889 onAdditionMode( false );
891 if ( theMode == AdditionMode )
893 anAction->setChecked( true );
894 onModeChanged( true );
899 case ModificationMode:
909 CurveCreator_Widget::ActionMode CurveCreator_Widget::getActionMode() const
911 ActionMode aMode = NoneMode;
913 if ( myActionMap[ADDITION_MODE_ID]->isChecked() )
914 aMode = AdditionMode;
915 else if ( myActionMap[MODIFICATION_MODE_ID]->isChecked() )
916 aMode = ModificationMode;
917 else if ( myActionMap[DETECTION_MODE_ID]->isChecked() )
918 aMode = DetectionMode;
923 //=================================================================================
924 // function : GeometryGUI::addCoordsByClick()
925 // purpose : Manage mouse press events in Additon mode
926 //=================================================================================
927 void CurveCreator_Widget::addCoordsByClick( QMouseEvent* pe )
929 if (pe->button() != Qt::LeftButton)
932 if ( pe->modifiers() != Qt::ControlModifier ) {
933 Handle(AIS_InteractiveContext) ic = getAISContext();
940 if ( pe->modifiers() == Qt::ShiftModifier )
941 ic->ShiftSelect(); // Append selection
943 ic->Select(); // New selection
946 OCCViewer_ViewPort3d* vp = getViewPort();
947 aPnt = CurveCreator_Utils::ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
949 // set the coordinates into dialog
950 CurveCreator::Coordinates aCoords;
951 aCoords.push_back( aPnt.X() );
952 aCoords.push_back( aPnt.Y() );
953 if ( myCurve->getDimension() == 3 ) {
954 aCoords.push_back( aPnt.Z() );
956 addNewPoint(aCoords);
961 * Manage mouse press events
962 * \param theWindow an owner of the signal
963 * \param theEvent a mouse event
965 void CurveCreator_Widget::onMousePress( SUIT_ViewWindow*, QMouseEvent* theEvent )
967 if ( theEvent->button() != Qt::LeftButton )
970 myPressedX = theEvent->x();
971 myPressedY = theEvent->y();
973 switch( getActionMode() ) {
974 case ModificationMode: {
975 //store initial cursor position for Drag&Drop
976 setDragStarted( true, theEvent->pos() );
980 addCoordsByClick( theEvent );
989 * Manage mouse release events in Modification mode
990 * \param theWindow an owner of the signal
991 * \param theEvent a mouse event
993 void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow*, QMouseEvent* theEvent )
995 if ( getActionMode() != ModificationMode )
998 if ( myDragStarted ) {
999 bool isDragged = myDragged;
1000 CurveCreator_ICurve::SectionToPointList aDraggedPoints;
1001 QMap<CurveCreator_ICurve::SectionToPoint, std::deque< float > > anInitialDragPointsCoords;
1003 aDraggedPoints = myDragPoints;
1004 anInitialDragPointsCoords = myInitialDragPointsCoords;
1007 setDragStarted( false );
1009 if ( aDraggedPoints.size() > 0 ) {
1010 // Collect old coordinates of the dragged points
1011 CurveCreator_ICurve::SectionToPointCoordsList anOldPoints;
1012 foreach ( const CurveCreator_ICurve::SectionToPoint aSectionToPoint, anInitialDragPointsCoords.keys() ) {
1013 CurveCreator::Coordinates aCoords = anInitialDragPointsCoords.value( aSectionToPoint );
1014 anOldPoints.push_back( std::make_pair( aSectionToPoint, aCoords ) );
1017 if ( myCurve->canPointsBeSorted() ) {
1018 // Add old coordinates of the curve points (except the dragged points) to the list
1019 for( int aSectionId = 0 ; aSectionId < myCurve->getNbSections() ; aSectionId++ ) {
1020 CurveCreator::Coordinates aCoords;
1021 for ( int aPointId = 0, aNb = myCurve->getNbPoints( aSectionId ); aPointId < aNb; aPointId++ ) {
1022 aCoords = myCurve->getPoint( aSectionId, aPointId );
1023 if ( aCoords.size() < 2 ) {
1027 CurveCreator_ICurve::SectionToPoint aSectionToPoint = std::make_pair( aSectionId, aPointId );
1029 if ( !anInitialDragPointsCoords.contains( aSectionToPoint ) ) {
1030 anOldPoints.push_back( std::make_pair( aSectionToPoint, aCoords ) );
1035 // Apply points sorting
1036 CurveCreator_ICurve::SectionToPointList aPoints;
1037 startCurveModification( aPoints, false );
1039 myCurve->setSkipSorting( false );
1041 CurveCreator_ICurve::SectionToPointCoordsList aCoordList;
1042 CurveCreator_ICurve::SectionToPointList::const_iterator anIt = aDraggedPoints.begin(),
1043 aLast = aDraggedPoints.end();
1044 for ( ; anIt != aLast; anIt++ ) {
1045 int aSectionId = anIt->first;
1046 int aPointId = anIt->second;
1047 std::deque<float> aPos = myCurve->getPoint( aSectionId, aPointId );
1049 aCoordList.push_back(
1050 std::make_pair( std::make_pair( aSectionId, aPointId ), aPos ) );
1053 myCurve->setSeveralPoints( aCoordList, false );
1055 finishCurveModification( aDraggedPoints );
1057 // if the drag of some points has happened, restore the drag selection
1059 setSelectedPoints( aDraggedPoints );
1060 END_MEASURE_TIME( "drop" );
1063 // Save drag difference
1064 myCurve->saveCoordDiff( anOldPoints );
1067 else // check whether the segment is clicked an a new point should be added to the segment
1069 int aReleasedX = theEvent->x();
1070 int aReleasedY = theEvent->y();
1071 if ( myPressedX == aReleasedX && myPressedY == aReleasedY )
1072 insertPointToSelectedSegment( aReleasedX, aReleasedY );
1075 // updates the input panel table to show the selected point coordinates
1076 updateLocalPointView();
1081 * Manage mouse move events in Modification mode
1082 * \param theWindow an owner of the signal
1083 * \param theEvent a mouse event
1085 void CurveCreator_Widget::onMouseMove( SUIT_ViewWindow*, QMouseEvent* theEvent )
1087 if ( getActionMode() != ModificationMode || !myDragStarted )
1090 QPoint aPos = theEvent->pos();
1091 if ( (aPos - myDragStartPosition).manhattanLength() < QApplication::startDragDistance() )
1096 moveSelectedPoints( aPos.x(), aPos.y() );
1097 myDragStartPosition = aPos;
1099 END_MEASURE_TIME( "drag" );
1103 * Set zero viewer by the last view closed in
1104 * \param theManager a viewer manager
1106 void CurveCreator_Widget::onLastViewClosed( SUIT_ViewManager* theManager )
1111 void CurveCreator_Widget::onMousePress( QMouseEvent* theEvent )
1113 onMousePress( 0, theEvent );
1116 void CurveCreator_Widget::onMouseRelease( QMouseEvent* theEvent )
1118 onMouseRelease( 0, theEvent );
1121 void CurveCreator_Widget::onMouseMove( QMouseEvent* theEvent )
1123 onMouseMove( 0, theEvent );
1126 void CurveCreator_Widget::onCellChanged( int theRow, int theColumn )
1128 int aCurrSect = myLocalPointView->getSectionId( theRow );
1129 int aPntIndex = myLocalPointView->getPointId( theRow );
1131 if ( aPntIndex < 0 )
1134 CurveCreator_ICurve::SectionToPointList aSelPoints;
1135 startCurveModification( aSelPoints );
1137 double aX = myLocalPointView->item( theRow, 2 )->data( Qt::UserRole ).toDouble();
1138 double anY = myLocalPointView->item( theRow, 3 )->data( Qt::UserRole ).toDouble();
1139 std::deque<float> aChangedPos;
1140 aChangedPos.push_back( aX );
1141 aChangedPos.push_back( anY );
1142 myCurve->setPoint( aCurrSect, aPntIndex, aChangedPos );
1144 finishCurveModification( aSelPoints );
1148 * Removes a selected section from the curve. Updates undo/redo status
1150 void CurveCreator_Widget::removeSection()
1154 QList<int> aSections = mySectionView->getSelectedSections();
1155 for( int i = 0 ; i < aSections.size() ; i++ ){
1156 int aSectNum = aSections[i] - (i);
1157 myCurve->removeSection( aSectNum );
1158 mySectionView->sectionsRemoved( aSectNum );
1160 mySectionView->clearSelection();
1165 * Removes a selected points from the curve. Updates undo/redo status
1167 void CurveCreator_Widget::removePoint()
1169 CurveCreator_ICurve::SectionToPointList aPoints;
1170 getSelectedPoints( aPoints );
1171 if ( aPoints.size() == 0 )
1174 CurveCreator_ICurve::SectionToPointList aSelPoints;
1175 startCurveModification( aSelPoints, false );
1177 myCurve->removeSeveralPoints( aPoints );
1178 finishCurveModification( CurveCreator_ICurve::SectionToPointList() );
1181 void CurveCreator_Widget::addNewPoint(const CurveCreator::Coordinates& theCoords)
1185 QList<int> aSections = mySectionView->getSelectedSections();
1186 if( aSections.size() == 0 ){
1189 int aSection = aSections[0];
1190 myCurve->addPoints(theCoords, aSection); // add to the end of section
1191 mySectionView->pointsAdded( aSection, myCurve->getNbPoints( aSection ) );
1192 updateActionsStates();
1196 void CurveCreator_Widget::insertPointToSelectedSegment( const int theX,
1199 Handle(AIS_InteractiveContext) aContext = getAISContext();
1201 OCCViewer_ViewPort3d* aViewPort = getViewPort();
1202 Handle(V3d_View) aView;
1204 aView = aViewPort->getView();
1206 if ( aContext.IsNull() || aView.IsNull() )
1209 gp_Pnt aPoint1, aPoint2;
1210 Handle(AIS_InteractiveObject) anAISObject = myCurve->getAISObject();
1211 bool isFoundPoint = CurveCreator_Utils::pointOnObject( aView, anAISObject, theX, theY,
1212 aPoint, aPoint1, aPoint2 );
1213 if ( !isFoundPoint )
1216 // insert the point to the model curve
1217 CurveCreator_ICurve::SectionToPointList aSelPoints;
1218 startCurveModification( aSelPoints );
1220 CurveCreator::Coordinates aCoords;
1221 aCoords.push_back( aPoint.X() );
1222 aCoords.push_back( aPoint.Y() );
1224 CurveCreator_ICurve::SectionToPointList aPoints1, aPoints2;
1225 findSectionsToPoints( aPoint1.X(), aPoint1.Y(), aPoints1 );
1226 findSectionsToPoints( aPoint2.X(), aPoint2.Y(), aPoints2 );
1227 CurveCreator_ICurve::SectionToPointList::const_iterator anIt = aPoints1.begin(),
1228 aLast = aPoints1.end();
1229 int aSectionId = -1;
1230 // find the indices of the neighbour point
1231 // there can be a case when a new point is added into two sections
1232 int aPoint1Id = -1, aPoint2Id = -1;
1233 for ( ; anIt != aLast && aSectionId < 0; anIt++ ) {
1234 int aSectionCur = anIt->first;
1235 CurveCreator_ICurve::SectionToPointList::const_iterator anIt2 = aPoints2.begin(),
1236 aLast2 = aPoints2.end();
1237 for ( ; anIt2 != aLast2 && aSectionId < 0; anIt2++ ) {
1238 if ( anIt2->first == aSectionCur ) {
1239 aSectionId = aSectionCur;
1240 aPoint1Id = anIt->second;
1241 aPoint2Id = anIt2->second;
1246 int anInsertPos = -1;
1247 int aLastPoint = myCurve->getNbPoints( aSectionId )-1;
1248 if ( ( aPoint1Id == aLastPoint && aPoint2Id == 0 ) ||
1249 ( aPoint2Id == aLastPoint && aPoint1Id == 0 ) )
1250 anInsertPos = -1; // if the section happens between first and last points
1252 anInsertPos = aPoint1Id < aPoint2Id ? aPoint1Id + 1 : aPoint2Id + 1;
1254 myCurve->addPoints( aCoords, aSectionId, anInsertPos );
1255 mySectionView->pointsAdded( aSectionId, myCurve->getNbPoints( aSectionId ) );
1257 finishCurveModification( aSelPoints );
1259 setSelectedPoints();
1262 void CurveCreator_Widget::moveSelectedPoints( const int theXPosition,
1263 const int theYPosition )
1265 OCCViewer_ViewPort3d* aViewPort = getViewPort();
1269 CurveCreator_ICurve::SectionToPointList aPoints;
1270 startCurveModification( aPoints, false );
1272 gp_Pnt aStartPnt = CurveCreator_Utils::ConvertClickToPoint( myDragStartPosition.x(),
1273 myDragStartPosition.y(),
1274 aViewPort->getView() );
1275 gp_Pnt anEndPnt = CurveCreator_Utils::ConvertClickToPoint( theXPosition, theYPosition,
1276 aViewPort->getView() );
1277 double aXDelta = aStartPnt.X() - anEndPnt.X();
1278 double anYDelta = aStartPnt.Y() - anEndPnt.Y();
1280 CurveCreator_ICurve::SectionToPointCoordsList aCoordList;
1281 std::deque<float> aChangedPos;
1282 CurveCreator_ICurve::SectionToPointList::const_iterator anIt = myDragPoints.begin(),
1283 aLast = myDragPoints.end();
1284 for ( ; anIt != aLast; anIt++ ) {
1285 int aSectionId = anIt->first;
1286 int aPointId = anIt->second;
1287 aChangedPos = myCurve->getPoint( aSectionId, aPointId );
1288 if ( aChangedPos.size() < 2 )
1291 // Remember drag points coordinates
1293 myInitialDragPointsCoords.insert( std::make_pair( aSectionId, aPointId ), aChangedPos );
1296 aChangedPos[0] = aChangedPos[0] - aXDelta;
1297 aChangedPos[1] = aChangedPos[1] - anYDelta;
1299 aCoordList.push_back(
1300 std::make_pair(std::make_pair( aSectionId, aPointId ),
1303 myCurve->setSeveralPoints( aCoordList, false );
1306 finishCurveModification( myDragPoints );
1309 void CurveCreator_Widget::updateLocalPointView()
1311 if ( myDragStarted )
1313 Handle(AIS_InteractiveContext) aContext = getAISContext();
1314 if ( aContext.IsNull() )
1317 CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints );
1318 int aNbPoints = myLocalPoints.size();
1320 bool isRowLimit = aNbPoints > myLocalPointRowLimit;
1321 myLocalPointView->setVisible( getActionMode() == ModificationMode && !isRowLimit );
1323 if ( !isRowLimit ) {
1324 bool isBlocked = myLocalPointView->blockSignals(true);
1326 myLocalPointView->setLocalPointsToTable( myLocalPoints );
1328 myLocalPointView->blockSignals( isBlocked );
1335 void CurveCreator_Widget::setLocalPointContext( const bool theOpen, const bool isUpdateTable )
1337 CurveCreator_Utils::setLocalPointContext( myCurve, getAISContext(), theOpen );
1338 if ( !theOpen && isUpdateTable )
1339 updateLocalPointView();
1343 * Set drag operation started. Save the position and a list of dragged points
1344 * \param theState the drag operation state: started/finished
1345 * \param thePoint the start drag position
1347 void CurveCreator_Widget::setDragStarted( const bool theState, const QPoint& thePoint )
1350 getSelectedPoints( myDragPoints );
1352 myDragStarted = myDragPoints.size();
1353 myDragStartPosition = thePoint;
1354 if ( myDragStarted ) {
1355 // change a viewer interaction style in order to avoid a select rectangle build
1356 myDragInteractionStyle = changeInteractionStyle( SUIT_ViewModel::KEY_FREE );
1357 myCurve->setSkipSorting( true );
1361 if ( myDragStarted )
1362 changeInteractionStyle( myDragInteractionStyle );
1363 myDragStarted = false;
1364 myDragPoints.clear();
1365 myInitialDragPointsCoords.clear();
1370 void CurveCreator_Widget::getSelectedPoints( CurveCreator_ICurve::SectionToPointList& thePoints )
1373 thePoints = myLocalPoints;
1376 void CurveCreator_Widget::setSelectedPoints( const CurveCreator_ICurve::SectionToPointList& thePoints )
1378 if ( myDragStarted )
1380 Handle(AIS_InteractiveContext) aContext = getAISContext();
1381 if ( aContext.IsNull() || !aContext->HasOpenedContext() )
1384 CurveCreator_Utils::setSelectedPoints( aContext, myCurve, thePoints );
1386 updateLocalPointView();
1389 void CurveCreator_Widget::stopActionMode()
1391 setActionMode( NoneMode );
1395 * Get viewer information before perform the curve modification.
1396 * Take a list of selected cuve points an close local context.
1397 * The context should be closed because the curve presentation is
1398 * redisplayed and if it is not closed, when we close the local context
1399 * later, the presentation shown in the local context is disappeared.
1400 * \param thePoints an output list of curve selected points
1401 * \param theFillPoints a flag whether the selection list should be filled
1403 void CurveCreator_Widget::startCurveModification(
1404 CurveCreator_ICurve::SectionToPointList& thePoints,
1405 const bool theFillPoints )
1407 if ( theFillPoints ) {
1409 getSelectedPoints( thePoints );
1411 setLocalPointContext( false );
1415 * Restore the viewer state after the curve modification is done.
1416 * Open local context and select given points inside it.
1417 * \param thePoints a list of curve selected points
1419 void CurveCreator_Widget::finishCurveModification(
1420 const CurveCreator_ICurve::SectionToPointList& thePoints )
1422 if ( getActionMode() == ModificationMode )
1423 setLocalPointContext( true );
1424 setSelectedPoints( thePoints );
1429 * Returns a point index in the model curve by the point coordinates in the viewer
1430 * \param theX the X coordinate of the point
1431 * \param theY the Y coordinate of the point
1433 int CurveCreator_Widget::findLocalPointIndex( int theSectionId, float theX, float theY )
1435 return CurveCreator_UtilsICurve::findLocalPointIndex( myCurve, theSectionId, theX, theY );
1438 void CurveCreator_Widget::findSectionsToPoints( const double theX, const double theY,
1439 CurveCreator_ICurve::SectionToPointList& thePoints )
1441 return CurveCreator_UtilsICurve::findSectionsToPoints( myCurve, theX, theY, thePoints );
1444 void CurveCreator_Widget::convert( const CurveCreator_ICurve::SectionToPointList& thePoints,
1445 QMap<int, QList<int> >& theConvPoints )
1447 return CurveCreator_UtilsICurve::convert( thePoints, theConvPoints );
1451 * Returns whethe the container has the value
1452 * \param theList a container of values
1453 * \param theValue a value
1455 bool CurveCreator_Widget::contains( const CurveCreator_ICurve::SectionToPointList& theList,
1456 const CurveCreator_ICurve::SectionToPoint& theValue ) const
1458 return CurveCreator_UtilsICurve::contains( theList, theValue );