1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File : MeasureGUI_FastCheckIntersectionsDlg.cxx
26 #include "MeasureGUI_FastCheckIntersectionsDlg.h"
27 #include "MeasureGUI.h"
29 #include <SUIT_OverrideCursor.h>
30 #include <SUIT_Session.h>
31 #include <SUIT_ResourceMgr.h>
32 #include <SUIT_MessageBox.h>
33 #include <LightApp_SelectionMgr.h>
34 #include <SalomeApp_Tools.h>
35 #include <SalomeApp_Application.h>
37 #include <TopTools_IndexedMapOfShape.hxx>
39 #include <TColStd_IndexedMapOfInteger.hxx>
40 #include <TColStd_MapOfInteger.hxx>
43 #include <GeometryGUI.h>
45 #include <GEOMImpl_Types.hxx>
47 #include <QListWidget>
49 #define TEXTEDIT_FONT_FAMILY "Courier"
50 #define TEXTEDIT_FONT_SIZE 11
51 //=================================================================================
52 // class : MeasureGUI_FastCheckIntersectionsDlg()
53 // purpose : Constructs a MeasureGUI_FastCheckIntersectionsDlg which is a child of 'parent', with the
54 // name 'name' and widget flags set to 'f'.
55 // The dialog will by default be modeless, unless you set 'modal' to
56 // true to construct a modal dialog.
57 //=================================================================================
58 MeasureGUI_FastCheckIntersectionsDlg::MeasureGUI_FastCheckIntersectionsDlg (GeometryGUI* GUI, QWidget* parent)
59 : GEOMBase_Skeleton (GUI, parent, false)
61 SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
62 QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FAST_CHECK_INTERSECTIONS")));
63 QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
65 setWindowTitle(tr("GEOM_FAST_CHECK_INTERSECTIONS"));
67 /***************************************************************/
68 mainFrame()->GroupConstructors->setTitle(tr("GEOM_FAST_CHECK_INTERSECTIONS"));
69 mainFrame()->RadioButton1->setIcon(image0);
70 mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
71 mainFrame()->RadioButton2->close();
72 mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
73 mainFrame()->RadioButton3->close();
75 QGroupBox* aGrp = new QGroupBox(tr("GEOM_FAST_CHECK_OBJ"), centralWidget());
76 QLabel* anObjLbl1 = new QLabel(tr("GEOM_OBJECT_I").arg("1"), aGrp);
77 QLabel* anObjLbl2 = new QLabel(tr("GEOM_OBJECT_I").arg("2"), aGrp);
78 QLabel* aShapeLbl1 = new QLabel(tr("GEOM_FAST_CHECK_INT_SUBSHAPES").arg("1"), aGrp);
79 QLabel* aShapeLbl2 = new QLabel(tr("GEOM_FAST_CHECK_INT_SUBSHAPES").arg("2"), aGrp);
80 QLabel* aDeflectLbl = new QLabel(tr("GEOM_FAST_CHECK_INT_DEFLECT"), aGrp);
82 mySelButton1 = new QPushButton(aGrp);
83 mySelButton1->setIcon(image1);
84 mySelButton1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
85 mySelButton2 = new QPushButton(aGrp);
86 mySelButton2->setIcon(image1);
87 mySelButton2->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
89 myEditObjName1 = new QLineEdit(aGrp);
90 myEditObjName1->setReadOnly(true);
91 myEditObjName2 = new QLineEdit(aGrp);
92 myEditObjName2->setReadOnly(true);
94 myDetGaps = new QCheckBox(tr( "GEOM_FAST_CHECK_INT_DETECT_GAPS" ));
95 myTolerance = new SalomeApp_DoubleSpinBox(aGrp);
96 myDeflection = new SalomeApp_DoubleSpinBox(aGrp);
97 myShapeList1 = new QListWidget(aGrp);
98 myShapeList2 = new QListWidget(aGrp);
99 myShapeList1->setSelectionMode(QAbstractItemView::ExtendedSelection);
100 myShapeList2->setSelectionMode(QAbstractItemView::ExtendedSelection);
102 myComputeButton = new QPushButton(tr("GEOM_FAST_CHECK_INT_COMPUTE"));
104 QGridLayout *aGrpLayout = new QGridLayout(aGrp);
105 aGrpLayout->setMargin(9);
106 aGrpLayout->setSpacing(6);
107 aGrpLayout->addWidget(anObjLbl1, 0, 0);
108 aGrpLayout->addWidget(mySelButton1, 0, 1);
109 aGrpLayout->addWidget(myEditObjName1, 0, 2);
110 aGrpLayout->addWidget(anObjLbl2, 1, 0);
111 aGrpLayout->addWidget(mySelButton2, 1, 1);
112 aGrpLayout->addWidget(myEditObjName2, 1, 2);
113 aGrpLayout->addWidget(aDeflectLbl, 2, 0);
114 aGrpLayout->addWidget(myDeflection, 2, 1, 1, 2);
115 aGrpLayout->addWidget(myDetGaps, 3, 0);
116 aGrpLayout->addWidget(myTolerance, 3, 1, 1, 2);
117 aGrpLayout->addWidget(myComputeButton, 4, 0, 1, 3);
119 QGridLayout *aGrpLayout2 = new QGridLayout();
120 aGrpLayout->addLayout(aGrpLayout2, 5, 0, 1, 3);
121 aGrpLayout2->addWidget(aShapeLbl1, 0, 0);
122 aGrpLayout2->addWidget(aShapeLbl2, 0, 1);
123 aGrpLayout2->addWidget(myShapeList1, 1, 0);
124 aGrpLayout2->addWidget(myShapeList2, 1, 1);
126 QVBoxLayout* layout = new QVBoxLayout (centralWidget());
127 layout->setMargin(0); layout->setSpacing(6);
128 layout->addWidget(aGrp);
130 /***************************************************************/
132 myHelpFileName = "fast_intersection_page.html";
138 //=================================================================================
139 // function : ~MeasureGUI_FastCheckIntersectionsDlg()
140 // purpose : Destroys the object and frees any allocated resources
141 //=================================================================================
142 MeasureGUI_FastCheckIntersectionsDlg::~MeasureGUI_FastCheckIntersectionsDlg()
146 //=================================================================================
149 //=================================================================================
150 void MeasureGUI_FastCheckIntersectionsDlg::Init()
154 myEditObjName1->setText("");
155 myEditObjName2->setText("");
156 myEditObjName1->setEnabled(true);
157 myEditObjName2->setEnabled(false);
159 myDetGaps->setChecked(false);
160 initSpinBox(myTolerance, 0, MAX_NUMBER, 1);
161 myTolerance->setValue(0);
162 myTolerance->setEnabled(false);
164 // Obtain deflection from preferences
165 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
166 initSpinBox(myDeflection, 1e-3, 1.0, 1e-3);
167 myDeflection->setValue(qMax(1e-3, resMgr->doubleValue("Geometry", "deflection_coeff", 1e-3)));
169 myEditCurrentArgument = myEditObjName1;
171 connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()),
172 this, SLOT(DeactivateActiveDialog()));
173 connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()),
174 this, SLOT(ClickOnCancel()));
175 connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
176 connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
177 connect(mySelButton1, SIGNAL(clicked()),
178 this, SLOT(SetEditCurrentArgument()));
179 connect(mySelButton2, SIGNAL(clicked()),
180 this, SLOT(SetEditCurrentArgument()));
181 connect(myDetGaps, SIGNAL(toggled(bool)), this, SLOT(OnGaps(bool)));
182 connect( myTolerance, SIGNAL(valueChanged(double)), this, SLOT(clear()));
183 connect( myDeflection, SIGNAL(valueChanged(double)), this, SLOT(clear()));
184 connect(myShapeList1, SIGNAL(itemSelectionChanged()),
185 SLOT(onSubShapesListSelectionChanged()));
186 connect(myShapeList2, SIGNAL(itemSelectionChanged()),
187 SLOT(onSubShapesListSelectionChanged()));
188 connect(myComputeButton, SIGNAL(clicked()), this, SLOT(onCompute()));
190 LightApp_SelectionMgr* aSel = myGeomGUI->getApp()->selectionMgr();
192 connect(aSel, SIGNAL(currentSelectionChanged()),
193 this, SLOT(SelectionIntoArgument()));
195 initName(tr("GEOM_FAST_INTERSECTION_NAME"));
196 buttonOk()->setEnabled(false);
197 buttonApply()->setEnabled(false);
198 myComputeButton->setEnabled(false);
201 mySelButton1->click();
202 SelectionIntoArgument();
205 //=================================================================================
208 //=================================================================================
209 void MeasureGUI_FastCheckIntersectionsDlg::clear()
211 disconnect(myShapeList1, SIGNAL(itemSelectionChanged()), this, 0);
212 disconnect(myShapeList2, SIGNAL(itemSelectionChanged()), this, 0);
213 myShapeList1->clear();
214 myShapeList2->clear();
215 connect(myShapeList1, SIGNAL(itemSelectionChanged()),
216 SLOT(onSubShapesListSelectionChanged()));
217 connect(myShapeList2, SIGNAL(itemSelectionChanged()),
218 SLOT(onSubShapesListSelectionChanged()));
220 buttonOk()->setEnabled(false);
221 buttonApply()->setEnabled(false);
222 myComputeButton->setEnabled(true);
225 //=================================================================================
226 // function : onCompute
228 //=================================================================================
229 void MeasureGUI_FastCheckIntersectionsDlg::onCompute()
231 SUIT_OverrideCursor wc;
233 myShapeList1->clear();
234 myShapeList2->clear();
236 if (!findIntersections()) {
237 myShapeList1->addItem(tr("GEOM_FAST_INTERSECTION_FAILS"));
238 myShapeList1->setEnabled(false);
239 myShapeList2->addItem(tr("GEOM_FAST_INTERSECTION_FAILS"));
240 myShapeList2->setEnabled(false);
244 myShapeList1->setEnabled(true);
245 myShapeList2->setEnabled(true);
246 QStringList aSubShapeList1, aSubShapeList2;
247 TopoDS_Shape aSelShape1, aSelShape2;
248 if (myObj1 && GEOMBase::GetShape(myObj1.get(), aSelShape1) && myObj2
249 && GEOMBase::GetShape(myObj2.get(), aSelShape2)) {
250 TopTools_IndexedMapOfShape anIndices1, anIndices2;
251 TopExp::MapShapes(aSelShape1, anIndices1);
252 TopExp::MapShapes(aSelShape2, anIndices2);
254 //Sub-shapes of 1st Object
255 for (int i = 0; i < myInters1->length(); i++) {
256 TopoDS_Shape aSubShape = anIndices1.FindKey(myInters1[i]);
257 QString aType = GEOMBase::GetShapeTypeString(aSubShape);
258 if (!aType.isEmpty())
259 aSubShapeList1.append(QString("%1_%2").arg(aType).arg(myInters1[i]));
261 myShapeList1->addItems(aSubShapeList1);
262 myShapeList1->selectAll();
264 //Sub-shapes of second Object
265 for (int i = 0; i < myInters2->length(); i++) {
266 TopoDS_Shape aSubShape = anIndices2.FindKey(myInters2[i]);
267 QString aType = GEOMBase::GetShapeTypeString(aSubShape);
268 if (!aType.isEmpty())
269 aSubShapeList2.append(QString("%1_%2").arg(aType).arg(myInters2[i]));
271 myShapeList2->addItems(aSubShapeList2);
272 myShapeList2->selectAll();
275 buttonOk()->setEnabled(true);
276 buttonApply()->setEnabled(true);
277 myComputeButton->setEnabled(false);
280 //=================================================================================
281 // function : ActivateThisDialog
283 //=================================================================================
284 void MeasureGUI_FastCheckIntersectionsDlg::ActivateThisDialog()
286 GEOMBase_Skeleton::ActivateThisDialog();
288 LightApp_SelectionMgr* aSel = myGeomGUI->getApp()->selectionMgr();
290 connect( aSel, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
293 DISPLAY_PREVIEW_MACRO
296 //=================================================================================
297 // function : DeactivateActiveDialog()
298 // purpose : public slot to deactivate if active
299 //=================================================================================
300 void MeasureGUI_FastCheckIntersectionsDlg::DeactivateActiveDialog()
302 GEOMBase_Skeleton::DeactivateActiveDialog();
305 //=================================================================================
306 // function : activateSelection
308 //=================================================================================
309 void MeasureGUI_FastCheckIntersectionsDlg::activateSelection()
311 TColStd_MapOfInteger aTypes;
312 aTypes.Add(GEOM_COMPOUND );
313 aTypes.Add(GEOM_SOLID );
314 aTypes.Add(GEOM_SHELL);
315 aTypes.Add(GEOM_FACE);
316 globalSelection(aTypes);
318 std::list<int> needTypes;
319 needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
320 localSelection( needTypes );
324 //=================================================================================
325 // function : ClickOnOk()
327 //=================================================================================
328 void MeasureGUI_FastCheckIntersectionsDlg::ClickOnOk()
330 if ( ClickOnApply() )
334 //=================================================================================
335 // function : ClickOnApply()
337 //=================================================================================
338 bool MeasureGUI_FastCheckIntersectionsDlg::ClickOnApply()
348 //=================================================================================
349 // function : extractPrefix
351 //=================================================================================
352 bool MeasureGUI_FastCheckIntersectionsDlg::extractPrefix() const
357 //=================================================================================
358 // function : createOperation
360 //=================================================================================
361 GEOM::GEOM_IOperations_ptr MeasureGUI_FastCheckIntersectionsDlg::createOperation()
363 return getGeomEngine()->GetIMeasureOperations( getStudyId() );
366 //=================================================================================
367 // function : isValid
369 //=================================================================================
370 bool MeasureGUI_FastCheckIntersectionsDlg::isValid( QString& )
372 return myObj1 && myObj2;
375 //=================================================================================
376 // function : SetEditCurrentArgument
378 //=================================================================================
379 void MeasureGUI_FastCheckIntersectionsDlg::SetEditCurrentArgument()
381 QPushButton* send = (QPushButton*)sender();
383 if (send == mySelButton1) {
384 myEditCurrentArgument = myEditObjName1;
386 mySelButton2->setDown(false);
387 myEditObjName2->setEnabled(false);
391 myEditCurrentArgument = myEditObjName2;
393 mySelButton1->setDown(false);
394 myEditObjName1->setEnabled(false);
398 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
400 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
401 this, SLOT(SelectionIntoArgument()));
404 myEditCurrentArgument->setEnabled(true);
405 myEditCurrentArgument->setFocus();
406 // after setFocus(), because it will be setDown(false) when loses focus
409 SelectionIntoArgument();
412 //=================================================================================
413 // function : OnGaps()
415 //=================================================================================
416 void MeasureGUI_FastCheckIntersectionsDlg::OnGaps(bool cheked)
419 myTolerance->setEnabled(cheked);
421 //=================================================================================
422 // function : SelectionIntoArgument
424 //=================================================================================
425 void MeasureGUI_FastCheckIntersectionsDlg::SelectionIntoArgument()
427 myEditCurrentArgument->setText("");
431 QList<TopAbs_ShapeEnum> typesLst;
432 typesLst << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPOUND;
433 GEOM::GeomObjPtr aSelectedObject = getSelected( typesLst );
436 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
437 myGeomGUI->getApp()->selectionMgr()->clearSelected();
438 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
439 this, SLOT(SelectionIntoArgument()));
441 if (myEditCurrentArgument == myEditObjName1) {
442 myObj1 = aSelectedObject;
443 if (myObj1 && !myObj2)
444 mySelButton2->click();
447 myObj2 = aSelectedObject;
448 if (myObj2 && !myObj1)
449 mySelButton1->click();
451 myEditObjName1->setText(myObj1 ? GEOMBase::GetName(myObj1.get()) : "");
452 myEditObjName2->setText(myObj2 ? GEOMBase::GetName(myObj2.get()) : "");
455 //=================================================================================
456 // function : enterEvent
458 //=================================================================================
459 void MeasureGUI_FastCheckIntersectionsDlg::enterEvent(QEvent *)
461 if (!mainFrame()->GroupConstructors->isEnabled())
462 ActivateThisDialog();
465 //=================================================================================
466 // function : findIntersections
468 //=================================================================================
469 bool MeasureGUI_FastCheckIntersectionsDlg::findIntersections()
471 if (!myObj1 || !myObj2)
474 GEOM::GEOM_IMeasureOperations_var anOper =
475 GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
480 HasInte = anOper->FastIntersect(myObj1.get(), myObj2.get(), getTolerance(), getDeflection(), myInters1, myInters2);
482 catch (const SALOME::SALOME_Exception& e) {
483 SalomeApp_Tools::QtCatchCorbaException(e);
487 bool isDone = anOper->IsDone();
489 CORBA::String_var aMsg = anOper->GetErrorCode();
490 SUIT_MessageBox::warning(this,
491 QObject::tr("WRN_WARNING"),
492 QObject::tr(aMsg.in()));
495 if ( !HasInte || myInters1->length() == 0 || myInters2->length() == 0)
501 //=================================================================================
502 // function : onSubShapesListSelectionChanged
504 //=================================================================================
505 void MeasureGUI_FastCheckIntersectionsDlg::onSubShapesListSelectionChanged()
508 previewSubShapesListSelection(myShapeList1);
509 previewSubShapesListSelection(myShapeList2);
512 //=================================================================================
513 // function : previewSubShapesListSelection
515 //=================================================================================
516 void MeasureGUI_FastCheckIntersectionsDlg::previewSubShapesListSelection(QListWidget* theWidget)
518 GEOM::ListOfLong_var anInters;
519 GEOM::GeomObjPtr anObj;
521 if (theWidget == myShapeList1) { // Sub-Shapes of Object 1
523 anInters = myInters1;
526 if (theWidget == myShapeList2) { // Sub-Shapes of Object 2
528 anInters = myInters2;
534 for (int i = 0, n = theWidget->count(); i < n; i++) {
535 if (theWidget->item(i)->isSelected())
538 if (aIds.count() < 1)
541 TopoDS_Shape aSelShape;
542 TopoDS_Shape aSubShape;
543 TopTools_IndexedMapOfShape anIndices;
544 if (anObj && GEOMBase::GetShape(anObj.get(), aSelShape)) {
545 SALOME_Prs* aPrs = 0;
546 TopExp::MapShapes(aSelShape, anIndices);
547 QList<int>::iterator it;
548 getDisplayer()->SetColor(theWidget == myShapeList1 ? Quantity_NOC_RED : Quantity_NOC_GREEN);
549 getDisplayer()->SetWidth(3);
550 getDisplayer()->SetToActivate(false);
551 for (it = aIds.begin(); it != aIds.end(); ++it) {
552 aSubShape = anIndices.FindKey(anInters[(*it)]);
554 aPrs = !aSubShape.IsNull() ? getDisplayer()->BuildPrs(aSubShape) : 0;
556 displayPreview(aPrs, true);
558 catch (const SALOME::SALOME_Exception& e) {
559 SalomeApp_Tools::QtCatchCorbaException(e);
565 //=================================================================================
566 // function : getLstObjFromListSelection
568 //=================================================================================
569 GEOM::ListOfGO_var MeasureGUI_FastCheckIntersectionsDlg::getLstObjFromListSelection(QListWidget* theWidget)
571 GEOM::ListOfLong_var anInters;
572 GEOM::GeomObjPtr anObj;
573 GEOM::ListOfGO_var anObjLst = new GEOM::ListOfGO();
575 if (theWidget == myShapeList1) { // Sub-Shapes of Object 1
577 anInters = myInters1;
580 if (theWidget == myShapeList2) { // Sub-Shapes of Object 2
582 anInters = myInters2;
587 //Add in study myObj if local selection
588 GEOMBase::PublishSubObject( anObj.get() );
589 // Collect the map of indices and already publised objects
590 TColStd_IndexedMapOfInteger aMapIndex;
591 ObjectList aObjLstExist;
592 for (int i = 0, n = theWidget->count(); i < n; i++) {
593 if (theWidget->item(i)->isSelected()) {
594 GEOM::GEOM_Object_var aTmpObj = GEOMBase_Helper::findObjectInFather(anObj.get(), anInters[i]);
595 if (aTmpObj->_is_nil())
596 aMapIndex.Add(anInters[i]);
598 aObjLstExist.push_back( GEOM::GEOM_Object::_duplicate(aTmpObj));
602 if (aMapIndex.IsEmpty() && aObjLstExist.empty())
606 GEOM::ListOfLong_var anArray = new GEOM::ListOfLong;
607 const int aNbShapes = aMapIndex.Extent();
608 anArray->length(aNbShapes);
609 for (int i = 1; i <= aNbShapes; i++) {
610 anArray[i - 1] = aMapIndex.FindKey(i);
613 if (myShapesOper->_is_nil())
614 myShapesOper = getGeomEngine()->GetIShapesOperations(getStudyId());
616 GEOM::ListOfGO_var aObjLstCreate = myShapesOper->MakeSubShapes(anObj.get(), anArray);
618 //Collect all objects in list
619 anObjLst->length(aObjLstCreate->length() + aObjLstExist.size());
621 ObjectList::iterator anIter;
623 for (i=0, anIter = aObjLstExist.begin(); anIter != aObjLstExist.end(); i++, ++anIter) {
624 anObjLst[i] = *anIter;
626 for (int j = 0; j < aObjLstCreate->length(); j++) {
627 anObjLst[aObjLstExist.size()+j]=aObjLstCreate[j];
629 return anObjLst._retn();
632 //=================================================================================
633 // function : execute
635 //=================================================================================
636 bool MeasureGUI_FastCheckIntersectionsDlg::execute(ObjectList& objects)
638 GEOM::ListOfGO_var aList1 = getLstObjFromListSelection(myShapeList1);
639 GEOM::ListOfGO_var aList2 = getLstObjFromListSelection(myShapeList2);
640 GEOM::ListOfGO_var aCompList = new GEOM::ListOfGO();
641 const int nbObj = aList1->length() + aList2->length();
645 //Collect general intersection list
646 aCompList->length(nbObj);
648 for (i = 0; i < aList1->length(); i++) {
649 GEOMBase::PublishSubObject( aList1[i] );
650 aCompList[i]=aList1[i];
652 for (int j = 0; j < aList2->length(); j++) {
653 GEOMBase::PublishSubObject( aList2[j] );
654 aCompList[i+j]=aList2[j];
658 objects.push_back(myShapesOper->MakeCompound(aCompList));
662 //=================================================================================
663 // function : getDeflection
665 //=================================================================================
666 float MeasureGUI_FastCheckIntersectionsDlg::getDeflection()
668 return (float)myDeflection->value();
671 //=================================================================================
672 // function : getTolerance
674 //=================================================================================
675 double MeasureGUI_FastCheckIntersectionsDlg::getTolerance()
677 double aVal = myTolerance->value();
678 if (!myDetGaps->isChecked() || aVal < 0.0)
683 //=================================================================================
684 // function : getSourceObjects
685 // purpose : virtual method to get source objects
686 //=================================================================================
687 QList<GEOM::GeomObjPtr> MeasureGUI_FastCheckIntersectionsDlg::getSourceObjects()
689 QList<GEOM::GeomObjPtr> res;
690 res << myObj1 << myObj2;