*** empty log message ***

This commit is contained in:
vsr 2007-10-23 09:11:45 +00:00
parent 1bc18718b8
commit 72596e692a
14 changed files with 569 additions and 461 deletions

View File

@ -0,0 +1,140 @@
<ui version="4.0" >
<class>DlgRef_1Sel1List4Btn_QTD</class>
<widget class="QWidget" name="DlgRef_1Sel1List4Btn_QTD" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>221</width>
<height>174</height>
</rect>
</property>
<property name="windowTitle" >
<string/>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QGroupBox" name="GroupBox1" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string/>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item rowspan="3" row="2" column="0" colspan="3" >
<widget class="QListWidget" name="ListView1" />
</item>
<item row="1" column="3" >
<widget class="QPushButton" name="PushButton3" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3" >
<widget class="QPushButton" name="PushButton2" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>TL1</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="2" colspan="2" >
<widget class="QLineEdit" name="LineEdit1" />
</item>
<item row="0" column="1" >
<widget class="QPushButton" name="PushButton1" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="2" column="3" >
<widget class="QPushButton" name="PushButton4" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="3" column="3" >
<widget class="QPushButton" name="PushButton5" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="4" column="3" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>21</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>PushButton1</tabstop>
<tabstop>LineEdit1</tabstop>
<tabstop>PushButton2</tabstop>
<tabstop>PushButton3</tabstop>
<tabstop>ListView1</tabstop>
<tabstop>PushButton4</tabstop>
<tabstop>PushButton5</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -79,6 +79,20 @@ DlgRef_1Sel1Check::~DlgRef_1Sel1Check()
{ {
} }
//////////////////////////////////////////
// DlgRef_1Sel1List4Btn
//////////////////////////////////////////
DlgRef_1Sel1List4Btn::DlgRef_1Sel1List4Btn( QWidget* parent, Qt::WindowFlags f )
: QWidget( parent, f )
{
setupUi( this );
}
DlgRef_1Sel1List4Btn::~DlgRef_1Sel1List4Btn()
{
}
////////////////////////////////////////// //////////////////////////////////////////
// DlgRef_1Sel1Spin1Check // DlgRef_1Sel1Spin1Check
////////////////////////////////////////// //////////////////////////////////////////

View File

@ -98,6 +98,22 @@ public:
~DlgRef_1Sel1Check(); ~DlgRef_1Sel1Check();
}; };
//////////////////////////////////////////
// DlgRef_1Sel1List4Btn
//////////////////////////////////////////
#include "ui_DlgRef_1Sel1List4Btn_QTD.h"
class DLGREF_EXPORT DlgRef_1Sel1List4Btn : public QWidget,
public Ui::DlgRef_1Sel1List4Btn_QTD
{
Q_OBJECT
public:
DlgRef_1Sel1List4Btn( QWidget* = 0, Qt::WindowFlags = 0 );
~DlgRef_1Sel1List4Btn();
};
////////////////////////////////////////// //////////////////////////////////////////
// DlgRef_1Sel1Spin1Check // DlgRef_1Sel1Spin1Check
////////////////////////////////////////// //////////////////////////////////////////

View File

@ -42,6 +42,7 @@ UIC_FILES = \
ui_DlgRef_1Sel1Check1List_QTD.h \ ui_DlgRef_1Sel1Check1List_QTD.h \
ui_DlgRef_1Sel1Check1Sel_QTD.h \ ui_DlgRef_1Sel1Check1Sel_QTD.h \
ui_DlgRef_1Sel1Check_QTD.h \ ui_DlgRef_1Sel1Check_QTD.h \
ui_DlgRef_1Sel1List4Btn_QTD.h \
ui_DlgRef_1Sel1Spin1Check_QTD.h \ ui_DlgRef_1Sel1Spin1Check_QTD.h \
ui_DlgRef_1Sel1Spin_QTD.h \ ui_DlgRef_1Sel1Spin_QTD.h \
ui_DlgRef_1Sel2Spin_QTD.h \ ui_DlgRef_1Sel2Spin_QTD.h \

View File

@ -227,15 +227,17 @@ const char* GEOMBase_Skeleton::getNewObjectName() const
//================================================================================= //=================================================================================
int GEOMBase_Skeleton::getConstructorId() const int GEOMBase_Skeleton::getConstructorId() const
{ {
/*if ( GroupConstructors != NULL && GroupConstructors->selected() != NULL ) if ( myRBGroup )
return GroupConstructors->id( GroupConstructors->selected() );
return -1;*/
if ( myRBGroup != NULL )
return myRBGroup->checkedId(); return myRBGroup->checkedId();
return -1; return -1;
} }
void GEOMBase_Skeleton::setConstructorId( const int id )
{
if ( myRBGroup && myRBGroup->button( id ) )
myRBGroup->button( id )->setChecked( true );
}
//================================================================================= //=================================================================================
// function : ClickOnHelp() // function : ClickOnHelp()
// purpose : // purpose :

View File

@ -73,6 +73,9 @@ protected:
/*! returns id of a selected "constructor" radio button or '-1' in case of error /*! returns id of a selected "constructor" radio button or '-1' in case of error
*/ */
int getConstructorId() const; int getConstructorId() const;
/*! set selected "constructor" radio button id
*/
void setConstructorId( const int );
void setHelpFileName( const QString& ); void setHelpFileName( const QString& );

View File

