1 // Copyright (C) 2007-2014 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),
71 SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
72 QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FAST_CHECK_INTERSECTIONS")));
73 QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
75 setWindowTitle(tr("GEOM_FAST_CHECK_INTERSECTIONS"));
77 /***************************************************************/
78 mainFrame()->GroupConstructors->setTitle(tr("GEOM_FAST_CHECK_INTERSECTIONS"));
79 mainFrame()->RadioButton1->setIcon(image0);
80 mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
81 mainFrame()->RadioButton2->close();
82 mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
83 mainFrame()->RadioButton3->close();
85 QGroupBox *aGrp = new QGroupBox(tr("GEOM_FAST_CHECK_OBJ"));
86 QLabel *anObjLbl1 = new QLabel(tr("GEOM_OBJECT_I").arg("1"));
87 QLabel *anObjLbl2 = new QLabel(tr("GEOM_OBJECT_I").arg("2"));
88 QLabel *aShapeLbl1 = new QLabel(tr("GEOM_FAST_CHECK_INT_SUBSHAPES").arg("1"));
89 QLabel *aShapeLbl2 = new QLabel(tr("GEOM_FAST_CHECK_INT_SUBSHAPES").arg("2"));
90 QLabel *aDeflectLbl = new QLabel(tr("GEOM_FAST_CHECK_INT_DEFLECT"));
91 QFont aFont (TEXTEDIT_FONT_FAMILY, TEXTEDIT_FONT_SIZE);
93 aFont.setStyleHint(QFont::TypeWriter, QFont::PreferAntialias);
95 mySelButton1 = new QPushButton;
96 mySelButton1->setIcon(image1);
97 mySelButton1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
98 mySelButton2 = new QPushButton;
99 mySelButton2->setIcon(image1);
100 mySelButton2->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
102 myEditObjName1 = new QLineEdit;
103 myEditObjName1->setReadOnly(true);
104 myEditObjName2 = new QLineEdit;
105 myEditObjName2->setReadOnly(true);
107 myDetGaps = new QCheckBox( tr( "GEOM_FAST_CHECK_INT_DETECT_GAPS" ));
108 myTolerance = new SalomeApp_DoubleSpinBox;
109 myDeflection = new SalomeApp_DoubleSpinBox;
110 myShapeList1 = new QListWidget;
111 myShapeList2 = new QListWidget;
112 myShapeList1->setSelectionMode(QAbstractItemView::ExtendedSelection);
113 myShapeList2->setSelectionMode(QAbstractItemView::ExtendedSelection);
115 myComputeButton = new QPushButton(tr("GEOM_FAST_CHECK_INT_COMPUTE"));
117 QGridLayout *aGrpLayout = new QGridLayout(aGrp);
118 aGrpLayout->setMargin(9);
119 aGrpLayout->setSpacing(6);
120 aGrpLayout->addWidget(anObjLbl1, 0, 0);
121 aGrpLayout->addWidget(mySelButton1, 0, 1);
122 aGrpLayout->addWidget(myEditObjName1, 0, 2);
123 aGrpLayout->addWidget(anObjLbl2, 1, 0);
124 aGrpLayout->addWidget(mySelButton2, 1, 1);
125 aGrpLayout->addWidget(myEditObjName2, 1, 2);
126 aGrpLayout->addWidget(aDeflectLbl, 2, 0);
127 aGrpLayout->addWidget(myDeflection, 2, 1, 1, 2);
128 aGrpLayout->addWidget(myDetGaps, 3, 0);
129 aGrpLayout->addWidget(myTolerance, 3, 1, 1, 2);
130 aGrpLayout->addWidget(myComputeButton, 4, 0, 1, 3);
132 QGridLayout *aGrpLayout2 = new QGridLayout();
133 aGrpLayout->addLayout(aGrpLayout2, 5, 0, 1, 3);
134 aGrpLayout2->addWidget(aShapeLbl1, 0, 0);
135 aGrpLayout2->addWidget(aShapeLbl2, 0, 1);
136 aGrpLayout2->addWidget(myShapeList1, 1, 0);
137 aGrpLayout2->addWidget(myShapeList2, 1, 1);
139 QVBoxLayout* layout = new QVBoxLayout (centralWidget());
140 layout->setMargin(0); layout->setSpacing(6);
141 layout->addWidget(aGrp);
143 /***************************************************************/
145 myHelpFileName = "fast_intersection_page.html";
151 //=================================================================================
152 // function : ~MeasureGUI_FastCheckIntersectionsDlg()
153 // purpose : Destroys the object and frees any allocated resources
154 //=================================================================================
155 MeasureGUI_FastCheckIntersectionsDlg::~MeasureGUI_FastCheckIntersectionsDlg()
159 //=================================================================================
162 //=================================================================================
163 void MeasureGUI_FastCheckIntersectionsDlg::Init()
167 myEditObjName1->setText("");
168 myEditObjName2->setText("");
169 myEditObjName1->setEnabled(true);
170 myEditObjName2->setEnabled(false);
172 myDetGaps->setChecked(false);
173 double SpecificStep = 0.001;
174 double prec = Precision::Confusion();
175 initSpinBox(myTolerance, prec, MAX_NUMBER, SpecificStep);
176 myTolerance->setValue(SpecificStep);
177 myTolerance->setEnabled(false);
179 // Obtain deflection from preferences
180 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
181 const char* quantity = "deflection_coeff";
182 double aDeflection = resMgr->doubleValue("Geometry", quantity, 0.00001);
183 initSpinBox(myDeflection, prec, 1.0, aDeflection);
184 myDeflection->setValue(aDeflection);
186 myEditCurrentArgument = myEditObjName1;
188 connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()),
189 this, SLOT(DeactivateActiveDialog()));
190 connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()),
191 this, SLOT(ClickOnCancel()));
192 connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
193 connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
194 connect(mySelButton1, SIGNAL(clicked()),
195 this, SLOT(SetEditCurrentArgument()));
196 connect(mySelButton2, SIGNAL(clicked()),
197 this, SLOT(SetEditCurrentArgument()));
198 connect(myDetGaps, SIGNAL(toggled(bool)), this, SLOT(OnGaps(bool)));
199 connect( myTolerance, SIGNAL(valueChanged(double)), this, SLOT(clear()));
200 connect( myDeflection, SIGNAL(valueChanged(double)), this, SLOT(clear()));
201 connect(myShapeList1, SIGNAL(itemSelectionChanged()),
202 SLOT(onSubShapesListSelectionChanged()));
203 connect(myShapeList2, SIGNAL(itemSelectionChanged()),
204 SLOT(onSubShapesListSelectionChanged()));
205 connect(myComputeButton, SIGNAL(clicked()), this, SLOT(onCompute()));
207 LightApp_SelectionMgr* aSel = myGeomGUI->getApp()->selectionMgr();
209 connect(aSel, SIGNAL(currentSelectionChanged()),
210 this, SLOT(SelectionIntoArgument()));
212 initName(tr("GEOM_FAST_INTERSECTION_NAME"));
213 buttonOk()->setEnabled(false);
214 buttonApply()->setEnabled(false);
215 myComputeButton->setEnabled(false);
218 mySelButton1->click();
219 SelectionIntoArgument();
222 //=================================================================================
225 //=================================================================================
226 void MeasureGUI_FastCheckIntersectionsDlg::clear()
228 disconnect(myShapeList1, SIGNAL(itemSelectionChanged()), this, 0);
229 disconnect(myShapeList2, SIGNAL(itemSelectionChanged()), this, 0);
230 myShapeList1->clear();
231 myShapeList2->clear();
232 connect(myShapeList1, SIGNAL(itemSelectionChanged()),
233 SLOT(onSubShapesListSelectionChanged()));
234 connect(myShapeList2, SIGNAL(itemSelectionChanged()),
235 SLOT(onSubShapesListSelectionChanged()));
237 buttonOk()->setEnabled(false);
238 buttonApply()->setEnabled(false);
239 myComputeButton->setEnabled(true);
242 //=================================================================================
243 // function : onCompute
245 //=================================================================================
246 void MeasureGUI_FastCheckIntersectionsDlg::onCompute()
248 myShapeList1->clear();
249 myShapeList2->clear();
251 if (!findIntersections()) {
252 myShapeList1->addItem(tr("GEOM_FAST_INTERSECTION_FAILS"));
253 myShapeList1->setEnabled(false);
254 myShapeList2->addItem(tr("GEOM_FAST_INTERSECTION_FAILS"));
255 myShapeList2->setEnabled(false);
259 myShapeList1->setEnabled(true);
260 myShapeList2->setEnabled(true);
261 QStringList aSubShapeList1, aSubShapeList2;
262 TopoDS_Shape aSelShape1, aSelShape2;
263 if (myObj1 && GEOMBase::GetShape(myObj1.get(), aSelShape1) && myObj2
264 && GEOMBase::GetShape(myObj2.get(), aSelShape2)) {
265 TopTools_IndexedMapOfShape anIndices1, anIndices2;
266 TopExp::MapShapes(aSelShape1, anIndices1);
267 TopExp::MapShapes(aSelShape2, anIndices2);
269 //Sub-shapes of 1st Object
270 for (int i = 0; i < myInters1->length(); i++) {
271 TopoDS_Shape aSubShape = anIndices1.FindKey(myInters1[i]);
272 QString aType = GEOMBase::GetShapeTypeString(aSubShape);
273 if (!aType.isEmpty())
274 aSubShapeList1.append(QString("%1_%2").arg(aType).arg(myInters1[i]));
276 myShapeList1->addItems(aSubShapeList1);
277 myShapeList1->selectAll();
279 //Sub-shapes of second Object
280 for (int i = 0; i < myInters2->length(); i++) {
281 TopoDS_Shape aSubShape = anIndices2.FindKey(myInters2[i]);
282 QString aType = GEOMBase::GetShapeTypeString(aSubShape);
283 if (!aType.isEmpty())
284 aSubShapeList2.append(QString("%1_%2").arg(aType).arg(myInters2[i]));
286 myShapeList2->addItems(aSubShapeList2);
287 myShapeList2->selectAll();
290 buttonOk()->setEnabled(true);
291 buttonApply()->setEnabled(true);
292 myComputeButton->setEnabled(false);
295 //=================================================================================
296 // function : ActivateThisDialog
298 //=================================================================================
299 void MeasureGUI_FastCheckIntersectionsDlg::ActivateThisDialog()
301 GEOMBase_Skeleton::ActivateThisDialog();
303 LightApp_SelectionMgr* aSel = myGeomGUI->getApp()->selectionMgr();
305 connect( aSel, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
308 DISPLAY_PREVIEW_MACRO
311 //=================================================================================
312 // function : DeactivateActiveDialog()
313 // purpose : public slot to deactivate if active
314 //=================================================================================
315 void MeasureGUI_FastCheckIntersectionsDlg::DeactivateActiveDialog()
317 GEOMBase_Skeleton::DeactivateActiveDialog();
320 //=================================================================================
321 // function : activateSelection
323 //=================================================================================
324 void MeasureGUI_FastCheckIntersectionsDlg::activateSelection()
326 TColStd_MapOfInteger aTypes;
327 aTypes.Add(GEOM_COMPOUND );
328 aTypes.Add(GEOM_SOLID );
329 aTypes.Add(GEOM_SHELL);
330 aTypes.Add(GEOM_FACE);
331 globalSelection(aTypes);
333 std::list<int> needTypes;
334 needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
335 localSelection(GEOM::GEOM_Object::_nil(), needTypes );
339 //=================================================================================
340 // function : ClickOnOk()
342 //=================================================================================
343 void MeasureGUI_FastCheckIntersectionsDlg::ClickOnOk()
345 if ( ClickOnApply() )
349 //=================================================================================
350 // function : ClickOnApply()
352 //=================================================================================
353 bool MeasureGUI_FastCheckIntersectionsDlg::ClickOnApply()
363 //=================================================================================
364 // function : extractPrefix
366 //=================================================================================
367 bool MeasureGUI_FastCheckIntersectionsDlg::extractPrefix() const
372 //=================================================================================
373 // function : createOperation
375 //=================================================================================
376 GEOM::GEOM_IOperations_ptr MeasureGUI_FastCheckIntersectionsDlg::createOperation()
378 return getGeomEngine()->GetIMeasureOperations( getStudyId() );
381 //=================================================================================
382 // function : isValid
384 //=================================================================================
385 bool MeasureGUI_FastCheckIntersectionsDlg::isValid( QString& )
387 return myObj1 && myObj2;
390 //=================================================================================
391 // function : SetEditCurrentArgument
393 //=================================================================================
394 void MeasureGUI_FastCheckIntersectionsDlg::SetEditCurrentArgument()
396 QPushButton* send = (QPushButton*)sender();
398 if (send == mySelButton1) {
399 myEditCurrentArgument = myEditObjName1;
401 mySelButton2->setDown(false);
402 myEditObjName2->setEnabled(false);
406 myEditCurrentArgument = myEditObjName2;
408 mySelButton1->setDown(false);
409 myEditObjName1->setEnabled(false);
413 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
415 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
416 this, SLOT(SelectionIntoArgument()));
419 myEditCurrentArgument->setEnabled(true);
420 myEditCurrentArgument->setFocus();
421 // after setFocus(), because it will be setDown(false) when loses focus
424 SelectionIntoArgument();
427 //=================================================================================
428 // function : OnGaps()
430 //=================================================================================
431 void MeasureGUI_FastCheckIntersectionsDlg::OnGaps(bool cheked)
434 myTolerance->setEnabled(cheked);
436 //=================================================================================
437 // function : SelectionIntoArgument
439 //=================================================================================
440 void MeasureGUI_FastCheckIntersectionsDlg::SelectionIntoArgument()
442 myEditCurrentArgument->setText("");
446 QList<TopAbs_ShapeEnum> typesLst;
447 typesLst << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPOUND;
448 GEOM::GeomObjPtr aSelectedObject = getSelected( typesLst );
451 disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
452 myGeomGUI->getApp()->selectionMgr()->clearSelected();
453 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
454 this, SLOT(SelectionIntoArgument()));
456 if (myEditCurrentArgument == myEditObjName1) {
457 myObj1 = aSelectedObject;
458 if (myObj1 && !myObj2)
459 mySelButton2->click();
462 myObj2 = aSelectedObject;
463 if (myObj2 && !myObj1)
464 mySelButton1->click();
466 myEditObjName1->setText(myObj1 ? GEOMBase::GetName(myObj1.get()) : "");
467 myEditObjName2->setText(myObj2 ? GEOMBase::GetName(myObj2.get()) : "");
470 //=================================================================================
471 // function : enterEvent
473 //=================================================================================
474 void MeasureGUI_FastCheckIntersectionsDlg::enterEvent(QEvent *)
476 if (!mainFrame()->GroupConstructors->isEnabled())
477 ActivateThisDialog();
480 //=================================================================================
481 // function : findIntersections
483 //=================================================================================
484 bool MeasureGUI_FastCheckIntersectionsDlg::findIntersections()
486 if (!myObj1 || !myObj2)
489 GEOM::GEOM_IMeasureOperations_var anOper =
490 GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
495 HasInte = anOper->FastIntersect(myObj1.get(), myObj2.get(), getTolerance(), getDeflection(), myInters1, myInters2);
497 catch (const SALOME::SALOME_Exception& e) {
498 SalomeApp_Tools::QtCatchCorbaException(e);
502 bool isDone = anOper->IsDone();
504 CORBA::String_var aMsg = anOper->GetErrorCode();
505 SUIT_MessageBox::warning(this,
506 QObject::tr("WRN_WARNING"),
507 QObject::tr(aMsg.in()));
510 if ( !HasInte || myInters1->length() == 0 || myInters2->length() == 0)
516 //=================================================================================
517 // function : onSubShapesListSelectionChanged
519 //=================================================================================
520 void MeasureGUI_FastCheckIntersectionsDlg::onSubShapesListSelectionChanged()
523 previewSubShapesListSelection(myShapeList1);
524 previewSubShapesListSelection(myShapeList2);
527 //=================================================================================
528 // function : previewSubShapesListSelection
530 //=================================================================================
531 void MeasureGUI_FastCheckIntersectionsDlg::previewSubShapesListSelection(QListWidget* theWidget)
533 GEOM::ListOfLong_var anInters;
534 GEOM::GeomObjPtr anObj;
536 if (theWidget == myShapeList1) { // Sub-Shapes of Object 1
538 anInters = myInters1;
541 if (theWidget == myShapeList2) { // Sub-Shapes of Object 2
543 anInters = myInters2;
549 for (int i = 0, n = theWidget->count(); i < n; i++) {
550 if (theWidget->item(i)->isSelected())
553 if (aIds.count() < 1)
556 TopoDS_Shape aSelShape;
557 TopoDS_Shape aSubShape;
558 TopTools_IndexedMapOfShape anIndices;
559 if (anObj && GEOMBase::GetShape(anObj.get(), aSelShape)) {
560 SALOME_Prs* aPrs = 0;
561 TopExp::MapShapes(aSelShape, anIndices);
562 QList<int>::iterator it;
563 for (it = aIds.begin(); it != aIds.end(); ++it) {
564 aSubShape = anIndices.FindKey(anInters[(*it)]);
566 getDisplayer()->SetColor(Quantity_NOC_RED);
567 getDisplayer()->SetWidth(3);
568 getDisplayer()->SetToActivate(false);
569 aPrs = !aSubShape.IsNull() ? getDisplayer()->BuildPrs(aSubShape) : 0;
571 displayPreview(aPrs, true);
573 catch (const SALOME::SALOME_Exception& e) {
574 SalomeApp_Tools::QtCatchCorbaException(e);
580 //=================================================================================
581 // function : getLstObjFromListSelection
583 //=================================================================================
584 GEOM::ListOfGO_var MeasureGUI_FastCheckIntersectionsDlg::getLstObjFromListSelection(QListWidget* theWidget)
586 GEOM::ListOfLong_var anInters;
587 GEOM::GeomObjPtr anObj;
588 GEOM::ListOfGO_var anObjLst = new GEOM::ListOfGO();
590 if (theWidget == myShapeList1) { // Sub-Shapes of Object 1
592 anInters = myInters1;
595 if (theWidget == myShapeList2) { // Sub-Shapes of Object 2
597 anInters = myInters2;
602 //Add in study myObj if local selection
603 GEOMBase::PublishSubObject( anObj.get() );
604 // Collect the map of indices and already publised objects
605 TColStd_IndexedMapOfInteger aMapIndex;
606 ObjectList aObjLstExist;
607 for (int i = 0, n = theWidget->count(); i < n; i++) {
608 if (theWidget->item(i)->isSelected()) {
609 GEOM::GEOM_Object_var aTmpObj = GEOMBase_Helper::findObjectInFather(anObj.get(), anInters[i]);
610 if (aTmpObj->_is_nil())
611 aMapIndex.Add(anInters[i]);
613 aObjLstExist.push_back( GEOM::GEOM_Object::_duplicate(aTmpObj));
617 if (aMapIndex.IsEmpty() && aObjLstExist.empty())
621 GEOM::ListOfLong_var anArray = new GEOM::ListOfLong;
622 const int aNbShapes = aMapIndex.Extent();
623 anArray->length(aNbShapes);
624 for (int i = 1; i <= aNbShapes; i++) {
625 anArray[i - 1] = aMapIndex.FindKey(i);
628 if (myShapesOper->_is_nil())
629 myShapesOper = getGeomEngine()->GetIShapesOperations(getStudyId());
631 GEOM::ListOfGO_var aObjLstCreate = myShapesOper->MakeSubShapes(anObj.get(), anArray);
633 //Collect all objects in list
634 anObjLst->length(aObjLstCreate->length() + aObjLstExist.size());
636 ObjectList::iterator anIter;
638 for (i=0, anIter = aObjLstExist.begin(); anIter != aObjLstExist.end(); i++, ++anIter) {
639 anObjLst[i] = *anIter;
641 for (int j = 0; j < aObjLstCreate->length(); j++) {
642 anObjLst[aObjLstExist.size()+j]=aObjLstCreate[j];
644 return anObjLst._retn();
647 //=================================================================================
648 // function : execute
650 //=================================================================================
651 bool MeasureGUI_FastCheckIntersectionsDlg::execute(ObjectList& objects)
653 GEOM::ListOfGO_var aList1 = getLstObjFromListSelection(myShapeList1);
654 GEOM::ListOfGO_var aList2 = getLstObjFromListSelection(myShapeList2);
655 GEOM::ListOfGO_var aCompList = new GEOM::ListOfGO();
656 const int nbObj = aList1->length() + aList2->length();
660 //Collect general intersection list
661 aCompList->length(nbObj);
663 for (i = 0; i < aList1->length(); i++) {
664 GEOMBase::PublishSubObject( aList1[i] );
665 aCompList[i]=aList1[i];
667 for (int j = 0; j < aList2->length(); j++) {
668 GEOMBase::PublishSubObject( aList2[j] );
669 aCompList[i+j]=aList2[j];
673 objects.push_back(myShapesOper->MakeCompound(aCompList));
677 //=================================================================================
678 // function : getDeflection
680 //=================================================================================
681 float MeasureGUI_FastCheckIntersectionsDlg::getDeflection()
683 return (float)myDeflection->value();
686 //=================================================================================
687 // function : getTolerance
689 //=================================================================================
690 double MeasureGUI_FastCheckIntersectionsDlg::getTolerance()
692 double aVal = myTolerance->value();
693 if (!myDetGaps->isChecked() || aVal < 0.0)