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 : BuildGUI_FaceDlg.cxx
25 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
27 #include "BuildGUI_FaceDlg.h"
29 #include <GEOMImpl_Types.hxx>
30 #include <TColStd_MapOfInteger.hxx>
33 #include <GeometryGUI.h>
36 #include <SalomeApp_Application.h>
37 #include <LightApp_SelectionMgr.h>
39 #include <SUIT_ResourceMgr.h>
40 #include <SUIT_Session.h>
41 #include <SUIT_MessageBox.h>
42 #include <SUIT_OverrideCursor.h>
44 #include <QTreeWidget>
46 //=================================================================================
47 // class : BuildGUI_TreeWidgetItem
48 // purpose : class for constraint(Edge-Face) creation
49 //=================================================================================
50 class BuildGUI_FaceDlg::TreeWidgetItem : public QTreeWidgetItem
53 TreeWidgetItem( QTreeWidget*, const GEOM::GeomObjPtr, int = Type );
54 TreeWidgetItem( QTreeWidgetItem*, const GEOM::GeomObjPtr, int = Type );
56 void setFace( const GEOM::GeomObjPtr );
57 GEOM::GeomObjPtr getFace() const;
58 GEOM::GeomObjPtr getEdge() const;
60 GEOM::GeomObjPtr myEdge;
61 GEOM::GeomObjPtr myFace;
64 BuildGUI_FaceDlg::TreeWidgetItem::TreeWidgetItem( QTreeWidget* view, const GEOM::GeomObjPtr edge, int type )
65 :QTreeWidgetItem( view, QStringList()<<GEOMBase::GetName( edge.get() ), type ),
71 BuildGUI_FaceDlg::TreeWidgetItem::TreeWidgetItem( QTreeWidgetItem* parent, const GEOM::GeomObjPtr edge, int type )
72 :QTreeWidgetItem( parent, QStringList()<<GEOMBase::GetName( edge.get() ), type ),
78 BuildGUI_FaceDlg::TreeWidgetItem::~TreeWidgetItem()
82 void BuildGUI_FaceDlg::TreeWidgetItem::setFace( const GEOM::GeomObjPtr face )
84 QString aName = GEOMBase::GetName( face.get() );
86 treeWidget()->resizeColumnToContents(1);
90 GEOM::GeomObjPtr BuildGUI_FaceDlg::TreeWidgetItem::getFace() const
95 GEOM::GeomObjPtr BuildGUI_FaceDlg::TreeWidgetItem::getEdge() const
100 //=================================================================================
101 // class : BuildGUI_FaceDlg()
102 // purpose : Constructs a BuildGUI_FaceDlg which is a child of 'parent', with the
103 // name 'name' and widget flags set to 'f'.
104 // The dialog will by default be modeless, unless you set 'modal' to
105 // TRUE to construct a modal dialog.
106 //=================================================================================
107 BuildGUI_FaceDlg::BuildGUI_FaceDlg( GeometryGUI* theGeometryGUI, QWidget* parent )
108 : GEOMBase_Skeleton( theGeometryGUI, parent ),
111 myGroupWireConstraints(0)
113 QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
114 QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BUILD_FACE" ) ) );
115 QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BUILD_FACE_SURFACE" ) ) );
116 QPixmap image3( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BUILD_FACE_CONSTRAINTS" ) ) );
118 setWindowTitle( tr( "GEOM_FACE_TITLE" ) );
120 /***************************************************************/
121 mainFrame()->GroupConstructors->setTitle( tr( "GEOM_FACE" ) );
122 mainFrame()->RadioButton1->setIcon( image1 );
123 mainFrame()->RadioButton2->setIcon( image2 );
124 mainFrame()->RadioButton3->setIcon( image3 );
126 // Face creation from wires and/or edges
128 myGroupWire = new DlgRef_1Sel1Check( centralWidget() );
130 myGroupWire->GroupBox1->setTitle( tr( "GEOM_FACE_FFW" ) );
131 myGroupWire->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
132 myGroupWire->CheckButton1->setText( tr( "GEOM_FACE_OPT" ) );
133 myGroupWire->PushButton1->setIcon( image0 );
135 // Face creation from surface
137 myGroupSurf = new DlgRef_2Sel(centralWidget());
139 myGroupSurf->GroupBox1->setTitle(tr("GEOM_FACE_FROM_SURFACE" ) );
140 myGroupSurf->TextLabel1->setText(tr("GEOM_FACE"));
141 myGroupSurf->TextLabel2->setText(tr("GEOM_WIRE"));
142 myGroupSurf->PushButton1->setIcon(image0);
143 myGroupSurf->PushButton2->setIcon(image0);
145 // Face creation from wire and constraints
147 myGroupWireConstraints = new DlgRef_1SelExt( centralWidget() );
148 myGroupWireConstraints->GroupBox1->setTitle( tr( "GEOM_FACE_FFWC" ) );
149 myGroupWireConstraints->TextLabel1->setText( tr( "GEOM_WIRE" ) );
150 myGroupWireConstraints->PushButton1->setIcon( image0 );
152 QLabel* aLabel = new QLabel( tr( "GEOM_CONSTRAINTS" ) );
153 myTreeConstraints = new QTreeWidget( myGroupWireConstraints->Box );
154 myTreeConstraints->setColumnCount(2);
155 QStringList columnNames;
156 columnNames.append( tr( "GEOM_EDGE" ));
157 columnNames.append( tr( "GEOM_FACE_CONSTRAINT" ) );
158 myTreeConstraints->setHeaderLabels( columnNames );
159 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
160 myTreeConstraints->header()->setMovable( false );
161 myTreeConstraints->header()->setResizeMode( QHeaderView::ResizeToContents );
163 myTreeConstraints->header()->setSectionsMovable( false );
164 myTreeConstraints->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
166 myTreeConstraints->setMinimumHeight( 140 );
168 QHBoxLayout* l = new QHBoxLayout( myGroupWireConstraints->Box );
169 l->setMargin( 0 ); l->setSpacing( 6 );
170 l->addWidget( aLabel);
171 l->addWidget( myTreeConstraints );
173 QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
174 layout->setMargin( 0 ); layout->setSpacing( 6 );
175 layout->addWidget( myGroupWire );
176 layout->addWidget( myGroupSurf );
177 layout->addWidget( myGroupWireConstraints );
178 /***************************************************************/
180 setHelpFileName("create_face_page.html");
182 /* Initialisations */
187 //=================================================================================
188 // function : ~BuildGUI_FaceDlg()
189 // purpose : Destroys the object and frees any allocated resources
190 //=================================================================================
191 BuildGUI_FaceDlg::~BuildGUI_FaceDlg()
193 // no need to delete child widgets, Qt does it all for us
197 //=================================================================================
200 //=================================================================================
201 void BuildGUI_FaceDlg::Init()
204 myEditCurrentArgument = myGroupWire->LineEdit1;
205 myGroupWire->LineEdit1->setReadOnly( true );
206 myGroupSurf->LineEdit1->setReadOnly( true );
207 myGroupSurf->LineEdit2->setReadOnly( true );
208 myGroupWireConstraints->LineEdit1->setReadOnly( true );
210 myGroupWire->CheckButton1->setChecked( true );
216 /* signals and slots connections */
217 connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
218 connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
220 connect(this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
222 connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
223 connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
224 connect( myGroupWire->LineEdit1, SIGNAL( returnPressed()), this, SLOT( LineEditReturnPressed() ) );
225 connect( myGroupWire->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
226 connect( myGroupSurf->LineEdit1, SIGNAL( returnPressed()), this, SLOT( LineEditReturnPressed() ) );
227 connect( myGroupSurf->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
228 connect( myGroupSurf->LineEdit2, SIGNAL( returnPressed()), this, SLOT( LineEditReturnPressed() ) );
229 connect( myGroupSurf->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
230 connect( myGroupWireConstraints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
231 connect( myGroupWireConstraints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
232 connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
233 SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
235 connect( myTreeConstraints, SIGNAL( itemClicked( QTreeWidgetItem*, int) ), this, SLOT( onItemClicked( QTreeWidgetItem*, int ) ) );
237 initName( tr( "GEOM_FACE" ) );
239 ConstructorsClicked(0);
242 //=================================================================================
243 // function : ConstructorsClicked()
244 // purpose : Radio button management
245 //=================================================================================
246 void BuildGUI_FaceDlg::ConstructorsClicked(int constructorId)
248 switch (constructorId) {
251 TColStd_MapOfInteger aMap;
256 aMap.Add(GEOM_SHELL);
257 aMap.Add(GEOM_SOLID);
258 aMap.Add(GEOM_COMPOUND);
259 globalSelection(aMap);
261 myEditCurrentArgument = myGroupWire->LineEdit1;
262 myGroupWire->LineEdit1->setText("");
265 myGroupWireConstraints->hide();
270 globalSelection(GEOM_FACE); // For the first element.
271 localSelection( TopAbs_FACE );
273 myEditCurrentArgument = myGroupSurf->LineEdit1;
274 myGroupSurf->LineEdit1->setText("");
275 myGroupSurf->PushButton1->setDown(true);
276 myGroupSurf->PushButton2->setDown(false);
279 myGroupWireConstraints->hide();
285 localSelection( TopAbs_WIRE );
287 myTreeConstraints->clear();
289 myEditCurrentArgument = myGroupWireConstraints->LineEdit1;
290 myGroupWireConstraints->LineEdit1->setText("");
291 myGroupWireConstraints->LineEdit1->setEnabled(true);
294 myGroupWireConstraints->show();
302 qApp->processEvents();
304 resize(minimumSizeHint());
305 SelectionIntoArgument();
308 //=================================================================================
309 // function : updateConstraintsTree
311 //=================================================================================
312 void BuildGUI_FaceDlg::updateConstraintsTree()
314 if ( myEditCurrentArgument != myGroupWireConstraints->LineEdit1 || myWire.isNull() )
317 myTreeConstraints->clear();
319 GEOM::GEOM_IShapesOperations_ptr anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
320 GEOM::ListOfGO_var aList = anOper->ExtractSubShapes( myWire.get(), TopAbs_EDGE, false );
321 if ( !aList->length() )
324 for ( int i = 0, n = aList->length(); i < n; i++ ) {
325 /*TreeWidgetItem* item =*/
326 new TreeWidgetItem( myTreeConstraints, GEOM::GeomObjPtr( aList[i] ) );
329 myEditCurrentArgument->setEnabled(false);
331 localSelection( TopAbs_FACE );
333 myTreeConstraints->resizeColumnToContents(0);
334 QTreeWidgetItem* firstItem = myTreeConstraints->topLevelItem(0);
335 firstItem->setSelected( true );
336 onItemClicked( firstItem, 0 );
339 //=================================================================================
340 // function : findEmptyTreeItem()
342 //=================================================================================
343 void BuildGUI_FaceDlg::findEmptyTreeItem()
348 QTreeWidgetItem* nextItem = 0;
349 QTreeWidgetItem* item;
350 for ( item = myTreeConstraints->itemBelow( myCurrentItem );
352 item = myTreeConstraints->itemBelow( item ) ) {
353 if ( (dynamic_cast<TreeWidgetItem*>(item))->getFace().isNull() )
356 for ( item = myTreeConstraints->topLevelItem(0);
357 item && item != myCurrentItem && !nextItem;
358 item = myTreeConstraints->itemBelow( item ) ) {
359 if ( (dynamic_cast<TreeWidgetItem*>(item))->getFace().isNull() )
363 if ( nextItem && nextItem != myCurrentItem ) {
364 myCurrentItem->setSelected( false );
365 nextItem->setSelected( true );
366 onItemClicked( nextItem, 0 );
370 //=================================================================================
371 // function : isTreeFull()
373 //=================================================================================
374 bool BuildGUI_FaceDlg::isTreeFull()
377 QTreeWidgetItem* item;
378 for ( item = myTreeConstraints->topLevelItem(0);
380 item = myTreeConstraints->itemBelow( item ) ) {
381 ok = !(dynamic_cast<TreeWidgetItem*>(item))->getFace().isNull();
386 //=================================================================================
387 // function : ClickOnOk()
389 //=================================================================================
390 void BuildGUI_FaceDlg::ClickOnOk()
392 setIsApplyAndClose( true );
393 if ( ClickOnApply() )
398 //=================================================================================
399 // function : ClickOnApply()
401 //=================================================================================
402 bool BuildGUI_FaceDlg::ClickOnApply()
409 myEditCurrentArgument->setText("");
410 ConstructorsClicked( getConstructorId() );
415 //=================================================================================
416 // function : SelectionIntoArgument()
417 // purpose : Called when selection as changed or other case
418 //=================================================================================
419 void BuildGUI_FaceDlg::SelectionIntoArgument()
422 if ( myEditCurrentArgument == myGroupWire->LineEdit1 ) {
423 myEditCurrentArgument->setText( "" );
425 QList<TopAbs_ShapeEnum> types;
426 types << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE
427 << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPOUND;
428 myWires = getSelected( types, -1 );
430 if ( !myWires.isEmpty() ) {
431 QString aName = myWires.count() > 1 ? QString( "%1_objects").arg( myWires.count() ) : GEOMBase::GetName( myWires[0].get() );
432 myEditCurrentArgument->setText( aName );
435 else if (myEditCurrentArgument == myGroupSurf->LineEdit1 ||
436 myEditCurrentArgument == myGroupSurf->LineEdit2) {
437 const bool isEditFace = myEditCurrentArgument == myGroupSurf->LineEdit1;
438 const TopAbs_ShapeEnum aType = isEditFace ? TopAbs_FACE : TopAbs_WIRE;
439 GEOM::GeomObjPtr aSelectedObject = getSelected(aType);
440 GEOM::GeomObjPtr &anObj = isEditFace ? myFace : myWire;
442 if (aSelectedObject) {
443 myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject.get()));
444 anObj = aSelectedObject;
446 myEditCurrentArgument->setText("");
451 if (myFace && !myWire) {
452 myGroupSurf->PushButton2->click();
455 if (!myFace && myWire) {
456 myGroupSurf->PushButton1->click();
460 else if ( myEditCurrentArgument == myGroupWireConstraints->LineEdit1 ) {
461 if ( myCurrentItem ) {
462 GEOM::GeomObjPtr aSelectedObject = getSelected( TopAbs_FACE );
463 TopoDS_Shape aFaceShape;
464 GEOM::GEOM_IShapesOperations_ptr anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
465 if ( aSelectedObject && GEOMBase::GetShape( aSelectedObject.get(), aFaceShape ) && !aFaceShape.IsNull()
466 && anOper->IsSubShapeBelongsTo( myCurrentItem->getEdge().get(), 0, aSelectedObject.get(), 0 ) ) {
467 myCurrentItem->setFace( aSelectedObject );
471 myCurrentItem->setFace( 0 );
472 displayPreview( myCurrentItem->getEdge().get(), true, false, true, 5, -1, Quantity_NOC_RED );
477 myEditCurrentArgument->setText( "" );
478 GEOM::GeomObjPtr aSelectedObject = getSelected( TopAbs_WIRE );
479 TopoDS_Shape aWireShape;
480 if ( aSelectedObject && GEOMBase::GetShape( aSelectedObject.get(), aWireShape ) && !aWireShape.IsNull() ) {
481 QString aName = GEOMBase::GetName( aSelectedObject.get() );
482 myEditCurrentArgument->setText( aName );
483 myWire = aSelectedObject;
484 updateConstraintsTree();
487 myTreeConstraints->clear();
488 erasePreview( true );
492 displayPreview( true, false, true, true, -1, -1, -1, true );
496 //=================================================================================
497 // function : SetEditCurrentArgument()
499 //=================================================================================
500 void BuildGUI_FaceDlg::SetEditCurrentArgument()
502 QPushButton* send = (QPushButton*)sender();
503 if ( send == myGroupWire->PushButton1 ) {
504 TColStd_MapOfInteger aMap;
509 aMap.Add(GEOM_SHELL);
510 aMap.Add(GEOM_SOLID);
511 aMap.Add(GEOM_COMPOUND);
512 globalSelection(aMap);
513 myEditCurrentArgument = myGroupWire->LineEdit1;
515 else if (send == myGroupSurf->PushButton1) {
516 globalSelection(GEOM_FACE);
517 localSelection( TopAbs_FACE );
518 myEditCurrentArgument = myGroupSurf->LineEdit1;
519 myGroupSurf->PushButton2->setDown(false);
520 myGroupSurf->LineEdit2->setEnabled(false);
522 else if (send == myGroupSurf->PushButton2) {
523 globalSelection(GEOM_WIRE);
524 localSelection( TopAbs_WIRE );
525 myEditCurrentArgument = myGroupSurf->LineEdit2;
526 myGroupSurf->PushButton1->setDown(false);
527 myGroupSurf->LineEdit1->setEnabled(false);
529 else if (send == myGroupWireConstraints->PushButton1) {
531 localSelection( TopAbs_WIRE );
532 myEditCurrentArgument = myGroupWireConstraints->LineEdit1;
537 myEditCurrentArgument->setEnabled(true);
538 myEditCurrentArgument->setFocus();
539 SelectionIntoArgument();
543 //=================================================================================
544 // function : ActivateThisDialog()
546 //=================================================================================
547 void BuildGUI_FaceDlg::ActivateThisDialog()
549 GEOMBase_Skeleton::ActivateThisDialog();
550 connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
551 SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
552 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
553 this, SLOT(SelectionIntoArgument()));
555 ConstructorsClicked(getConstructorId());
558 //=================================================================================
559 // function : onItemClicked()
560 // purpose : called when tree item was clicked
561 //=================================================================================
562 void BuildGUI_FaceDlg::onItemClicked( QTreeWidgetItem* theItem, int theColumn )
564 if ( !theItem || !( theItem->flags() & Qt::ItemIsSelectable ) )
567 myCurrentItem = dynamic_cast<TreeWidgetItem*>( theItem );
568 displayPreview( true );
569 displayPreview( myCurrentItem->getEdge().get(), true, false, true, 5, -1, Quantity_NOC_RED );
572 //=================================================================================
573 // function : enterEvent()
575 //=================================================================================
576 void BuildGUI_FaceDlg::enterEvent( QEvent* )
578 if ( !mainFrame()->GroupConstructors->isEnabled() )
579 ActivateThisDialog();
582 //=================================================================================
583 // function : createOperation
585 //=================================================================================
586 GEOM::GEOM_IOperations_ptr BuildGUI_FaceDlg::createOperation()
588 return getGeomEngine()->GetIShapesOperations( getStudyId() );
591 //=================================================================================
592 // function : isValid
594 //=================================================================================
595 bool BuildGUI_FaceDlg::isValid( QString& )
599 switch (getConstructorId()) {
601 ok = !myWires.isEmpty();
604 ok = myFace && myWire;
616 //=================================================================================
617 // function : execute
619 //=================================================================================
620 bool BuildGUI_FaceDlg::execute( ObjectList& objects )
623 GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
624 GEOM::GEOM_Object_var anObj;
626 switch (getConstructorId()) {
629 GEOM::ListOfGO_var objlist = new GEOM::ListOfGO();
631 objlist->length( myWires.count() );
633 for ( int i = 0; i < myWires.count(); i++ ) {
634 objlist[i] = myWires[i].copy();
637 anObj = anOper->MakeFaceWires( objlist.in(), myGroupWire->CheckButton1->isChecked() );
642 anObj = anOper->MakeFaceFromSurface(myFace.get(), myWire.get());
647 int numberOfItems = myTreeConstraints->topLevelItemCount();
648 GEOM::ListOfGO_var constraints = new GEOM::ListOfGO();
649 constraints->length( 2 * numberOfItems );
651 for ( int i = 0; i < numberOfItems; i++ ) {
652 TreeWidgetItem* item = dynamic_cast<TreeWidgetItem*>( myTreeConstraints->topLevelItem(i) );
653 constraints[j++] = item->getEdge().copy();
654 if ( item->getFace() )
655 constraints[j++] = item->getFace().copy();
657 constraints->length(j);
658 anObj = anOper->MakeFaceWithConstraints( constraints.in() );
666 if (!anObj->_is_nil()) {
667 if ( !anOper->IsDone() && QString(anOper->GetErrorCode()) == "MAKE_FACE_TOLERANCE_TOO_BIG") {
668 if ( !IsPreview() ) {
669 SUIT_OverrideCursor wc;
671 QString msgw = QObject::tr(anOper->GetErrorCode());
672 SUIT_MessageBox::warning(this, tr("WRN_WARNING"), msgw, tr("BUT_OK"));
674 anOper->SetErrorCode("PAL_NO_ERROR");
676 else if ( anObj->GetShapeType() == GEOM::COMPOUND ) {
677 if ( !IsPreview() ) {
678 SUIT_MessageBox::warning(this,
679 QObject::tr("GEOM_WRN_WARNING"),
680 QObject::tr("GEOM_WRN_FACES_NOT_FACE"));
683 objects.push_back(anObj._retn());
689 //=================================================================================
690 // function : addSubshapeToStudy
691 // purpose : virtual method to add new SubObjects if local selection
692 //=================================================================================
693 void BuildGUI_FaceDlg::addSubshapesToStudy()
695 switch (getConstructorId()) {
701 for( int i = 0; i < myTreeConstraints->topLevelItemCount(); i++ ) {
702 TreeWidgetItem* item = dynamic_cast<TreeWidgetItem*>( myTreeConstraints->topLevelItem(i) );
703 if ( item->getFace().get() )
704 GEOMBase::PublishSubObject( item->getFace().get() );
705 GEOMBase::PublishSubObject( myWire.get() );
713 //=================================================================================
714 // function : getSourceObjects
715 // purpose : virtual method to get source objects
716 //=================================================================================
717 QList<GEOM::GeomObjPtr> BuildGUI_FaceDlg::getSourceObjects()
719 QList<GEOM::GeomObjPtr> res(myWires);
720 res << myFace << myWire;