@ -19,31 +19,30 @@
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
//
//
// File : GroupGUI.cxx // File : GroupGUI.cxx
// Author : Sergey ANIKIN // Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
// Module : GEOM //
// $Header$
#include "GroupGUI.h" #include "GroupGUI.h"
#include "GroupGUI_GroupDlg.h" #include "GroupGUI_GroupDlg.h"
#include "GEOMImpl_Types.hxx" #include <GeometryGUI.h>
#include <GEOMBase.h>
#include <GEOMImpl_Types.hxx>
#include "SUIT_Session.h" #include <SUIT_Session.h>
#include "SUIT_Desktop.h" #include <SUIT_Desktop.h>
#include "SUIT_MessageBox.h" #include <SUIT_MessageBox.h>
#include "SalomeApp_Application.h" #include <SalomeApp_Application.h>
#include "SalomeApp_Study.h" #include <SalomeApp_Study.h>
#include "LightApp_SelectionMgr.h" #include <LightApp_SelectionMgr.h>
//======================================================================= //=======================================================================
// function : GroupGUI() // function : GroupGUI()
// purpose : Constructor // purpose : Constructor
//======================================================================= //=======================================================================
GroupGUI::GroupGUI(GeometryGUI* parent) GroupGUI::GroupGUI( GeometryGUI* parent )
: GEOMGUI(parent) : GEOMGUI( parent )
{ {
} }
@ -67,24 +66,23 @@ bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
getGeometryGUI()->EmitSignalDeactivateDialog(); getGeometryGUI()->EmitSignalDeactivateDialog();
QDialog* aDlg = NULL; QDialog* aDlg = 0;
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy()); SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
if ( !appStudy ) return false; if ( !appStudy ) return false;
_PTR(Study) aStudy = appStudy->studyDS(); _PTR(Study) aStudy = appStudy->studyDS();
if ( aStudy->GetProperties()->IsLocked() ) { if ( aStudy->GetProperties()->IsLocked() ) {
SUIT_MessageBox::warn1 ( parent, SUIT_MessageBox::warning( parent,
QObject::tr("WRN_WARNING"), tr( "WRN_WARNING" ),
QObject::tr("WRN_STUDY_LOCKED"), tr( "WRN_STUDY_LOCKED" ) );
QObject::tr("BUT_OK") );
return false; return false;
} }
switch ( theCommandID ) { switch ( theCommandID ) {
case 800: case 800:
case 8001: // CREATE GROUP case 8001: // CREATE GROUP
aDlg = new GroupGUI_GroupDlg (GroupGUI_GroupDlg::CreateGroup, getGeometryGUI(), parent); aDlg = new GroupGUI_GroupDlg( GroupGUI_GroupDlg::CreateGroup, getGeometryGUI(), parent );
break; break;
case 801: // EDIT GROUP case 801: // EDIT GROUP
{ {
@ -92,29 +90,32 @@ bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
aList.Clear(); aList.Clear();
LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
if (aSelMgr) if ( aSelMgr )
aSelMgr->selectedObjects(aList); aSelMgr->selectedObjects( aList );
if (aList.Extent() == 1) { if ( aList.Extent() == 1 ) {
Standard_Boolean aResult = Standard_False; Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object_var anObj =
GEOMBase::ConvertIOinGEOMObject( aList.First(), aResult ); GEOMBase::ConvertIOinGEOMObject( aList.First(), aResult );
if (aResult && !CORBA::is_nil(anObj) && anObj->GetType() == GEOM_GROUP) { if ( aResult && !CORBA::is_nil( anObj ) && anObj->GetType() == GEOM_GROUP ) {
aDlg = new GroupGUI_GroupDlg (GroupGUI_GroupDlg::EditGroup, getGeometryGUI(), parent); aDlg = new GroupGUI_GroupDlg( GroupGUI_GroupDlg::EditGroup, getGeometryGUI(), parent );
break; break;
} }
} }
SUIT_MessageBox::warn1(parent, tr("WRN_WARNING"), tr("NO_GROUP"), tr("BUT_OK") ); SUIT_MessageBox::warning( parent, tr( "WRN_WARNING" ), tr( "NO_GROUP" ) );
break; break;
} }
default: default:
app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
break; break;
} }
if (aDlg != NULL) if ( aDlg ) {
aDlg->updateGeometry();
aDlg->resize( aDlg->minimumSize() );
aDlg->show(); aDlg->show();
}
return true; return true;
} }
@ -124,11 +125,11 @@ bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
//===================================================================================== //=====================================================================================
extern "C" extern "C"
{ {
#ifdef WNT #ifdef WIN32
__declspec( dllexport ) __declspec( dllexport )
#endif #endif
GEOMGUI* GetLibGUI(GeometryGUI* p) GEOMGUI* GetLibGUI( GeometryGUI* p )
{ {
return new GroupGUI(p); return new GroupGUI( p );
} }
} }

View File

@ -19,16 +19,14 @@
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
//
//
// File : GroupGUI.h // File : GroupGUI.h
// Author : Sergey ANIKIN // Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
// Module : GEOM //
#ifndef GROUPGUI_H #ifndef GROUPGUI_H
#define GROUPGUI_H #define GROUPGUI_H
#include "GEOMGUI.h" #include <GEOMGUI.h>
//================================================================================= //=================================================================================
// class : GroupGUI // class : GroupGUI
@ -39,10 +37,10 @@ class GroupGUI : public GEOMGUI
Q_OBJECT Q_OBJECT
public: public:
GroupGUI(GeometryGUI* parent); GroupGUI( GeometryGUI* );
~GroupGUI(); ~GroupGUI();
bool OnGUIEvent( int theCommandID, SUIT_Desktop* parent ); bool OnGUIEvent( int, SUIT_Desktop* );
}; };
#endif #endif // GROUPGUI_H

View File

