/****************************************************************************
** 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!
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() ) );
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() ) );
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" );
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
#include "LightApp_SelectionMgr.h"
#include <qlabel.h>
-
+#include <qcheckbox.h>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS.hxx>
#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
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"));
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);
/***************************************************************/
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()));
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()));
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()
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 );
}
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();
}
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
}
+
+ if (send == GroupPoints->LineEdit2)
+ GroupPoints->CheckButton1->setEnabled(true);
+ else
+ GroupPoints->CheckButton1->setEnabled(false);
}
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());