Mantis issue 0021852: EDF 1680 GEOM: Publish 'Check free boundaries' results in the Object Browser

This commit is contained in:
jfa 2012-12-21 13:13:33 +00:00
parent 9023c3cda7
commit d45b760938
14 changed files with 227 additions and 252 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -4,6 +4,8 @@
Detects and highlights wires and edges that are not shared between
two faces and are considered a shape's boundary.
<br>Creates corresponding objects and publishes them into the study on
"Apply" or "Apply and Close".
<b>TUI Command:</b> <em>(NoError, ClosedWires, OpenWires) =
geompy.GetFreeBoundary(Shape),</em> where \em Shape is a shape to be

View File

@ -509,7 +509,7 @@ GEOM::GEOM_Object_ptr BlocksGUI_ExplodeDlg::getFather( GEOM::GEOM_Object_ptr )
// Function : getNewObjectName
// Purpose : Redefine this method to return proper name for a new object
//================================================================
QString BlocksGUI_ExplodeDlg::getNewObjectName() const
QString BlocksGUI_ExplodeDlg::getNewObjectName (int) const
{
return QString::null;
}

View File

@ -50,7 +50,7 @@ protected:
virtual bool execute( ObjectList& );
virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr );
virtual QString getNewObjectName() const;
virtual QString getNewObjectName (int CurrObj = -1) const;
private:
void Init();

View File

@ -831,7 +831,7 @@ GEOM::GEOM_Object_ptr EntityGUI_SubShapeDlg::getFather(GEOM::GEOM_Object_ptr)
// Function : getNewObjectName
// Purpose :
//================================================================
QString EntityGUI_SubShapeDlg::getNewObjectName() const
QString EntityGUI_SubShapeDlg::getNewObjectName (int) const
{
return QString::null;
}

View File