@ -19,99 +19,75 @@
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
//
//
// File : GroupGUI_GroupDlg.cxx // File : GroupGUI_GroupDlg.cxx
// Author : Sergey ANIKIN // Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
// Module : GEOM //
// $Header$
#include "GroupGUI_GroupDlg.h" #include "GroupGUI_GroupDlg.h"
#include "SUIT_Desktop.h" #include <SUIT_Desktop.h>
#include "SUIT_Session.h" #include <SUIT_Session.h>
#include "SalomeApp_Application.h" #include <SUIT_ResourceMgr.h>
#include "SalomeApp_Study.h" #include <SalomeApp_Application.h>
#include "LightApp_SelectionMgr.h" #include <SalomeApp_Study.h>
#include <LightApp_SelectionMgr.h>
#include "GEOMBase.h" #include <GEOM_DlgRef.h>
#include <GEOMBase.h>
#include "GEOMImpl_Types.hxx" #include <GEOMImpl_Types.hxx>
#include <qlabel.h>
#include <qlistbox.h>
#include <qlineedit.h>
#include <qmap.h>
#include <TColStd_IndexedMapOfInteger.hxx> #include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx> #include <TColStd_MapOfInteger.hxx>
GroupGUI_GroupDlg::GroupGUI_GroupDlg( Mode mode, GeometryGUI* theGeometryGUI, QWidget* parent )
GroupGUI_GroupDlg::GroupGUI_GroupDlg(Mode mode, GeometryGUI* theGeometryGUI, QWidget* parent) : GEOMBase_Skeleton( theGeometryGUI, parent, false ),
:GEOMBase_Skeleton( theGeometryGUI, parent, "GroupGUI_GroupDlg", false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
myMode( mode ), myMode( mode ),
myBusy( false ) myBusy( false )
{ {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
QPixmap image0 (resMgr->loadPixmap("GEOM", tr("ICON_OBJBROWSER_VERTEX"))); QPixmap image0 ( resMgr->loadPixmap( "GEOM", tr( "ICON_OBJBROWSER_VERTEX" ) ) );
QPixmap image1 (resMgr->loadPixmap("GEOM", tr("ICON_OBJBROWSER_EDGE"))); QPixmap image1 ( resMgr->loadPixmap( "GEOM", tr( "ICON_OBJBROWSER_EDGE" ) ) );
QPixmap image2 (resMgr->loadPixmap("GEOM", tr("ICON_OBJBROWSER_FACE"))); QPixmap image2 ( resMgr->loadPixmap( "GEOM", tr( "ICON_OBJBROWSER_FACE" ) ) );
QPixmap image3 (resMgr->loadPixmap("GEOM", tr("ICON_OBJBROWSER_SOLID"))); QPixmap image3 ( resMgr->loadPixmap( "GEOM", tr( "ICON_OBJBROWSER_SOLID" ) ) );
QPixmap iconSelect (resMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); QPixmap iconSelect( resMgr->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
setCaption( myMode == CreateGroup ? tr( "CREATE_GROUP_TITLE" ) : tr( "EDIT_GROUP_TITLE" ) ); setWindowTitle( myMode == CreateGroup ? tr( "CREATE_GROUP_TITLE" ) : tr( "EDIT_GROUP_TITLE" ) );
// Shape type button group // Shape type button group
GroupConstructors->setEnabled( myMode == CreateGroup ); mainFrame()->GroupConstructors->setEnabled( myMode == CreateGroup );
GroupConstructors->setTitle( tr( "SHAPE_TYPE" ) ); mainFrame()->GroupConstructors->setTitle( tr( "SHAPE_TYPE" ) );
RadioButton1->setPixmap( image0 ); mainFrame()->RadioButton1->setIcon( image0 );
RadioButton2->setPixmap( image1 ); mainFrame()->RadioButton2->setIcon( image1 );
RadioButton3->setPixmap( image2 ); mainFrame()->RadioButton3->setIcon( image2 );
RadioButton4->setPixmap( image3 ); mainFrame()->RadioButton4->setIcon( image3 );
RadioButton4->show(); mainFrame()->RadioButton4->show();
// Group name // Group name
GroupBoxName->setTitle( tr( "GROUP_NAME" ) ); mainFrame()->GroupBoxName->setTitle( tr( "GROUP_NAME" ) );
// Main shape and sub-shapes // Main shape and sub-shapes
GroupMedium = new QGroupBox( 1, Qt::Vertical, tr( "MAIN_SUB_SHAPES" ), this ); myGroupBox = new DlgRef_1Sel1List4Btn( centralWidget() );
GroupMedium->setInsideMargin( 10 ); myGroupBox->GroupBox1->setTitle( tr( "MAIN_SUB_SHAPES" ) );
Layout1->addWidget( GroupMedium, 2, 0 ); myGroupBox->TextLabel1->setText( tr( "MAIN_SHAPE" ) );
myGroupBox->PushButton1->setIcon( iconSelect );
myGroupBox->PushButton1->setEnabled( myMode == CreateGroup );
myGroupBox->LineEdit1->setReadOnly( true );
myGroupBox->LineEdit1->setEnabled( myMode == CreateGroup );
myGroupBox->PushButton2->setText( tr( "SELECT_SUB_SHAPES" ) );
myGroupBox->PushButton3->setText( tr( "SELECT_ALL" ) );
myGroupBox->PushButton4->setText( tr( "ADD" ) );
myGroupBox->PushButton5->setText( tr( "REMOVE" ) );
myGroupBox->ListView1->setSelectionMode( QAbstractItemView::ExtendedSelection );
myGroupBox->ListView1->setFlow( QListView::TopToBottom );
myGroupBox->ListView1->setWrapping( true );
QWidget* aFrame = new QWidget( GroupMedium ); QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
QGridLayout* aMedLayout = new QGridLayout( aFrame, 4, 4, 0, 6 ); layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( myGroupBox );
QLabel* aMainLabel = new QLabel( tr( "MAIN_SHAPE" ), aFrame ); setHelpFileName( "working_with_groups.htm" );
mySelBtn = new QPushButton( aFrame );
mySelBtn->setPixmap( iconSelect );
mySelBtn->setEnabled( myMode == CreateGroup );
myMainName = new QLineEdit( aFrame );
myMainName->setReadOnly( true );
myMainName->setEnabled( myMode == CreateGroup );
mySelSubBtn = new QPushButton( tr( "SELECT_SUB_SHAPES" ), aFrame );
mySelAllBtn = new QPushButton( tr( "SELECT_ALL" ), aFrame );
myAddBtn = new QPushButton( tr( "ADD" ), aFrame );
myRemBtn = new QPushButton( tr( "REMOVE" ), aFrame );
myIdList = new QListBox( aFrame );
myIdList->setSelectionMode( QListBox::Extended );
myIdList->setRowMode( QListBox::FitToWidth );
aMedLayout->addWidget( aMainLabel, 0, 0 );
aMedLayout->addWidget( mySelBtn, 0, 1 );
aMedLayout->addMultiCellWidget( myMainName, 0, 0, 2, 3 );
aMedLayout->addMultiCellWidget( mySelSubBtn, 1, 1, 0, 2 );
aMedLayout->addWidget( mySelAllBtn, 1, 3 );
aMedLayout->addMultiCellWidget( myIdList, 2, 3, 0, 2 );
aMedLayout->addWidget( myAddBtn, 2, 3 );
aMedLayout->addWidget( myRemBtn, 3, 3 );
setHelpFileName("working_with_groups.htm");
Init(); Init();
} }
@ -133,10 +109,10 @@ void GroupGUI_GroupDlg::Init()
initName( tr( "GROUP_PREFIX" ) ); initName( tr( "GROUP_PREFIX" ) );
// Get ready for main shape selection // Get ready for main shape selection
myEditCurrentArgument = myMainName; myEditCurrentArgument = myGroupBox->LineEdit1;
connect( GroupConstructors, SIGNAL( clicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) ); connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
connect( mySelBtn, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ); connect( myGroupBox->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
} }
else if ( myMode == EditGroup && IObjectCount() ) { else if ( myMode == EditGroup && IObjectCount() ) {
Standard_Boolean aResult = Standard_False; Standard_Boolean aResult = Standard_False;
@ -146,39 +122,36 @@ void GroupGUI_GroupDlg::Init()
if ( aResult && !CORBA::is_nil( anObj ) && anObj->GetType() == GEOM_GROUP ) { if ( aResult && !CORBA::is_nil( anObj ) && anObj->GetType() == GEOM_GROUP ) {
myGroup = anObj; myGroup = anObj;
ResultName->setText( GEOMBase::GetName( myGroup ) ); mainFrame()->ResultName->setText( GEOMBase::GetName( myGroup ) );
GEOM::GEOM_IGroupOperations_var anOp = GEOM::GEOM_IGroupOperations::_narrow( getOperation() ); GEOM::GEOM_IGroupOperations_var anOp = GEOM::GEOM_IGroupOperations::_narrow( getOperation() );
myMainObj = anOp->GetMainShape( myGroup ); myMainObj = anOp->GetMainShape( myGroup );
if ( !CORBA::is_nil( myMainObj ) ) if ( !CORBA::is_nil( myMainObj ) )
myMainName->setText( GEOMBase::GetName( myMainObj ) ); myGroupBox->LineEdit1->setText( GEOMBase::GetName( myMainObj ) );
setShapeType( (TopAbs_ShapeEnum)anOp->GetType( myGroup ) ); setShapeType( (TopAbs_ShapeEnum)anOp->GetType( myGroup ) );
GEOM::ListOfLong_var aCurrList = anOp->GetObjects( myGroup ); GEOM::ListOfLong_var aCurrList = anOp->GetObjects( myGroup );
QListBoxItem* anItem; for ( int i = 0, n = aCurrList->length(); i < n; i++ )
for ( int i = 0, n = aCurrList->length(); i < n; i++ ) { myGroupBox->ListView1->addItem( new QListWidgetItem( QString( "%1" ).arg( aCurrList[i] ) ) );
anItem = new QListBoxText( QString( "%1" ).arg(aCurrList[i] ) );
myIdList->insertItem( anItem );
}
myEditCurrentArgument = 0; myEditCurrentArgument = 0;
} }
} }
LightApp_SelectionMgr* aSelMgr = LightApp_SelectionMgr* aSelMgr =
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(); ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr();
connect( aSelMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); connect( aSelMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
connect( buttonOk , SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( mySelSubBtn, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ); connect( myGroupBox->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( mySelAllBtn, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ); connect( myGroupBox->PushButton3, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( myAddBtn, SIGNAL( clicked() ), this, SLOT( add() ) ); connect( myGroupBox->PushButton4, SIGNAL( clicked() ), this, SLOT( add() ) );
connect( myRemBtn, SIGNAL( clicked() ), this, SLOT( remove() ) ); connect( myGroupBox->PushButton5, SIGNAL( clicked() ), this, SLOT( remove() ) );
connect( myIdList, SIGNAL( selectionChanged() ), this, SLOT( selectionChanged() ) ); connect( myGroupBox->ListView1, SIGNAL( itemSelectionChanged() ), this, SLOT( selectionChanged() ) );
activateSelection(); activateSelection();
} }
@ -187,9 +160,9 @@ void GroupGUI_GroupDlg::Init()
// function : enterEvent() // function : enterEvent()
// purpose : // purpose :
//================================================================================= //=================================================================================
void GroupGUI_GroupDlg::enterEvent( QEvent* e ) void GroupGUI_GroupDlg::enterEvent( QEvent* )
{ {
if ( !buttonCancel->isEnabled() ) if ( !buttonCancel()->isEnabled() )
this->ActivateThisDialog(); this->ActivateThisDialog();
} }
@ -212,13 +185,13 @@ bool GroupGUI_GroupDlg::ClickOnApply()
if ( !onAccept( myMode == CreateGroup, true ) ) if ( !onAccept( myMode == CreateGroup, true ) )
return false; return false;
if ( myMode == CreateGroup ) if ( myMode == CreateGroup ) {
{
initName(); initName();
myIdList->clear(); myGroupBox->ListView1->clear();
} }
else else {
activateSelection(); activateSelection();
}
return true; return true;
} }
@ -231,7 +204,7 @@ void GroupGUI_GroupDlg::ActivateThisDialog()
{ {
GEOMBase_Skeleton::ActivateThisDialog(); GEOMBase_Skeleton::ActivateThisDialog();
connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
activateSelection(); activateSelection();
@ -245,12 +218,13 @@ void GroupGUI_GroupDlg::LineEditReturnPressed()
{ {
QLineEdit* send = ( QLineEdit* )sender(); QLineEdit* send = ( QLineEdit* )sender();
if ( send == myMainName && !myEditCurrentArgument ) { if ( send == myGroupBox->LineEdit1 && !myEditCurrentArgument ) {
myEditCurrentArgument = myMainName; myEditCurrentArgument = myGroupBox->LineEdit1;
activateSelection(); activateSelection();
} }
else else {
GEOMBase_Skeleton::LineEditReturnPressed(); GEOMBase_Skeleton::LineEditReturnPressed();
}
updateState(); updateState();
} }
@ -264,14 +238,14 @@ void GroupGUI_GroupDlg::SetEditCurrentArgument()
{ {
QPushButton* send = (QPushButton*)sender(); QPushButton* send = (QPushButton*)sender();
if ( send == mySelBtn ) if ( send == myGroupBox->PushButton1 )
myEditCurrentArgument = myMainName; myEditCurrentArgument = myGroupBox->LineEdit1;
else if ( send == mySelSubBtn || send == mySelAllBtn ) else if ( send == myGroupBox->PushButton2 || send == myGroupBox->PushButton3 )
myEditCurrentArgument = 0; myEditCurrentArgument = 0;
activateSelection(); activateSelection();
if ( send == mySelAllBtn ) if ( send == myGroupBox->PushButton3 )
selectAllSubShapes(); selectAllSubShapes();
else else
updateState(); updateState();
@ -286,7 +260,7 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
{ {
if ( myEditCurrentArgument ) { // Selection of a main shape is active if ( myEditCurrentArgument ) { // Selection of a main shape is active
myEditCurrentArgument->setText( "" ); myEditCurrentArgument->setText( "" );
myIdList->clear(); myGroupBox->ListView1->clear();
if ( IObjectCount() == 1 ) { if ( IObjectCount() == 1 ) {
Standard_Boolean aResult = Standard_False; Standard_Boolean aResult = Standard_False;
@ -307,9 +281,9 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
if ( myBusy ) if ( myBusy )
return; return;
bool isBlocked = myIdList->signalsBlocked(); bool isBlocked = myGroupBox->ListView1->signalsBlocked();
myIdList->blockSignals( true ); myGroupBox->ListView1->blockSignals( true );
myIdList->clearSelection(); myGroupBox->ListView1->clearSelection();
TColStd_IndexedMapOfInteger aMapIndex; TColStd_IndexedMapOfInteger aMapIndex;
@ -319,7 +293,7 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult ); GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
if ( aResult && !anObj->_is_nil() ) if ( aResult && !anObj->_is_nil() )
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))-> ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->
selectionMgr()->GetIndexes( firstIObject(), aMapIndex ); selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
} }
@ -333,13 +307,11 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations( getStudyId() ); GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations( getStudyId() );
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
for (int i = 0; i < anObjects.length(); i++) for (int i = 0; i < anObjects.length(); i++) {
{
GEOM::GEOM_Object_var aGeomObj = anObjects[i]; GEOM::GEOM_Object_var aGeomObj = anObjects[i];
GEOM::ListOfGO_var aSubObjects = new GEOM::ListOfGO(); GEOM::ListOfGO_var aSubObjects = new GEOM::ListOfGO();
TopoDS_Shape aShape; TopoDS_Shape aShape;
if ( GEOMBase::GetShape(aGeomObj, aShape, getShapeType()) ) if ( GEOMBase::GetShape( aGeomObj, aShape, getShapeType() ) ) {
{
aSubObjects->length(1); aSubObjects->length(1);
aSubObjects[0] = aGeomObj; aSubObjects[0] = aGeomObj;
} }
@ -348,11 +320,9 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
else else
continue; continue;
for (int i = 0; i < aSubObjects->length(); i++) for (int i = 0; i < aSubObjects->length(); i++) {
{
TopoDS_Shape aShape; TopoDS_Shape aShape;
if ( GEOMBase::GetShape(aSubObjects[i], aShape, getShapeType()) ) if ( GEOMBase::GetShape( aSubObjects[i], aShape, getShapeType() ) ) {
{
CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, aSubObjects[i] ); CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, aSubObjects[i] );
if ( anIndex >= 0 ) if ( anIndex >= 0 )
aMapIndex.Add( anIndex ); aMapIndex.Add( anIndex );
@ -364,17 +334,17 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
localSelection( myMainObj, getShapeType() ); localSelection( myMainObj, getShapeType() );
} }
if (aMapIndex.Extent() >= 1) { if ( aMapIndex.Extent() >= 1 ) {
QMap<int, int> aMap; QMap<int, int> aMap;
for ( int i = 0, n = myIdList->count(); i < n; i++ ) for ( int i = 0, n = myGroupBox->ListView1->count(); i < n; i++ )
aMap.insert( myIdList->item( i )->text().toInt(), i ); aMap.insert( myGroupBox->ListView1->item( i )->text().toInt(), i );
for ( int ii = 1, nn = aMapIndex.Extent(); ii <= nn; ii++ ) { for ( int ii = 1, nn = aMapIndex.Extent(); ii <= nn; ii++ ) {
if ( aMap.contains( aMapIndex( ii ) ) ) if ( aMap.contains( aMapIndex( ii ) ) )
myIdList->setSelected( aMap[aMapIndex( ii )], true ); myGroupBox->ListView1->item( aMap[aMapIndex( ii )])->setSelected( true );
} }
} }
myIdList->blockSignals( isBlocked ); myGroupBox->ListView1->blockSignals( isBlocked );
} }
updateState(); updateState();
@ -384,9 +354,9 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
// function : ConstructorsClicked() // function : ConstructorsClicked()
// purpose : Radio button management // purpose : Radio button management
//================================================================================= //=================================================================================
void GroupGUI_GroupDlg::ConstructorsClicked( int constructorId ) void GroupGUI_GroupDlg::ConstructorsClicked( int )
{ {
myIdList->clear(); myGroupBox->ListView1->clear();
activateSelection(); activateSelection();
updateState(); updateState();
} }
@ -407,22 +377,21 @@ void GroupGUI_GroupDlg::selectAllSubShapes()
if ( !aShOp->IsDone() ) if ( !aShOp->IsDone() )
return; return;
bool isBlocked = myIdList->signalsBlocked(); bool isBlocked = myGroupBox->ListView1->signalsBlocked();
myIdList->blockSignals( true ); myGroupBox->ListView1->blockSignals( true );
myIdList->clear(); myGroupBox->ListView1->clear();
QListBoxItem* anItem;
for ( int i = 0, n = aSubShapes->length(); i < n; i++ ) { for ( int i = 0, n = aSubShapes->length(); i < n; i++ ) {
CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, aSubShapes[i] ); CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, aSubShapes[i] );
if ( anIndex < 0 ) if ( anIndex < 0 )
continue; continue;
anItem = new QListBoxText( QString( "%1" ).arg( anIndex ) ); QListWidgetItem* anItem = new QListWidgetItem( QString( "%1" ).arg( anIndex ) );
myIdList->insertItem( anItem ); myGroupBox->ListView1->addItem( anItem );
myIdList->setSelected( anItem, true ); anItem->setSelected( true );
} }
myIdList->blockSignals( isBlocked ); myGroupBox->ListView1->blockSignals( isBlocked );
highlightSubShapes(); highlightSubShapes();
updateState(); updateState();
} }
@ -434,8 +403,8 @@ void GroupGUI_GroupDlg::selectAllSubShapes()
void GroupGUI_GroupDlg::add() void GroupGUI_GroupDlg::add()
{ {
TColStd_MapOfInteger aMap; TColStd_MapOfInteger aMap;
for ( int i = 0, n = myIdList->count(); i < n; i++ ) for ( int i = 0, n = myGroupBox->ListView1->count(); i < n; i++ )
aMap.Add( myIdList->item( i )->text().toInt() ); aMap.Add( myGroupBox->ListView1->item( i )->text().toInt() );
TColStd_IndexedMapOfInteger aMapIndex; TColStd_IndexedMapOfInteger aMapIndex;
@ -445,7 +414,7 @@ void GroupGUI_GroupDlg::add()
GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult ); GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
if ( aResult && !anObj->_is_nil() ) if ( aResult && !anObj->_is_nil() )
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))-> ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->
selectionMgr()->GetIndexes( firstIObject(), aMapIndex ); selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
} }
@ -457,26 +426,22 @@ void GroupGUI_GroupDlg::add()
GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations( getStudyId() ); GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations( getStudyId() );
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
for (int i = 0; i < anObjects.length(); i++) for ( int i = 0; i < anObjects.length(); i++ ) {
{
GEOM::GEOM_Object_var aGeomObj = anObjects[i]; GEOM::GEOM_Object_var aGeomObj = anObjects[i];
GEOM::ListOfGO_var aSubObjects = new GEOM::ListOfGO(); GEOM::ListOfGO_var aSubObjects = new GEOM::ListOfGO();
TopoDS_Shape aShape; TopoDS_Shape aShape;
if ( GEOMBase::GetShape(aGeomObj, aShape, getShapeType()) ) if ( GEOMBase::GetShape( aGeomObj, aShape, getShapeType() ) ) {
{ aSubObjects->length( 1 );
aSubObjects->length(1);
aSubObjects[0] = aGeomObj; aSubObjects[0] = aGeomObj;
} }
else if (aGeomObj->GetType() == GEOM_GROUP) else if ( aGeomObj->GetType() == GEOM_GROUP )
aSubObjects = aShapesOp->MakeExplode( aGeomObj, getShapeType(), false); aSubObjects = aShapesOp->MakeExplode( aGeomObj, getShapeType(), false );
else else
break; break;
for (int i = 0; i < aSubObjects->length(); i++) for ( int i = 0; i < aSubObjects->length(); i++ ) {
{
TopoDS_Shape aShape; TopoDS_Shape aShape;
if ( GEOMBase::GetShape(aSubObjects[i], aShape, getShapeType()) ) if ( GEOMBase::GetShape( aSubObjects[i], aShape, getShapeType() ) ) {
{
CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, aSubObjects[i] ); CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, aSubObjects[i] );
if ( anIndex >= 0 ) if ( anIndex >= 0 )
aMapIndex.Add( anIndex ); aMapIndex.Add( anIndex );
@ -486,20 +451,19 @@ void GroupGUI_GroupDlg::add()
} }
if ( aMapIndex.Extent() >= 1 ) { if ( aMapIndex.Extent() >= 1 ) {
QListBoxItem* anItem; bool isBlocked = myGroupBox->ListView1->signalsBlocked();
bool isBlocked = myIdList->signalsBlocked(); myGroupBox->ListView1->blockSignals( true );
myIdList->blockSignals( true );
for ( int i = 1, n = aMapIndex.Extent(); i <= n; i++ ) { for ( int i = 1, n = aMapIndex.Extent(); i <= n; i++ ) {
if ( aMap.Contains( aMapIndex( i ) ) ) if ( aMap.Contains( aMapIndex( i ) ) )
continue; continue;
anItem = new QListBoxText( QString( "%1" ).arg( aMapIndex( i ) ) ); QListWidgetItem* anItem = new QListWidgetItem( QString( "%1" ).arg( aMapIndex( i ) ) );
myIdList->insertItem( anItem ); myGroupBox->ListView1->addItem( anItem );
myIdList->setSelected( anItem, true ); anItem->setSelected( true );
} }
myIdList->blockSignals( isBlocked ); myGroupBox->ListView1->blockSignals( isBlocked );
} }
updateState(); updateState();
@ -511,23 +475,13 @@ void GroupGUI_GroupDlg::add()
//================================================================================= //=================================================================================
void GroupGUI_GroupDlg::remove() void GroupGUI_GroupDlg::remove()
{ {
for ( int i = myIdList->count() - 1; i >= 0; i-- ) { QListIterator<QListWidgetItem*> it( myGroupBox->ListView1->selectedItems() );
if ( myIdList->isSelected( i ) ) while ( it.hasNext() )
myIdList->removeItem( i ); delete it.next();
}
updateState(); updateState();
} }
//=================================================================================
// function : getConstructorId()
// purpose :
//=================================================================================
int GroupGUI_GroupDlg::getConstructorId() const
{
return GroupConstructors->id( GroupConstructors->selected() );
}
//================================================================================= //=================================================================================
// function : getShapeType() // function : getShapeType()
// purpose : // purpose :
@ -556,7 +510,7 @@ void GroupGUI_GroupDlg::setShapeType( const TopAbs_ShapeEnum theType )
case TopAbs_FACE: anId = 2; break; case TopAbs_FACE: anId = 2; break;
case TopAbs_SOLID: anId = 3; break; case TopAbs_SOLID: anId = 3; break;
} }
GroupConstructors->setButton( anId ); setConstructorId( anId );
} }
@ -591,44 +545,39 @@ void GroupGUI_GroupDlg::updateState()
GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult ); GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
if ( aResult && !anObj->_is_nil() ) if ( aResult && !anObj->_is_nil() )
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))-> ( (SalomeApp_Application*)(SUIT_Session::session()->activeApplication() ) )->
selectionMgr()->GetIndexes( firstIObject(), aMapIndex ); selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
} }
// try to find out and process the object browser selection // try to find out and process the object browser selection
if ( !aMapIndex.Extent() && !CORBA::is_nil( myMainObj ) ) { if ( !aMapIndex.Extent() && !CORBA::is_nil( myMainObj ) ) {
GEOM::ListOfGO anObjects; GEOM::ListOfGO anObjects;
GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), anObjects); GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), anObjects );
GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations( getStudyId() ); GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations( getStudyId() );
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
isAdd = true; isAdd = true;
for (int i = 0; i < anObjects.length(); i++) for ( int i = 0; i < anObjects.length(); i++ ) {
{
GEOM::GEOM_Object_var aGeomObj = anObjects[i]; GEOM::GEOM_Object_var aGeomObj = anObjects[i];
GEOM::ListOfGO_var aSubObjects = new GEOM::ListOfGO(); GEOM::ListOfGO_var aSubObjects = new GEOM::ListOfGO();
TopoDS_Shape aShape; TopoDS_Shape aShape;
if ( GEOMBase::GetShape(aGeomObj, aShape, getShapeType()) ) if ( GEOMBase::GetShape( aGeomObj, aShape, getShapeType() ) ) {
{ aSubObjects->length( 1 );
aSubObjects->length(1);
aSubObjects[0] = aGeomObj; aSubObjects[0] = aGeomObj;
} }
else if (aGeomObj->GetType() == GEOM_GROUP) else if ( aGeomObj->GetType() == GEOM_GROUP )
aSubObjects = aShapesOp->MakeExplode( aGeomObj, getShapeType(), false); aSubObjects = aShapesOp->MakeExplode( aGeomObj, getShapeType(), false );
else else {
{
aMapIndex.Clear(); aMapIndex.Clear();
break; break;
} }
for (int i = 0; i < aSubObjects->length(); i++) for ( int i = 0; i < aSubObjects->length(); i++ ) {
{
TopoDS_Shape aShape; TopoDS_Shape aShape;
aSubObjects[i]; aSubObjects[i];
if ( GEOMBase::GetShape(aSubObjects[i], aShape, getShapeType()) ) if ( GEOMBase::GetShape( aSubObjects[i], aShape, getShapeType() ) ) {
{
CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, aSubObjects[i] ); CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, aSubObjects[i] );
if ( anIndex >= 0 ) if ( anIndex >= 0 )
aMapIndex.Add( anIndex ); aMapIndex.Add( anIndex );
@ -653,13 +602,11 @@ void GroupGUI_GroupDlg::updateState()
isAdd = aMapIndex.Extent() > 0; isAdd = aMapIndex.Extent() > 0;
myAddBtn->setEnabled( !myEditCurrentArgument && !CORBA::is_nil( myMainObj ) && isAdd ); myGroupBox->PushButton4->setEnabled( !myEditCurrentArgument && !CORBA::is_nil( myMainObj ) && isAdd );
bool hasSel = false; bool hasSel = myGroupBox->ListView1->selectedItems().count() > 0;
for ( int ii = 0, nn = myIdList->count(); !hasSel && ii < nn; ii++ ) myGroupBox->PushButton5->setEnabled( hasSel );
hasSel = myIdList->isSelected( ii ); myGroupBox->PushButton2->setEnabled( !CORBA::is_nil( myMainObj ) );
myRemBtn->setEnabled( hasSel ); myGroupBox->PushButton3->setEnabled( !CORBA::is_nil( myMainObj ) );
mySelSubBtn->setEnabled( !CORBA::is_nil( myMainObj ) );
mySelAllBtn->setEnabled( !CORBA::is_nil( myMainObj ) );
} }
//================================================================================= //=================================================================================
@ -692,12 +639,12 @@ void GroupGUI_GroupDlg::highlightSubShapes()
myBusy = true; myBusy = true;
for ( int ii = 0, nn = myIdList->count(); ii < nn; ii++ ) for ( int ii = 0, nn = myGroupBox->ListView1->count(); ii < nn; ii++ )
if ( myIdList->isSelected( ii ) ) if ( myGroupBox->ListView1->item( ii )->isSelected() )
anIds.Add( myIdList->item( ii )->text().toInt() ); anIds.Add( myGroupBox->ListView1->item( ii )->text().toInt() );
LightApp_SelectionMgr* aSelMgr = LightApp_SelectionMgr* aSelMgr =
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(); ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr();
aSelMgr->clearSelected(); aSelMgr->clearSelected();
aSelMgr->AddOrRemoveIndex( aSh->getIO(), anIds, false ); aSelMgr->AddOrRemoveIndex( aSh->getIO(), anIds, false );
@ -738,10 +685,10 @@ bool GroupGUI_GroupDlg::isValid( QString& theMessage )
RETURN_WITH_MSG( !CORBA::is_nil( myMainObj ), tr( "NO_GROUP" ) ) RETURN_WITH_MSG( !CORBA::is_nil( myMainObj ), tr( "NO_GROUP" ) )
} }
QString aName (getNewObjectName()); QString aName( getNewObjectName() );
RETURN_WITH_MSG ( !aName.stripWhiteSpace().isEmpty(), tr( "EMPTY_NAME" ) ) RETURN_WITH_MSG ( !aName.trimmed().isEmpty(), tr( "EMPTY_NAME" ) )
RETURN_WITH_MSG ( myIdList->count(), tr( "EMPTY_LIST" ) ) RETURN_WITH_MSG ( myGroupBox->ListView1->count(), tr( "EMPTY_LIST" ) )
return true; return true;
} }
@ -772,8 +719,8 @@ bool GroupGUI_GroupDlg::execute( ObjectList& objects )
return false; return false;
} }
for ( int ii = 0, nn = myIdList->count(); ii < nn; ii++ ) { for ( int ii = 0, nn = myGroupBox->ListView1->count(); ii < nn; ii++ ) {
anOp->AddObject( aGroup, myIdList->item( ii )->text().toInt() ); anOp->AddObject( aGroup, myGroupBox->ListView1->item( ii )->text().toInt() );
if ( !anOp->IsDone() ) if ( !anOp->IsDone() )
return false; return false;
} }

