0020154: Implement major axis support for ellipse creation (merge development from series 5x)

This commit is contained in:
vsr 2009-04-13 12:51:18 +00:00
parent 3313eb5f07
commit 3a84ec0f08
24 changed files with 836 additions and 48 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -4,14 +4,28 @@
To create an \b Ellipse in the <b>Main Menu</b> select <b>New Entity - > Basic - > Ellipse</b>
\n You can define an \b Ellipse by its <b>Center Point</b>, a \b
Vector giving its normal, and its <b>Major & Minor Radiuses</b>.
\n You can define an \b Ellipse by its <b>Center</b> point, a \b
Vector giving its normal, another vector specifying the direction of
ellipse's <b>Major Axis</b> (optionally) and its <b>Major</b> & <b>Minor Radiuses</b>.
\n The \b Result of the operation will be a GEOM_Object (edge).
\n <b>TUI Command:</b> <em>geompy.MakeEllipse(Point, Vector, RadiusMajor, RadiusMinor)</em>
\note The parameter <b>Major Axis</b> is optional. It is calculated
automatically basing on the direction of the normal vector (by default
it corresponds to the OX axis of the global coordinate system).
\note Actual direction of the major axis vector is defined as
<EM> Vmaj' = (Vn * Vmaj) * Vn</em> where \em Vn is a normal vector and
\em Vmaj is an original vector of the major axis.
\n <b>TUI Command (no major axis):</b> <em>geompy.MakeEllipse(Point, Vector, RadiusMajor, RadiusMinor)</em>
\n <b>Arguments:</b> Name + 1 vertex (for the center) + 1 edge (for
the direction) + 1 X Radius + 1 Y Radius.
\n <b>TUI Command (use major axis):</b> <em>geompy.MakeEllipseVec(Point, Vector, RadiusMajor, RadiusMinor, VectorMajor)</em>
\n <b>Arguments:</b> Name + 1 vertex (for the center) + 1 edge (for
the normal direction) + 1 X Radius + 1 Y Radius + 1 edge (for the
major axis direction)
\image html ellipse.png
<b>Example:</b>
@ -21,4 +35,4 @@ the direction) + 1 X Radius + 1 Y Radius.
Our <b>TUI Scripts</b> provide you with useful examples of creation of
\ref tui_creation_ellipse "Basic Geometric Objects".
*/
*/

View File

@ -116,21 +116,32 @@ gg = salome.ImportComponentGUI("GEOM")
# create vertices
p0 = geompy.MakeVertex(0., 0., 0.)
p50 = geompy.MakeVertex(50., 50., 50.)
p1 = geompy.MakeVertex(50., 50., 50.)
p2 = geompy.MakeVertex(0., 50., 0.)
# create a vector from two points
vector = geompy.MakeVector(p0, p50)
# create a normal vector from two points
normal = geompy.MakeVector(p0, p1)
# create a major axis vector from two points
major = geompy.MakeVector(p0, p2)
# create an ellipse from a point, a vector and radiuses
ellipse = geompy.MakeEllipse(p50, vector, 50, 25)
ellipse1 = geompy.MakeEllipse(p1, normal, 50, 25)
# create an ellipse from a point, a normal vector, radiuses and a major axis vector
ellipse2 = geompy.MakeEllipse(p1, normal, 50, 25, major)
# add objects in the study
id_vector = geompy.addToStudy(vector, "Vector")
id_ellipse = geompy.addToStudy(ellipse,"Ellipse")
id_normal = geompy.addToStudy(normal, "Normal")
id_major = geompy.addToStudy(major, "Major Axis")
id_ellipse1 = geompy.addToStudy(ellipse1, "Ellipse 1")
id_ellipse2 = geompy.addToStudy(ellipse2, "Ellipse 2")
# display the ellipse and its normal vector
gg.createAndDisplayGO(id_vector)
gg.createAndDisplayGO(id_ellipse)
gg.createAndDisplayGO(id_normal)
gg.createAndDisplayGO(id_major)
gg.createAndDisplayGO(id_ellipse1)
gg.createAndDisplayGO(id_ellipse2)
\endcode
\anchor tui_creation_curve
@ -269,4 +280,4 @@ gg.setDisplayMode(id_plane3,1)
gg.setTransparency(id_plane3,0.5)
\endcode
*/
*/

View File

