0020044: EDF 866 GEOM: Extrusion along a path : impossible to select a Wire

This commit is contained in:
dmv 2008-11-18 11:09:15 +00:00
parent 6dd2eac181
commit 2620958c22
6 changed files with 106 additions and 60 deletions

View File

@ -1,7 +1,7 @@
/****************************************************************************
** Form implementation generated from reading ui file 'DlgRef_3Sel1Check_QTD.ui'
**
** Created: Mon Oct 29 18:14:59 2007
** Created: Tue Nov 18 12:14:50 2008
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
@ -46,7 +46,7 @@ DlgRef_3Sel1Check_QTD::DlgRef_3Sel1Check_QTD( QWidget* parent, const char* name,
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
GroupBox1Layout->addMultiCellWidget( LineEdit1, 0, 0, 2, 3 );
GroupBox1Layout->addWidget( LineEdit1, 0, 2 );
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
@ -60,7 +60,7 @@ DlgRef_3Sel1Check_QTD::DlgRef_3Sel1Check_QTD( QWidget* parent, const char* name,
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
GroupBox1Layout->addMultiCellWidget( LineEdit2, 1, 1, 2, 3 );
GroupBox1Layout->addWidget( LineEdit2, 1, 2 );
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
@ -74,14 +74,14 @@ DlgRef_3Sel1Check_QTD::DlgRef_3Sel1Check_QTD( QWidget* parent, const char* name,
LineEdit3 = new QLineEdit( GroupBox1, "LineEdit3" );
GroupBox1Layout->addMultiCellWidget( LineEdit3, 2, 2, 2, 3 );
GroupBox1Layout->addWidget( LineEdit3, 2, 2 );
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
GroupBox1Layout->addWidget( TextLabel3, 2, 0 );
Spacer3 = new QSpacerItem( 16, 721, QSizePolicy::Minimum, QSizePolicy::Expanding );
GroupBox1Layout->addItem( Spacer3, 4, 3 );
GroupBox1Layout->addItem( Spacer3, 4, 2 );
CheckButton1 = new QCheckBox( GroupBox1, "CheckButton1" );
@ -89,7 +89,7 @@ DlgRef_3Sel1Check_QTD::DlgRef_3Sel1Check_QTD( QWidget* parent, const char* name,
DlgRef_3Sel1Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
languageChange();
resize( QSize(403, 441).expandedTo(minimumSizeHint()) );
resize( QSize(311, 299).expandedTo(minimumSizeHint()) );
clearWState( WState_Polished );
// tab order

View File

@ -1,7 +1,7 @@
/****************************************************************************
** Form interface generated from reading ui file 'DlgRef_3Sel1Check_QTD.ui'
**
** Created: Mon Oct 29 18:14:59 2007
** Created: Tue Nov 18 12:14:50 2008
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
@ -10,8 +10,6 @@
#ifndef DLGREF_3SEL1CHECK_QTD_H
#define DLGREF_3SEL1CHECK_QTD_H
#include "GEOM_DlgRef.hxx"
#include <qvariant.h>
#include <qwidget.h>
@ -25,7 +23,7 @@ class QLineEdit;
class QLabel;
class QCheckBox;
class GEOM_DLGREF_EXPORT DlgRef_3Sel1Check_QTD : public QWidget
class DlgRef_3Sel1Check_QTD : public QWidget
{
Q_OBJECT

View File

@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>403</width>
<height>441</height>
<width>311</width>
<height>299</height>
</rect>
</property>
<property name="sizePolicy">
@ -74,7 +74,7 @@
<string></string>
</property>
</widget>
<widget class="QLineEdit" row="0" column="2" rowspan="1" colspan="2">
<widget class="QLineEdit" row="0" column="2">
<property name="name">
<cstring>LineEdit1</cstring>
</property>
@ -111,7 +111,7 @@
<string></string>
</property>
</widget>
<widget class="QLineEdit" row="1" column="2" rowspan="1" colspan="2">
<widget class="QLineEdit" row="1" column="2">
<property name="name">
<cstring>LineEdit2</cstring>
</property>
@ -148,7 +148,7 @@
<string></string>
</property>
</widget>
<widget class="QLineEdit" row="2" column="2" rowspan="1" colspan="2">
<widget class="QLineEdit" row="2" column="2">
<property name="name">
<cstring>LineEdit3</cstring>
</property>
@ -169,7 +169,7 @@
<string>TL3</string>
</property>
</widget>
<spacer row="4" column="3">
<spacer row="4" column="2">
<property name="name">
<cstring>Spacer3</cstring>
</property>

View File

@ -1205,6 +1205,9 @@ msgstr "<< Set"
msgid "GEOM_PIPE_TITLE"
msgstr "Pipe Construction"
msgid "GEOM_SELECT_UNPUBLISHED_EDGES"
msgstr "Select unpublished edges"
#: GeometryGUI_PointDlg.cxx:52
msgid "GEOM_POINT_TITLE"
msgstr "Point Construction"

View File

@ -34,7 +34,7 @@
#include "LightApp_SelectionMgr.h"
#include <qlabel.h>
#include <qcheckbox.h>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS.hxx>
@ -43,6 +43,8 @@
#include <TopTools_IndexedMapOfShape.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepOffsetAPI_MakePipe.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#if OCC_VERSION_MAJOR >= 5
#include <BRepAlgo.hxx>
#else
@ -77,7 +79,7 @@ GenerationGUI_PipeDlg::GenerationGUI_PipeDlg(GeometryGUI* theGeometryGUI, QWidge
RadioButton2->setPixmap(image2);
RadioButton3->close(TRUE);
GroupPoints = new DlgRef_3Sel_QTD(this, "GroupPoints");
GroupPoints = new DlgRef_3Sel1Check_QTD(this, "GroupPoints");
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupPoints->TextLabel1->setText(tr("GEOM_BASE_OBJECT"));
GroupPoints->TextLabel2->setText(tr("GEOM_PATH_OBJECT"));
@ -85,6 +87,7 @@ GenerationGUI_PipeDlg::GenerationGUI_PipeDlg(GeometryGUI* theGeometryGUI, QWidge
GroupPoints->PushButton1->setPixmap(image1);
GroupPoints->PushButton2->setPixmap(image1);
GroupPoints->PushButton3->setPixmap(image1);
GroupPoints->CheckButton1->setText(tr("GEOM_SELECT_UNPUBLISHED_EDGES"));
Layout1->addWidget(GroupPoints, 2, 0);
/***************************************************************/
@ -119,6 +122,8 @@ void GenerationGUI_PipeDlg::Init()
myOkBase = myOkPath = myOkVec = false;
GroupPoints->CheckButton1->setEnabled(false);
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
@ -131,6 +136,8 @@ void GenerationGUI_PipeDlg::Init()
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(SelectionTypeButtonClicked()));
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
@ -175,6 +182,22 @@ void GenerationGUI_PipeDlg::ConstructorsClicked( int constructorId )
displayPreview();
}
//=================================================================================
// function : SelectionBittonClicked()
// purpose : Selection type Radio button management
//=================================================================================
void GenerationGUI_PipeDlg::SelectionTypeButtonClicked()
{
if ( GroupPoints->CheckButton1->isChecked() ) {
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
} else {
TColStd_MapOfInteger aMap;
aMap.Add(GEOM_WIRE);
aMap.Add(GEOM_LINE);
globalSelection(aMap);
}
}
//=================================================================================
// function : ClickOnOk()
@ -258,49 +281,55 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
return;
QString aName = GEOMBase::GetName( aSelectedObject );
if ( testResult && !aSelectedObject->_is_nil() && aSelectedObject != myBase)
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes( firstIObject(), aMap );
if ( aMap.Extent() == 1 )
{
int anIndex = aMap( 1 );
aName.append( ":edge_" + QString::number( anIndex ) );
//Find SubShape Object in Father
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
myOk = true;
}
else { // get Object from study
if (myEditCurrentArgument == GroupPoints->LineEdit2 && !GroupPoints->CheckButton1->isChecked() ){
myPath = aSelectedObject;
myOkPath = true;
}
else
{
if ( testResult && !aSelectedObject->_is_nil() && aSelectedObject != myBase)
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes( firstIObject(), aMap );
if ( aMap.Extent() == 1 )
{
int anIndex = aMap( 1 );
aName.append( ":edge_" + QString::number( anIndex ) );
//Find SubShape Object in Father
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
myOk = true;
}
else { // get Object from study
aSelectedObject = aFindedObject;
myOk = true;
}
}
else {
myOk = true;
if (S.ShapeType() != TopAbs_EDGE) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
myOk = false;
}
}
else {
myOk = true;
if (S.ShapeType() != TopAbs_EDGE) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
myOk = false;
if (myEditCurrentArgument == GroupPoints->LineEdit2) {
myPath = aSelectedObject;
myOkPath = myOk;
}
else if (myEditCurrentArgument == GroupPoints->LineEdit3) {
myVec = aSelectedObject;
myOkVec = myOk;
}
}
if (myEditCurrentArgument == GroupPoints->LineEdit2) {
myPath = aSelectedObject;
myOkPath = myOk;
}
else if (myEditCurrentArgument == GroupPoints->LineEdit3) {
myVec = aSelectedObject;
myOkVec = myOk;
}
}
}
myEditCurrentArgument->setText( aName );
}
@ -321,18 +350,28 @@ void GenerationGUI_PipeDlg::SetEditCurrentArgument()
GroupPoints->LineEdit1->setFocus();
globalSelection( GEOM_ALLSHAPES );
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->CheckButton1->setEnabled(false);
}
else if(send == GroupPoints->PushButton2) {
GroupPoints->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit2;
globalSelection();
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
if ( GroupPoints->CheckButton1->isChecked() ) {
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
} else {
TColStd_MapOfInteger aMap;
aMap.Add(GEOM_WIRE);
aMap.Add(GEOM_LINE);
globalSelection(aMap);
}
GroupPoints->CheckButton1->setEnabled(true);
}
else if(send == GroupPoints->PushButton3) {
GroupPoints->LineEdit3->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit3;
globalSelection();
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
GroupPoints->CheckButton1->setEnabled(false);
}
SelectionIntoArgument();
}
@ -352,6 +391,11 @@ void GenerationGUI_PipeDlg::LineEditReturnPressed()
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
if (send == GroupPoints->LineEdit2)
GroupPoints->CheckButton1->setEnabled(true);
else
GroupPoints->CheckButton1->setEnabled(false);
}
@ -373,7 +417,7 @@ void GenerationGUI_PipeDlg::enterEvent(QEvent* e)
void GenerationGUI_PipeDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
globalSelection( GEOM_ALLSHAPES );
// globalSelection( GEOM_ALLSHAPES );
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
ConstructorsClicked(getConstructorId());

View File

@ -31,7 +31,7 @@
#include "GenerationGUI.h"
#include "GEOMBase_Skeleton.h"
#include "DlgRef_3Sel_QTD.h"
#include "DlgRef_3Sel1Check_QTD.h"
//=================================================================================
// class : GenerationGUI_PipeDlg
@ -64,7 +64,7 @@ private:
bool myOkPath;
bool myOkVec; /* to check when arguments are defined */
DlgRef_3Sel_QTD* GroupPoints;
DlgRef_3Sel1Check_QTD* GroupPoints;
private slots:
void ClickOnOk();
@ -74,6 +74,7 @@ private slots:
void SelectionIntoArgument();
void SetEditCurrentArgument();
void ConstructorsClicked(int constructorId);
void SelectionTypeButtonClicked();
};
#endif // DIALOGBOX_PIPE_H