View File

@ -19,21 +19,18 @@
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
//
//
// File : GroupGUI_GroupDlg.h // File : GroupGUI_GroupDlg.h
// Author : Sergey ANIKIN // Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
// Module : GEOM //
#ifndef GROUPGUI_GROUPDLG_H #ifndef GROUPGUI_GROUPDLG_H
#define GROUPGUI_GROUPDLG_H #define GROUPGUI_GROUPDLG_H
#include "GEOMBase_Skeleton.h" #include <GEOMBase_Skeleton.h>
#include <TopAbs_ShapeEnum.hxx> #include <TopAbs_ShapeEnum.hxx>
class QLineEdit; class DlgRef_1Sel1List4Btn;
class QListBox;
//================================================================================= //=================================================================================
// class : GroupGUI_GroupDlg // class : GroupGUI_GroupDlg
@ -49,15 +46,15 @@ public:
EditGroup EditGroup
} Mode; } Mode;
GroupGUI_GroupDlg(Mode mode, GeometryGUI*, QWidget* parent = 0); GroupGUI_GroupDlg( Mode, GeometryGUI*, QWidget* = 0 );
~GroupGUI_GroupDlg(); ~GroupGUI_GroupDlg();
protected: protected:
// redefined from GEOMBase_Helper // redefined from GEOMBase_Helper
virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& msg ); virtual bool isValid( QString& );
virtual bool execute( ObjectList& objects ); virtual bool execute( ObjectList& );
virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr theObj ); virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr );
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
@ -66,7 +63,7 @@ private slots:
void LineEditReturnPressed(); void LineEditReturnPressed();
void SelectionIntoArgument(); void SelectionIntoArgument();
void SetEditCurrentArgument(); void SetEditCurrentArgument();
void ConstructorsClicked( int constructorId ); void ConstructorsClicked( int );
void selectAllSubShapes(); void selectAllSubShapes();
void add(); void add();
@ -75,8 +72,7 @@ private slots:
private: private:
void Init(); void Init();
void enterEvent( QEvent* e ); void enterEvent( QEvent* );
int getConstructorId() const;
TopAbs_ShapeEnum getShapeType() const; TopAbs_ShapeEnum getShapeType() const;
void setShapeType( const TopAbs_ShapeEnum ); void setShapeType( const TopAbs_ShapeEnum );
void activateSelection(); void activateSelection();
@ -89,13 +85,7 @@ private:
GEOM::GEOM_Object_var myMainObj; GEOM::GEOM_Object_var myMainObj;
GEOM::GEOM_Object_var myGroup; GEOM::GEOM_Object_var myGroup;
QPushButton* mySelBtn; DlgRef_1Sel1List4Btn* myGroupBox;
QLineEdit* myMainName;
QPushButton* mySelSubBtn;
QPushButton* mySelAllBtn;
QPushButton* myAddBtn;
QPushButton* myRemBtn;
QListBox* myIdList;
}; };
#endif #endif // GROUPGUI_GROUPDLG_H

