/***************************************************************/
QGroupBox* aReverseGroupBox = new QGroupBox( centralWidget() );
QHBoxLayout* aReverseGroupBoxLayout = new QHBoxLayout( aReverseGroupBox );
- aReverseGroupBoxLayout->setMargin( 9 );
+ aReverseGroupBoxLayout->setMargin( 9 );
aReverseGroupBoxLayout->setSpacing( 6 );
-
+
myReverseCB = new QCheckBox( aReverseGroupBox );
myReverseCB->setText( tr( "GEOM_REVERSE_PLANE" ) );
aReverseGroupBoxLayout->addWidget( myReverseCB );
-
+
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( Group1 );
layout->addWidget( Group2 );
layout->addWidget( Group3 );
layout->addWidget( aReverseGroupBox );
-
+
setHelpFileName( "create_wplane_page.html" );
Init();
initName( tr( "GEOM_WPLANE" ) );
- ConstructorsClicked( 0 );
+ setConstructorId( 2 ); // simplest constructor
+ ConstructorsClicked( 2 );
}
//=================================================================================
aMap.Add( GEOM_PLANE );
aMap.Add( GEOM_MARKER );
globalSelection( aMap );
-
+
Group2->hide();
Group3->hide();
Group1->show();
-
+
myEditCurrentArgument = Group1->LineEdit1;
Group1->LineEdit1->setText( "" );
myFace = GEOM::GEOM_Object::_nil();
-
+
connect( aSelMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
break;
}
//globalSelection( GEOM_LINE );
GEOM::GEOM_Object_var anObj;
localSelection( anObj, TopAbs_EDGE );
-
+
Group1->hide();
Group3->hide();
Group2->show();
-
+
myEditCurrentArgument = Group2->LineEdit1;
Group2->LineEdit1->setText( "" );
Group2->LineEdit2->setText( "" );
myVectX = GEOM::GEOM_Object::_nil();
myVectZ = GEOM::GEOM_Object::_nil();
-
+
connect( aSelMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
break;
}
Group1->hide();
Group2->hide();
Group3->show();
-
+
Group3->RadioButton1->setChecked( true );
aOriginType = 1;
break;
}
}
-
+
qApp->processEvents();
updateGeometry();
resize( minimumSize() );
{
buttonApply()->setFocus();
myGeomGUI->application()->putInfo( "" );
-
+
if ( updateWPlane( false ) ) {
myGeomGUI->SetWorkingPlane( myWPlane );
myGeomGUI->ActiveWorkingPlane();
}
-
+
return true;
}
if ( myEditCurrentArgument == Group1->LineEdit1 )
myFace = aSelectedObject;
- else if ( myEditCurrentArgument == Group2->LineEdit1 ||
+ else if ( myEditCurrentArgument == Group2->LineEdit1 ||
myEditCurrentArgument == Group2->LineEdit2 ) {
if ( aRes && !aSelectedObject->_is_nil() ) {
TopoDS_Shape aShape;
}
myEditCurrentArgument->setText( aName );
-
+
updateWPlane();
}
bool BasicGUI_WorkingPlaneDlg::updateWPlane( const bool showPreview )
{
erasePreview();
-
+
const int id = getConstructorId();
if ( id == 0 ) { // by planar face selection
gp_Dir aDirN ( Zx, Zy, Zz );
gp_Dir aDirX ( Xx, Xy, Xz );
myWPlane = gp_Ax3( aPnt, aDirN, aDirX );
- }
+ }
else {
if ( !showPreview )
showError( "Wrong shape selected (has to be a planar face)" );
return false;
}
- }
+ }
else if ( id == 1 ) { // by two vectors (Ox & Oz)
if ( CORBA::is_nil( myVectX ) || CORBA::is_nil( myVectZ ) ) {
if ( !showPreview )
showError( "Two vectors have to be selected" );
return false;
}
-
+
TopoDS_Edge aVectX, aVectZ;
TopoDS_Vertex VX1, VX2, VZ1, VZ2;
gp_Vec aVX, aVZ;
myWPlane = gp_Ax3( BRep_Tool::Pnt( VX1 ), aDirZ, aDirX );
- }
+ }
else if ( id == 2 ) { // by selection from standard (OXY or OYZ, or OZX)
gp_Ax2 anAx2;
myWPlane = gp_Ax3( anAx2 );
- }
+ }
else {
return false;
}
-
+
if ( myReverseCB->isChecked() ) {
myWPlane.YReverse();
myWPlane.ZReverse();
}
-
+
if ( showPreview ) {
GEOM::GEOM_IBasicOperations_var aBasicOp = getGeomEngine()->GetIBasicOperations( getStudyId() );
- GEOM::GEOM_Object_var anObj = aBasicOp->MakeMarker( myWPlane.Location().X(), myWPlane.Location().Y(), myWPlane.Location().Z(),
- myWPlane.XDirection().X(), myWPlane.XDirection().Y(), myWPlane.XDirection().Z(),
- myWPlane.YDirection().X(), myWPlane.YDirection().Y(), myWPlane.YDirection().Z() );
+ GEOM::GEOM_Object_var anObj = aBasicOp->MakeMarker
+ ( myWPlane.Location().X(), myWPlane.Location().Y(), myWPlane.Location().Z(),
+ myWPlane.XDirection().X(), myWPlane.XDirection().Y(), myWPlane.XDirection().Z(),
+ myWPlane.YDirection().X(), myWPlane.YDirection().Y(), myWPlane.YDirection().Z() );
displayPreview( anObj );
}
-
+
return true;
}