// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
//=================================================================================
// class : BasicGUI_ArcDlg()
-// purpose : Constructs a BasicGUI_ArcDlg which is a child of 'parent', with the
+// purpose : Constructs a BasicGUI_ArcDlg which is a child of 'parent', with the
// name 'name' and widget flags set to 'f'.
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-BasicGUI_ArcDlg::BasicGUI_ArcDlg(GeometryGUI* theGeometryGUI, QWidget* parent, const char* name, bool modal, WFlags fl)
- :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
- myGeometryGUI()
+BasicGUI_ArcDlg::BasicGUI_ArcDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
+ const char* name, bool modal, WFlags fl)
+ : GEOMBase_Skeleton(parent, name, modal, WStyle_Customize |
+ WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+ myGeometryGUI(theGeometryGUI)
{
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ARC")));
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
Group3Pnts->LineEdit1->setReadOnly( true );
Group3Pnts->LineEdit2->setReadOnly( true );
Group3Pnts->LineEdit3->setReadOnly( true );
-
+
Group3Pnts->PushButton1->setPixmap(image1);
Group3Pnts->PushButton2->setPixmap(image1);
Group3Pnts->PushButton3->setPixmap(image1);
connect(Group3Pnts->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3Pnts->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
initName( tr( "GEOM_ARC" ) );
}
ClickOnCancel();
}
-//=======================================================================
+//=================================================================================
// function : ClickOnCancel()
// purpose :
-//=======================================================================
+//=================================================================================
void BasicGUI_ArcDlg::ClickOnCancel()
{
GEOMBase_Skeleton::ClickOnCancel();
Group3Pnts->LineEdit2->setText( "" );
Group3Pnts->LineEdit3->setText( "" );
myEditCurrentArgument = Group3Pnts->LineEdit1;
-
+
return true;
}
void BasicGUI_ArcDlg::SelectionIntoArgument()
{
myEditCurrentArgument->setText("");
-
- if ( IObjectCount() != 1 )
+
+ if ( IObjectCount() != 1 )
{
if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
Standard_Boolean aRes = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
- {
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ {
+ myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = aSelectedObject;
if ( send == Group3Pnts->PushButton1 ) myEditCurrentArgument = Group3Pnts->LineEdit1;
else if ( send == Group3Pnts->PushButton2 ) myEditCurrentArgument = Group3Pnts->LineEdit2;
else if ( send == Group3Pnts->PushButton3 ) myEditCurrentArgument = Group3Pnts->LineEdit3;
-
+
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
// purpose :
//=================================================================================
void BasicGUI_ArcDlg::LineEditReturnPressed()
-{
+{
QLineEdit* send = (QLineEdit*)sender();
if ( send == Group3Pnts->LineEdit1 ||
send == Group3Pnts->LineEdit2 ||
void BasicGUI_ArcDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
// myGeometryGUI->SetState( 0 );
globalSelection( GEOM_POINT );
//=================================================================================
bool BasicGUI_ArcDlg::execute( ObjectList& objects )
{
- GEOM::GEOM_Object_var anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeArc( myPoint1, myPoint2, myPoint3 );
+ GEOM::GEOM_Object_var anObj =
+ GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->MakeArc(myPoint1, myPoint2, myPoint3);
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
return true;
}
case 212: // MENU VIEW - DISPLAY ALL
{
+ getGeometryGUI()->EmitSignalDeactivateDialog();
myDisplayGUI->DisplayAll();
break;
}
case 213: // MENU VIEW - DISPLAY ONLY
{
+ getGeometryGUI()->EmitSignalDeactivateDialog();
myDisplayGUI->DisplayOnly();
break;
}
}
case 216: // MENU VIEW - DISPLAY
{
+ getGeometryGUI()->EmitSignalDeactivateDialog();
myDisplayGUI->Display();
break;
}
aDlg = new RepairGUI_RemoveIntWiresDlg( parent, "" );
break;
case 608: // ADD POINT ON EDGE
- aDlg = new RepairGUI_DivideEdgeDlg( parent, "" );
+ aDlg = new RepairGUI_DivideEdgeDlg( getGeometryGUI(), parent, "" );
break;
case 609: // FREE BOUNDARIES
aDlg = new RepairGUI_FreeBoundDlg( getGeometryGUI(), parent );
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// The dialog will by default be modeless, unless you set 'modal' to
// TRUE to construct a modal dialog.
//=================================================================================
-RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg(QWidget* parent, const char* name, bool modal, WFlags fl)
- :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg (GeometryGUI* theGeometryGUI, QWidget* parent,
+ const char* name, bool modal, WFlags fl)
+ : GEOMBase_Skeleton(parent, name, modal, WStyle_Customize |
+ WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
+ myGeomGUI = theGeometryGUI;
+
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_DIVIDE_EDGE")));
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
myIsParameterGr->find( 0 )->toggle();
QGridLayout* aLay = new QGridLayout( 0, 1, 2, 0, 6, "aLay" );
- myValEdt = new QtxDblSpinBox(0., 1., 0.1, GroupPoints->GroupBox1);// QAD_SpinBoxDbl( GroupPoints->GroupBox1, 0., 1., 0.1, 3 );
+ myValEdt = new QtxDblSpinBox(0., 1., 0.1, GroupPoints->GroupBox1);
myValEdt->setPrecision( 3 );
myValEdt->setValue( 0.5 );
QLabel* aLbl1 = new QLabel( tr( "GEOM_VALUE" ), GroupPoints->GroupBox1 );
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+ connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
initName( tr( "DEVIDE_EDGE_NEW_OBJECT_NAME" ) );
}
}
-
//=================================================================================
// function : ClickOnApply()
// purpose :
bool RepairGUI_DivideEdgeDlg::ClickOnApply()
{
if ( !onAccept() )
- return false;
+ return false;
initName();
TopoDS_Shape aShape;
if ( myGeomBase->GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) )
{
- const int aType = aShape.ShapeType();
- if ( aType <= TopAbs_EDGE ) // edge, wire, face, shell, solid, compound
- {
- GEOM::short_array anIndexes;
-
- TColStd_IndexedMapOfInteger aMap;
- ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( anIO, aMap );
-
- if ( !aMap.IsEmpty() ) // subshape selection
- {
- myIndex = aMap( 1 );
- myObject = aSelectedObj;
- myEditCurrentArgument->setText( tr( "GEOM_EDGE" ) + "_1" );
- }
- else if ( aType == TopAbs_EDGE ) // single shape selection
- {
- myIndex = -1;
- myObject = aSelectedObj;
- myEditCurrentArgument->setText( GEOMBase::GetName( myObject ) );
- }
- else // face, shell, solid or compound was selected, and NOT its subshape.
- {
- myIndex = -1;
- myObject = GEOM::GEOM_Object::_nil();
- }
- }
+ const int aType = aShape.ShapeType();
+ if ( aType <= TopAbs_EDGE ) // edge, wire, face, shell, solid, compound
+ {
+ GEOM::short_array anIndexes;
+
+ TColStd_IndexedMapOfInteger aMap;
+ SalomeApp_Application* anApp =
+ (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
+ anApp->selectionMgr()->GetIndexes( anIO, aMap );
+
+ if ( !aMap.IsEmpty() ) // subshape selection
+ {
+ myIndex = aMap( 1 );
+ myObject = aSelectedObj;
+ myEditCurrentArgument->setText( tr( "GEOM_EDGE" ) + "_1" );
+ }
+ else if ( aType == TopAbs_EDGE ) // single shape selection
+ {
+ myIndex = -1;
+ myObject = aSelectedObj;
+ myEditCurrentArgument->setText( GEOMBase::GetName( myObject ) );
+ }
+ else // face, shell, solid or compound was selected, and NOT its subshape.
+ {
+ myIndex = -1;
+ myObject = GEOM::GEOM_Object::_nil();
+ }
+ }
}
}
}
if( sender() == GroupPoints->LineEdit1 )
{
myEditCurrentArgument = GroupPoints->LineEdit1;
- GEOMBase_Skeleton::LineEditReturnPressed();
- }
+ GEOMBase_Skeleton::LineEditReturnPressed();
+ }
}
GEOMBase_Skeleton::DeactivateActiveDialog();
}
-
//=================================================================================
// function : ActivateThisDialog()
// purpose :
void RepairGUI_DivideEdgeDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+ connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
myObject = GEOM::GEOM_Object::_nil();
myIndex = -1;
initSelection();
}
-
//=================================================================================
// function : enterEvent()
// purpose : Mouse enter onto the dialog to activate it
ActivateThisDialog();
}
-
//=================================================================================
// function : closeEvent()
// purpose :
GEOMBase_Skeleton::closeEvent( e );
}
+
//=================================================================================
// function : createOperation
// purpose :
//=================================================================================
bool RepairGUI_DivideEdgeDlg::isValid( QString& msg )
{
- return !myObject->_is_nil();
+ return !myObject->_is_nil();
}
//=================================================================================
//=================================================================================
bool RepairGUI_DivideEdgeDlg::execute( ObjectList& objects )
{
- GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow( getOperation() )->DivideEdge(
- myObject, myIndex, myValEdt->value(), getIsByParameter() );
- bool aResult = !anObj->_is_nil();
- if ( aResult )
- objects.push_back( anObj._retn() );
+ GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow( getOperation() )->DivideEdge
+ ( myObject, myIndex, myValEdt->value(), getIsByParameter() );
+ bool aResult = !anObj->_is_nil();
+ if ( aResult )
+ objects.push_back( anObj._retn() );
- return aResult;
+ return aResult;
}
//=================================================================================
//=================================================================================
bool RepairGUI_DivideEdgeDlg::getIsByParameter() const
{
- return myIsParameterGr->find( 0 )->isOn();
+ return myIsParameterGr->find( 0 )->isOn();
}
//=================================================================================
GEOM::GEOM_Object_var aNullGeomObject;
localSelection( aNullGeomObject, TopAbs_EDGE ); // load local selection on ALL objects
}
-
-
-
// GEOM GEOMGUI : GUI for Geometry component
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
Q_OBJECT
public:
- RepairGUI_DivideEdgeDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
+ RepairGUI_DivideEdgeDlg (GeometryGUI* theGeometryGUI, QWidget* parent = 0,
+ const char* name = 0, bool modal = FALSE, WFlags fl = 0);
~RepairGUI_DivideEdgeDlg();
protected:
bool getIsByParameter() const;
- GEOM::GEOM_Object_var myObject;
- int myIndex;
+ GEOM::GEOM_Object_var myObject;
+ int myIndex;
DlgRef_1Sel_Ext* GroupPoints;
QButtonGroup* myIsParameterGr;
QtxDblSpinBox* myValEdt;
-private slots:
+protected slots:
void ClickOnOk();
bool ClickOnApply();
void ClickOnCancel();