View File

@ -1,4 +1,4 @@
# GEOM BUILDGUI : # GEOM GROUPGUI :
# #
# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@ -19,13 +19,10 @@
# #
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
# File : Makefile.am
# Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com)
# Package : GroupGUI
# #
#
# File : Makefile.in
# Author : Sergey ANIKIN (OCC)
# Modified by : Alexander BORODIN (OCN) - autotools usage
# Module : GEOM
# $Header:
include $(top_srcdir)/adm_local/unix/make_common_starter.am include $(top_srcdir)/adm_local/unix/make_common_starter.am
@ -36,6 +33,8 @@ lib_LTLIBRARIES = libGroupGUI.la
salomeinclude_HEADERS = salomeinclude_HEADERS =
dist_libGroupGUI_la_SOURCES = \ dist_libGroupGUI_la_SOURCES = \
GroupGUI.h \
GroupGUI_GroupDlg.h \
GroupGUI.cxx \ GroupGUI.cxx \
GroupGUI_GroupDlg.cxx GroupGUI_GroupDlg.cxx
@ -43,7 +42,7 @@ MOC_FILES = \
GroupGUI_moc.cxx \ GroupGUI_moc.cxx \
GroupGUI_GroupDlg_moc.cxx GroupGUI_GroupDlg_moc.cxx
nodist_libGroupGUI_la_SOURCES= \ nodist_libGroupGUI_la_SOURCES = \
$(MOC_FILES) $(MOC_FILES)
# LIB_CLIENT_IDL = SALOME_GenericObj.idl SALOME_Component.idl SALOME_Exception.idl # LIB_CLIENT_IDL = SALOME_GenericObj.idl SALOME_Component.idl SALOME_Exception.idl
@ -69,6 +68,7 @@ libGroupGUI_la_CPPFLAGS = \
-I$(srcdir)/../GEOMClient \ -I$(srcdir)/../GEOMClient \
-I$(srcdir)/../GEOMImpl \ -I$(srcdir)/../GEOMImpl \
-I$(srcdir)/../GEOMFiltersSelection \ -I$(srcdir)/../GEOMFiltersSelection \
-I$(top_builddir)/src/DlgRef \
-I$(top_builddir)/idl \ -I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix -I$(top_builddir)/salome_adm/unix

