QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_PIPE")));
QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
QPixmap image2 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_PIPE_BINORMAL")));
+ QPixmap image3 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_PIPE_SECTION")));
setWindowTitle(tr("GEOM_PIPE_TITLE"));
mainFrame()->GroupConstructors->setTitle(tr("GEOM_PIPE"));
mainFrame()->RadioButton1->setIcon(image0);
mainFrame()->RadioButton2->setIcon(image2);
- mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
- mainFrame()->RadioButton3->close();
+ mainFrame()->RadioButton3->setIcon(image3);
+ // mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
+ // mainFrame()->RadioButton3->close();
GroupPoints = new DlgRef_3Sel1Check(centralWidget());
GroupPoints->PushButton3->setIcon(image1);
GroupPoints->CheckButton1->setText(tr("GEOM_SELECT_UNPUBLISHED_EDGES"));
+ GroupMakePoints = new DlgRef_3Sel2Check3Spin(centralWidget());
+
+ GroupMakePoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
+ GroupMakePoints->TextLabel1->setText(tr("GEOM_BASE_OBJECT"));
+ GroupMakePoints->TextLabel2->setText(tr("GEOM_LOCATIONS"));
+ GroupMakePoints->TextLabel3->setText(tr("GEOM_PATH_OBJECT"));
+ GroupMakePoints->PushButton1->setIcon(image1);
+ GroupMakePoints->PushButton2->setIcon(image1);
+ GroupMakePoints->PushButton3->setIcon(image1);
+ GroupMakePoints->CheckBox1->setText(tr("GEOM_WITH_CONTACT"));
+ GroupMakePoints->CheckBox2->setText(tr("GEOM_WITH_CORRECTION"));
+ GroupMakePoints->SpinBox1->close();
+ GroupMakePoints->SpinBox2->close();
+ GroupMakePoints->SpinBox3->close();
+ GroupMakePoints->TextLabel4->close();
+ GroupMakePoints->TextLabel5->close();
+ GroupMakePoints->TextLabel6->close();
+
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
layout->setMargin(0); layout->setSpacing(6);
layout->addWidget(GroupPoints);
+ layout->addWidget(GroupMakePoints);
/***************************************************************/
setHelpFileName("create_extrusion_alongpath_page.html");
GroupPoints->CheckButton1->setEnabled(false);
+ GroupMakePoints->LineEdit1->setReadOnly(true);
+ GroupMakePoints->LineEdit2->setReadOnly(true);
+ GroupMakePoints->LineEdit3->setReadOnly(true);
+
+ GroupMakePoints->LineEdit1->setText("");
+ GroupMakePoints->LineEdit2->setText("");
+ GroupMakePoints->LineEdit3->setText("");
+
showOnlyPreviewControl();
// signals and slots connections
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(SelectionTypeButtonClicked()));
+ connect(GroupMakePoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(GroupMakePoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(GroupMakePoints->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+
initName(tr("GEOM_PIPE"));
resize(100,100);
switch (constructorId) {
case 0:
+ GroupMakePoints->hide();
+ GroupPoints->show();
GroupPoints->TextLabel3->hide();
GroupPoints->PushButton3->hide();
GroupPoints->LineEdit3->hide();
GroupPoints->PushButton1->click();
break;
case 1:
+ GroupMakePoints->hide();
+ GroupPoints->show();
GroupPoints->TextLabel3->show();
GroupPoints->PushButton3->show();
GroupPoints->LineEdit3->show();
+ GroupPoints->PushButton1->click();
+ break;
+ case 2:
+ GroupPoints->hide();
+ GroupMakePoints->show();
+ GroupMakePoints->PushButton1->click();
break;
default:
break;
if ( getConstructorId() != 1 )
ConstructorsClicked( getConstructorId() );
// activate selection and connect selection manager
- GroupPoints->PushButton1->click();
+ // GroupPoints->PushButton1->click();
return true;
}
GroupPoints->PushButton2->click();
}
}
+ else if ( myEditCurrentArgument == GroupMakePoints->LineEdit1 ) {
+ myBaseObjects.clear();
+ QList<GEOM::GeomObjPtr> objects = getSelected( TopAbs_SHAPE, -1 );
+ for ( int i = 0; i < objects.count(); i++ ) {
+ GEOM::shape_type stype = objects[i]->GetMaxShapeType();
+ if ( stype < GEOM::SHELL || stype > GEOM::VERTEX )
+ continue;
+ myBaseObjects << objects[i];
+ }
+ if ( !myBaseObjects.isEmpty() ) {
+ QString aName = myBaseObjects.count() > 1 ? QString( "%1_objects").arg( myBaseObjects.count() ) : GEOMBase::GetName( myBaseObjects[0].get() );
+ myEditCurrentArgument->setText( aName );
+ }
+ }
+ else if ( myEditCurrentArgument == GroupMakePoints->LineEdit2 ) {
+ myLocations.clear();
+ QList<GEOM::GeomObjPtr> objects = getSelected( TopAbs_SHAPE, -1 );
+ for ( int i = 0; i < objects.count(); i++ ) {
+ GEOM::shape_type stype = objects[i]->GetMaxShapeType();
+ if ( stype < GEOM::SHELL || stype > GEOM::VERTEX )
+ continue;
+ myLocations << objects[i];
+ }
+ if ( !myLocations.isEmpty() ) {
+ QString aName = myLocations.count() > 1 ? QString( "%1_objects").arg( myLocations.count() ) : GEOMBase::GetName( myLocations[0].get() );
+ myEditCurrentArgument->setText( aName );
+ }
+ }
+ else if ( myEditCurrentArgument == GroupMakePoints->LineEdit3 ) {
+ QList<TopAbs_ShapeEnum> types;
+ types << TopAbs_EDGE << TopAbs_WIRE;
+ myPath = getSelected( types );
+ if ( myPath ) {
+ QString aName = GEOMBase::GetName( myPath.get() );
+ myEditCurrentArgument->setText( aName );
+ }
+ }
processPreview();
}
GroupPoints->CheckButton1->setEnabled(false);
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
}
+
+ GroupMakePoints->PushButton1->setDown(false);
+ GroupMakePoints->PushButton2->setDown(false);
+ GroupMakePoints->PushButton3->setDown(false);
+ GroupMakePoints->LineEdit1->setEnabled(false);
+ GroupMakePoints->LineEdit2->setEnabled(false);
+ GroupMakePoints->LineEdit3->setEnabled(false);
+ if (send == GroupMakePoints->PushButton1) {
+ myEditCurrentArgument = GroupMakePoints->LineEdit1;
+ }
+ else if(send == GroupMakePoints->PushButton2) {
+ myEditCurrentArgument = GroupMakePoints->LineEdit2;
+ }
+ else if (send == GroupMakePoints->PushButton3) {
+ myEditCurrentArgument = GroupMakePoints->LineEdit3;
+ }
+
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
this, SLOT(SelectionIntoArgument()));
case 1 :
ok = !myBaseObjects.isEmpty() && myPath && myVec;
break;
+ case 2 :
+ ok = !myBaseObjects.isEmpty() && ( myLocations.isEmpty() || myBaseObjects.count() == myLocations.count() ) && myPath;
+ break;
default:
break;
}
GEOM::GEOM_Object_var anObj;
GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());
-
- for (int i = 0; i < myBaseObjects.count(); i++) {
- switch ( getConstructorId() ) {
- case 0 :
- anObj = anOper->MakePipe(myBaseObjects[i].get(), myPath.get());
- break;
- case 1 :
- anObj = anOper->MakePipeBiNormalAlongVector(myBaseObjects[i].get(), myPath.get(), myVec.get());
- break;
- }
+ switch( getConstructorId() ) {
+ case 0:
+ case 1:
+ for (int i = 0; i < myBaseObjects.count(); i++) {
+ switch ( getConstructorId() ) {
+ case 0 :
+ anObj = anOper->MakePipe(myBaseObjects[i].get(), myPath.get());
+ break;
+ case 1 :
+ anObj = anOper->MakePipeBiNormalAlongVector(myBaseObjects[i].get(), myPath.get(), myVec.get());
+ break;
+ }
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
+ }
+ break;
+ case 2:
+ GEOM::ListOfGO_var myBaseGO = new GEOM::ListOfGO();
+ GEOM::ListOfGO_var myLocationsGO = new GEOM::ListOfGO();
+ myBaseGO->length( myBaseObjects.count() );
+ myLocationsGO->length( myLocations.count() );
+ for (int i = 0; i < myBaseObjects.count(); i++) {
+ myBaseGO[i] = myBaseObjects[i].copy();
+ }
+ for (int i = 0; i < myLocations.count(); i++) {
+ myLocationsGO[i] = myLocations[i].copy();
+ }
+
+ anObj = anOper->MakePipeWithDifferentSections(myBaseGO.in(), myLocationsGO.in(), myPath.get(), GroupMakePoints->CheckBox1->isChecked(), GroupMakePoints->CheckBox2->isChecked());
if (!anObj->_is_nil())
objects.push_back(anObj._retn());
+ break;
+ default:
+ break;
}
return true;
}