@ -2014,6 +2014,21 @@ module GEOM
in double theRMajor,
in double theRMinor);
/*!
* Create an ellipse with given center, normal vector, main axis vector and radiuses.
* \param thePnt Ellipse center.
* \param theVec Vector, normal to the plane of the ellipse.
* \param theRMajor Major ellipse radius.
* \param theRMinor Minor ellipse radius.
* \param theVecMaj Vector, direction of the ellipse's main axis.
* \return New GEOM_Object, containing the created ellipse.
*/
GEOM_Object MakeEllipseVec (in GEOM_Object thePnt,
in GEOM_Object theVec,
in double theRMajor,
in double theRMinor,
in GEOM_Object theVecMaj);
/*!
* Create an arc of circle, passing through three given points.
* \param thePnt1 Start point of the arc.

View File

@ -459,6 +459,11 @@ module GEOM
in GEOM_Object theVec,
in double theRMajor,
in double theRMinor) ;
GEOM_Object MakeEllipseVec (in GEOM_Object thePnt,
in GEOM_Object theVec,
in double theRMajor,
in double theRMinor,
in GEOM_Object theVecMaj) ;
GEOM_Object MakeArc (in GEOM_Object thePnt1,
in GEOM_Object thePnt2,
in GEOM_Object thePnt3) ;

View File

@ -70,17 +70,20 @@ BasicGUI_EllipseDlg::BasicGUI_EllipseDlg(GeometryGUI* theGeometryGUI, QWidget* p
RadioButton2->close(TRUE);
RadioButton3->close(TRUE);
GroupPoints = new DlgRef_2Sel2Spin(this, "GroupPoints");
GroupPoints = new DlgRef_3Sel2Spin(this, "GroupPoints");
GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
GroupPoints->TextLabel1->setText(tr("GEOM_CENTER"));
GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS_MAJOR"));
GroupPoints->TextLabel4->setText(tr("GEOM_RADIUS_MINOR"));
GroupPoints->TextLabel3->setText(tr("%1 (%2)").arg(tr("GEOM_VECTOR_MAJOR")).arg(tr("GEOM_OPTIONAL")));
GroupPoints->TextLabel4->setText(tr("GEOM_RADIUS_MAJOR"));
GroupPoints->TextLabel5->setText(tr("GEOM_RADIUS_MINOR"));
GroupPoints->PushButton1->setPixmap(image1);
GroupPoints->PushButton2->setPixmap(image1);
GroupPoints->PushButton3->setPixmap(image1);
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
GroupPoints->LineEdit3->setReadOnly( true );
Layout1->addWidget(GroupPoints, 2, 0);
/***************************************************************/
@ -111,7 +114,7 @@ void BasicGUI_EllipseDlg::Init()
globalSelection(); // close local contexts, if any
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
myPoint = myDir = GEOM::GEOM_Object::_nil();
myPoint = myDir = myMajor = GEOM::GEOM_Object::_nil();
/* Get setting of step value from file configuration */
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
@ -135,9 +138,11 @@ void BasicGUI_EllipseDlg::Init()
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(GroupPoints->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
@ -175,9 +180,10 @@ bool BasicGUI_EllipseDlg::ClickOnApply()
initName();
// reset
myPoint = myDir = GEOM::GEOM_Object::_nil();
myPoint = myDir = myMajor = GEOM::GEOM_Object::_nil();
GroupPoints->LineEdit1->setText( "" );
GroupPoints->LineEdit2->setText( "" );
GroupPoints->LineEdit3->setText( "" );
myEditCurrentArgument = GroupPoints->LineEdit1;
//globalSelection(GEOM_POINT);
globalSelection(); // close local contexts, if any
@ -207,6 +213,7 @@ void BasicGUI_EllipseDlg::SelectionIntoArgument()
{
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myDir = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit3 ) myMajor = GEOM::GEOM_Object::_nil();
return;
}
@ -223,7 +230,7 @@ void BasicGUI_EllipseDlg::SelectionIntoArgument()
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
{
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
if (myEditCurrentArgument == GroupPoints->LineEdit2)
if (myEditCurrentArgument == GroupPoints->LineEdit2 || myEditCurrentArgument == GroupPoints->LineEdit3)
aNeedType = TopAbs_EDGE;
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
@ -260,6 +267,7 @@ void BasicGUI_EllipseDlg::SelectionIntoArgument()
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint = aSelectedObject;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myDir = aSelectedObject;
else if ( myEditCurrentArgument == GroupPoints->LineEdit3 ) myMajor = aSelectedObject;
}
displayPreview();
@ -277,10 +285,11 @@ void BasicGUI_EllipseDlg::SetEditCurrentArgument()
if ( send == GroupPoints->PushButton1 ) myEditCurrentArgument = GroupPoints->LineEdit1;
else if ( send == GroupPoints->PushButton2 ) myEditCurrentArgument = GroupPoints->LineEdit2;
else if ( send == GroupPoints->PushButton3 ) myEditCurrentArgument = GroupPoints->LineEdit3;
myEditCurrentArgument->setFocus();
globalSelection(); // close local contexts, if any
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
if ( myEditCurrentArgument == GroupPoints->LineEdit2 || myEditCurrentArgument == GroupPoints->LineEdit3 )
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
else
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
@ -295,7 +304,8 @@ void BasicGUI_EllipseDlg::LineEditReturnPressed()
{
QLineEdit* send = (QLineEdit*)sender();
if ( send == GroupPoints->LineEdit1 ||
send == GroupPoints->LineEdit2 )
send == GroupPoints->LineEdit2 ||
send == GroupPoints->LineEdit3 )
{
myEditCurrentArgument = send;
GEOMBase_Skeleton::LineEditReturnPressed();
@ -318,6 +328,7 @@ void BasicGUI_EllipseDlg::ActivateThisDialog()
GroupPoints->LineEdit1->setText( "" );
GroupPoints->LineEdit2->setText( "" );
GroupPoints->LineEdit3->setText( "" );
myPoint = myDir = GEOM::GEOM_Object::_nil();
//globalSelection( GEOM_POINT );
@ -387,7 +398,10 @@ bool BasicGUI_EllipseDlg::execute( ObjectList& objects )
{
double aMajorR = GroupPoints->SpinBox_DX->GetValue();
double aMinorR = GroupPoints->SpinBox_DY->GetValue();
GEOM::GEOM_Object_var anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeEllipse( myPoint, myDir, aMajorR, aMinorR );
GEOM::GEOM_Object_var anObj = myMajor->_is_nil() ?
GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeEllipse ( myPoint, myDir, aMajorR, aMinorR ) :
GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeEllipseVec( myPoint, myDir, aMajorR, aMinorR, myMajor );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
@ -414,6 +428,8 @@ void BasicGUI_EllipseDlg::addSubshapesToStudy()
objMap[GroupPoints->LineEdit1->text()] = myPoint;
objMap[GroupPoints->LineEdit2->text()] = myDir;
if (!CORBA::is_nil(myMajor))
objMap[GroupPoints->LineEdit3->text()] = myMajor;
addSubshapesToFather( objMap );
}

View File

@ -30,7 +30,7 @@
#include "GEOM_BasicGUI.hxx"
#include "GEOMBase_Skeleton.h"
#include "DlgRef_2Sel2Spin.h"
#include "DlgRef_3Sel2Spin.h"
#include "BasicGUI.h"
@ -59,9 +59,9 @@ private :
void Init();
void enterEvent(QEvent* e);
GEOM::GEOM_Object_var myPoint, myDir;
GEOM::GEOM_Object_var myPoint, myDir, myMajor;
DlgRef_2Sel2Spin* GroupPoints;
DlgRef_3Sel2Spin* GroupPoints;
private slots:
void ClickOnOk();

View File

@ -0,0 +1,56 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : DlgRef_3Sel2Spin.cxx
// Author : Damien COQUERET
// Module : GEOM
// $Header:
//
#include "DlgRef_3Sel2Spin.h"
#include <qlayout.h>
#include <qspinbox.h>
#include <qgroupbox.h>
/*
* Constructs a DlgRef_3Sel1Spin which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*/
DlgRef_3Sel2Spin::DlgRef_3Sel2Spin(QWidget* parent, const char* name, WFlags fl)
:DlgRef_3Sel2Spin_QTD(parent, name, fl)
{
SpinBox1->close(TRUE);
SpinBox2->close(TRUE);
SpinBox_DX = new DlgRef_SpinBox(GroupBox1, "SpinBox_DX");
Layout2->addWidget(SpinBox_DX, 0, 1);
SpinBox_DY = new DlgRef_SpinBox(GroupBox1, "SpinBox_DY");
Layout2->addWidget(SpinBox_DY, 1, 1);
}
/*
* Destroys the object and frees any allocated resources
*/
DlgRef_3Sel2Spin::~DlgRef_3Sel2Spin()
{
// no need to delete child widgets, Qt does it all for us
}

View File

@ -0,0 +1,49 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : DlgRef_3Sel2Spin.h
// Author : Damien COQUERET
// Module : GEOM
// $Header:
//
#ifndef DLGREF_3SEL2SPIN_H
#define DLGREF_3SEL2SPIN_H
#include "GEOM_DlgRef.hxx"
#include "DlgRef_3Sel2Spin_QTD.h"
#include "DlgRef_SpinBox.h"
class GEOM_DLGREF_EXPORT DlgRef_3Sel2Spin : public DlgRef_3Sel2Spin_QTD
{
Q_OBJECT
public:
DlgRef_3Sel2Spin(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
~DlgRef_3Sel2Spin();
DlgRef_SpinBox* SpinBox_DX;
DlgRef_SpinBox* SpinBox_DY;
};
#endif // DLGREF_3SEL2SPIN_H

View File

@ -0,0 +1,148 @@
/****************************************************************************
** Form implementation generated from reading ui file 'DlgRef_3Sel2Spin_QTD.ui'
**
** Created: Mon Apr 13 11:59:12 2009
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "DlgRef_3Sel2Spin_QTD.h"
#include <qvariant.h>
#include <qpushbutton.h>
#include <qgroupbox.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
/*
* Constructs a DlgRef_3Sel2Spin_QTD as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
DlgRef_3Sel2Spin_QTD::DlgRef_3Sel2Spin_QTD( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
if ( !name )
setName( "DlgRef_3Sel2Spin_QTD" );
DlgRef_3Sel2Spin_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_3Sel2Spin_QTDLayout");
GroupBox1 = new QGroupBox( this, "GroupBox1" );
GroupBox1->setColumnLayout(0, Qt::Vertical );
GroupBox1->layout()->setSpacing( 6 );
GroupBox1->layout()->setMargin( 11 );
GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
GroupBox1Layout->setAlignment( Qt::AlignTop );
LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
GroupBox1Layout->addWidget( LineEdit1, 0, 2 );
TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
GroupBox1Layout->addWidget( TextLabel1, 0, 0 );
PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
GroupBox1Layout->addWidget( PushButton1, 0, 1 );
TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
GroupBox1Layout->addWidget( TextLabel2, 1, 0 );
LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
GroupBox1Layout->addWidget( LineEdit2, 1, 2 );
PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
GroupBox1Layout->addWidget( PushButton2, 1, 1 );
TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
GroupBox1Layout->addWidget( TextLabel3, 2, 0 );
PushButton3 = new QPushButton( GroupBox1, "PushButton3" );
PushButton3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton3->sizePolicy().hasHeightForWidth() ) );
GroupBox1Layout->addWidget( PushButton3, 2, 1 );
LineEdit3 = new QLineEdit( GroupBox1, "LineEdit3" );
GroupBox1Layout->addWidget( LineEdit3, 2, 2 );
Layout2 = new QGridLayout( 0, 1, 1, 0, 6, "Layout2");
SpinBox2 = new QSpinBox( GroupBox1, "SpinBox2" );
SpinBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox2->sizePolicy().hasHeightForWidth() ) );
Layout2->addWidget( SpinBox2, 1, 1 );
TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
TextLabel5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel5->sizePolicy().hasHeightForWidth() ) );
Layout2->addWidget( TextLabel5, 1, 0 );
TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
Layout2->addWidget( TextLabel4, 0, 0 );
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
SpinBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, SpinBox1->sizePolicy().hasHeightForWidth() ) );
Layout2->addWidget( SpinBox1, 0, 1 );
GroupBox1Layout->addMultiCellLayout( Layout2, 3, 3, 0, 2 );
Spacer5 = new QSpacerItem( 16, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
GroupBox1Layout->addItem( Spacer5, 4, 1 );
DlgRef_3Sel2Spin_QTDLayout->addWidget( GroupBox1, 0, 0 );
languageChange();
resize( QSize(124, 201).expandedTo(minimumSizeHint()) );
clearWState( WState_Polished );
// tab order
setTabOrder( PushButton1, LineEdit1 );
setTabOrder( LineEdit1, PushButton2 );
setTabOrder( PushButton2, LineEdit2 );
setTabOrder( LineEdit2, PushButton3 );
setTabOrder( PushButton3, LineEdit3 );
setTabOrder( LineEdit3, SpinBox1 );
setTabOrder( SpinBox1, SpinBox2 );
}
/*
* Destroys the object and frees any allocated resources
*/
DlgRef_3Sel2Spin_QTD::~DlgRef_3Sel2Spin_QTD()
{
// no need to delete child widgets, Qt does it all for us
}
/*
* Sets the strings of the subwidgets using the current
* language.
*/
void DlgRef_3Sel2Spin_QTD::languageChange()
{
setCaption( tr( "DlgRef_2Sel2Spin_QTD" ) );
GroupBox1->setTitle( QString::null );
TextLabel1->setText( tr( "TL1" ) );
PushButton1->setText( QString::null );
TextLabel2->setText( tr( "TL2" ) );
PushButton2->setText( QString::null );
TextLabel3->setText( tr( "TL3" ) );
PushButton3->setText( QString::null );
TextLabel5->setText( tr( "TL5" ) );
TextLabel4->setText( tr( "TL4" ) );
}

View File

@ -0,0 +1,60 @@
/****************************************************************************
** Form interface generated from reading ui file 'DlgRef_3Sel2Spin_QTD.ui'
**
** Created: Mon Apr 13 11:59:11 2009
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef DLGREF_3SEL2SPIN_QTD_H
#define DLGREF_3SEL2SPIN_QTD_H
#include <qvariant.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QSpacerItem;
class QGroupBox;
class QLineEdit;
class QLabel;
class QPushButton;
class QSpinBox;
class DlgRef_3Sel2Spin_QTD : public QWidget
{
Q_OBJECT
public:
DlgRef_3Sel2Spin_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~DlgRef_3Sel2Spin_QTD();
QGroupBox* GroupBox1;
QLineEdit* LineEdit1;
QLabel* TextLabel1;
QPushButton* PushButton1;
QLabel* TextLabel2;
QLineEdit* LineEdit2;
QPushButton* PushButton2;
QLabel* TextLabel3;
QPushButton* PushButton3;
QLineEdit* LineEdit3;
QSpinBox* SpinBox2;
QLabel* TextLabel5;
QLabel* TextLabel4;
QSpinBox* SpinBox1;
protected:
QGridLayout* DlgRef_3Sel2Spin_QTDLayout;
QGridLayout* GroupBox1Layout;
QSpacerItem* Spacer5;
QGridLayout* Layout2;
protected slots:
virtual void languageChange();
};
#endif // DLGREF_3SEL2SPIN_QTD_H

View File

@ -49,6 +49,7 @@ dist_libDlgRef_la_SOURCES = \
DlgRef_2Sel1Spin_QTD.cxx \
DlgRef_2Sel2Spin_QTD.cxx \
DlgRef_2Sel3Spin_QTD.cxx \
DlgRef_3Sel2Spin_QTD.cxx \
DlgRef_1Sel1Spin1Check_QTD.cxx \
DlgRef_2Sel1Spin2Check_QTD.cxx \
DlgRef_2Sel2Spin1Check_QTD.cxx \
@ -79,6 +80,7 @@ dist_libDlgRef_la_SOURCES = \
DlgRef_2Sel1Spin.cxx \
DlgRef_2Sel2Spin.cxx \
DlgRef_2Sel3Spin.cxx \
DlgRef_3Sel2Spin.cxx \
DlgRef_1Sel1Spin1Check.cxx \
DlgRef_2Sel1Spin2Check.cxx \
DlgRef_2Sel2Spin1Check.cxx \
@ -113,6 +115,7 @@ MOC_FILES = \
DlgRef_2Sel1Spin_QTD_moc.cxx \
DlgRef_2Sel2Spin_QTD_moc.cxx \
DlgRef_2Sel3Spin_QTD_moc.cxx \
DlgRef_3Sel2Spin_QTD_moc.cxx \
DlgRef_2Sel3Spin2Rb_QTD_moc.cxx \
DlgRef_2Sel3Spin2Rb_moc.cxx \
DlgRef_1Sel1Spin1Check_QTD_moc.cxx \
@ -143,6 +146,7 @@ MOC_FILES = \
DlgRef_2Sel1Spin_moc.cxx \
DlgRef_2Sel2Spin_moc.cxx \
DlgRef_2Sel3Spin_moc.cxx \
DlgRef_3Sel2Spin_moc.cxx \
DlgRef_1Sel1Spin1Check_moc.cxx \
DlgRef_2Sel1Spin2Check_moc.cxx \
DlgRef_2Sel2Spin1Check_moc.cxx \
@ -179,6 +183,7 @@ salomeinclude_HEADERS = \
DlgRef_2Sel1Spin_QTD.h \
DlgRef_2Sel2Spin_QTD.h \
DlgRef_2Sel3Spin_QTD.h \
DlgRef_3Sel2Spin_QTD.h \
DlgRef_1Sel1Spin1Check_QTD.h \
DlgRef_2Sel1Spin2Check_QTD.h \
DlgRef_2Sel2Spin1Check_QTD.h \
@ -209,6 +214,7 @@ salomeinclude_HEADERS = \
DlgRef_2Sel1Spin.h \
DlgRef_2Sel2Spin.h \
DlgRef_2Sel3Spin.h \
DlgRef_3Sel2Spin.h \
DlgRef_1Sel1Spin1Check.h \
DlgRef_2Sel1Spin2Check.h \
DlgRef_2Sel2Spin1Check.h \

View File

@ -0,0 +1,262 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>DlgRef_3Sel2Spin_QTD</class>
<widget class="QWidget">
<property name="name">
<cstring>DlgRef_3Sel2Spin_QTD</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>124</width>
<height>201</height>
</rect>
</property>
<property name="caption">
<string>DlgRef_2Sel2Spin_QTD</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QGroupBox" row="0" column="0">
<property name="name">
<cstring>GroupBox1</cstring>
</property>
<property name="title">
<string></string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>11</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QLineEdit" row="0" column="2">
<property name="name">
<cstring>LineEdit1</cstring>
</property>
</widget>
<widget class="QLabel" row="0" column="0">
<property name="name">
<cstring>TextLabel1</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TL1</string>
</property>
</widget>
<widget class="QPushButton" row="0" column="1">
<property name="name">
<cstring>PushButton1</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string></string>
</property>
</widget>
<widget class="QLabel" row="1" column="0">
<property name="name">
<cstring>TextLabel2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TL2</string>
</property>
</widget>
<widget class="QLineEdit" row="1" column="2">
<property name="name">
<cstring>LineEdit2</cstring>
</property>
</widget>
<widget class="QPushButton" row="1" column="1">
<property name="name">
<cstring>PushButton2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string></string>
</property>
</widget>
<widget class="QLabel" row="2" column="0">
<property name="name">
<cstring>TextLabel3</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TL3</string>
</property>
</widget>
<widget class="QPushButton" row="2" column="1">
<property name="name">
<cstring>PushButton3</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string></string>
</property>
</widget>
<widget class="QLineEdit" row="2" column="2">
<property name="name">
<cstring>LineEdit3</cstring>
</property>
</widget>
<widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>Layout2</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QSpinBox" row="1" column="1">
<property name="name">
<cstring>SpinBox2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<widget class="QLabel" row="1" column="0">
<property name="name">
<cstring>TextLabel5</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TL5</string>
</property>
</widget>
<widget class="QLabel" row="0" column="0">
<property name="name">
<cstring>TextLabel4</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>TL4</string>
</property>
</widget>
<widget class="QSpinBox" row="0" column="1">
<property name="name">
<cstring>SpinBox1</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</grid>
</widget>
<spacer row="4" column="1">
<property name="name">
<cstring>Spacer5</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</spacer>
</grid>
</widget>
</grid>
</widget>
<tabstops>
<tabstop>PushButton1</tabstop>
<tabstop>LineEdit1</tabstop>
<tabstop>PushButton2</tabstop>
<tabstop>LineEdit2</tabstop>
<tabstop>PushButton3</tabstop>
<tabstop>LineEdit3</tabstop>
<tabstop>SpinBox1</tabstop>
<tabstop>SpinBox2</tabstop>
</tabstops>
<layoutdefaults spacing="6" margin="11"/>
</UI>

View File

@ -121,5 +121,8 @@
#uic -o DlgRef_3Sel1Check_QTD.h DlgRef_3Sel3Spin2Check_QTD.ui
#uic -o DlgRef_3Sel1Check_QTD.cxx -impl DlgRef_3Sel1Check_QTD.h DlgRef_3Sel1Check_QTD.ui>>>>>>> 1.6.2.3
uic -o DlgRef_3Sel3Spin2Check_QTD.h DlgRef_3Sel3Spin2Check_QTD.ui
uic -o DlgRef_3Sel3Spin2Check_QTD.cxx -impl DlgRef_3Sel3Spin2Check_QTD.h DlgRef_3Sel3Spin2Check_QTD.ui
#uic -o DlgRef_3Sel3Spin2Check_QTD.h DlgRef_3Sel3Spin2Check_QTD.ui
#uic -o DlgRef_3Sel3Spin2Check_QTD.cxx -impl DlgRef_3Sel3Spin2Check_QTD.h DlgRef_3Sel3Spin2Check_QTD.ui
uic -o DlgRef_3Sel2Spin_QTD.h DlgRef_3Sel2Spin_QTD.ui
uic -o DlgRef_3Sel2Spin_QTD.cxx -impl DlgRef_3Sel2Spin_QTD.h DlgRef_3Sel2Spin_QTD.ui

View File

@ -732,6 +732,14 @@ msgstr "Major radius :"
msgid "GEOM_RADIUS_MINOR"
msgstr "Minor radius :"
#Major axis
msgid "GEOM_VECTOR_MAJOR"
msgstr "Major Axis"
#Optional tag
msgid "GEOM_OPTIONAL"
msgstr "optional"
#Compound
msgid "GEOM_COMPOUND"
msgstr "Compound"

View File

@ -72,23 +72,68 @@ Standard_Integer GEOMImpl_EllipseDriver::Execute(TFunction_Logbook& log) const
TopoDS_Shape aShape;
if (aType == ELLIPSE_PNT_VEC_RR) {
// Center
Handle(GEOM_Function) aRefPoint = aCI.GetCenter();
Handle(GEOM_Function) aRefVector = aCI.GetVector();
TopoDS_Shape aShapePnt = aRefPoint->GetValue();
if (aShapePnt.ShapeType() != TopAbs_VERTEX) {
Standard_ConstructionError::Raise
("Ellipse creation aborted: invalid center argument, must be a point");
}
gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt));
// Normal
Handle(GEOM_Function) aRefVector = aCI.GetVector();
TopoDS_Shape aShapeVec = aRefVector->GetValue();
if (aShapePnt.ShapeType() == TopAbs_VERTEX &&
aShapeVec.ShapeType() == TopAbs_EDGE) {
gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt));
if (aShapeVec.ShapeType() != TopAbs_EDGE) {
Standard_ConstructionError::Raise
("Ellipse creation aborted: invalid normal vector argument, must be a vector or an edge");
}
TopoDS_Edge anE = TopoDS::Edge(aShapeVec);
TopoDS_Vertex V1, V2;
TopExp::Vertices(anE, V1, V2, Standard_True);
if (V1.IsNull() || V2.IsNull()) {
Standard_ConstructionError::Raise
("Ellipse creation aborted: invalid normal vector argument: cannot retrieve vertices");
}
gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
if (aV.Magnitude() < gp::Resolution()) {
Standard_ConstructionError::Raise
("Ellipse creation aborted: normal vector of zero length is given");
}
// Axes
gp_Ax2 anAxes (aP, aV);
// Main Axis vector (optional)
Handle(GEOM_Function) aRefVectorMaj = aCI.GetVectorMajor();
if (!aRefVectorMaj.IsNull()) {
TopoDS_Shape aShapeVec = aRefVectorMaj->GetValue();
if (aShapeVec.ShapeType() != TopAbs_EDGE) {
Standard_ConstructionError::Raise
("Ellipse creation aborted: invalid major axis vector argument, must be a vector or an edge");
}
TopoDS_Edge anE = TopoDS::Edge(aShapeVec);
TopoDS_Vertex V1, V2;
TopExp::Vertices(anE, V1, V2, Standard_True);
if (!V1.IsNull() && !V2.IsNull()) {
gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
gp_Ax2 anAxes (aP, aV);
gp_Elips anEll (anAxes, aCI.GetRMajor(), aCI.GetRMinor());
aShape = BRepBuilderAPI_MakeEdge(anEll).Edge();
if (V1.IsNull() || V2.IsNull()) {
Standard_ConstructionError::Raise
("Ellipse creation aborted: invalid major axis vector argument: cannot retrieve vertices");
}
gp_Vec aVM (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
if (aVM.Magnitude() < gp::Resolution()) {
Standard_ConstructionError::Raise
("Ellipse creation aborted: major axis vector of zero length is given");
}
if (aV.IsParallel(aVM, Precision::Angular())) {
Standard_ConstructionError::Raise
("Ellipse creation aborted: normal and major axis vectors are parallel");
}
// Axes defined with main axis vector
anAxes = gp_Ax2 (aP, aV, aVM);
}
// Ellipse
gp_Elips anEll (anAxes, aCI.GetRMajor(), aCI.GetRMinor());
aShape = BRepBuilderAPI_MakeEdge(anEll).Edge();
} else {
}

View File

@ -325,7 +325,8 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCirclePntVecR
//=============================================================================
Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeEllipse
(Handle(GEOM_Object) thePnt, Handle(GEOM_Object) theVec,
double theRMajor, double theRMinor)
double theRMajor, double theRMinor,
Handle(GEOM_Object) theVecMaj)
{
SetErrorCode(KO);
@ -354,6 +355,13 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeEllipse
aCI.SetRMajor(theRMajor);
aCI.SetRMinor(theRMinor);
// vector of major axis is optional parameter
if (!theVecMaj.IsNull()) {
Handle(GEOM_Function) aRefVecMaj = theVecMaj->GetLastFunction();
if (aRefVecMaj.IsNull()) return NULL;
aCI.SetVectorMajor(aRefVecMaj);
}
//Compute the Ellipse value
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
@ -371,8 +379,16 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeEllipse
}
//Make a Python command
GEOM::TPythonDump(aFunction) << anEll << " = geompy.MakeEllipse("
<< thePnt << ", " << theVec << ", " << theRMajor << ", " << theRMinor << ")";
//Make a Python command
if (!theVecMaj.IsNull()) {
GEOM::TPythonDump(aFunction) << anEll << " = geompy.MakeEllipse("
<< thePnt << ", " << theVec << ", " << theRMajor << ", " << theRMinor
<< ", " << theVecMaj << ")";
}
else {
GEOM::TPythonDump(aFunction) << anEll << " = geompy.MakeEllipse("
<< thePnt << ", " << theVec << ", " << theRMajor << ", " << theRMinor << ")";
}
SetErrorCode(OK);
return anEll;

View File

@ -49,7 +49,8 @@ class GEOMImpl_ICurvesOperations : public GEOM_IOperations {
Standard_EXPORT Handle(GEOM_Object) MakeEllipse (Handle(GEOM_Object) thePnt,
Handle(GEOM_Object) theVec,
double theRMajor, double theRMinor);
double theRMajor, double theRMinor,
Handle(GEOM_Object) theVecMaj);
Standard_EXPORT Handle(GEOM_Object) MakeArc (Handle(GEOM_Object) thePnt1,
Handle(GEOM_Object) thePnt2,

View File

@ -23,10 +23,11 @@
//
#include "GEOM_Function.hxx"
#define ELLIPS_ARG_CC 1
#define ELLIPS_ARG_VV 2
#define ELLIPS_ARG_RMAJ 3
#define ELLIPS_ARG_RMIN 4
#define ELLIPS_ARG_CC 1
#define ELLIPS_ARG_VV 2
#define ELLIPS_ARG_RMAJ 3
#define ELLIPS_ARG_RMIN 4
#define ELLIPS_ARG_VVMAJ 5
class GEOMImpl_IEllipse
{
@ -40,12 +41,16 @@ class GEOMImpl_IEllipse
void SetRMajor(double theR) { _func->SetReal(ELLIPS_ARG_RMAJ, theR); }
void SetRMinor(double theR) { _func->SetReal(ELLIPS_ARG_RMIN, theR); }
void SetVectorMajor(Handle(GEOM_Function) theV) { _func->SetReference(ELLIPS_ARG_VVMAJ, theV); }
Handle(GEOM_Function) GetCenter() { return _func->GetReference(ELLIPS_ARG_CC); }
Handle(GEOM_Function) GetVector() { return _func->GetReference(ELLIPS_ARG_VV); }
double GetRMajor() { return _func->GetReal(ELLIPS_ARG_RMAJ); }
double GetRMinor() { return _func->GetReal(ELLIPS_ARG_RMIN); }
Handle(GEOM_Function) GetVectorMajor() { return _func->GetReference(ELLIPS_ARG_VVMAJ); }
private:
Handle(GEOM_Function) _func;

View File

@ -173,17 +173,54 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeEllipse
if (thePnt == NULL || theVec == NULL) return aGEOMObject._retn();
//Get the reference points
//Get the arguments
Handle(GEOM_Object) aPnt = GetOperations()->GetEngine()->GetObject
(thePnt->GetStudyID(), thePnt->GetEntry());
Handle(GEOM_Object) aVec = GetOperations()->GetEngine()->GetObject
(theVec->GetStudyID(), theVec->GetEntry());
Handle(GEOM_Object) aVecMaj;
if (aPnt.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
// Make Ellipse
Handle(GEOM_Object) anObject =
GetOperations()->MakeEllipse(aPnt, aVec, theRMajor, theRMinor);
GetOperations()->MakeEllipse(aPnt, aVec, theRMajor, theRMinor, aVecMaj);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
return GetObject(anObject);
}
//=============================================================================
/*!
* MakeEllipseVec
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeEllipseVec
(GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
CORBA::Double theRMajor, double theRMinor,
GEOM::GEOM_Object_ptr theVecMaj)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
//Get the arguments
Handle(GEOM_Object) aPnt = GetOperations()->GetEngine()->GetObject
(thePnt->GetStudyID(), thePnt->GetEntry());
Handle(GEOM_Object) aVec = GetOperations()->GetEngine()->GetObject
(theVec->GetStudyID(), theVec->GetEntry());
Handle(GEOM_Object) aVecMaj;
if (!CORBA::is_nil(theVecMaj)) {
aVecMaj = GetOperations()->GetEngine()->GetObject
(theVecMaj->GetStudyID(), theVecMaj->GetEntry());
if (aVecMaj.IsNull()) return aGEOMObject._retn();
}
// Make Ellipse
Handle(GEOM_Object) anObject =
GetOperations()->MakeEllipse(aPnt, aVec, theRMajor, theRMinor, aVecMaj);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();

View File

@ -57,6 +57,11 @@ class GEOM_I_EXPORT GEOM_ICurvesOperations_i :
GEOM::GEOM_Object_ptr theVector,
double theRMajor, double theRMinor);
GEOM::GEOM_Object_ptr MakeEllipseVec (GEOM::GEOM_Object_ptr theCenter,
GEOM::GEOM_Object_ptr theVector,
double theRMajor, double theRMinor,
GEOM::GEOM_Object_ptr theVectorMajor);
GEOM::GEOM_Object_ptr MakeArc (GEOM::GEOM_Object_ptr thePnt1,
GEOM::GEOM_Object_ptr thePnt2,
GEOM::GEOM_Object_ptr thePnt3);

View File

@ -2412,6 +2412,23 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeEllipse (GEOM::GEOM_Object_ptr theCente
return anObj;
}
//=============================================================================
// MakeEllipseVec:
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeEllipseVec (GEOM::GEOM_Object_ptr theCenter,
GEOM::GEOM_Object_ptr theVector,
CORBA::Double theRMajor,
CORBA::Double theRMinor,
GEOM::GEOM_Object_ptr theVectorMajor)
{
beginService( " GEOM_Superv_i::MakeEllipseVec" );
MESSAGE("GEOM_Superv_i::MakeEllipseVec");
getCurvesOp();
GEOM::GEOM_Object_ptr anObj = myCurvesOp->MakeEllipseVec(theCenter, theVector, theRMajor, theRMinor, theVectorMajor);
endService( " GEOM_Superv_i::MakeEllipseVec" );
return anObj;
}
//=============================================================================
// MakeArc:
//=============================================================================

View File

@ -530,6 +530,10 @@ public:
GEOM::GEOM_Object_ptr MakeEllipse (GEOM::GEOM_Object_ptr theCenter,
GEOM::GEOM_Object_ptr theVector,
CORBA::Double theRMajor, CORBA::Double theRMinor);
GEOM::GEOM_Object_ptr MakeEllipseVec (GEOM::GEOM_Object_ptr theCenter,
GEOM::GEOM_Object_ptr theVector,
CORBA::Double theRMajor, CORBA::Double theRMinor,
GEOM::GEOM_Object_ptr theVectorMajor);
GEOM::GEOM_Object_ptr MakeArc (GEOM::GEOM_Object_ptr thePnt1,
GEOM::GEOM_Object_ptr thePnt2,
GEOM::GEOM_Object_ptr thePnt3);

View File

@ -534,12 +534,17 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theVec Vector, normal to the plane of the ellipse.
# @param theRMajor Major ellipse radius.
# @param theRMinor Minor ellipse radius.
# @param theVecMaj Vector, direction of the ellipse's main axis.
# @return New GEOM_Object, containing the created ellipse.
#
# @ref tui_creation_ellipse "Example"
def MakeEllipse(self,thePnt, theVec, theRMajor, theRMinor):
def MakeEllipse(self,thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
# Example: see GEOM_TestAll.py
anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
if theVecMaj is not None:
anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
else:
anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
pass
RaiseIfFailed("MakeEllipse", self.CurvesOp)
return anObj