View File

@ -27,7 +27,6 @@
#include "MeasureGUI_Widgets.h" #include "MeasureGUI_Widgets.h"
#include <GEOMBase.h> #include <GEOMBase.h>
//#include <GEOM_Displayer.h>
#include <BRepPrimAPI_MakeBox.hxx> #include <BRepPrimAPI_MakeBox.hxx>

View File

@ -248,7 +248,7 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs()
try try
{ {
if( aDist <= 1.e-9 ) { if ( aDist <= 1.e-9 ) {
BRepBuilderAPI_MakeVertex aMaker( aPnt1 ); BRepBuilderAPI_MakeVertex aMaker( aPnt1 );
return getDisplayer()->BuildPrs( aMaker.Vertex() ); return getDisplayer()->BuildPrs( aMaker.Vertex() );
} }

View File

@ -33,14 +33,11 @@
#include <SalomeApp_Application.h> #include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h> #include <LightApp_SelectionMgr.h>
//#include <TColStd_MapOfInteger.hxx>
//#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
//#include <TopAbs_ShapeEnum.hxx>
#include <TopTools_IndexedMapOfShape.hxx> #include <TopTools_IndexedMapOfShape.hxx>
#include <TColStd_IndexedMapOfInteger.hxx> #include <TColStd_IndexedMapOfInteger.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>