* \param theW horisontal size (width).
* \return New GEOM_Object, containing the created face.
*/
- GEOM_Object MakeFaceVecHW (in GEOM_Object theVec, in double theH, in double theW);
+ GEOM_Object MakeFaceObjHW (in GEOM_Object theObj, in double theH, in double theW);
/*!
* Create a Disk (circular face) with given center, normal vector and radius.
* \param thePnt disk center.
GEOM_Object MakeFaceHW (in double theH,
in double theW,
in short theOrientation) ;
- GEOM_Object MakeFaceVecHW (in GEOM_Object theVec,
+ GEOM_Object MakeFaceObjHW (in GEOM_Object theObj,
in double theH,
in double theW) ;
GEOM_Object MakeDiskPntVecR (in GEOM_Object thePnt,
{
}
+//////////////////////////////////////////
+// DlgRef_3Radio
+//////////////////////////////////////////
+
+DlgRef_3Radio::DlgRef_3Radio( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+ setupUi( this );
+}
+
+DlgRef_3Radio::~DlgRef_3Radio()
+{
+}
+
//////////////////////////////////////////
// DlgRef_3Sel1Check
//////////////////////////////////////////
~DlgRef_1Sel3Check();
};
+
+
//////////////////////////////////////////
// DlgRef_1Sel3Spin
//////////////////////////////////////////
~DlgRef_3Check();
};
+//////////////////////////////////////////
+// DlgRef_1Sel3Radio
+//////////////////////////////////////////
+
+#include "ui_DlgRef_3Radio_QTD.h"
+
+class DLGREF_EXPORT DlgRef_3Radio : public QWidget,
+ public Ui::DlgRef_3Radio_QTD
+{
+ Q_OBJECT
+
+public:
+ DlgRef_3Radio( QWidget* = 0, Qt::WindowFlags = 0 );
+ ~DlgRef_3Radio();
+};
+
//////////////////////////////////////////
// DlgRef_3Sel1Check
//////////////////////////////////////////
ui_DlgRef_2SelExt_QTD.h \
ui_DlgRef_2Spin_QTD.h \
ui_DlgRef_3Check_QTD.h \
+ ui_DlgRef_3Radio_QTD.h \
ui_DlgRef_3Sel1Check_QTD.h \
ui_DlgRef_3Sel1Spin_QTD.h \
ui_DlgRef_3Sel3Spin1Check_QTD.h \
<translation>face_hw.png</translation>
</message>
<message>
- <source>ICON_DLG_FACE_VEC_HW</source>
+ <source>ICON_DLG_FACE_OBJ_HW</source>
<translation>face_vechw.png</translation>
</message>
<message>
<source>GEOM_DISK</source>
<translation>Disk</translation>
</message>
+ <message>
+ <source>GEOM_DISK_TITLE</source>
+ <translation>Create A Disk</translation>
+ </message>
<message>
<source>GEOM_DIMENSIONS</source>
<translation>Dimensions</translation>
<source>GEOM_OBJECT</source>
<translation>Object</translation>
</message>
+ <message>
+ <source>GEOM_OBJECT_TYPE</source>
+ <translation>Object Type</translation>
+ </message>
<message>
<source>GEOM_OBJECTS</source>
<translation>Objects</translation>
TopoDS_Shape aShape;
- if (aType == FACE_VEC_H_W) {
- Handle(GEOM_Function) aRefVec = aFI.GetRef1();
- TopoDS_Shape aShapeVec = aRefVec->GetValue();
- if (aShapeVec.ShapeType() == TopAbs_EDGE) {
- TopoDS_Edge anEdge = TopoDS::Edge(aShapeVec);
+ if (aType == FACE_OBJ_H_W) {
+ Handle(GEOM_Function) aRefFunct = aFI.GetRef1();
+ TopoDS_Shape aRefShape = aRefFunct->GetValue();
+ if (aRefShape.ShapeType() == TopAbs_EDGE) {
+ TopoDS_Edge anEdge = TopoDS::Edge(aRefShape);
double aH = aFI.GetH() / 2.0;
double aW = aFI.GetW() / 2.0;
TopoDS_Vertex V1, V2;
gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
gp_Pln aPlane (aP, aV);
aShape = BRepBuilderAPI_MakeFace(aPlane, -aH, +aH, -aW, +aW).Shape();
+ } else if (aRefShape.ShapeType() == TopAbs_FACE) {
+ double aH = aFI.GetH() / 2.0;
+ double aW = aFI.GetW() / 2.0;
+ gp_Ax3 anAx = GEOMImpl_IMeasureOperations::GetPosition(aRefShape);
+ gp_Pln aPln (anAx);
+ aShape = BRepBuilderAPI_MakeFace(aPln, -aH, +aH, -aW, +aW).Shape();
}
}
else if (aType == FACE_H_W) {
//=============================================================================
/*!
- * MakeFaceVecHW
+ * MakeFaceObjHW
*/
//=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceVecHW (Handle(GEOM_Object) theVec,
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceObjHW (Handle(GEOM_Object) theObj,
double theH, double theW)
{
SetErrorCode(KO);
- if (theVec.IsNull()) return NULL;
+ if (theObj.IsNull()) return NULL;
//Add a new Face object
Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
//Add a new Box function for creation a box relatively to two points
- Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_VEC_H_W);
+ Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_OBJ_H_W);
if (aFunction.IsNull()) return NULL;
//Check if the function is set correctly
GEOMImpl_IFace aFI (aFunction);
- Handle(GEOM_Function) aRefFunction1 = theVec->GetLastFunction();
+ Handle(GEOM_Function) aRefFunction1 = theObj->GetLastFunction();
if (aRefFunction1.IsNull())
return aFace;
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << aFace << " = geompy.MakeFaceVecHW("
- << theVec << ", " << theH << ", " << theW << ")";
+ GEOM::TPythonDump(aFunction) << aFace << " = geompy.MakeFaceObjHW("
+ << theObj << ", " << theH << ", " << theW << ")";
SetErrorCode(OK);
return aFace;
Standard_EXPORT Handle(GEOM_Object) MakeBoxTwoPnt (Handle(GEOM_Object) thePnt1,
Handle(GEOM_Object) thePnt2);
Standard_EXPORT Handle(GEOM_Object) MakeFaceHW (double theH, double theW, int theOrientation);
- Standard_EXPORT Handle(GEOM_Object) MakeFaceVecHW (Handle(GEOM_Object) theVec,
+ Standard_EXPORT Handle(GEOM_Object) MakeFaceObjHW (Handle(GEOM_Object) theObj,
double theH, double theW);
Standard_EXPORT Handle(GEOM_Object) MakeDiskThreePnt (Handle(GEOM_Object) thePnt1,
Handle(GEOM_Object) thePnt2,
#define BOX_DX_DY_DZ 1
#define BOX_TWO_PNT 2
-#define FACE_VEC_H_W 1
+#define FACE_OBJ_H_W 1
#define FACE_H_W 2
#define DISK_PNT_VEC_R 1
//=============================================================================
/*!
- * MakeFaceVecHW
+ * MakeFaceObjHW
*/
//=============================================================================
-GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFaceVecHW
- (GEOM::GEOM_Object_ptr theVec,
+GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeFaceObjHW
+ (GEOM::GEOM_Object_ptr theObj,
CORBA::Double theH,
CORBA::Double theW)
{
//Set a not done flag
GetOperations()->SetNotDone();
- if (theVec == NULL || theH == 0 || theW == 0)
+ if (theObj == NULL || theH == 0 || theW == 0)
return aGEOMObject._retn();
//Get the reference points
- Handle(GEOM_Object) aFace = GetOperations()->GetEngine()->GetObject
- (theVec->GetStudyID(), theVec->GetEntry());
+ Handle(GEOM_Object) anObj = GetOperations()->GetEngine()->GetObject
+ (theObj->GetStudyID(), theObj->GetEntry());
- if (aFace.IsNull())
+ if (anObj.IsNull())
return aGEOMObject._retn();
//Create the Face
- Handle(GEOM_Object) anObject = GetOperations()->MakeFaceVecHW(aFace, theH, theW);
+ Handle(GEOM_Object) anObject = GetOperations()->MakeFaceObjHW(anObj, theH, theW);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
CORBA::Double theW,
CORBA::Short theOrientation);
- GEOM::GEOM_Object_ptr MakeFaceVecHW (GEOM::GEOM_Object_ptr theFace,
- CORBA::Double theH,
- CORBA::Double theW);
+ GEOM::GEOM_Object_ptr MakeFaceObjHW (GEOM::GEOM_Object_ptr theObj,
+ CORBA::Double theH,
+ CORBA::Double theW);
GEOM::GEOM_Object_ptr MakeDiskPntVecR (GEOM::GEOM_Object_ptr theCenter,
GEOM::GEOM_Object_ptr theVector,
}
//=============================================================================
-// MakeFaceVecHW:
+// MakeFaceObjHW:
//=============================================================================
-GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceVecHW (GEOM::GEOM_Object_ptr theVec,
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceObjHW (GEOM::GEOM_Object_ptr theObj,
CORBA::Double theH,
CORBA::Double theW)
{
- beginService( " GEOM_Superv_i::MakeFaceVecHW" );
- MESSAGE("GEOM_Superv_i::MakeFaceVecHW");
+ beginService( " GEOM_Superv_i::MakeFaceObjHW" );
+ MESSAGE("GEOM_Superv_i::MakeFaceObjHW");
get3DPrimOp();
- GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFaceVecHW(theVec, theH, theW);
- endService( " GEOM_Superv_i::MakeFaceVecHW" );
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFaceObjHW(theObj, theH, theW);
+ endService( " GEOM_Superv_i::MakeFaceObjHW" );
return anObj;
}
GEOM::GEOM_Object_ptr MakeFaceHW (CORBA::Double theH,
CORBA::Double theW,
CORBA::Short theOrientation);
- GEOM::GEOM_Object_ptr MakeFaceVecHW (GEOM::GEOM_Object_ptr theFace,
+ GEOM::GEOM_Object_ptr MakeFaceObjHW (GEOM::GEOM_Object_ptr theObj,
CORBA::Double theH,
CORBA::Double theW);
GEOM::GEOM_Object_ptr MakeDiskPntVecR (GEOM::GEOM_Object_ptr theCenter,
WantPlanarFace) #(List of GEOM_Object_ptr, Boolean)->GEOM_Object_ptr
Face2 = geompy.MakeFace(Sketcher, WantPlanarFace)
Face3 = geompy.MakeFaceHW (100., 200., 1) #(2 Doubles, 1 Int)->GEOM_Object_ptr
- Face4 = geompy.MakeFaceVecHW (vz, 200., 100.) #(1 GEOM_Object_ptr, 2 Doubles)->GEOM_Object_ptr
+ Face4 = geompy.MakeFaceObjHW (vz, 200., 100.) #(1 GEOM_Object_ptr, 2 Doubles)->GEOM_Object_ptr
Disk = geompy.MakeDiskPntVecR (p0, vz, radius) #(2 GEOM_Object_ptr, 1 Double)->GEOM_Object_ptr
Disk2 = geompy.MakeDiskThreePnt(p0, p200, pz) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
Disk3 = geompy.MakeDiskR(100., 1) #(1 Doubles, 1 Int)->GEOM_Object_ptr
## Create a face from another plane and two sizes,
# vertical size and horisontal size.
- # @param theVec Normale vector to the creating face.
+ # @param theObj Normale vector to the creating face or
+ # the face object.
# @param theH Height (vertical size).
# @param theW Width (horisontal size).
# @return New GEOM_Object, containing the created face.
#
# @ref tui_creation_face "Example"
- def MakeFaceVecHW(self, theVec, theH, theW):
+ def MakeFaceObjHW(self, theObj, theH, theW):
# Example: see GEOM_TestAll.py
- anObj = self.PrimOp.MakeFaceVecHW(theVec, theH, theW)
- RaiseIfFailed("MakeFaceVecHW", self.PrimOp)
+ anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
+ RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
return anObj
## Create a disk with given center, normal vector and radius.
/***************************************************************/
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_DISK" ) );
- mainFrame()->RadioButton1->setIcon( image0 );
- mainFrame()->RadioButton2->setIcon( image2 );
- mainFrame()->RadioButton3->setIcon( image3 );
+ mainFrame()->RadioButton1->setIcon( image3 );
+ mainFrame()->RadioButton2->setIcon( image0 );
+ mainFrame()->RadioButton3->setIcon( image2 );
GroupPntVecR = new DlgRef_2Sel1Spin( centralWidget() );
GroupPntVecR->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
GroupDimensions->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
GroupDimensions->TextLabel1->setText( tr( "GEOM_RADIUS" ) );
- GroupOrientation = new DlgRef_3Check( centralWidget() );
+ GroupOrientation = new DlgRef_3Radio( centralWidget() );
GroupOrientation->GroupBox1->setTitle( tr( "GEOM_ORIENTATION" ) );
GroupOrientation->RadioButton1->setText( tr( "GEOM_WPLANE_OXY" ) );
GroupOrientation->RadioButton2->setText( tr( "GEOM_WPLANE_OYZ" ) );
switch ( constructorId ) {
case 0:
+ {
+ GroupPntVecR->hide();
+ Group3Pnts->hide();
+ GroupDimensions->show();
+ GroupOrientation->show();
+ GroupOrientation->RadioButton1->setChecked( true );
+ myOrientationType = 1;
+ break;
+ }
+ case 1:
{
Group3Pnts->hide();
GroupPntVecR->show();
GroupPntVecR->LineEdit2->setText( "" );
break;
}
- case 1:
+ case 2:
{
GroupPntVecR->hide();
Group3Pnts->show();
Group3Pnts->LineEdit3->setText( "" );
break;
}
- case 2:
- {
- GroupPntVecR->hide();
- Group3Pnts->hide();
- GroupDimensions->show();
- GroupOrientation->show();
- GroupOrientation->RadioButton1->setChecked( true );
- myOrientationType = 1;
- }
}
qApp->processEvents();
//=================================================================================
void PrimitiveGUI_DiskDlg::SelectionIntoArgument()
{
- if (getConstructorId() == 2) {
+ if (getConstructorId() == 0) {
displayPreview();
return;
}
double r = 0.;
switch ( getConstructorId() ) {
case 0:
- r = GroupPntVecR->SpinBox_DX->value(); break;
- case 2:
r = GroupDimensions->SpinBox_DX->value(); break;
+ case 1:
+ r = GroupPntVecR->SpinBox_DX->value(); break;
}
return r;
}
{
const int id = getConstructorId();
if ( id == 0 )
- return !myPoint->_is_nil() && !myDir->_is_nil() && getRadius() > 0;
+ return true;
else if ( id == 1 )
+ return !myPoint->_is_nil() && !myDir->_is_nil() && getRadius() > 0;
+ else if ( id == 2 )
return !myPoint1->_is_nil() && !myPoint2->_is_nil() && !myPoint3->_is_nil() &&
!isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 );
- else if ( id == 2 )
- return true;
return false;
}
switch ( getConstructorId() ) {
case 0 :
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeDiskPntVecR( myPoint, myDir, getRadius() );
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeDiskR( getRadius(), myOrientationType );
res = true;
break;
case 1 :
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeDiskThreePnt( myPoint1, myPoint2, myPoint3 );
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeDiskPntVecR( myPoint, myDir, getRadius() );
res = true;
break;
case 2 :
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeDiskR( getRadius(), myOrientationType );
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeDiskThreePnt( myPoint1, myPoint2, myPoint3 );
res = true;
break;
}
QMap<QString, GEOM::GEOM_Object_var> objMap;
switch ( getConstructorId() ) {
- case 0:
+ case 1:
objMap[GroupPntVecR->LineEdit1->text()] = myPoint;
objMap[GroupPntVecR->LineEdit2->text()] = myDir;
break;
- case 1:
+ case 2:
objMap[Group3Pnts->LineEdit1->text()] = myPoint1;
objMap[Group3Pnts->LineEdit2->text()] = myPoint2;
objMap[Group3Pnts->LineEdit3->text()] = myPoint3;
class DlgRef_3Sel;
class DlgRef_2Sel1Spin;
class DlgRef_1Spin;
-class DlgRef_3Check;
+class DlgRef_3Radio;
//=================================================================================
// class : PrimitiveGUI_DiskDlg
DlgRef_2Sel1Spin* GroupPntVecR;
DlgRef_3Sel* Group3Pnts;
DlgRef_1Spin* GroupDimensions;
- DlgRef_3Check* GroupOrientation;
+ DlgRef_3Radio* GroupOrientation;
private slots:
void ClickOnOk();
bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
- QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FACE_VEC_HW" ) ) );
+ QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FACE_OBJ_HW" ) ) );
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_FACE_HW" ) ) );
/***************************************************************/
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_FACE" ) );
- mainFrame()->RadioButton1->setIcon( image0 );
- mainFrame()->RadioButton2->setIcon( image2 );
+ mainFrame()->RadioButton1->setIcon( image2 );
+ mainFrame()->RadioButton2->setIcon( image0 );
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close();
GroupPlane->PushButton1->setIcon( image1 );
GroupPlane->LineEdit1->setReadOnly( true );
+ GroupType = new DlgRef_3Radio( centralWidget() );
+ GroupType->GroupBox1->setTitle( tr( "GEOM_OBJECT_TYPE" ) );
+ GroupType->RadioButton1->setText( tr( "GEOM_EDGE" ) );
+ GroupType->RadioButton2->setText( tr( "GEOM_FACE" ) );
+ GroupType->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+ GroupType->RadioButton3->close();
+
GroupDimensions = new DlgRef_2Spin( centralWidget() );
GroupDimensions->GroupBox1->setTitle( tr( "GEOM_BOX_OBJ" ) );
GroupDimensions->TextLabel1->setText( tr( "GEOM_HEIGHT" ) );
GroupDimensions->TextLabel2->setText( tr( "GEOM_WIDTH" ) );
- GroupOrientation = new DlgRef_3Check( centralWidget() );
+ GroupOrientation = new DlgRef_3Radio( centralWidget() );
GroupOrientation->GroupBox1->setTitle( tr( "GEOM_ORIENTATION" ) );
GroupOrientation->RadioButton1->setText( tr( "GEOM_WPLANE_OXY" ) );
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
+ layout->addWidget( GroupType );
layout->addWidget( GroupPlane );
layout->addWidget( GroupDimensions );
layout->addWidget( GroupOrientation );
{
/* init variables */
myEditCurrentArgument = GroupPlane->LineEdit1;
+ GroupType->RadioButton1->setChecked(true);
myEdge = GEOM::GEOM_Object::_nil();
+ myFace = GEOM::GEOM_Object::_nil();
globalSelection(); // close local contexts, if any
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+ // localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
myOrientationType = 1;
connect( GroupOrientation->RadioButton2, SIGNAL( clicked() ), this, SLOT( RadioButtonClicked() ) );
connect( GroupOrientation->RadioButton3, SIGNAL( clicked() ), this, SLOT( RadioButtonClicked() ) );
+ connect( GroupType->RadioButton1, SIGNAL( clicked() ), this, SLOT( TypeButtonClicked() ) );
+ connect( GroupType->RadioButton2, SIGNAL( clicked() ), this, SLOT( TypeButtonClicked() ) );
+
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
this, SLOT( SelectionIntoArgument() ) );
displayPreview();
}
+//=================================================================================
+// function : TypeBittonClicked()
+// purpose : Radio button management
+//=================================================================================
+void PrimitiveGUI_FaceDlg::TypeButtonClicked()
+{
+ if ( GroupType->RadioButton1->isChecked() ) {
+ globalSelection(); // close local contexts, if any
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+ GroupPlane->TextLabel1->setText( tr( "GEOM_EDGE" ) );
+ }
+ else if ( GroupType->RadioButton2->isChecked() ) {
+ globalSelection(); // close local contexts, if any
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+ GroupPlane->TextLabel1->setText( tr( "GEOM_FACE" ) );
+ }
+}
+
//=================================================================================
// function : ClickOnOk()
// purpose :
{
switch ( constructorId ) {
case 0:
+ {
+ globalSelection(); // close local contexts, if any
+ GroupPlane->hide();
+ GroupDimensions->show();
+ GroupOrientation->show();
+ GroupType->hide();
+ GroupOrientation->RadioButton1->setChecked( true );
+ myOrientationType = 1;
+ break;
+ }
+ case 1:
{
globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
-
myEditCurrentArgument = GroupPlane->LineEdit1;
myEditCurrentArgument->setText("");
myEdge = GEOM::GEOM_Object::_nil();
+ myFace = GEOM::GEOM_Object::_nil();
+ GroupType->RadioButton1->setChecked( true );
+ TypeButtonClicked();
GroupDimensions->hide();
GroupOrientation->hide();
+ GroupType->show();
GroupPlane->show();
break;
}
- case 1:
- {
- globalSelection(); // close local contexts, if any
- GroupPlane->hide();
- GroupDimensions->show();
- GroupOrientation->show();
- GroupOrientation->RadioButton1->setChecked( true );
- myOrientationType = 1;
- break;
- }
}
qApp->processEvents();
//=================================================================================
void PrimitiveGUI_FaceDlg::SelectionIntoArgument()
{
- if (getConstructorId() != 0) {
+ if (getConstructorId() == 0) {
displayPreview();
return;
}
// nbSel == 1
Standard_Boolean aRes = Standard_False;
+ TopAbs_ShapeEnum aNeedType = TopAbs_EDGE;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
QString aName = GEOMBase::GetName( aSelectedObject );
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
+ if (GroupType->RadioButton2->isChecked())
+ aNeedType = TopAbs_FACE;
+
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes( firstIObject(), aMap );
if ( aMap.Extent() == 1 ) { // Local Selection
int anIndex = aMap( 1 );
- aName += QString( ":edge_%1" ).arg( anIndex );
+ if ( aNeedType == TopAbs_EDGE )
+ aName += QString( ":edge_%1" ).arg( anIndex );
+ else
+ aName += QString( ":face_%1" ).arg( anIndex );
//Find SubShape Object in Father
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
aSelectedObject = aFindedObject; // get Object from study
}
else { // Global Selection
- if ( aShape.ShapeType() != TopAbs_EDGE ) {
+ if ( aShape.ShapeType() != aNeedType ) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
}
}
myEditCurrentArgument->setText( aName );
- if ( myEditCurrentArgument == GroupPlane->LineEdit1 ) myEdge = aSelectedObject;
+ if ( myEditCurrentArgument == GroupPlane->LineEdit1 && aNeedType == TopAbs_EDGE )
+ myEdge = aSelectedObject;
+ else if ( myEditCurrentArgument == GroupPlane->LineEdit1 && aNeedType == TopAbs_FACE )
+ myFace = aSelectedObject;
}
displayPreview();
}
globalSelection(); // close previous local contexts
if ( send == GroupPlane->PushButton1 ) {
myEditCurrentArgument = GroupPlane->LineEdit1;
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+ if (GroupType->RadioButton1->isChecked())
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+ else if (GroupType->RadioButton1->isChecked())
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
}
myEditCurrentArgument->setFocus();
{
const int id = getConstructorId();
if ( id == 0 )
- return !myEdge->_is_nil();
- else if ( id == 1 )
return true;
+ else if ( id == 1 ) {
+ if (GroupType->RadioButton1->isChecked())
+ return !myEdge->_is_nil();
+ else if (GroupType->RadioButton2->isChecked())
+ return !myFace->_is_nil();
+ }
return false;
}
GEOM::GEOM_Object_var anObj;
switch ( getConstructorId() ) {
case 0 :
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeFaceVecHW( myEdge, GroupPlane->SpinBox_DX->value(), GroupPlane->SpinBox_DY->value() );
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeFaceHW( GroupDimensions->SpinBox_DX->value(), GroupDimensions->SpinBox_DY->value(), myOrientationType );
res = true;
break;
case 1 :
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeFaceHW( GroupDimensions->SpinBox_DX->value(), GroupDimensions->SpinBox_DY->value(), myOrientationType );
+ if ( GroupType->RadioButton1->isChecked() )
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeFaceObjHW( myEdge, GroupPlane->SpinBox_DX->value(), GroupPlane->SpinBox_DY->value() );
+ else if (GroupType->RadioButton2->isChecked())
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeFaceObjHW( myFace, GroupPlane->SpinBox_DX->value(), GroupPlane->SpinBox_DY->value() );
res = true;
break;
}
{
QMap<QString, GEOM::GEOM_Object_var> objMap;
switch ( getConstructorId() ) {
- case 0 :
- objMap[GroupPlane->LineEdit1->text()] = myEdge;
+ case 1 :
+ if ( GroupType->RadioButton1->isChecked() )
+ objMap[GroupPlane->LineEdit1->text()] = myEdge;
+ if ( GroupType->RadioButton2->isChecked() )
+ objMap[GroupPlane->LineEdit1->text()] = myFace;
break;
}
addSubshapesToFather( objMap );
class DlgRef_2Spin;
class DlgRef_1Sel2Spin;
-class DlgRef_3Check;
+class DlgRef_3Radio;
//=================================================================================
// class : PrimitiveGUI_FaceDlg
GEOM::GEOM_Object_var myPoint2;
GEOM::GEOM_Object_var myVector;
GEOM::GEOM_Object_var myEdge;
+ GEOM::GEOM_Object_var myFace;
int myOrientationType;
DlgRef_2Spin* GroupDimensions;
DlgRef_1Sel2Spin* GroupPlane;
- DlgRef_3Check* GroupOrientation;
+ DlgRef_3Radio* GroupOrientation;
+ DlgRef_3Radio* GroupType;
private slots:
void ClickOnOk();
void ValueChangedInSpinBox( double );
void SetDoubleSpinBoxStep( double );
void RadioButtonClicked();
+ void TypeButtonClicked();
};
#endif // BASICGUI_FACEDLG_H