@ -51,7 +51,7 @@ protected:
virtual bool isValid (QString&);
virtual bool execute (ObjectList&);
virtual GEOM::GEOM_Object_ptr getFather (GEOM::GEOM_Object_ptr);
virtual QString getNewObjectName() const;
virtual QString getNewObjectName (int CurrObj = -1) const;
void closeEvent (QCloseEvent*);

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : GEOMBase_Helper.cxx
// Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
//
#include "GEOMBase_Helper.h"
#include "GEOMBase.h"
#include "GEOM_Operation.h"
@ -858,11 +857,11 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction, b
addSubshapesToStudy(); // add Sub-shapes if local selection
const int nbObjs = objects.size();
QStringList anEntryList;
int aNumber = 1;
for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) {
int currObj = 1, aNumber = 1;
for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it, currObj++ ) {
GEOM::GEOM_Object_var obj=*it;
if ( publish ) {
QString aName = getNewObjectName();
QString aName = getNewObjectName(currObj);
if ( nbObjs > 1 ) {
if (aName.isEmpty())
aName = getPrefix(obj);
@ -1006,7 +1005,7 @@ GEOM::GEOM_Object_ptr GEOMBase_Helper::getFather( GEOM::GEOM_Object_ptr theObj )
// Function : getNewObjectName
// Purpose : Redefine this method to return proper name for a new object
//================================================================
QString GEOMBase_Helper::getNewObjectName() const
QString GEOMBase_Helper::getNewObjectName (int) const
{
return QString::null;
}

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : GEOMBase_Helper.h
// Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
//
#ifndef GEOMBASE_HELPER_H
#define GEOMBASE_HELPER_H
@ -163,7 +162,7 @@ protected:
// for <theObj> or a nil reference if <theObj> should be published
// as a top-level object.
virtual QString getNewObjectName() const;
virtual QString getNewObjectName (int CurrObj = -1) const;
virtual bool extractPrefix() const;
virtual void addSubshapesToStudy();
@ -193,7 +192,6 @@ protected:
virtual void setIsDisableBrowsing( const bool theFlag ) { myIsDisableBrowsing = theFlag; }
virtual bool isDisableBrowsing() const { return myIsDisableBrowsing; }
private:
QString getEntry( GEOM::GEOM_Object_ptr ) const;
void clearShapeBuffer( GEOM::GEOM_Object_ptr );
@ -215,7 +213,6 @@ private:
bool myIsWaitCursorEnabled;
bool myIsDisableBrowsing; //This flag enable/disable selection
//in the Object Browser newly created objects.
};
#endif // GEOMBASE_HELPER_H

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : GEOMBase_Skeleton.cxx
// Author : Damien COQUERET, Open CASCADE S.A.S.
//
#include "GEOMBase_Skeleton.h"
#include "GEOMBase.h"
@ -293,7 +292,7 @@ void GEOMBase_Skeleton::initName( const QString& thePrefix )
// function : getNewObjectName()
// purpose : returns contents of Name field
//=================================================================================
QString GEOMBase_Skeleton::getNewObjectName() const
QString GEOMBase_Skeleton::getNewObjectName (int) const
{
return myMainFrame->ResultName->text();
}

View File

@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : GEOMBase_Skeleton.h
// Author : Damine COQUERET, Open CASCADE S.A.S.
//
#ifndef GEOMBASE_SKELETON_H
#define GEOMBASE_SKELETON_H
@ -74,7 +73,7 @@ protected:
/*! returns contents of "Name" field
*/
virtual QString getNewObjectName() const;
virtual QString getNewObjectName (int CurrObj = -1) const;
/*! returns id of a selected "constructor" radio button or '-1' in case of error
*/

View File

@ -259,6 +259,10 @@
<source>ICON_DLG_FREE_FACES</source>
<translation>free_faces.png</translation>
</message>
<message>
<source>ICON_DLG_FREE_BOUNDS</source>
<translation>free_bound.png</translation>
</message>
<message>
<source>ICON_DLG_FUSE</source>
<translation>fuse.png</translation>

View File

@ -5414,6 +5414,14 @@ Number of sketch points too small</translation>
<source>NUMBER_OPEN</source>
<translation>Number of open free boundaries: </translation>
</message>
<message>
<source>NAME_CLOSED</source>
<translation>Closed_Free_Boundary_%1</translation>
</message>
<message>
<source>NAME_OPEN</source>
<translation>Open_Free_Boundary_%1</translation>
</message>
</context>
<context>
<name>RepairGUI_GlueDlg</name>

View File

@ -18,15 +18,16 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : RepairGUI_FreeBoundDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S. (sergey.litonin@opencascade.com)
//
#include "RepairGUI_FreeBoundDlg.h"
#include <GEOMBase.h>
#include <DlgRef.h>
#include <GeometryGUI.h>
#include <GEOM_Displayer.h>
#include <GEOMImpl_Types.hxx>
@ -51,7 +52,7 @@
#include <QKeyEvent>
#define SPACING 6
#define MARGIN 9
#define MARGIN 0
/*!
Class : RepairGUI_FreeBoundDlg
@ -62,59 +63,55 @@
// function : RepairGUI_FreeBoundDlg
// purpose : Constructor
//=================================================================================
RepairGUI_FreeBoundDlg::RepairGUI_FreeBoundDlg( GeometryGUI* theGUI, QWidget* theParent )
: QDialog( theParent, 0 ),
GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( theParent ) ),
myGeomGUI( theGUI )
RepairGUI_FreeBoundDlg::RepairGUI_FreeBoundDlg (GeometryGUI* theGUI, QWidget* theParent)
: GEOMBase_Skeleton(theGUI, theParent)
{
setAttribute( Qt::WA_DeleteOnClose );
QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_FREE_BOUNDS")));
QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
setWindowTitle( tr( "CAPTION" ) );
setWindowTitle(tr("CAPTION"));
QPixmap iconSelect( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
/***************************************************************/
QGroupBox* aMainGrp = new QGroupBox( tr( "FREE_BOUND" ), this );
mainFrame()->GroupConstructors->setTitle(tr("FREE_BOUND"));
mainFrame()->RadioButton1->setIcon(image0);
mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
mainFrame()->RadioButton2->close();
mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
mainFrame()->RadioButton3->close();
QLabel* lab = new QLabel( tr( "GEOM_OBJECT" ), aMainGrp );
QPushButton* btn = new QPushButton( aMainGrp );
btn->setIcon( iconSelect );
myEdit = new QLineEdit( aMainGrp );
myEdit->setReadOnly( true );
myEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
mainFrame()->GroupBoxName->hide();
myClosedLbl = new QLabel( tr( "NUMBER_CLOSED" ), aMainGrp );
myOpenLbl = new QLabel( tr( "NUMBER_OPEN" ), aMainGrp );
myClosedLbl->setMinimumWidth( 150 );
myOpenLbl->setMinimumWidth( 150 );
QGroupBox* aMainGrp = new QGroupBox (tr("FREE_BOUND"), this);
QGridLayout* aMainGrpLayout = new QGridLayout( aMainGrp );
aMainGrpLayout->setMargin( MARGIN ); aMainGrpLayout->setSpacing( SPACING );
aMainGrpLayout->addWidget( lab, 0, 0 );
aMainGrpLayout->addWidget( btn, 0, 1 );
aMainGrpLayout->addWidget( myEdit, 0, 2 );
aMainGrpLayout->addWidget( myClosedLbl, 1, 0, 1, 3 );
aMainGrpLayout->addWidget( myOpenLbl, 2, 0, 1, 3 );
QLabel* lab = new QLabel (tr("GEOM_OBJECT"), aMainGrp);
QPushButton* btn = new QPushButton (aMainGrp);
btn->setIcon(image1);
myEdit = new QLineEdit (aMainGrp);
myEdit->setReadOnly(true);
myEdit->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
QFrame* aFrame = new QFrame( this );
aFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
QPushButton* aCloseBtn = new QPushButton( tr( "GEOM_BUT_CLOSE" ), aFrame );
QPushButton* aHelpBtn = new QPushButton( tr( "GEOM_BUT_HELP" ), aFrame );
QHBoxLayout* aBtnLay = new QHBoxLayout( aFrame );
aBtnLay->setMargin( MARGIN ); aBtnLay->setSpacing( SPACING );
aBtnLay->addWidget( aCloseBtn );
aBtnLay->addSpacing( SPACING ); aBtnLay->addStretch();
aBtnLay->addWidget( aHelpBtn );
myClosedLbl = new QLabel (tr("NUMBER_CLOSED"), aMainGrp);
myOpenLbl = new QLabel (tr("NUMBER_OPEN"), aMainGrp);
myClosedLbl->setMinimumWidth(150);
myOpenLbl->setMinimumWidth(150);
QVBoxLayout* aLay = new QVBoxLayout( this );
aLay->setSpacing( SPACING );
aLay->setMargin( MARGIN );
aLay->addWidget( aMainGrp );
aLay->addWidget( aFrame );
QGridLayout* aMainGrpLayout = new QGridLayout (aMainGrp);
aMainGrpLayout->addWidget(lab, 0, 0);
aMainGrpLayout->addWidget(btn, 0, 1);
aMainGrpLayout->addWidget(myEdit, 0, 2);
aMainGrpLayout->addWidget(myClosedLbl, 1, 0, 1, 3);
aMainGrpLayout->addWidget(myOpenLbl, 2, 0, 1, 3);
myHelpFileName = "using_measurement_tools_page.html#boundaries_anchor";
QVBoxLayout* aLay = new QVBoxLayout (centralWidget());
aLay->setSpacing(SPACING);
aLay->setMargin(MARGIN);
aLay->addWidget(aMainGrp);
connect( aCloseBtn, SIGNAL( clicked() ), SLOT( onClose() ) );
connect( aHelpBtn, SIGNAL( clicked() ), SLOT( onHelp() ) );
resize(minimumSizeHint());
/***************************************************************/
myHelpFileName = "boundaries_page.html";
Init();
}
@ -127,94 +124,6 @@ RepairGUI_FreeBoundDlg::~RepairGUI_FreeBoundDlg()
{
}
//=================================================================================
// function : onClose
// purpose : SLOT. Called when "close" button pressed. Close dialog
//=================================================================================
void RepairGUI_FreeBoundDlg::onClose()
{
globalSelection();
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
myGeomGUI->SetActiveDialogBox( 0 );
reject();
erasePreview();
}
//=================================================================================
// function : onHelp()
// purpose :
//=================================================================================
void RepairGUI_FreeBoundDlg::onHelp()
{
LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
if ( app )
app->onHelpContextModule( myGeomGUI ? app->moduleName( myGeomGUI->moduleName() ) : QString(""), myHelpFileName );
else {
QString platform;
#ifdef WIN32
platform = "winapplication";
#else
platform = "application";
#endif
SUIT_MessageBox::warning( this,
tr( "WRN_WARNING" ),
tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
arg( app->resourceMgr()->stringValue( "ExternalBrowser",
platform ) ).arg( myHelpFileName ) );
}
}
//=================================================================================
// function : onDeactivate
// purpose : Deactivate this dialog
//=================================================================================
void RepairGUI_FreeBoundDlg::onDeactivate()
{
setEnabled( false );
globalSelection();
disconnect( myGeomGUI->getApp()->selectionMgr(), 0, this, 0 );
myGeomGUI->SetActiveDialogBox( 0 );
}
//=================================================================================
// function : onActivate
// purpose : Activate this dialog
//=================================================================================
void RepairGUI_FreeBoundDlg::onActivate()
{
myGeomGUI->EmitSignalDeactivateDialog();
setEnabled( true );
myGeomGUI->SetActiveDialogBox( this );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), SLOT( onSelectionDone() ) );
activateSelection();
onSelectionDone();
}
//=================================================================================
// function : onSelectionDone
// purpose : SLOT. Called when selection changed.
//=================================================================================
void RepairGUI_FreeBoundDlg::onSelectionDone()
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
SALOME_ListIO aSelList;
aSelMgr->selectedObjects(aSelList);
if ( aSelList.Extent() != 1 )
return;
GEOM::GEOM_Object_var anObj =
GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
if ( !GEOMBase::IsShape( anObj ) )
return;
else {
myObj = anObj;
displayPreview( true, false, true, true, 3 );
}
}
//=================================================================================
// function : Init
// purpose : Initialize dialog fields
@ -224,30 +133,91 @@ void RepairGUI_FreeBoundDlg::Init()
myNbClosed = myNbOpen = 0;
myObj = GEOM::GEOM_Object::_nil();
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT ( onDeactivate() ) );
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), SLOT( onSelectionDone() ) );
myEditCurrentArgument = myEdit;
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
this, SLOT(SelectionIntoArgument()));
activateSelection();
onSelectionDone();
SelectionIntoArgument();
}
//=================================================================================
// function : enterEvent
// purpose : Activate dialog
// function : ClickOnOk()
// purpose :
//=================================================================================
void RepairGUI_FreeBoundDlg::enterEvent( QEvent* )
void RepairGUI_FreeBoundDlg::ClickOnOk()
{
onActivate();
if (ClickOnApply())
ClickOnCancel();
}
//=================================================================================
// function : closeEvent
// purpose : Close dialog
// function : ClickOnApply()
// purpose :
//=================================================================================
void RepairGUI_FreeBoundDlg::closeEvent( QCloseEvent* )
bool RepairGUI_FreeBoundDlg::ClickOnApply()
{
onClose();
if (!onAccept())
return false;
return true;
}
//=================================================================================
// function : ActivateThisDialog()
// purpose :
//=================================================================================
void RepairGUI_FreeBoundDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
this, SLOT(SelectionIntoArgument()));
activateSelection();
displayPreview(true);
}
//=================================================================================
// function : enterEvent()
// purpose :
//=================================================================================
void RepairGUI_FreeBoundDlg::enterEvent(QEvent*)
{
if (!mainFrame()->GroupConstructors->isEnabled())
ActivateThisDialog();
}
//=================================================================================
// function : SelectionIntoArgument
// purpose : SLOT. Called when selection changed.
//=================================================================================
void RepairGUI_FreeBoundDlg::SelectionIntoArgument()
{
myEditCurrentArgument->setText("");
myClosedLbl->setText(tr("NUMBER_CLOSED"));
myOpenLbl->setText(tr("NUMBER_OPEN"));
myObj = GEOM::GEOM_Object::_nil();
erasePreview();
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
SALOME_ListIO aSelList;
aSelMgr->selectedObjects(aSelList);
if (aSelList.Extent() != 1)
return;
GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject(aSelList.First());
if (!GEOMBase::IsShape(anObj))
return;
myObj = anObj;
myEditCurrentArgument->setText(GEOMBase::GetName(myObj));
displayPreview(true, false, true, true, 3);
}
//=================================================================================
@ -257,11 +227,11 @@ void RepairGUI_FreeBoundDlg::closeEvent( QCloseEvent* )
void RepairGUI_FreeBoundDlg::activateSelection()
{
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_FACE );
aMap.Add( GEOM_SHELL );
aMap.Add( GEOM_SOLID );
aMap.Add( GEOM_COMPOUND );
globalSelection( aMap );
aMap.Add(GEOM_FACE);
aMap.Add(GEOM_SHELL);
aMap.Add(GEOM_SOLID);
aMap.Add(GEOM_COMPOUND);
globalSelection(aMap);
}
//=================================================================================
@ -270,14 +240,14 @@ void RepairGUI_FreeBoundDlg::activateSelection()
//=================================================================================
GEOM::GEOM_IOperations_ptr RepairGUI_FreeBoundDlg::createOperation()
{
return getGeomEngine()->GetIHealingOperations( getStudyId() );
return getGeomEngine()->GetIHealingOperations(getStudyId());
}
//=================================================================================
// function : isValid
// purpose :
//=================================================================================
bool RepairGUI_FreeBoundDlg::isValid( QString& )
bool RepairGUI_FreeBoundDlg::isValid (QString&)
{
return !myObj->_is_nil();
}
@ -286,52 +256,50 @@ bool RepairGUI_FreeBoundDlg::isValid( QString& )
// function : execute
// purpose : Get free boundaries
//=================================================================================
bool RepairGUI_FreeBoundDlg::execute( ObjectList& objects )
bool RepairGUI_FreeBoundDlg::execute (ObjectList& objects)
{
if ( !IsPreview() || myObj->_is_nil() )
return false;
GEOM::ListOfGO_var aClosed, anOpen;
GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow( getOperation() );
bool result = anOper->GetFreeBoundary( myObj, aClosed, anOpen );
GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow(getOperation());
bool result = anOper->GetFreeBoundary(myObj, aClosed, anOpen);
if ( result ) {
if (result) {
myNbClosed = aClosed->length();
myNbOpen = anOpen->length();
int i;
for ( i = 0; i < myNbClosed; i++ )
objects.push_back( aClosed[i]._retn() );
for ( i = 0; i < myNbOpen; i++ )
objects.push_back( anOpen[i]._retn() );
for (i = 0; i < myNbClosed; i++)
objects.push_back(aClosed[i]._retn());
for (i = 0; i < myNbOpen; i++)
objects.push_back(anOpen[i]._retn());
myEdit->setText( GEOMBase::GetName( myObj ) );
QString aLabelText = tr( "NUMBER_CLOSED" ) + QString( "%1" ).arg( myNbClosed );
myClosedLbl->setText( aLabelText );
aLabelText = tr( "NUMBER_OPEN" ) + QString( "%1" ).arg( myNbOpen );
myOpenLbl->setText( aLabelText );
}
else {
myEdit->setText( GEOMBase::GetName( myObj ) );
myClosedLbl->setText( tr( "NUMBER_CLOSED" ) );
myOpenLbl->setText( tr( "NUMBER_OPEN" ) );
QString aLabelText = tr("NUMBER_CLOSED") + QString("%1").arg(myNbClosed);
myClosedLbl->setText(aLabelText);
aLabelText = tr("NUMBER_OPEN") + QString("%1").arg(myNbOpen);
myOpenLbl->setText(aLabelText);
}
myCurrObj = 1;
return result;
}
//=================================================================================
// function : keyPressEvent()
// purpose :
//=================================================================================
void RepairGUI_FreeBoundDlg::keyPressEvent( QKeyEvent* e )
//================================================================
// Function : getNewObjectName
// Purpose : Redefine this method to return proper name for a new object
//================================================================
QString RepairGUI_FreeBoundDlg::getNewObjectName (int currObj) const
{
QDialog::keyPressEvent( e );
if ( e->isAccepted() )
return;
if ( e->key() == Qt::Key_F1 ) {
e->accept();
onHelp();
}
QString aName = tr("NAME_CLOSED").arg(currObj);
if (currObj > myNbClosed)
aName = tr("NAME_OPEN").arg(currObj);
return aName;
}
//================================================================
// Function : getFather
// Purpose : Get father object for object to be added in study
// (called with addInStudy method)
//================================================================
GEOM::GEOM_Object_ptr RepairGUI_FreeBoundDlg::getFather (GEOM::GEOM_Object_ptr)
{
return myObj;
}

View File

@ -18,17 +18,16 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : RepairGUI_FreeBoundDlg.h
// Author : Sergey LITONIN, Open CASCADE S.A.S. (sergey.litonin@opencascade.com)
//
#ifndef REPAIRGUI_FREEBOUNDDLG_H
#define REPAIRGUI_FREEBOUNDDLG_H
#include <QDialog>
#include <GEOMBase_Helper.h>
#include <GEOMBase_Skeleton.h>
class QLineEdit;
class QLabel;
@ -38,42 +37,42 @@ class GeometryGUI;
// class : RepairGUI_FreeBoundDlg
// purpose : Dialog for displaying free boundaries of selected face, shell or solid
//=================================================================================
class RepairGUI_FreeBoundDlg : public QDialog,
public GEOMBase_Helper
class RepairGUI_FreeBoundDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
RepairGUI_FreeBoundDlg( GeometryGUI*, QWidget* );
RepairGUI_FreeBoundDlg (GeometryGUI*, QWidget*);
~RepairGUI_FreeBoundDlg();
private slots:
void onClose();
void onHelp();
void onDeactivate();
void onActivate();
void onSelectionDone();
protected:
// redefined from GEOMBase_Helper
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid (QString&);
virtual bool execute (ObjectList&);
virtual GEOM::GEOM_Object_ptr getFather (GEOM::GEOM_Object_ptr);
virtual QString getNewObjectName (int CurrObj = -1) const;
private:
void Init();
void enterEvent( QEvent* );
void closeEvent( QCloseEvent* );
void keyPressEvent( QKeyEvent* );
void enterEvent (QEvent*);
void activateSelection();
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool execute( ObjectList& );
virtual bool isValid( QString& );
private:
QLineEdit* myEdit;
QLabel* myClosedLbl;
QLabel* myOpenLbl;
GEOM::GEOM_Object_var myObj;
GeometryGUI* myGeomGUI;
int myNbClosed;
int myNbOpen;
QString myHelpFileName;
int myCurrObj;
private slots:
void ClickOnOk();
bool ClickOnApply();
void SelectionIntoArgument();
void ActivateThisDialog();
};
#endif // REPAIRGUI_FREEBOUNDDLG_H