geometry.png \
line.png \
line2points.png \
+line2faces.png \
lineedge.png \
linepointvector.png \
mindist.png \
planeworkingorigin.png \
point2.png \
pointonedge.png \
+point_line_intersection.png \
polyline.png \
prism.png \
prism2.png \
GEOM_Object MakePointOnCurve (in GEOM_Object theRefCurve,
in double theParameter);
+ /*!
+ * Create a point, on two lines intersection.
+ * \param theRefLine1, theRefLine2 The referenced lines.
+ * \return New GEOM_Object, containing the created point.
+ */
+ GEOM_Object MakePointOnLinesIntersection (in GEOM_Object theRefLine1,
+ in GEOM_Object theRefLine2);
/*!
* Create a vector, corresponding to tangent to the given parameter on the given curve.
*/
GEOM_Object MakeLineTwoPnt (in GEOM_Object thePnt1, in GEOM_Object thePnt2);
+ /*!
+ * Create a line, given by two faces intersection.
+ * \param theFace1 First of two faces, defining the line.
+ * \param theFace2 Second of two faces, defining the line.
+ * \return New GEOM_Object, containing the created line.
+ */
+ GEOM_Object MakeLineTwoFaces (in GEOM_Object theFace1, in GEOM_Object theFace2);
+
/*!
* Create a plane, passing through the three given points
* \param thePnt1 First of three points, defining the plane.
GEOM_Object MakePrismVecH (in GEOM_Object theBase,
in GEOM_Object theVec,
in double theH);
+ /* The Same Prism but in 2 directions (forward&backward) */
+ GEOM_Object MakePrismVecH2Ways (in GEOM_Object theBase,
+ in GEOM_Object theVec,
+ in double theH);
/*!
* Create a shape by extrusion of the base shape along a vector, defined by two points.
GEOM_Object MakePrismTwoPnt (in GEOM_Object theBase,
in GEOM_Object thePoint1,
in GEOM_Object thePoint2);
+ /* The same prism but in two directions forward&backward */
+ GEOM_Object MakePrismTwoPnt2Ways (in GEOM_Object theBase,
+ in GEOM_Object thePoint1,
+ in GEOM_Object thePoint2);
/*!
* Create a shape by extrusion of the base shape along
GEOM_Object MakeRevolutionAxisAngle (in GEOM_Object theBase,
in GEOM_Object theAxis,
in double theAngle);
+ /* The Same Revolution but in both ways forward&backward */
+ GEOM_Object MakeRevolutionAxisAngle2Ways (in GEOM_Object theBase,
+ in GEOM_Object theAxis,
+ in double theAngle);
/*!
* Create a filling from the given compound of contours.
in GEOM_Object thePnt2) ;
GEOM_Object MakeLineTwoPnt (in GEOM_Object thePnt1,
in GEOM_Object thePnt2) ;
+ GEOM_Object MakeLineTwoFaces (in GEOM_Object theFace1,
+ in GEOM_Object theFace2) ;
GEOM_Object MakePlaneThreePnt (in GEOM_Object thePnt1,
in GEOM_Object thePnt2,
in GEOM_Object thePnt3,
GEOM_Object MakePrismVecH (in GEOM_Object theBase,
in GEOM_Object theVec,
in double theH) ;
+ GEOM_Object MakePrismVecH2Ways (in GEOM_Object theBase,
+ in GEOM_Object theVec,
+ in double theH) ;
GEOM_Object MakePrismTwoPnt (in GEOM_Object theBase,
in GEOM_Object thePoint1,
in GEOM_Object thePoint2) ;
+ GEOM_Object MakePrismTwoPnt2Ways (in GEOM_Object theBase,
+ in GEOM_Object thePoint1,
+ in GEOM_Object thePoint2) ;
GEOM_Object MakePipe (in GEOM_Object theBase,
in GEOM_Object thePath) ;
GEOM_Object MakeRevolutionAxisAngle (in GEOM_Object theBase,
in GEOM_Object theAxis,
in double theAngle) ;
+ GEOM_Object MakeRevolutionAxisAngle2Ways (in GEOM_Object theBase,
+ in GEOM_Object theAxis,
+ in double theAngle) ;
GEOM_Object MakeFilling (in GEOM_Object theShape,
in long theMinDeg, in long theMaxDeg,
in double theTol2D, in double theTol3D,
#include "LightApp_SelectionMgr.h"
#include <qlabel.h>
+#include <qcheckbox.h>
#include "GEOMImpl_Types.hxx"
Group3Pnts2->PushButton2->setPixmap(image2);
Group3Pnts2->PushButton3->setPixmap(image2);
- Group3Pnts2->radioButton4->setText(tr("GEOM_REVERSE"));
+ Group3Pnts2->CheckButton1->setText(tr("GEOM_REVERSE"));
Layout1->addWidget( Group3Pnts, 2, 0 );
Layout1->addWidget( Group3Pnts2, 2, 0 );
/* init variables */
myEditCurrentArgument = Group3Pnts->LineEdit1;
myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
- Group3Pnts2->radioButton4->setChecked(FALSE);
+ Group3Pnts2->CheckButton1->setChecked(FALSE);
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(Group3Pnts2->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(Group3Pnts2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
- connect(Group3Pnts2->radioButton4, SIGNAL(stateChanged(int)), this, SLOT(ReverseSense(int)));
+ connect(Group3Pnts2->CheckButton1, SIGNAL(stateChanged(int)), this, SLOT(ReverseSense(int)));
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
case 1:
{
bool Sense;
- (Group3Pnts2->radioButton4->isChecked()) ? Sense = true : Sense = false;
+ (Group3Pnts2->CheckButton1->isChecked()) ? Sense = true : Sense = false;
if ( !CORBA::is_nil(myPoint1) && !CORBA::is_nil(myPoint2) &&!CORBA::is_nil(myPoint3) )
{
anObj = GEOM::GEOM_ICurvesOperations::_narrow(getOperation())->
{
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM",tr("ICON_DLG_LINE_2P")));
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM",tr("ICON_SELECT")));
+ QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM",tr("ICON_DLG_LINE_2F")));
setCaption(tr("GEOM_LINE_TITLE"));
+ QGroupBox* aFrame = new QGroupBox( 1, Qt::Horizontal, this );
+ aFrame->setInsideMargin( 0 );
+ aFrame->setFrameStyle( QFrame::NoFrame );
+
/***************************************************************/
GroupConstructors->setTitle(tr("GEOM_LINE"));
RadioButton1->setPixmap(image0);
- RadioButton2->close(TRUE);
+ RadioButton2->setPixmap(image2);
RadioButton3->close(TRUE);
- GroupPoints = new DlgRef_2Sel_QTD(this, "GroupPoints");
+ GroupPoints = new DlgRef_2Sel_QTD( aFrame, "GroupPoints");
GroupPoints->GroupBox1->setTitle(tr("GEOM_POINTS"));
GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1"));
GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2"));
GroupPoints->PushButton1->setPixmap(image1);
GroupPoints->PushButton2->setPixmap(image1);
-
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
- Layout1->addWidget(GroupPoints, 2, 0);
+ GroupFaces = new DlgRef_2Sel_QTD( aFrame, "GroupFaces");
+ GroupFaces->GroupBox1->setTitle(tr("GEOM_FACES"));
+ GroupFaces->TextLabel1->setText(tr("GEOM_FACE_I").arg("1"));
+ GroupFaces->TextLabel2->setText(tr("GEOM_FACE_I").arg("2"));
+ GroupFaces->PushButton1->setPixmap(image1);
+ GroupFaces->PushButton2->setPixmap(image1);
+ GroupFaces->LineEdit1->setReadOnly( true );
+ GroupFaces->LineEdit2->setReadOnly( true );
+
+ Layout1->addWidget(aFrame, 2, 0);
/***************************************************************/
setHelpFileName("line.htm");
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(GroupFaces->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(GroupFaces->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect(GroupFaces->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect(GroupFaces->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ ConstructorsClicked (0);
initName( tr("GEOM_LINE") );
}
return true;
}
+//=================================================================================
+// function : ConstructorsClicked()
+// purpose : Radio button management
+//=================================================================================
+void BasicGUI_LineDlg::ConstructorsClicked(int constructorId)
+{
+ switch ( constructorId )
+ {
+ case 0:
+ {
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ myEditCurrentArgument->setText("");
+ myPoint1 = GEOM::GEOM_Object::_nil();
+ myPoint2 = GEOM::GEOM_Object::_nil();
+ globalSelection( GEOM_POINT );
+ GroupPoints->show();
+ GroupFaces->hide();
+ break;
+ }
+ case 1:
+ {
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+ myEditCurrentArgument = GroupFaces->LineEdit1;
+ myEditCurrentArgument->setText("");
+ myFace1 = GEOM::GEOM_Object::_nil();
+ myFace2 = GEOM::GEOM_Object::_nil();
+ globalSelection( GEOM_FACE );
+ GroupPoints->hide();
+ GroupFaces->show();
+ break;
+ }
+ }
+
+ updateGeometry();
+ resize( minimumSize() );
+ SelectionIntoArgument();
+}
//=================================================================================
// function : SelectionIntoArgument()
{
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
+ else if ( myEditCurrentArgument == GroupFaces->LineEdit1 ) myFace1 = GEOM::GEOM_Object::_nil();
+ else if ( myEditCurrentArgument == GroupFaces->LineEdit2 ) myFace2 = GEOM::GEOM_Object::_nil();
return;
}
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = aSelectedObject;
+ else if ( myEditCurrentArgument == GroupFaces->LineEdit1 ) myFace1 = aSelectedObject;
+ else if ( myEditCurrentArgument == GroupFaces->LineEdit2 ) myFace2 = aSelectedObject;
}
displayPreview();
QPushButton* send = (QPushButton*)sender();
if ( send == GroupPoints->PushButton1 ) myEditCurrentArgument = GroupPoints->LineEdit1;
else if ( send == GroupPoints->PushButton2 ) myEditCurrentArgument = GroupPoints->LineEdit2;
+ else if ( send == GroupFaces->PushButton1 ) myEditCurrentArgument = GroupFaces->LineEdit1;
+ else if ( send == GroupFaces->PushButton2 ) myEditCurrentArgument = GroupFaces->LineEdit2;
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
QLineEdit* send = (QLineEdit*)sender();
if ( send == GroupPoints->LineEdit1 ) myEditCurrentArgument = GroupPoints->LineEdit1;
else if ( send == GroupPoints->LineEdit2 ) myEditCurrentArgument = GroupPoints->LineEdit2;
+ else if ( send == GroupFaces->LineEdit1 ) myEditCurrentArgument = GroupFaces->LineEdit1;
+ else if ( send == GroupFaces->LineEdit2 ) myEditCurrentArgument = GroupFaces->LineEdit2;
else return;
GEOMBase_Skeleton::LineEditReturnPressed();
}
GroupPoints->LineEdit1->setText( "" );
GroupPoints->LineEdit2->setText( "" );
- myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
+ GroupFaces->LineEdit1->setText( "" );
+ GroupFaces->LineEdit2->setText( "" );
+ myPoint1 = myPoint2 = myFace1 = myFace2 = GEOM::GEOM_Object::_nil();
}
//=================================================================================
//=================================================================================
bool BasicGUI_LineDlg::isValid( QString& msg )
{
- return !myPoint1->_is_nil() && !myPoint2->_is_nil();
+ const int id = getConstructorId();
+ if ( id == 0 )
+ return !myPoint1->_is_nil() && !myPoint2->_is_nil();
+ else if ( id == 1 )
+ return !myFace1->_is_nil() && !myFace2->_is_nil();
+ return false;
}
//=================================================================================
//=================================================================================
bool BasicGUI_LineDlg::execute( ObjectList& objects )
{
- GEOM::GEOM_Object_var anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakeLineTwoPnt( myPoint1, myPoint2 );
+ bool res = false;
+ GEOM::GEOM_Object_var anObj;
+ switch ( getConstructorId() )
+ {
+ case 0 :
+ {
+ anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakeLineTwoPnt( myPoint1, myPoint2 );
+ res = true;
+ break;
+ }
+ case 1 :
+ {
+ anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakeLineTwoFaces( myFace1, myFace2 );
+ res = true;
+ break;
+ }
+ }
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
- return true;
+
+ return res;
}
//=================================================================================
GEOM::GEOM_Object_var myPoint1;
GEOM::GEOM_Object_var myPoint2;
+ GEOM::GEOM_Object_var myFace1;
+ GEOM::GEOM_Object_var myFace2;
DlgRef_2Sel_QTD* GroupPoints;
+ DlgRef_2Sel_QTD* GroupFaces;
private slots:
void ClickOnOk();
void ActivateThisDialog();
void DeactivateActiveDialog();
-
+ void ConstructorsClicked(int constructorId);
void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT_EDGE")));
QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
QPixmap image3(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT_REF")));
+ QPixmap image4(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT_LINES")));
setCaption(tr("GEOM_POINT_TITLE"));
RadioButton1->setPixmap(image0);
RadioButton2->setPixmap(image3);
RadioButton3->setPixmap(image1);
+ RadioButton4->show();
+ RadioButton4->setPixmap(image4);
GroupXYZ = new DlgRef_3Spin( aFrame, "GroupXYZ" );
GroupXYZ->GroupBox1->setTitle(tr("GEOM_COORDINATES"));
GroupRefPoint->TextLabel3->setText(tr("GEOM_DY"));
GroupRefPoint->TextLabel4->setText(tr("GEOM_DZ"));
+ GroupLineIntersection = new DlgRef_2Sel_QTD (aFrame, "GroupLineIntersection");
+ GroupLineIntersection->GroupBox1->setTitle(tr("GEOM_LINE_INTERSECTION"));
+ GroupLineIntersection->TextLabel1->setText(tr("GEOM_LINE1"));
+ GroupLineIntersection->PushButton1->setPixmap(image2);
+ GroupLineIntersection->TextLabel2->setText(tr("GEOM_LINE2"));
+ GroupLineIntersection->PushButton2->setPixmap(image2);
+
Layout1->addWidget( aFrame, 2, 0 );
/***************************************************************/
{
GroupOnCurve->LineEdit1->setReadOnly( true );
GroupRefPoint->LineEdit1->setReadOnly( true );
+ GroupLineIntersection->LineEdit1->setReadOnly( true );
+ GroupLineIntersection->LineEdit2->setReadOnly( true );
myEdge = GEOM::GEOM_Object::_nil();
myRefPoint = GEOM::GEOM_Object::_nil();
connect(GroupOnCurve->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupOnCurve->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect(GroupLineIntersection->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(GroupLineIntersection->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(GroupLineIntersection->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+ connect(GroupLineIntersection->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupOnCurve->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(GroupXYZ->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
GroupRefPoint->hide();
GroupOnCurve->hide();
-
+ GroupLineIntersection->hide();
GroupXYZ->show();
-
myCoordGrp->hide();
break;
}
GroupXYZ->hide();
GroupOnCurve->hide();
-
GroupRefPoint->show();
-
+ GroupLineIntersection->hide();
myCoordGrp->show();
break;
}
GroupXYZ->hide();
GroupRefPoint->hide();
-
GroupOnCurve->show();
-
+ GroupLineIntersection->hide();
myCoordGrp->show();
break;
}
+ case 3:
+ {
+ myEditCurrentArgument = GroupLineIntersection->LineEdit1;
+ GroupLineIntersection->LineEdit1->setText("");
+ GroupLineIntersection->LineEdit2->setText("");
+ myLine1 = GEOM::GEOM_Object::_nil();
+ myLine2 = GEOM::GEOM_Object::_nil();
+
+ globalSelection( GEOM_EDGE );
+
+ GroupXYZ->hide();
+ GroupRefPoint->hide();
+ GroupOnCurve->hide();
+ GroupLineIntersection->show();
+ myCoordGrp->hide();
+ break;
+ }
}
myX->setText( "" );
myEdge = aSelectedObject;
GroupOnCurve->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) );
}
+ else if ( id == 3 )
+ {
+ if (myEditCurrentArgument == GroupLineIntersection->LineEdit1) {
+ myLine1 = aSelectedObject;
+ GroupLineIntersection->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) );
+ }
+ else if (myEditCurrentArgument == GroupLineIntersection->LineEdit2) {
+ myLine2 = aSelectedObject;
+ GroupLineIntersection->LineEdit2->setText( GEOMBase::GetName( aSelectedObject ) );
+ }
+ }
}
}
void BasicGUI_PointDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
- if ( send == GroupRefPoint->LineEdit1 || send == GroupOnCurve->LineEdit1 )
+ if ( send == GroupRefPoint->LineEdit1 || send == GroupOnCurve->LineEdit1 ||
+ send == GroupLineIntersection->LineEdit1 || send == GroupLineIntersection->LineEdit2 )
{
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
GroupOnCurve->LineEdit1->setFocus();
myEditCurrentArgument = GroupOnCurve->LineEdit1;
+ globalSelection( GEOM_EDGE );
+ }
+ else if ( send == GroupLineIntersection->PushButton1 )
+ {
+ GroupLineIntersection->LineEdit1->setFocus();
+ myEditCurrentArgument = GroupLineIntersection->LineEdit1;
+
+ globalSelection( GEOM_EDGE );
+ }
+ else if ( send == GroupLineIntersection->PushButton2 )
+ {
+ GroupLineIntersection->LineEdit2->setFocus();
+ myEditCurrentArgument = GroupLineIntersection->LineEdit2;
+
globalSelection( GEOM_EDGE );
}
}
-
//=================================================================================
// function : enterEvent()
// purpose : to reactivate this dialog box when mouse enter onto the window
return !myRefPoint->_is_nil();
else if ( id == 2 )
return !myEdge->_is_nil();
+ else if ( id == 3)
+ return ( !myLine1->_is_nil() && !myLine2->_is_nil() );
return false;
}
MakePointOnCurve( myEdge, getParameter() );
res = true;
break;
+ case 3 :
+ anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
+ MakePointOnLinesIntersection( myLine1, myLine2 );
+ res = true;
+ break;
}
if ( getConstructorId() == 1 || getConstructorId() == 2 )
#include "GEOMBase_Skeleton.h"
#include "DlgRef_1Sel1Spin.h"
#include "DlgRef_3Spin.h"
+#include "DlgRef_2Sel_QTD.h"
#include "DlgRef_1Sel3Spin.h"
class QLineEdit;
GEOM::GEOM_Object_var myEdge;
GEOM::GEOM_Object_var myRefPoint;
+ GEOM::GEOM_Object_var myLine1;
+ GEOM::GEOM_Object_var myLine2;
DlgRef_3Spin* GroupXYZ;
DlgRef_1Sel3Spin* GroupRefPoint;
DlgRef_1Sel1Spin* GroupOnCurve;
+ DlgRef_2Sel_QTD* GroupLineIntersection;
QGroupBox* myCoordGrp;
QLineEdit* myX;
/****************************************************************************
-** Form implementation generated from reading ui file 'UIFiles/DlgRef_3Sel1Check_QTD.ui'
+** Form implementation generated from reading ui file 'DlgRef_3Sel1Check_QTD.ui'
**
-** Created: Wed Feb 21 10:49:18 2007
+** Created: Mon Oct 29 18:14:59 2007
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
#include <qgroupbox.h>
#include <qlineedit.h>
#include <qlabel.h>
-#include <qradiobutton.h>
+#include <qcheckbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
- GroupBox1Layout->addWidget( LineEdit1, 0, 2 );
+ GroupBox1Layout->addMultiCellWidget( LineEdit1, 0, 0, 2, 3 );
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->addWidget( LineEdit2, 1, 2 );
+ GroupBox1Layout->addMultiCellWidget( LineEdit2, 1, 1, 2, 3 );
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->addWidget( LineEdit3, 2, 2 );
+ GroupBox1Layout->addMultiCellWidget( LineEdit3, 2, 2, 2, 3 );
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 );
- radioButton4 = new QRadioButton( GroupBox1, "radioButton4" );
+ CheckButton1 = new QCheckBox( GroupBox1, "CheckButton1" );
- GroupBox1Layout->addMultiCellWidget( radioButton4, 3, 3, 0, 1 );
- Spacer3 = new QSpacerItem( 16, 721, QSizePolicy::Minimum, QSizePolicy::Expanding );
- GroupBox1Layout->addItem( Spacer3, 4, 2 );
+ GroupBox1Layout->addMultiCellWidget( CheckButton1, 3, 3, 0, 2 );
DlgRef_3Sel1Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
languageChange();
- resize( QSize(490, 878).expandedTo(minimumSizeHint()) );
+ resize( QSize(403, 441).expandedTo(minimumSizeHint()) );
clearWState( WState_Polished );
// tab order
TextLabel2->setText( tr( "TL2" ) );
PushButton3->setText( QString::null );
TextLabel3->setText( tr( "TL3" ) );
- radioButton4->setText( tr( "radioButton4" ) );
+ CheckButton1->setText( tr( "CheckButton1" ) );
}
/****************************************************************************
-** Form interface generated from reading ui file 'UIFiles/DlgRef_3Sel1Check_QTD.ui'
+** Form interface generated from reading ui file 'DlgRef_3Sel1Check_QTD.ui'
**
-** Created: Wed Feb 21 10:48:39 2007
+** Created: Mon Oct 29 18:14:59 2007
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
class QPushButton;
class QLineEdit;
class QLabel;
-class QRadioButton;
+class QCheckBox;
class DlgRef_3Sel1Check_QTD : public QWidget
{
QPushButton* PushButton3;
QLineEdit* LineEdit3;
QLabel* TextLabel3;
- QRadioButton* radioButton4;
+ QCheckBox* CheckButton1;
protected:
QGridLayout* DlgRef_3Sel1Check_QTDLayout;
<rect>
<x>0</x>
<y>0</y>
- <width>490</width>
- <height>878</height>
+ <width>403</width>
+ <height>441</height>
</rect>
</property>
<property name="sizePolicy">
<string></string>
</property>
</widget>
- <widget class="QLineEdit" row="0" column="2">
+ <widget class="QLineEdit" row="0" column="2" rowspan="1" colspan="2">
<property name="name">
<cstring>LineEdit1</cstring>
</property>
<string></string>
</property>
</widget>
- <widget class="QLineEdit" row="1" column="2">
+ <widget class="QLineEdit" row="1" column="2" rowspan="1" colspan="2">
<property name="name">
<cstring>LineEdit2</cstring>
</property>
<string></string>
</property>
</widget>
- <widget class="QLineEdit" row="2" column="2">
+ <widget class="QLineEdit" row="2" column="2" rowspan="1" colspan="2">
<property name="name">
<cstring>LineEdit3</cstring>
</property>
<string>TL3</string>
</property>
</widget>
- <widget class="QRadioButton" row="3" column="0" rowspan="1" colspan="2">
- <property name="name">
- <cstring>radioButton4</cstring>
- </property>
- <property name="text">
- <string>radioButton4</string>
- </property>
- </widget>
- <spacer row="4" column="2">
+ <spacer row="4" column="3">
<property name="name">
<cstring>Spacer3</cstring>
</property>
</size>
</property>
</spacer>
+ <widget class="QCheckBox" row="3" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>CheckButton1</cstring>
+ </property>
+ <property name="text">
+ <string>CheckButton1</string>
+ </property>
+ </widget>
</grid>
</widget>
</grid>
#uic -o DlgRef_4Sel1Spin2Check_QTD.h DlgRef_4Sel1Spin2Check_QTD.ui
#uic -o DlgRef_4Sel1Spin2Check_QTD.cxx -impl DlgRef_4Sel1Spin2Check_QTD.h DlgRef_4Sel1Spin2Check_QTD.ui
-uic -o DlgRef_2Sel3Spin2Rb_QTD.h DlgRef_2Sel3Spin2Rb_QTD.ui
-uic -o DlgRef_2Sel3Spin2Rb_QTD.cxx -impl DlgRef_2Sel3Spin2Rb_QTD.h DlgRef_2Sel3Spin2Rb_QTD.ui
\ No newline at end of file
+#uic -o DlgRef_2Sel3Spin2Rb_QTD.h DlgRef_2Sel3Spin2Rb_QTD.ui
+#uic -o DlgRef_2Sel3Spin2Rb_QTD.cxx -impl DlgRef_2Sel3Spin2Rb_QTD.h DlgRef_2Sel3Spin2Rb_QTD.ui
+
+uic -o DlgRef_3Sel1Check_QTD.h DlgRef_3Sel1Check_QTD.ui
+uic -o DlgRef_3Sel1Check_QTD.cxx -impl DlgRef_3Sel1Check_QTD.h DlgRef_3Sel1Check_QTD.ui
\ No newline at end of file
msgid "ICON_DLG_LINE_2P"
msgstr "line2points.png"
+#LineDlg
+msgid "ICON_DLG_LINE_2F"
+msgstr "line2faces.png"
+
#LineDlg
msgid "ICON_DLG_LINE_EDGE"
msgstr "lineedge.png"
msgid "ICON_DLG_POINT_EDGE"
msgstr "pointonedge.png"
+#PoinDlg
+msgid "ICON_DLG_POINT_LINES"
+msgstr "point_line_intersection.png"
+
#ArcDlg
msgid "ICON_DLG_ARC"
msgstr "arc.png"
msgid "GEOM_POINT_I"
msgstr "Point %1"
+#Face i
+msgid "GEOM_FACE_I"
+msgstr "Face %1"
+
#Arguments
msgid "GEOM_ARGUMENTS"
msgstr "Arguments"
msgid "GEOM_REVERSE"
msgstr "Reverse"
+#Bothway
+msgid "GEOM_BOTHWAY"
+msgstr "Bothway"
+
#Reverse U
msgid "GEOM_REVERSE_U"
msgstr "Reverse U"
msgid "GEOM_LINE"
msgstr "Line"
+#Line 1
+msgid "GEOM_LINE1"
+msgstr "Line 1"
+
+#Line 2
+msgid "GEOM_LINE2"
+msgstr "Line 2"
+
#Plane
msgid "GEOM_PLANE"
msgstr "Plane"
msgid "ICON_DLG_LINE_2P"
msgstr "line2points.png"
+#LineDlg
+msgid "ICON_DLG_LINE_2F"
+msgstr "line2faces.png"
+
#LineDlg
msgid "ICON_DLG_LINE_EDGE"
msgstr "lineedge.png"
msgid "ICON_DLG_POINT_EDGE"
msgstr "pointonedge.png"
+#PoinDlg
+msgid "ICON_DLG_POINT_LINES"
+msgstr "point_line_intersection.png"
+
#ArcDlg
msgid "ICON_DLG_ARC"
msgstr "arc.png"
#: GeometryGUI.cxx:3854
msgid "GEOM_REALLY_DELETE"
-msgstr "Do you really want to delete object(s) ?"
+msgstr "Do you really want to delete this %1 object(s): %2"
#
#==============================================================================
msgid "GEOM_POINT_I"
msgstr "Point %1"
+#Face i
+msgid "GEOM_FACE_I"
+msgstr "Face %1"
+
#Arguments
msgid "GEOM_ARGUMENTS"
msgstr "Arguments"
msgid "GEOM_REVERSE"
msgstr "Reverse"
+#Bothway
+msgid "GEOM_BOTHWAY"
+msgstr "Bothway"
+
#Reverse U
msgid "GEOM_REVERSE_U"
msgstr "Reverse U"
msgid "GEOM_LINE"
msgstr "Line"
+#Line 1
+msgid "GEOM_LINE1"
+msgstr "Line 1"
+
+#Line 2
+msgid "GEOM_LINE2"
+msgstr "Line 2"
+
#Plane
msgid "GEOM_PLANE"
msgstr "Plane"
msgid "GEOM_REF_POINT"
msgstr "Point with reference"
+msgid "GEOM_LINE_INTERSECTION"
+msgstr "Point On Lines Intersection"
+
#
#==============================================================================
#
return aPrism;
}
+//=============================================================================
+/*!
+ * MakePrismVecH2Ways
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH2Ways (Handle(GEOM_Object) theBase,
+ Handle(GEOM_Object) theVec,
+ double theH)
+{
+ SetErrorCode(KO);
+
+ if (theBase.IsNull() || theVec.IsNull()) return NULL;
+
+ //Add a new Prism object
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+
+ //Add a new Prism function for creation a Prism relatively to vector
+ Handle(GEOM_Function) aFunction =
+ aPrism->AddFunction(GEOMImpl_PrismDriver::GetID(), PRISM_BASE_VEC_H_2WAYS);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_PrismDriver::GetID()) return NULL;
+
+ GEOMImpl_IPrism aCI (aFunction);
+
+ Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
+ Handle(GEOM_Function) aRefVec = theVec->GetLastFunction();
+
+ if (aRefBase.IsNull() || aRefVec.IsNull()) return NULL;
+
+ aCI.SetBase(aRefBase);
+ aCI.SetVector(aRefVec);
+ aCI.SetH(theH);
+
+ //Compute the Prism value
+ try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ //SetErrorCode("Prism driver failed");
+ SetErrorCode("Extrusion can not be created, check input data");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrismVecH2Ways("
+ << theBase << ", " << theVec << ", " << theH << ")";
+
+ SetErrorCode(OK);
+ return aPrism;
+}
+
//=============================================================================
/*!
* MakePrismTwoPnt
return aPrism;
}
+//=============================================================================
+/*!
+ * MakePrismTwoPnt2Ways
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt2Ways
+ (Handle(GEOM_Object) theBase,
+ Handle(GEOM_Object) thePoint1, Handle(GEOM_Object) thePoint2)
+{
+ SetErrorCode(KO);
+
+ if (theBase.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL;
+
+ //Add a new Prism object
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+
+ //Add a new Prism function for creation a Prism relatively to two points
+ Handle(GEOM_Function) aFunction =
+ aPrism->AddFunction(GEOMImpl_PrismDriver::GetID(), PRISM_BASE_TWO_PNT_2WAYS);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_PrismDriver::GetID()) return NULL;
+
+ GEOMImpl_IPrism aCI (aFunction);
+
+ Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
+ Handle(GEOM_Function) aRefPnt1 = thePoint1->GetLastFunction();
+ Handle(GEOM_Function) aRefPnt2 = thePoint2->GetLastFunction();
+
+ if (aRefBase.IsNull() || aRefPnt1.IsNull() || aRefPnt2.IsNull()) return NULL;
+
+ aCI.SetBase(aRefBase);
+ aCI.SetFirstPoint(aRefPnt1);
+ aCI.SetLastPoint(aRefPnt2);
+
+ //Compute the Prism value
+ try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ //SetErrorCode("Prism driver failed");
+ SetErrorCode("Extrusion can not be created, check input data");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrism2Ways("
+ << theBase << ", " << thePoint1 << ", " << thePoint2 << ")";
+
+ SetErrorCode(OK);
+ return aPrism;
+}
+
//=============================================================================
/*!
return aRevolution;
}
+//=============================================================================
+/*!
+ * MakeRevolutionAxisAngle2Ways
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle2Ways
+ (Handle(GEOM_Object) theBase, Handle(GEOM_Object) theAxis, double theAngle)
+{
+ SetErrorCode(KO);
+
+ if (theBase.IsNull() || theAxis.IsNull()) return NULL;
+
+ //Add a new Revolution object
+ Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GetDocID(), GEOM_REVOLUTION);
+
+ //Add a new Revolution function for creation a revolution relatively to axis
+ Handle(GEOM_Function) aFunction =
+ aRevolution->AddFunction(GEOMImpl_RevolutionDriver::GetID(), REVOLUTION_BASE_AXIS_ANGLE_2WAYS);
+ if (aFunction.IsNull()) return NULL;
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_RevolutionDriver::GetID()) return NULL;
+
+ GEOMImpl_IRevolution aCI (aFunction);
+
+ Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
+ Handle(GEOM_Function) aRefAxis = theAxis->GetLastFunction();
+
+ if (aRefBase.IsNull() || aRefAxis.IsNull()) return NULL;
+
+ aCI.SetBase(aRefBase);
+ aCI.SetAxis(aRefAxis);
+ aCI.SetAngle(theAngle);
+
+ //Compute the Revolution value
+ try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("Revolution driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << aRevolution << " = geompy.MakeRevolution2Ways("
+ << theBase << ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)";
+
+ SetErrorCode(OK);
+ return aRevolution;
+}
//=============================================================================
/*!
Standard_EXPORT Handle(GEOM_Object) MakePrismVecH (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) theVec, double theH);
+ Standard_EXPORT Handle(GEOM_Object) MakePrismVecH2Ways (Handle(GEOM_Object) theBase,
+ Handle(GEOM_Object) theVec, double theH);
+
Standard_EXPORT Handle(GEOM_Object) MakePrismTwoPnt (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) thePoint1,
Handle(GEOM_Object) thePoint2);
+ Standard_EXPORT Handle(GEOM_Object) MakePrismTwoPnt2Ways (Handle(GEOM_Object) theBase,
+ Handle(GEOM_Object) thePoint1,
+ Handle(GEOM_Object) thePoint2);
+
Standard_EXPORT Handle(GEOM_Object) MakePipe (Handle(GEOM_Object) theBase,
Handle(GEOM_Object) thePath);
Handle(GEOM_Object) theAxis,
double theAngle);
+ Standard_EXPORT Handle(GEOM_Object) MakeRevolutionAxisAngle2Ways (Handle(GEOM_Object) theBase,
+ Handle(GEOM_Object) theAxis,
+ double theAngle);
+
Standard_EXPORT Handle(GEOM_Object) MakeSolidShell (Handle(GEOM_Object) theShell);
Standard_EXPORT Handle(GEOM_Object) MakeFilling (Handle(GEOM_Object) theShape, int theMinDeg, int theMaxDeg, double theTol2D, double theTol3D, int theNbIter);
return aPoint;
}
+//=============================================================================
+/*!
+ * MakePointOnLinesIntersection
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnLinesIntersection
+ (Handle(GEOM_Object) theLine1, Handle(GEOM_Object) theLine2)
+{
+ SetErrorCode(KO);
+
+ if (theLine1.IsNull() || theLine2.IsNull()) return NULL;
+
+ //Add a new Point object
+ Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
+
+ //Add a new Point function for creation a point relativley another point
+ Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_LINES_INTERSECTION);
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_PointDriver::GetID()) return NULL;
+
+ GEOMImpl_IPoint aPI (aFunction);
+
+ Handle(GEOM_Function) aRef1 = theLine1->GetLastFunction();
+ Handle(GEOM_Function) aRef2 = theLine2->GetLastFunction();
+ if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
+
+ aPI.SetLine1(aRef1);
+ aPI.SetLine2(aRef2);
+
+ //Compute the point value
+ try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("Point driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnLinesIntersection("
+ << theLine1 << ", " << theLine2 << ")";
+
+ SetErrorCode(OK);
+ return aPoint;
+}
+
//=============================================================================
/*!
* MakeTangentOnCurve
return aLine;
}
+//=============================================================================
+/*!
+ * MakeLineTwoFaces
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLineTwoFaces
+ (Handle(GEOM_Object) theFace1, Handle(GEOM_Object) theFace2)
+{
+ SetErrorCode(KO);
+
+ if (theFace1.IsNull() || theFace2.IsNull()) return NULL;
+
+ //Add a new Line object
+ Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE);
+
+ //Add a new Line function
+ Handle(GEOM_Function) aFunction =
+ aLine->AddFunction(GEOMImpl_LineDriver::GetID(), LINE_TWO_FACES);
+
+ //Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != GEOMImpl_LineDriver::GetID()) return NULL;
+
+ GEOMImpl_ILine aPI (aFunction);
+
+ Handle(GEOM_Function) aRef1 = theFace1->GetLastFunction();
+ Handle(GEOM_Function) aRef2 = theFace2->GetLastFunction();
+ if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
+
+ aPI.SetFace1(aRef1);
+ aPI.SetFace2(aRef2);
+
+ //Compute the Line value
+ try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("Line driver failed");
+ return NULL;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return NULL;
+ }
+
+ //Make a Python command
+ GEOM::TPythonDump(aFunction) << aLine << " = geompy.MakeLineTwoFaces("
+ << theFace1 << ", " << theFace2 << ")";
+
+ SetErrorCode(OK);
+ return aLine;
+}
//=============================================================================
/*!
Standard_EXPORT Handle(GEOM_Object) MakePointOnCurve (Handle(GEOM_Object) theCurve,
double theParameter);
+ Standard_EXPORT Handle(GEOM_Object) MakePointOnLinesIntersection
+ (Handle(GEOM_Object) theLine1, Handle(GEOM_Object) theLine2);
+
// Vector
Standard_EXPORT Handle(GEOM_Object) MakeVectorDXDYDZ (double theDX, double theDY, double theDZ);
Standard_EXPORT Handle(GEOM_Object) MakeLineTwoPnt (Handle(GEOM_Object) thePnt1,
Handle(GEOM_Object) thePnt2);
+ Standard_EXPORT Handle(GEOM_Object) MakeLineTwoFaces (Handle(GEOM_Object) theFace1,
+ Handle(GEOM_Object) theFace2);
+
Standard_EXPORT Handle(GEOM_Object) MakeLine (Handle(GEOM_Object) thePnt,
Handle(GEOM_Object) theDir);
#include "GEOM_Function.hxx"
-#define LINE_ARG_PNT1 1
-#define LINE_ARG_PNT2 2
+#define LINE_ARG_PNT1 1
+#define LINE_ARG_PNT2 2
+#define LINE_ARG_FACE1 3
+#define LINE_ARG_FACE2 4
class GEOMImpl_ILine
{
void SetPoint1(Handle(GEOM_Function) theRef) { _func->SetReference(LINE_ARG_PNT1, theRef); }
void SetPoint2(Handle(GEOM_Function) theRef) { _func->SetReference(LINE_ARG_PNT2, theRef); }
+ void SetFace1(Handle(GEOM_Function) theRef) { _func->SetReference(LINE_ARG_FACE1, theRef); }
+ void SetFace2(Handle(GEOM_Function) theRef) { _func->SetReference(LINE_ARG_FACE2, theRef); }
Handle(GEOM_Function) GetPoint1() { return _func->GetReference(LINE_ARG_PNT1); }
Handle(GEOM_Function) GetPoint2() { return _func->GetReference(LINE_ARG_PNT2); }
+ Handle(GEOM_Function) GetFace1() { return _func->GetReference(LINE_ARG_FACE1); }
+ Handle(GEOM_Function) GetFace2() { return _func->GetReference(LINE_ARG_FACE2); }
private:
#define ARG_PARAM 5
#define ARG_CURVE 6
+#define ARG_LINE1 7
+#define ARG_LINE2 8
class GEOMImpl_IPoint
{
Handle(GEOM_Function) GetRef() { return _func->GetReference(ARG_REF); }
void SetCurve(Handle(GEOM_Function) theRef) { _func->SetReference(ARG_CURVE, theRef); }
+ void SetLine1(Handle(GEOM_Function) theRef) { _func->SetReference(ARG_LINE1, theRef); }
+ void SetLine2(Handle(GEOM_Function) theRef) { _func->SetReference(ARG_LINE2, theRef); }
Handle(GEOM_Function) GetCurve() { return _func->GetReference(ARG_CURVE); }
+ Handle(GEOM_Function) GetLine1() { return _func->GetReference(ARG_LINE1); }
+ Handle(GEOM_Function) GetLine2() { return _func->GetReference(ARG_LINE2); }
void SetParameter(double theParam) { _func->SetReal(ARG_PARAM, theParam); }
#include <BRep_Tool.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
-
+#include <BRepAlgoAPI_Section.hxx>
#include <TopAbs.hxx>
#include <TopExp.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopTools_MapOfShape.hxx>
#include <gp_Pnt.hxx>
#include <Precision.hxx>
}
aShape = BRepBuilderAPI_MakeEdge(P1, P2).Shape();
+ } else if (aType == LINE_TWO_FACES) {
+ Handle(GEOM_Function) aRefFace1 = aPI.GetFace1();
+ Handle(GEOM_Function) aRefFace2 = aPI.GetFace2();
+ TopoDS_Shape aShape1 = aRefFace1->GetValue();
+ TopoDS_Shape aShape2 = aRefFace2->GetValue();
+ if (aShape1.ShapeType() != TopAbs_FACE ||
+ aShape2.ShapeType() != TopAbs_FACE) {
+ Standard_ConstructionError::Raise("Wrong arguments: two faces must be given");
+ }
+ if (aShape1.IsSame(aShape2)) {
+ Standard_ConstructionError::Raise("The end faces must be different");
+ }
+ BRepAlgoAPI_Section E (aShape1, aShape2, Standard_False);
+ E.Approximation(Standard_True);
+ E.Build();
+ if (!E.IsDone()) {
+ Standard_ConstructionError::Raise("Line can not be performed on the given faces");
+ }
+ else
+ {
+ TopExp_Explorer Exp (E, TopAbs_EDGE);
+ if ( Exp.More() ){
+ aShape = Exp.Current();
+ Exp.Next();
+ }
+ else
+ {
+ Standard_ConstructionError::Raise("Faces not have intersection line");
+ aShape = E.Shape();
+ }
+ if ( Exp.More() )
+ aShape = E.Shape();
+ }
+
} else if (aType == LINE_PNT_DIR) {
Handle(GEOM_Function) aRefPnt = aPI.GetPoint1();
Handle(GEOM_Function) aRefDir = aPI.GetPoint2();
#include <BRep_Tool.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
-
+#include <BRepExtrema_DistShapeShape.hxx>
+#include <Precision.hxx>
#include <TopAbs.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
aP = aFP + (aLP - aFP) * aPI.GetParameter();
aPnt = aCurve->Value(aP);
- } else {
+ } else if (aType == POINT_LINES_INTERSECTION) {
+ Handle(GEOM_Function) aRef1 = aPI.GetLine1();
+ Handle(GEOM_Function) aRef2 = aPI.GetLine2();
+
+ TopoDS_Shape aRefShape1 = aRef1->GetValue();
+ TopoDS_Shape aRefShape2 = aRef2->GetValue();
+
+ if (aRefShape1.ShapeType() != TopAbs_EDGE || aRefShape2.ShapeType() != TopAbs_EDGE ) {
+ Standard_TypeMismatch::Raise
+ ("Creation Point On Lines Intersection Aborted : Line shape is not an edge");
+ }
+ //Calculate Lines Intersection Point
+ BRepExtrema_DistShapeShape dst (aRefShape1, aRefShape2);
+ if (dst.IsDone())
+ {
+ gp_Pnt P1, P2;
+ for (int i = 1; i <= dst.NbSolution(); i++) {
+ P1 = dst.PointOnShape1(i);
+ P2 = dst.PointOnShape2(i);
+ Standard_Real Dist = P1.Distance(P2);
+ if ( Dist <= Precision::Confusion() )
+ aPnt = P1;
+ else
+ Standard_TypeMismatch::Raise ("Lines not have an Intersection Point");
+ }
+ }
+ }
+ else {
return 0;
}
#include <GEOM_Function.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
+#include <BRepBuilderAPI_Transform.hxx>
#include <BRep_Tool.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <Precision.hxx>
#include <gp_Pnt.hxx>
+#include <gp_Trsf.hxx>
+#include <gp_Vec.hxx>
#include <Standard_ConstructionError.hxx>
//=======================================================================
}
}
}
- } else if (aType == PRISM_BASE_TWO_PNT) {
+ } else if (aType == PRISM_BASE_VEC_H_2WAYS) {
+ Handle(GEOM_Function) aRefBase = aCI.GetBase();
+ Handle(GEOM_Function) aRefVector = aCI.GetVector();
+ TopoDS_Shape aShapeBase = aRefBase->GetValue();
+ TopoDS_Shape aShapeVec = aRefVector->GetValue();
+ if (aShapeVec.ShapeType() == TopAbs_EDGE) {
+ TopoDS_Edge anE = TopoDS::Edge(aShapeVec);
+ TopoDS_Vertex V1, V2;
+ gp_Trsf aTrsf;
+ gp_Pnt aP1, aP2;
+ TopExp::Vertices(anE, V1, V2, Standard_True);
+ if (!V1.IsNull() && !V2.IsNull()) {
+ gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
+ if (Abs(aCI.GetH()) < Precision::Confusion()) {
+ Standard_ConstructionError::Raise("Absolute value of prism height is too small");
+ }
+ if (aV.Magnitude() > Precision::Confusion()) {
+ gp_Vec aVec;
+ aV.Normalize();
+ aVec.Normalize();
+ aVec = aV * (-aCI.GetH());
+ aTrsf.SetTranslation(aVec);
+ BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
+ aShapeBase = aTransformation.Shape();
+ aShape = BRepPrimAPI_MakePrism(aShapeBase, (aV * aCI.GetH() * 2), Standard_False).Shape();
+ }
+ }
+ }
+ } else if (aType == PRISM_BASE_TWO_PNT || aType == PRISM_BASE_TWO_PNT_2WAYS) {
Handle(GEOM_Function) aRefBase = aCI.GetBase();
Handle(GEOM_Function) aRefPnt1 = aCI.GetFirstPoint();
Handle(GEOM_Function) aRefPnt2 = aCI.GetLastPoint();
if (!V1.IsNull() && !V2.IsNull()) {
gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
if (aV.Magnitude() > gp::Resolution()) {
+ if (aType == PRISM_BASE_TWO_PNT_2WAYS)
+ {
+ gp_Trsf aTrsf;
+ aTrsf.SetTranslation(-aV);
+ BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
+ aShapeBase = aTransformation.Shape();
+ aV = aV * 2;
+ }
aShape = BRepPrimAPI_MakePrism(aShapeBase, aV, Standard_False).Shape();
}
}
#include <GEOM_Function.hxx>
#include <BRepPrimAPI_MakeRevol.hxx>
+#include <BRepBuilderAPI_Transform.hxx>
#include <BRep_Tool.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopAbs.hxx>
#include <TopExp.hxx>
-
+#include <gp_Trsf.hxx>
#include <gp_Pnt.hxx>
#include <gp_Lin.hxx>
#include <gp_Dir.hxx>
TopoDS_Shape aShape;
- if (aType == REVOLUTION_BASE_AXIS_ANGLE) {
+ if (aType == REVOLUTION_BASE_AXIS_ANGLE || aType == REVOLUTION_BASE_AXIS_ANGLE_2WAYS) {
Handle(GEOM_Function) aRefBase = aCI.GetBase();
Handle(GEOM_Function) aRefAxis = aCI.GetAxis();
TopoDS_Shape aShapeBase = aRefBase->GetValue();
Standard_ConstructionError::Raise("Vertex to be rotated is too close to Revolution Axis");
}
}
-
+ double anAngle = aCI.GetAngle();
gp_Ax1 anAxis (BRep_Tool::Pnt(V1), aV);
- BRepPrimAPI_MakeRevol MR (aShapeBase, anAxis, aCI.GetAngle(), Standard_False);
+ if (aType == REVOLUTION_BASE_AXIS_ANGLE_2WAYS)
+ {
+ gp_Trsf aTrsf;
+ aTrsf.SetRotation(anAxis, ( -anAngle ));
+ BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
+ aShapeBase = aTransformation.Shape();
+ anAngle = anAngle * 2;
+ }
+ BRepPrimAPI_MakeRevol MR (aShapeBase, anAxis, anAngle, Standard_False);
if (!MR.IsDone()) MR.Build();
if (!MR.IsDone()) StdFail_NotDone::Raise("Revolution algorithm has failed");
aShape = MR.Shape();
#define EXPORT_SHAPE 1
#define IMPORT_SHAPE 1
-#define POINT_XYZ 1
-#define POINT_XYZ_REF 2
-#define POINT_CURVE_PAR 3
-//#define POINT_FACE_PAR 4
+#define POINT_XYZ 1
+#define POINT_XYZ_REF 2
+#define POINT_CURVE_PAR 3
+#define POINT_LINES_INTERSECTION 4
+//#define POINT_FACE_PAR 5
#define VECTOR_TWO_PNT 1
#define VECTOR_DX_DY_DZ 2
#define PLANE_THREE_PNT 3
#define PLANE_TANGENT_FACE 4
-#define LINE_TWO_PNT 1
-#define LINE_PNT_DIR 2
+#define LINE_TWO_PNT 1
+#define LINE_PNT_DIR 2
+#define LINE_TWO_FACES 3
#define TRANSLATE_TWO_POINTS 1
#define TRANSLATE_VECTOR 2
#define SPHERE_R 1
#define SPHERE_PNT_R 2
-#define PRISM_BASE_VEC_H 1
-#define PRISM_BASE_TWO_PNT 2
+#define PRISM_BASE_VEC_H 1
+#define PRISM_BASE_TWO_PNT 2
+#define PRISM_BASE_VEC_H_2WAYS 3
+#define PRISM_BASE_TWO_PNT_2WAYS 4
-#define REVOLUTION_BASE_AXIS_ANGLE 1
+#define REVOLUTION_BASE_AXIS_ANGLE 1
+#define REVOLUTION_BASE_AXIS_ANGLE_2WAYS 2
#define PIPE_BASE_PATH 1
#define PIPE_DIFFERENT_SECTIONS 2
#include "GeometryGUI.h"
#include "GEOM_Actor.h"
#include "GEOMBase.h"
+
#include "GEOM_Operation.h"
#include "GEOM_Displayer.h"
return;
}
// VSR 17/11/04: check if all objects selected belong to GEOM component <-- finish
-
+ QString aNameList;
+ int nbSel = selected.Extent();
+ for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() )
+ {
+ Handle(SALOME_InteractiveObject) io = It.Value();
+ aNameList.append("\n - ");
+ aNameList.append(io->getName());
+ }
+
if ( SUIT_MessageBox::warn2( app->desktop(),
QObject::tr( "GEOM_WRN_WARNING" ),
- QObject::tr( "GEOM_REALLY_DELETE" ),
+ QObject::tr( "GEOM_REALLY_DELETE" ).arg( nbSel ).arg( aNameList ),
QObject::tr( "GEOM_BUT_YES" ),
QObject::tr( "GEOM_BUT_NO" ), 1, 0, 0 ) != 1 )
return;
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * MakePrismVecH2Ways
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismVecH2Ways
+ (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theVec,
+ CORBA::Double theH)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ if (theBase == NULL || theVec == NULL) return aGEOMObject._retn();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
+ (theBase->GetStudyID(), theBase->GetEntry());
+ Handle(GEOM_Object) aVec = GetOperations()->GetEngine()->GetObject
+ (theVec->GetStudyID(), theVec->GetEntry());
+
+ if (aBase.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
+
+ //Create the Prism
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakePrismVecH2Ways(aBase, aVec, theH);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
//=============================================================================
/*!
* MakePrismTwoPnt
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * MakePrismTwoPnt2Ways
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPnt2Ways
+ (GEOM::GEOM_Object_ptr theBase,
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ if (theBase == NULL || thePoint1 == NULL || thePoint2 == NULL)
+ return aGEOMObject._retn();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
+ (theBase->GetStudyID(), theBase->GetEntry());
+ Handle(GEOM_Object) aPoint1 = GetOperations()->GetEngine()->GetObject
+ (thePoint1->GetStudyID(), thePoint1->GetEntry());
+ Handle(GEOM_Object) aPoint2 = GetOperations()->GetEngine()->GetObject
+ (thePoint2->GetStudyID(), thePoint2->GetEntry());
+
+ if (aBase.IsNull() || aPoint1.IsNull() || aPoint2.IsNull())
+ return aGEOMObject._retn();
+
+ //Create the Prism
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakePrismTwoPnt2Ways(aBase, aPoint1, aPoint2);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
//=============================================================================
/*!
* MakePipe
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * MakeRevolutionAxisAngle2Ways
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeRevolutionAxisAngle2Ways
+ (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Double theAngle)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ if (theBase == NULL || theAxis == NULL) return aGEOMObject._retn();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
+ (theBase->GetStudyID(), theBase->GetEntry());
+ Handle(GEOM_Object) anAxis = GetOperations()->GetEngine()->GetObject
+ (theAxis->GetStudyID(), theAxis->GetEntry());
+
+ if (aBase.IsNull() || anAxis.IsNull()) return aGEOMObject._retn();
+
+ //Create the Revolution
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakeRevolutionAxisAngle2Ways(aBase, anAxis, theAngle);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
//=============================================================================
/*!
* MakeFilling
GEOM::GEOM_Object_ptr theVec,
CORBA::Double theH);
+ GEOM::GEOM_Object_ptr MakePrismVecH2Ways (GEOM::GEOM_Object_ptr theBase,
+ GEOM::GEOM_Object_ptr theVec,
+ CORBA::Double theH);
+
GEOM::GEOM_Object_ptr MakePrismTwoPnt (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr thePoint1,
GEOM::GEOM_Object_ptr thePoint2);
+ GEOM::GEOM_Object_ptr MakePrismTwoPnt2Ways (GEOM::GEOM_Object_ptr theBase,
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2);
+
GEOM::GEOM_Object_ptr MakePipe (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr thePath);
GEOM::GEOM_Object_ptr theAxis,
CORBA::Double theAngle);
+ GEOM::GEOM_Object_ptr MakeRevolutionAxisAngle2Ways (GEOM::GEOM_Object_ptr theBase,
+ GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Double theAngle);
+
GEOM::GEOM_Object_ptr MakeFilling(GEOM::GEOM_Object_ptr theShape, CORBA::Long theMinDeg, CORBA::Long theMaxDeg, CORBA::Double theTol2D, CORBA::Double theTol3D, CORBA::Long theNbIter);
GEOM::GEOM_Object_ptr MakeThruSections(const GEOM::ListOfGO& theSeqSections,
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * MakePointOnLinesIntersection
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnLinesIntersection
+ (GEOM::GEOM_Object_ptr theLine1, GEOM::GEOM_Object_ptr theLine2)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ if (theLine1 == NULL || theLine2 == NULL) return aGEOMObject._retn();
+
+ //Get the reference Lines
+
+ Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
+ (theLine1->GetStudyID(), theLine1->GetEntry());
+ Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
+ (theLine2->GetStudyID(), theLine2->GetEntry());
+ if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
+
+ //Create the point
+
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakePointOnLinesIntersection(aRef1, aRef2);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
//=============================================================================
/*!
* MakePointOnCurve
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * MakeLineTwoFaces
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeLineTwoFaces
+ (GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ if (theFace1 == NULL || theFace2 == NULL) return aGEOMObject._retn();
+
+ //Get the reference points
+
+ Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
+ (theFace1->GetStudyID(), theFace1->GetEntry());
+ Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
+ (theFace2->GetStudyID(), theFace2->GetEntry());
+ if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
+
+ //Create the Line
+
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakeLineTwoFaces(aRef1, aRef2);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
//=============================================================================
/*!
GEOM::GEOM_Object_ptr MakePointOnCurve (GEOM::GEOM_Object_ptr theCurve,
CORBA::Double theParameter);
+ GEOM::GEOM_Object_ptr MakePointOnLinesIntersection (GEOM::GEOM_Object_ptr theLine1,
+ GEOM::GEOM_Object_ptr theLine2);
+
GEOM::GEOM_Object_ptr MakeTangentOnCurve (GEOM::GEOM_Object_ptr theRefCurve,
CORBA::Double theParameter);
GEOM::GEOM_Object_ptr MakeLineTwoPnt (GEOM::GEOM_Object_ptr thePnt1,
GEOM::GEOM_Object_ptr thePnt2);
+ GEOM::GEOM_Object_ptr MakeLineTwoFaces (GEOM::GEOM_Object_ptr theFace1,
+ GEOM::GEOM_Object_ptr theFace2);
+
GEOM::GEOM_Object_ptr MakePlaneThreePnt (GEOM::GEOM_Object_ptr thePnt1,
GEOM::GEOM_Object_ptr thePnt2,
GEOM::GEOM_Object_ptr thePnt3,
return anObj;
}
+//=============================================================================
+// MakePointOnLinesIntersection:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointOnLinesIntersection (GEOM::GEOM_Object_ptr theRefLine1,
+ GEOM::GEOM_Object_ptr theRefLine2)
+{
+ beginService( " GEOM_Superv_i::MakePointOnLinesIntersection" );
+ MESSAGE("GEOM_Superv_i::MakePointOnLinesIntersection");
+ getBasicOp();
+ GEOM::GEOM_Object_ptr anObj = myBasicOp->MakePointOnLinesIntersection(theRefLine1, theRefLine2);
+ endService( " GEOM_Superv_i::MakePointOnLinesIntersection" );
+ return anObj;
+}
+
//=============================================================================
// MakeTangentOnCurve:
//=============================================================================
return anObj;
}
+//=============================================================================
+// MakeLineTwoFaces:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeLineTwoFaces (GEOM::GEOM_Object_ptr theFace1,
+ GEOM::GEOM_Object_ptr theFace2)
+{
+ beginService( " GEOM_Superv_i::MakeLineTwoFaces");
+ MESSAGE("GEOM_Superv_i::MakeLineTwoFaces");
+ getBasicOp();
+ GEOM::GEOM_Object_ptr anObj = myBasicOp->MakeLineTwoFaces(theFace1, theFace2);
+ endService( " GEOM_Superv_i::MakeLineTwoFaces");
+ return anObj;
+}
+
//=============================================================================
// MakePlaneThreePnt:
//=============================================================================
return anObj;
}
+//=============================================================================
+// MakePrismVecH2Ways:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePrismVecH2Ways (GEOM::GEOM_Object_ptr theBase,
+ GEOM::GEOM_Object_ptr theVec,
+ CORBA::Double theH)
+{
+ beginService( " GEOM_Superv_i::MakePrismVecH2Ways" );
+ MESSAGE("GEOM_Superv_i::MakePrismVecH2Ways");
+ get3DPrimOp();
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePrismVecH2Ways(theBase, theVec, theH);
+ endService( " GEOM_Superv_i::MakePrismVecH2Ways" );
+ return anObj;
+}
//=============================================================================
// MakePrismTwoPnt:
return anObj;
}
+//=============================================================================
+// MakePrismTwoPnt2Ways:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePrismTwoPnt2Ways (GEOM::GEOM_Object_ptr theBase,
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2)
+{
+ beginService( " GEOM_Superv_i::MakePrismTwoPnt2Ways" );
+ MESSAGE("GEOM_Superv_i::MakePrismTwoPnt2Ways");
+ get3DPrimOp();
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2);
+ endService( " GEOM_Superv_i::MakePrismTwoPnt2Ways" );
+ return anObj;
+}
+
//=============================================================================
// MakePipe:
//=============================================================================
return anObj;
}
+//=============================================================================
+// MakeRevolutionAxisAngle:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeRevolutionAxisAngle2Ways (GEOM::GEOM_Object_ptr theBase,
+ GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Double theAngle)
+{
+ beginService( " GEOM_Superv_i::MakeRevolutionAxisAngle2Ways" );
+ MESSAGE("GEOM_Superv_i::MakeRevolutionAxisAngle2Ways");
+ get3DPrimOp();
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle);
+ endService( " GEOM_Superv_i::MakeRevolutionAxisAngle2Ways" );
+ return anObj;
+}
+
//=============================================================================
// MakeFilling:
//=============================================================================
CORBA::Double theZ);
GEOM::GEOM_Object_ptr MakePointOnCurve (GEOM::GEOM_Object_ptr theRefCurve,
CORBA::Double theParameter);
+ GEOM::GEOM_Object_ptr MakePointOnLinesIntersection (GEOM::GEOM_Object_ptr theRefLine1,
+ GEOM::GEOM_Object_ptr theRefLine2);
GEOM::GEOM_Object_ptr MakeTangentOnCurve (GEOM::GEOM_Object_ptr theRefCurve,
CORBA::Double theParameter);
GEOM::GEOM_Object_ptr MakeVectorDXDYDZ (CORBA::Double theDX,
GEOM::GEOM_Object_ptr thePnt2);
GEOM::GEOM_Object_ptr MakeLineTwoPnt (GEOM::GEOM_Object_ptr thePnt1,
GEOM::GEOM_Object_ptr thePnt2);
+ GEOM::GEOM_Object_ptr MakeLineTwoFaces (GEOM::GEOM_Object_ptr theFace1,
+ GEOM::GEOM_Object_ptr theFace2);
GEOM::GEOM_Object_ptr MakePlaneThreePnt (GEOM::GEOM_Object_ptr thePnt1,
GEOM::GEOM_Object_ptr thePnt2,
GEOM::GEOM_Object_ptr thePnt3,
GEOM::GEOM_Object_ptr MakePrismVecH (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr theVec,
CORBA::Double theH);
+ GEOM::GEOM_Object_ptr MakePrismVecH2Ways (GEOM::GEOM_Object_ptr theBase,
+ GEOM::GEOM_Object_ptr theVec,
+ CORBA::Double theH);
GEOM::GEOM_Object_ptr MakePrismTwoPnt (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr thePoint1,
GEOM::GEOM_Object_ptr thePoint2);
+ GEOM::GEOM_Object_ptr MakePrismTwoPnt2Ways (GEOM::GEOM_Object_ptr theBase,
+ GEOM::GEOM_Object_ptr thePoint1,
+ GEOM::GEOM_Object_ptr thePoint2);
GEOM::GEOM_Object_ptr MakePipe (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr thePath);
GEOM::GEOM_Object_ptr MakeRevolutionAxisAngle (GEOM::GEOM_Object_ptr theBase,
GEOM::GEOM_Object_ptr theAxis,
CORBA::Double theAngle);
+ GEOM::GEOM_Object_ptr MakeRevolutionAxisAngle2Ways (GEOM::GEOM_Object_ptr theBase,
+ GEOM::GEOM_Object_ptr theAxis,
+ CORBA::Double theAngle);
GEOM::GEOM_Object_ptr MakeFilling (GEOM::GEOM_Object_ptr theShape,
CORBA::Long theMinDeg, CORBA::Long theMaxDeg,
CORBA::Double theTol2D, CORBA::Double theTol3D,
print "MakePrismTwoPnt : ", PrimOp.GetErrorCode()
return anObj
+def MakePrism2Ways(baseShape,point1,point2):
+ anObj = PrimOp.MakePrismTwoPnt2Ways(baseShape,point1,point2)
+ if PrimOp.IsDone() == 0:
+ print "MakePrismTwoPnt2Ways : ", PrimOp.GetErrorCode()
+ return anObj
+
def MakePrismVecH(baseShape,vector,height):
anObj = PrimOp.MakePrismVecH(baseShape,vector,height)
if PrimOp.IsDone() == 0:
print "MakePrismVecH : ", PrimOp.GetErrorCode()
return anObj
+def MakePrismVecH2Ways(baseShape,vector,height):
+ anObj = PrimOp.MakePrismVecH2Ways(baseShape,vector,height)
+ if PrimOp.IsDone() == 0:
+ print "MakePrismVecH2Ways : ", PrimOp.GetErrorCode()
+ return anObj
+
def MakePipe(baseShape,pathShape):
anObj = PrimOp.MakePipe(baseShape,pathShape)
if PrimOp.IsDone() == 0:
print "MakeRevolutionAxisAngle : ", PrimOp.GetErrorCode()
return anObj
+def MakeRevolution2Ways(aShape,axis,angle):
+ anObj = PrimOp.MakeRevolutionAxisAngle2Ways(aShape,axis,angle)
+ if PrimOp.IsDone() == 0:
+ print "MakeRevolutionAxisAngle2Ways : ", PrimOp.GetErrorCode()
+ return anObj
+
# -----------------------------------------------------------------------------
# Create base shapes
# -----------------------------------------------------------------------------
anObj = PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
RaiseIfFailed("MakePrismTwoPnt", PrimOp)
return anObj
+## The same prism but in two directions forward&backward.
+def MakePrism2Ways(theBase, thePoint1, thePoint2):
+ anObj = PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
+ RaiseIfFailed("MakePrismTwoPnt2Ways", PrimOp)
+ return anObj
## Create a shape by extrusion of the base shape along the vector,
# i.e. all the space, transfixed by the base shape during its translation
RaiseIfFailed("MakePrismVecH", PrimOp)
return anObj
+## Create a shape by extrusion of the base shape along the vector,
+# i.e. all the space, transfixed by the base shape during its translation
+# along the vector on the given distance in 2 Ways (forward/backward) .
+# @param theBase Base shape to be extruded.
+# @param theVec Direction of extrusion.
+# @param theH Prism dimension along theVec in forward direction.
+# @return New GEOM_Object, containing the created prism.
+#
+# Example: see GEOM_TestAll.py
+def MakePrismVecH2Ways(theBase, theVec, theH):
+ anObj = PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
+ RaiseIfFailed("MakePrismVecH2Ways", PrimOp)
+ return anObj
+
## Create a shape by extrusion of the base shape along
# the path shape. The path shape can be a wire or an edge.
# @param theBase Base shape to be extruded.
anObj = PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
RaiseIfFailed("MakeRevolutionAxisAngle", PrimOp)
return anObj
+## The Same Revolution but in both ways forward&backward.
+def MakeRevolution2Ways(theBase, theAxis, theAngle):
+ anObj = PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
+ RaiseIfFailed("MakeRevolutionAxisAngle2Ways", PrimOp)
+ return anObj
## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
# @param theSeqSections - set of specified sections.
RadioButton3->close(TRUE);
RadioButton1->setChecked(true);
+ myBothway = myBothway2 = false;
GroupPoints = new DlgRef_2Sel1Spin2Check(this, "GroupPoints");
- GroupPoints->CheckButton1->hide();
GroupPoints->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV"));
GroupPoints->TextLabel1->setText(tr("GEOM_BASE"));
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
GroupPoints->PushButton2->setPixmap(image1);
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
+ GroupPoints->CheckButton1->setText(tr("GEOM_BOTHWAY"));
+ GroupPoints->CheckButton1->setChecked(myBothway);
GroupPoints->CheckButton2->setText(tr("GEOM_REVERSE"));
- GroupPoints2 = new DlgRef_3Sel_QTD(this, "GroupPoints2");
+ GroupPoints2 = new DlgRef_3Sel1Check_QTD(this, "GroupPoints2");
GroupPoints2->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV_2P"));
GroupPoints2->TextLabel1->setText(tr("GEOM_BASE"));
GroupPoints2->TextLabel2->setText(tr("GEOM_POINT_I").arg("1"));
GroupPoints2->PushButton1->setPixmap(image1);
GroupPoints2->PushButton2->setPixmap(image1);
GroupPoints2->PushButton3->setPixmap(image1);
+ GroupPoints2->CheckButton1->setText(tr("GEOM_BOTHWAY"));
+ GroupPoints2->CheckButton1->setChecked(myBothway2);
Layout1->addWidget(GroupPoints, 2, 0);
Layout1->addWidget(GroupPoints2, 2, 0);
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
+ connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(onBothway()));
connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
-
connect(GroupPoints2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints2->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(GroupPoints2->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(onBothway2()));
connect(GroupPoints2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints2->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
//=================================================================================
double GenerationGUI_PrismDlg::getHeight() const
{
- return GroupPoints->SpinBox_DX->GetValue();
+ return GroupPoints->SpinBox_DX->GetValue();
}
//=================================================================================
bool GenerationGUI_PrismDlg::isValid( QString& )
{
if (getConstructorId() == 0)
- // by vector and height
- return (myOkBase && myOkVec);
-
- // by two points
- return (myOkBase && myOkPnt1 && myOkPnt2);
+ return (myOkBase && myOkVec); // by vector and height
+ else
+ return (myOkBase && myOkPnt1 && myOkPnt2); // by two points
}
//=================================================================================
{
case 0:
{
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
- MakePrismVecH(myBase, myVec, getHeight());
+ if (!myBothway)
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
+ MakePrismVecH(myBase, myVec, getHeight());
+ else
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
+ MakePrismVecH2Ways(myBase, myVec, ( fabs(getHeight()) ) );
break;
}
case 1:
{
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
+ if (!myBothway2)
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
MakePrismTwoPnt(myBase, myPoint1, myPoint2);
+ else
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
+ MakePrismTwoPnt2Ways(myBase, myPoint1, myPoint2);
break;
}
}
double anOldValue = GroupPoints->SpinBox_DX->GetValue();
GroupPoints->SpinBox_DX->SetValue( -anOldValue );
}
+
+//=================================================================================
+// function : onBothway()
+// purpose :
+//=================================================================================
+void GenerationGUI_PrismDlg::onBothway()
+{
+ bool anOldValue = myBothway;
+ myBothway = !anOldValue;
+ GroupPoints->CheckButton2->setEnabled(!myBothway);
+ displayPreview();
+}
+
+void GenerationGUI_PrismDlg::onBothway2()
+{
+ bool anOldValue = myBothway2;
+ myBothway2 = !anOldValue;
+ displayPreview();
+}
#include "GEOMBase_Skeleton.h"
#include "DlgRef_2Sel1Spin2Check.h"
-#include "DlgRef_3Sel_QTD.h"
+#include "DlgRef_3Sel1Check_QTD.h"
//=================================================================================
// class : GenerationGUI_PrismDlg
bool myOkVec;
bool myOkPnt1;
bool myOkPnt2;
+ bool myBothway;
+ bool myBothway2;
DlgRef_2Sel1Spin2Check* GroupPoints;
- DlgRef_3Sel_QTD* GroupPoints2; // for second layout for extrusion using 2 points
+ DlgRef_3Sel1Check_QTD* GroupPoints2; // for second layout for extrusion using 2 points
private slots:
void ClickOnOk();
void SetEditCurrentArgument();
void ValueChangedInSpinBox();
void onReverse();
+ void onBothway();
+ void onBothway2();
};
#endif // DIALOGBOX_PRISM_H
RadioButton1->setPixmap(image0);
RadioButton2->close(TRUE);
RadioButton3->close(TRUE);
+ myBothway = false;
GroupPoints = new DlgRef_2Sel1Spin2Check(this, "GroupPoints");
- GroupPoints->CheckButton1->hide();
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupPoints->TextLabel1->setText(tr("GEOM_OBJECT"));
GroupPoints->TextLabel2->setText(tr("GEOM_AXIS"));
GroupPoints->PushButton2->setPixmap(image1);
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
+ GroupPoints->CheckButton1->setText(tr("GEOM_BOTHWAY"));
GroupPoints->CheckButton2->setText(tr("GEOM_REVERSE"));
Layout1->addWidget(GroupPoints, 2, 0);
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
+ connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(onBothway()));
connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
{
GEOM::GEOM_Object_var anObj;
- anObj = GEOM::GEOM_I3DPrimOperations::_narrow(
- getOperation() )->MakeRevolutionAxisAngle( myBase, myAxis, getAngle() * PI180 );
+ if (!myBothway)
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow(
+ getOperation() )->MakeRevolutionAxisAngle( myBase, myAxis, getAngle() * PI180 );
+ else
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow(
+ getOperation() )->MakeRevolutionAxisAngle2Ways( myBase, myAxis, getAngle() * PI180 );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
double anOldValue = GroupPoints->SpinBox_DX->GetValue();
GroupPoints->SpinBox_DX->SetValue( -anOldValue );
}
+
+//=================================================================================
+// function : onBothway()
+// purpose :
+//=================================================================================
+void GenerationGUI_RevolDlg::onBothway()
+{
+ bool anOldValue = myBothway;
+ myBothway = !anOldValue;
+ GroupPoints->CheckButton2->setEnabled(!myBothway);
+ displayPreview();
+}
GEOM::GEOM_Object_var myAxis; /* Axis of the revolution */
bool myOkBase;
bool myOkAxis;
+ bool myBothway;
DlgRef_2Sel1Spin2Check* GroupPoints;
void SetEditCurrentArgument();
void ValueChangedInSpinBox();
void onReverse();
+ void onBothway();
};
#endif // DIALOGBOX_REVOLUTION_H
connect( myIdList, SIGNAL( selectionChanged() ), this, SLOT( selectionChanged() ) );
activateSelection();
+ // activate subshapes selection if Main Shape is Selected
+ if ( !CORBA::is_nil( myMainObj ) ) {
+ myEditCurrentArgument = 0;
+ activateSelection();
+ updateState();
+ }
}
//=================================================================================
if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
myMainObj = anObj;
myEditCurrentArgument->setText( GEOMBase::GetName( anObj ) );
- updateState();
+ // activate subshapes selection by default
+ myEditCurrentArgument = 0;
+ activateSelection();
+ updateState();
return;
}
}
break;
}
}
-
if ( !isAdd ) {
aMapIndex.Clear();
break;