Changes for bug NPAL15938.

This commit is contained in:
skl 2008-04-03 12:16:58 +00:00
parent b2eb7cce8a
commit 418e3b6999
24 changed files with 882 additions and 10 deletions

View File

@ -287,6 +287,18 @@ module GEOM
GEOM_Object MakePointOnCurve (in GEOM_Object theRefCurve,
in double theParameter);
/*!
* Create a point, corresponding to the given parameters on the
* given surface.
* \param theRefSurf The referenced surface.
* \param theUParameter Value of U-parameter on the referenced surface.
* \param theVParameter Value of V-parameter on the referenced surface.
* \return New GEOM_Object, containing the created point.
*/
GEOM_Object MakePointOnSurface (in GEOM_Object theRefSurf,
in double theUParameter,
in double theVParameter);
/*!
* Create a point, on two lines intersection.
* \param theRefLine1, theRefLine2 The referenced lines.
@ -2543,6 +2555,59 @@ module GEOM
* Get point coordinates
*/
void PointCoordinates (in GEOM_Object theShape, out double X, out double Y, out double Z);
/*!
* Get radius of curvature of curve in the point determinated by param
* \param theShape - curve.
* \param theParam - parameter on curve
* \return Value of curvature.
*/
double CurveCurvatureByParam (in GEOM_Object theShape, in double theParam);
/*!
* Get radius of curvature of curve in the given point
* \param theShape - curve.
* \param thePoint - point
* \return Value of curvature.
*/
double CurveCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
/*!
* Get max radius of curvature of surface in the point determinated by params
* \param theShape - surface.
* \param theUParam - U-parameter on surface
* \param theVParam - V-parameter on surface
* \return Value of curvature.
*/
double MaxSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam,
in double theVParam);
/*!
* Get max radius of curvature of surface in the given point
* \param theShape - surface.
* \param thePoint - point
* \return Value of curvature.
*/
double MaxSurfaceCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
/*!
* Get min radius of curvature of surface in the point determinated by params
* \param theShape - surface.
* \param theUParam - U-parameter on surface
* \param theVParam - V-parameter on surface
* \return Value of curvature.
*/
double MinSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam,
in double theVParam);
/*!
* Get min radius of curvature of surface in the given point
* \param theShape - surface.
* \param thePoint - point
* \return Value of curvature.
*/
double MinSurfaceCurvatureByPoint (in GEOM_Object theShape, in GEOM_Object thePoint);
};

View File

@ -118,6 +118,7 @@ planeworkingvector.png \
planeworkingorigin.png \
point2.png \
pointonedge.png \
pointonface.png \
point_line_intersection.png \
polyline.png \
prism.png \

BIN
resources/pointonface.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

View File

@ -68,6 +68,7 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren
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")));
QPixmap image5(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT_FACE")));
setCaption(tr("GEOM_POINT_TITLE"));
@ -82,6 +83,8 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren
RadioButton3->setPixmap(image1);
RadioButton4->show();
RadioButton4->setPixmap(image4);
RadioButton5->show();
RadioButton5->setPixmap(image5);
GroupXYZ = new DlgRef_3Spin( aFrame, "GroupXYZ" );
GroupXYZ->GroupBox1->setTitle(tr("GEOM_COORDINATES"));
@ -95,6 +98,13 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren
GroupOnCurve->TextLabel2->setText(tr("GEOM_PARAMETER"));
GroupOnCurve->PushButton1->setPixmap(image2);
GroupOnSurface = new DlgRef_1Sel2Spin( aFrame, "GroupOnSurface" );
GroupOnSurface->GroupBox1->setTitle(tr("GEOM_PARAM_POINT"));
GroupOnSurface->TextLabel1->setText(tr("GEOM_FACE"));
GroupOnSurface->TextLabel2->setText(tr("GEOM_UPARAMETER"));
GroupOnSurface->TextLabel3->setText(tr("GEOM_VPARAMETER"));
GroupOnSurface->PushButton1->setPixmap(image2);
GroupRefPoint = new DlgRef_1Sel3Spin( aFrame, "GoupRefPoint" );
GroupRefPoint->GroupBox1->setTitle(tr("GEOM_REF_POINT"));
GroupRefPoint->TextLabel1->setText(tr("GEOM_POINT"));
@ -156,6 +166,7 @@ BasicGUI_PointDlg::~BasicGUI_PointDlg()
void BasicGUI_PointDlg::Init()
{
GroupOnCurve->LineEdit1->setReadOnly( true );
GroupOnSurface->LineEdit1->setReadOnly( true );
GroupRefPoint->LineEdit1->setReadOnly( true );
GroupLineIntersection->LineEdit1->setReadOnly( true );
GroupLineIntersection->LineEdit2->setReadOnly( true );
@ -188,6 +199,11 @@ void BasicGUI_PointDlg::Init()
GroupOnCurve->SpinBox_DX->RangeStepAndValidator(0., 1., step, DBL_DIGITS_DISPLAY);
GroupOnCurve->SpinBox_DX->SetValue( 0.5 );
GroupOnSurface->SpinBox_DX->RangeStepAndValidator(0., 1., step, DBL_DIGITS_DISPLAY);
GroupOnSurface->SpinBox_DX->SetValue( 0.5 );
GroupOnSurface->SpinBox_DY->RangeStepAndValidator(0., 1., step, DBL_DIGITS_DISPLAY);
GroupOnSurface->SpinBox_DY->SetValue( 0.5 );
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
@ -199,12 +215,16 @@ void BasicGUI_PointDlg::Init()
connect(GroupOnCurve->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupOnCurve->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
connect(GroupOnSurface->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(GroupOnSurface->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(GroupOnSurface->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(GroupOnSurface->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(GroupXYZ->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(GroupXYZ->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(GroupXYZ->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
@ -214,6 +234,10 @@ void BasicGUI_PointDlg::Init()
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
GroupOnCurve->SpinBox_DX, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
GroupOnSurface->SpinBox_DX, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
GroupOnSurface->SpinBox_DY, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
GroupXYZ->SpinBox_DX, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
@ -253,6 +277,7 @@ void BasicGUI_PointDlg::ConstructorsClicked (int constructorId)
GroupOnCurve->hide();
GroupLineIntersection->hide();
GroupXYZ->show();
GroupOnSurface->hide();
myCoordGrp->hide();
break;
}
@ -268,6 +293,7 @@ void BasicGUI_PointDlg::ConstructorsClicked (int constructorId)
GroupOnCurve->hide();
GroupRefPoint->show();
GroupLineIntersection->hide();
GroupOnSurface->hide();
myCoordGrp->show();
break;
}
@ -283,6 +309,7 @@ void BasicGUI_PointDlg::ConstructorsClicked (int constructorId)
GroupRefPoint->hide();
GroupOnCurve->show();
GroupLineIntersection->hide();
GroupOnSurface->hide();
myCoordGrp->show();
break;
}
@ -300,9 +327,26 @@ void BasicGUI_PointDlg::ConstructorsClicked (int constructorId)
GroupRefPoint->hide();
GroupOnCurve->hide();
GroupLineIntersection->show();
GroupOnSurface->hide();
myCoordGrp->hide();
break;
}
case 4:
{
myEditCurrentArgument = GroupOnSurface->LineEdit1;
myEditCurrentArgument->setText("");
myFace = GEOM::GEOM_Object::_nil();
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE);
GroupXYZ->hide();
GroupRefPoint->hide();
GroupOnCurve->hide();
GroupLineIntersection->hide();
GroupOnSurface->show();
myCoordGrp->show();
break;
}
}
myX->setText( "" );
@ -357,13 +401,13 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
{
const int id = getConstructorId();
if ((id == 1 || id == 2) && myEditCurrentArgument != 0)
if ((id == 1 || id == 2 || id == 4 ) && myEditCurrentArgument != 0)
{
myEditCurrentArgument->setText("");
myX->setText( "" );
myY->setText( "" );
myZ->setText( "" );
myRefPoint = myEdge = GEOM::GEOM_Object::_nil();
myRefPoint = myEdge = myFace = GEOM::GEOM_Object::_nil();
}
if (IObjectCount() == 1)
@ -381,6 +425,8 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
if (id == 2 || id == 3)
aNeedType = TopAbs_EDGE;
if(id == 4)
aNeedType = TopAbs_FACE;
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
@ -442,6 +488,11 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
myEditCurrentArgument->setText(aName);
}
}
else if (id == 4)
{
myFace = aSelectedObject;
GroupOnSurface->LineEdit1->setText(aName);
}
}
}
@ -488,6 +539,13 @@ void BasicGUI_PointDlg::SetEditCurrentArgument()
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
else if ( send == GroupOnSurface->PushButton1 )
{
GroupOnSurface->LineEdit1->setFocus();
myEditCurrentArgument = GroupOnSurface->LineEdit1;
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
}
else if ( send == GroupLineIntersection->PushButton1 )
{
GroupLineIntersection->LineEdit1->setFocus();
@ -553,6 +611,27 @@ double BasicGUI_PointDlg::getParameter() const
return GroupOnCurve->SpinBox_DX->GetValue();
}
//=================================================================================
// funcion : getUParameter()
// purpose :
//=================================================================================
double BasicGUI_PointDlg::getUParameter() const
{
return GroupOnSurface->SpinBox_DX->GetValue();
}
//=================================================================================
// funcion : getVParameter()
// purpose :
//=================================================================================
double BasicGUI_PointDlg::getVParameter() const
{
return GroupOnSurface->SpinBox_DY->GetValue();
}
//=================================================================================
// function : OnPointSelected
// purpose :
@ -593,6 +672,8 @@ bool BasicGUI_PointDlg::isValid( QString& msg )
return !myEdge->_is_nil();
else if ( id == 3)
return ( !myLine1->_is_nil() && !myLine2->_is_nil() );
else if ( id == 4 )
return !myFace->_is_nil();
return false;
}
@ -639,6 +720,11 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
MakePointOnLinesIntersection( myLine1, myLine2 );
res = true;
break;
case 4 :
anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
MakePointOnSurface( myFace, getUParameter(), getVParameter() );
res = true;
break;
}
if ( getConstructorId() == 1 || getConstructorId() == 2 )
@ -685,7 +771,7 @@ void BasicGUI_PointDlg::addSubshapesToStudy()
{
QMap<QString, GEOM::GEOM_Object_var> objMap;
switch (getConstructorId())
switch (getConstructorId())
{
case 0:
break;
@ -699,6 +785,9 @@ switch (getConstructorId())
objMap[GroupLineIntersection->LineEdit1->text()] = myLine1;
objMap[GroupLineIntersection->LineEdit2->text()] = myLine2;
break;
case 4:
objMap[GroupOnSurface->LineEdit1->text()] = myFace;
break;
}
addSubshapesToFather( objMap );
}

View File

@ -35,6 +35,7 @@
#include "DlgRef_3Spin.h"
#include "DlgRef_2Sel_QTD.h"
#include "DlgRef_1Sel3Spin.h"
#include "DlgRef_1Sel2Spin.h"
class QLineEdit;
class QGroupBox;
@ -68,8 +69,11 @@ private :
void Init();
void enterEvent(QEvent* e);
double getParameter() const;
double getUParameter() const;
double getVParameter() const;
GEOM::GEOM_Object_var myEdge;
GEOM::GEOM_Object_var myFace;
GEOM::GEOM_Object_var myRefPoint;
GEOM::GEOM_Object_var myLine1;
GEOM::GEOM_Object_var myLine2;
@ -78,6 +82,7 @@ private :
DlgRef_1Sel3Spin* GroupRefPoint;
DlgRef_1Sel1Spin* GroupOnCurve;
DlgRef_2Sel_QTD* GroupLineIntersection;
DlgRef_1Sel2Spin* GroupOnSurface;
QGroupBox* myCoordGrp;
QLineEdit* myX;

View File

@ -1,7 +1,7 @@
/****************************************************************************
** Form implementation generated from reading ui file 'DlgRef_Skeleton_QTD.ui'
**
** Created: Wed Mar 26 12:14:14 2008
** Created: Wed Apr 2 16:42:12 2008
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
@ -60,6 +60,9 @@ DlgRef_Skeleton_QTD::DlgRef_Skeleton_QTD( QWidget* parent, const char* name, boo
RadioButton4 = new QRadioButton( GroupConstructors, "RadioButton4" );
Layout2->addWidget( RadioButton4 );
RadioButton5 = new QRadioButton( GroupConstructors, "RadioButton5" );
Layout2->addWidget( RadioButton5 );
GroupConstructorsLayout->addLayout( Layout2 );
Layout1->addWidget( GroupConstructors, 0, 0 );

View File

@ -1,7 +1,7 @@
/****************************************************************************
** Form interface generated from reading ui file 'DlgRef_Skeleton_QTD.ui'
**
** Created: Wed Mar 26 12:14:12 2008
** Created: Wed Apr 2 16:42:12 2008
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
@ -38,6 +38,7 @@ public:
QRadioButton* RadioButton2;
QRadioButton* RadioButton3;
QRadioButton* RadioButton4;
QRadioButton* RadioButton5;
QGroupBox* GroupBoxName;
QLabel* NameLabel;
QLineEdit* ResultName;

View File

@ -103,6 +103,11 @@
<cstring>RadioButton4</cstring>
</property>
</widget>
<widget class="QRadioButton">
<property name="name">
<cstring>RadioButton5</cstring>
</property>
</widget>
</hbox>
</widget>
</hbox>
@ -145,6 +150,7 @@
<cstring>ResultName</cstring>
</property>
</widget>
</grid>
</widget>
</grid>

View File

@ -113,6 +113,7 @@ void GEOMBase_Skeleton::Init()
/* displays Dialog */
RadioButton1->setChecked(TRUE);
RadioButton4->hide();
RadioButton5->hide();
CheckBoxRestoreSS->setChecked(FALSE);
GroupBoxPublish->hide();

View File

@ -185,6 +185,10 @@ msgstr "point3.png"
msgid "ICON_DLG_POINT_EDGE"
msgstr "pointonedge.png"
#PointDlg
msgid "ICON_DLG_POINT_FACE"
msgstr "pointonface.png"
#PoinDlg
msgid "ICON_DLG_POINT_LINES"
msgstr "point_line_intersection.png"

View File

@ -790,6 +790,10 @@ msgstr "Imported_Shape"
#Parameter
msgid "GEOM_PARAMETER"
msgstr "Parameter :"
msgid "GEOM_UPARAMETER"
msgstr "U-parameter :"
msgid "GEOM_VPARAMETER"
msgstr "V-parameter :"
#
#==============================================================================

View File

@ -722,6 +722,10 @@ msgstr "Wire(s)"
#Parameter
msgid "GEOM_PARAMETER"
msgstr "Paramètre :"
msgid "GEOM_UPARAMETER"
msgstr "U-paramètre :"
msgid "GEOM_VPARAMETER"
msgstr "V-paramètre :"
#

View File

@ -231,6 +231,64 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurve
return aPoint;
}
//=============================================================================
/*!
* MakePointOnSurface
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnSurface
(Handle(GEOM_Object) theSurface, double theUParameter, double theVParameter)
{
SetErrorCode(KO);
if (theSurface.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_SURFACE_PAR);
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_PointDriver::GetID()) return NULL;
GEOMImpl_IPoint aPI (aFunction);
Handle(GEOM_Function) aRefFunction = theSurface->GetLastFunction();
if (aRefFunction.IsNull()) return NULL;
aPI.SetSurface(aRefFunction);
aPI.SetParameter(theUParameter);
aPI.SetParameter2(theVParameter);
//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.MakeVertexOnSurface("
<< theSurface << ", " << theUParameter
<< ", " << theVParameter << ")";
SetErrorCode(OK);
return aPoint;
}
//=============================================================================
/*!
* MakePointOnLinesIntersection

View File

@ -44,6 +44,10 @@ class GEOMImpl_IBasicOperations : public GEOM_IOperations {
Standard_EXPORT Handle(GEOM_Object) MakePointOnLinesIntersection
(Handle(GEOM_Object) theLine1, Handle(GEOM_Object) theLine2);
Standard_EXPORT Handle(GEOM_Object) MakePointOnSurface (Handle(GEOM_Object) theSurface,
double theUParameter,
double theVParameter);
// Vector
Standard_EXPORT Handle(GEOM_Object) MakeVectorDXDYDZ (double theDX, double theDY, double theDZ);

View File

@ -87,6 +87,12 @@
#include <gp_Pln.hxx>
#include <gp_Lin.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <ShapeAnalysis.hxx>
#include <ShapeAnalysis_Surface.hxx>
#include <GeomLProp_CLProps.hxx>
#include <GeomLProp_SLProps.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
@ -1467,6 +1473,317 @@ Standard_Real GEOMImpl_IMeasureOperations::GetAngle (Handle(GEOM_Object) theLine
return anAngle;
}
//=============================================================================
/*!
* CurveCurvatureByParam
*/
//=============================================================================
Standard_Real GEOMImpl_IMeasureOperations::CurveCurvatureByParam
(Handle(GEOM_Object) theCurve, Standard_Real& theParam)
{
SetErrorCode(KO);
Standard_Real aRes = -1.0;
if(theCurve.IsNull()) return aRes;
Handle(GEOM_Function) aRefShape = theCurve->GetLastFunction();
if(aRefShape.IsNull()) return aRes;
TopoDS_Shape aShape = aRefShape->GetValue();
if(aShape.IsNull()) {
SetErrorCode("One of Objects has NULL Shape");
return aRes;
}
Standard_Real aFP, aLP, aP;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(TopoDS::Edge(aShape), aFP, aLP);
aP = aFP + (aLP - aFP) * theParam;
if(aCurve.IsNull()) return aRes;
//Compute curvature
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
GeomLProp_CLProps Prop = GeomLProp_CLProps
(aCurve, aP, 2, Precision::Confusion());
aRes = fabs(Prop.Curvature());
SetErrorCode(OK);
}
catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return aRes;
}
if( aRes > Precision::Confusion() )
aRes = 1/aRes;
else
aRes = RealLast();
return aRes;
}
//=============================================================================
/*!
* CurveCurvatureByPoint
*/
//=============================================================================
Standard_Real GEOMImpl_IMeasureOperations::CurveCurvatureByPoint
(Handle(GEOM_Object) theCurve, Handle(GEOM_Object) thePoint)
{
SetErrorCode(KO);
Standard_Real aRes = -1.0;
if( theCurve.IsNull() || thePoint.IsNull() ) return aRes;
Handle(GEOM_Function) aRefCurve = theCurve->GetLastFunction();
Handle(GEOM_Function) aRefPoint = thePoint->GetLastFunction();
if( aRefCurve.IsNull() || aRefPoint.IsNull() ) return aRes;
TopoDS_Edge anEdge = TopoDS::Edge(aRefCurve->GetValue());
TopoDS_Vertex aPnt = TopoDS::Vertex(aRefPoint->GetValue());
if( anEdge.IsNull() || aPnt.IsNull() ) {
SetErrorCode("One of Objects has NULL Shape");
return aRes;
}
Standard_Real aFP, aLP;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aFP, aLP);
if(aCurve.IsNull()) return aRes;
gp_Pnt aPoint = BRep_Tool::Pnt(aPnt);
//Compute curvature
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
GeomAPI_ProjectPointOnCurve PPC(aPoint, aCurve, aFP, aLP);
if(PPC.NbPoints()>0) {
GeomLProp_CLProps Prop = GeomLProp_CLProps
(aCurve, PPC.LowerDistanceParameter(), 2, Precision::Confusion());
aRes = fabs(Prop.Curvature());
SetErrorCode(OK);
}
}
catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return aRes;
}
if( aRes > Precision::Confusion() )
aRes = 1/aRes;
else
aRes = RealLast();
return aRes;
}
//=============================================================================
/*!
* getSurfaceCurvatures
*/
//=============================================================================
Standard_Real GEOMImpl_IMeasureOperations::getSurfaceCurvatures
(const Handle(Geom_Surface)& aSurf,
Standard_Real theUParam,
Standard_Real theVParam,
Standard_Boolean theNeedMaxCurv)
{
SetErrorCode(KO);
Standard_Real aRes = 1.0;
if (aSurf.IsNull()) return aRes;
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
GeomLProp_SLProps Prop = GeomLProp_SLProps
(aSurf, theUParam, theVParam, 2, Precision::Confusion());
if(Prop.IsCurvatureDefined()) {
if(Prop.IsUmbilic()) {
//cout<<"is umbilic"<<endl;
aRes = fabs(Prop.MeanCurvature());
}
else {
//cout<<"is not umbilic"<<endl;
double c1 = fabs(Prop.MaxCurvature());
double c2 = fabs(Prop.MinCurvature());
if(theNeedMaxCurv)
aRes = Max(c1,c2);
else
aRes = Min(c1,c2);
}
SetErrorCode(OK);
}
}
catch (Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
SetErrorCode(aFail->GetMessageString());
return aRes;
}
if( fabs(aRes) > Precision::Confusion() )
aRes = 1/aRes;
else
aRes = RealLast();
return aRes;
}
//=============================================================================
/*!
* MaxSurfaceCurvatureByParam
*/
//=============================================================================
Standard_Real GEOMImpl_IMeasureOperations::MaxSurfaceCurvatureByParam
(Handle(GEOM_Object) theSurf,
Standard_Real& theUParam,
Standard_Real& theVParam)
{
SetErrorCode(KO);
Standard_Real aRes = -1.0;
if (theSurf.IsNull()) return aRes;
Handle(GEOM_Function) aRefShape = theSurf->GetLastFunction();
if(aRefShape.IsNull()) return aRes;
TopoDS_Shape aShape = aRefShape->GetValue();
if(aShape.IsNull()) {
SetErrorCode("One of Objects has NULL Shape");
return aRes;
}
TopoDS_Face F = TopoDS::Face(aShape);
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(F);
//Compute the parameters
Standard_Real U1,U2,V1,V2;
ShapeAnalysis::GetFaceUVBounds(F,U1,U2,V1,V2);
Standard_Real U = U1 + (U2-U1)*theUParam;
Standard_Real V = V1 + (V2-V1)*theVParam;
return getSurfaceCurvatures(aSurf, U, V, true);
}
//=============================================================================
/*!
* MaxSurfaceCurvatureByPoint
*/
//=============================================================================
Standard_Real GEOMImpl_IMeasureOperations::MaxSurfaceCurvatureByPoint
(Handle(GEOM_Object) theSurf, Handle(GEOM_Object) thePoint)
{
SetErrorCode(KO);
Standard_Real aRes = -1.0;
if( theSurf.IsNull() || thePoint.IsNull() ) return aRes;
Handle(GEOM_Function) aRefShape = theSurf->GetLastFunction();
Handle(GEOM_Function) aRefPoint = thePoint->GetLastFunction();
if( aRefShape.IsNull() || aRefPoint.IsNull() ) return aRes;
TopoDS_Face aFace = TopoDS::Face(aRefShape->GetValue());
TopoDS_Vertex aPnt = TopoDS::Vertex(aRefPoint->GetValue());
if( aFace.IsNull() || aPnt.IsNull() ) {
SetErrorCode("One of Objects has NULL Shape");
return 0;
}
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace);
if(aSurf.IsNull()) return aRes;
gp_Pnt aPoint = BRep_Tool::Pnt(aPnt);
//Compute the parameters
ShapeAnalysis_Surface sas(aSurf);
gp_Pnt2d UV = sas.ValueOfUV(aPoint,Precision::Confusion());
return getSurfaceCurvatures(aSurf, UV.X(), UV.Y(), true);
}
//=============================================================================
/*!
* MinSurfaceCurvatureByParam
*/
//=============================================================================
Standard_Real GEOMImpl_IMeasureOperations::MinSurfaceCurvatureByParam
(Handle(GEOM_Object) theSurf,
Standard_Real& theUParam,
Standard_Real& theVParam)
{
SetErrorCode(KO);
Standard_Real aRes = -1.0;
if (theSurf.IsNull()) return aRes;
Handle(GEOM_Function) aRefShape = theSurf->GetLastFunction();
if(aRefShape.IsNull()) return aRes;
TopoDS_Shape aShape = aRefShape->GetValue();
if(aShape.IsNull()) {
SetErrorCode("One of Objects has NULL Shape");
return aRes;
}
TopoDS_Face F = TopoDS::Face(aShape);
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(F);
//Compute the parameters
Standard_Real U1,U2,V1,V2;
ShapeAnalysis::GetFaceUVBounds(F,U1,U2,V1,V2);
Standard_Real U = U1 + (U2-U1)*theUParam;
Standard_Real V = V1 + (V2-V1)*theVParam;
return getSurfaceCurvatures(aSurf, U, V, false);
}
//=============================================================================
/*!
* MinSurfaceCurvatureByPoint
*/
//=============================================================================
Standard_Real GEOMImpl_IMeasureOperations::MinSurfaceCurvatureByPoint
(Handle(GEOM_Object) theSurf, Handle(GEOM_Object) thePoint)
{
SetErrorCode(KO);
Standard_Real aRes = -1.0;
if( theSurf.IsNull() || thePoint.IsNull() ) return aRes;
Handle(GEOM_Function) aRefShape = theSurf->GetLastFunction();
Handle(GEOM_Function) aRefPoint = thePoint->GetLastFunction();
if( aRefShape.IsNull() || aRefPoint.IsNull() ) return aRes;
TopoDS_Face aFace = TopoDS::Face(aRefShape->GetValue());
TopoDS_Vertex aPnt = TopoDS::Vertex(aRefPoint->GetValue());
if( aFace.IsNull() || aPnt.IsNull() ) {
SetErrorCode("One of Objects has NULL Shape");
return 0;
}
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace);
if(aSurf.IsNull()) return aRes;
gp_Pnt aPoint = BRep_Tool::Pnt(aPnt);
//Compute the parameters
ShapeAnalysis_Surface sas(aSurf);
gp_Pnt2d UV = sas.ValueOfUV(aPoint,Precision::Confusion());
return getSurfaceCurvatures(aSurf, UV.X(), UV.Y(), false);
}
//=======================================================================
//function : StructuralDump
//purpose : Structural (data exchange) style of output.
@ -1709,6 +2026,7 @@ void GEOMImpl_IMeasureOperations::StructuralDump (const BRepCheck_Analyzer& theA
}
}
//=======================================================================
//function : GetProblemShapes
// purpose : for StructuralDump

View File

@ -31,6 +31,7 @@
#include <TColStd_HSequenceOfInteger.hxx>
#include <TColStd_HSequenceOfReal.hxx>
#include <gp_Ax3.hxx>
#include <Geom_Surface.hxx>
class GEOM_Engine;
class Handle(GEOM_Object);
@ -130,6 +131,24 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
Standard_EXPORT Standard_Real GetAngle (Handle(GEOM_Object) theLine1, Handle(GEOM_Object) theLine2);
// Methods for recieving radiuses of curvature of curves and surfaces
// in the given point
Standard_EXPORT Standard_Real CurveCurvatureByParam (Handle(GEOM_Object) theCurve,
Standard_Real& theParam);
Standard_EXPORT Standard_Real CurveCurvatureByPoint (Handle(GEOM_Object) theCurve,
Handle(GEOM_Object) thePoint);
Standard_EXPORT Standard_Real MaxSurfaceCurvatureByParam (Handle(GEOM_Object) theSurf,
Standard_Real& theUParam,
Standard_Real& theVParam);
Standard_EXPORT Standard_Real MaxSurfaceCurvatureByPoint (Handle(GEOM_Object) theSurf,
Handle(GEOM_Object) thePoint);
Standard_EXPORT Standard_Real MinSurfaceCurvatureByParam (Handle(GEOM_Object) theSurf,
Standard_Real& theUParam,
Standard_Real& theVParam);
Standard_EXPORT Standard_Real MinSurfaceCurvatureByPoint (Handle(GEOM_Object) theSurf,
Handle(GEOM_Object) thePoint);
public:
Standard_EXPORT static gp_Ax3 GetPosition (const TopoDS_Shape& theShape);
@ -150,6 +169,11 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
Handle(TColStd_HArray1OfInteger)& NbProblems,
const TopAbs_ShapeEnum Subtype,
TopTools_DataMapOfShapeListOfShape& theMap);
Standard_Real getSurfaceCurvatures (const Handle(Geom_Surface)& aSurf,
Standard_Real theUParam,
Standard_Real theVParam,
Standard_Boolean theNeedMaxCurv);
};
#endif

View File

@ -33,6 +33,9 @@
#define ARG_LINE1 7
#define ARG_LINE2 8
#define ARG_SURFACE 9
#define ARG_PARAM2 10
class GEOMImpl_IPoint
{
public:
@ -52,16 +55,20 @@ class GEOMImpl_IPoint
Handle(GEOM_Function) GetRef() { return _func->GetReference(ARG_REF); }
void SetCurve(Handle(GEOM_Function) theRef) { _func->SetReference(ARG_CURVE, theRef); }
void SetSurface(Handle(GEOM_Function) theRef) { _func->SetReference(ARG_SURFACE, 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) GetSurface() { return _func->GetReference(ARG_SURFACE); }
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); }
void SetParameter2(double theParam) { _func->SetReal(ARG_PARAM2, theParam); }
double GetParameter() { return _func->GetReal(ARG_PARAM); }
double GetParameter2() { return _func->GetReal(ARG_PARAM2); }
private:

View File

@ -36,7 +36,11 @@
#include <TopoDS_Vertex.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS_Face.hxx>
#include <ShapeAnalysis.hxx>
//=======================================================================
//function : GetID
@ -57,6 +61,7 @@ GEOMImpl_PointDriver::GEOMImpl_PointDriver()
{
}
//=======================================================================
//function : Execute
//purpose :
@ -74,7 +79,8 @@ Standard_Integer GEOMImpl_PointDriver::Execute(TFunction_Logbook& log) const
if (aType == POINT_XYZ) {
aPnt = gp_Pnt(aPI.GetX(), aPI.GetY(), aPI.GetZ());
} else if (aType == POINT_XYZ_REF) {
}
else if (aType == POINT_XYZ_REF) {
Handle(GEOM_Function) aRefPoint = aPI.GetRef();
TopoDS_Shape aRefShape = aRefPoint->GetValue();
@ -85,8 +91,8 @@ Standard_Integer GEOMImpl_PointDriver::Execute(TFunction_Logbook& log) const
gp_Pnt P = BRep_Tool::Pnt(TopoDS::Vertex(aRefShape));
aPnt = gp_Pnt(P.X() + aPI.GetX(), P.Y() + aPI.GetY(), P.Z() + aPI.GetZ());
} else if (aType == POINT_CURVE_PAR) {
}
else if (aType == POINT_CURVE_PAR) {
Handle(GEOM_Function) aRefCurve = aPI.GetCurve();
TopoDS_Shape aRefShape = aRefCurve->GetValue();
if (aRefShape.ShapeType() != TopAbs_EDGE) {
@ -97,8 +103,24 @@ Standard_Integer GEOMImpl_PointDriver::Execute(TFunction_Logbook& log) const
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(TopoDS::Edge(aRefShape), aFP, aLP);
aP = aFP + (aLP - aFP) * aPI.GetParameter();
aPnt = aCurve->Value(aP);
} else if (aType == POINT_LINES_INTERSECTION) {
}
else if (aType == POINT_SURFACE_PAR) {
Handle(GEOM_Function) aRefCurve = aPI.GetSurface();
TopoDS_Shape aRefShape = aRefCurve->GetValue();
if (aRefShape.ShapeType() != TopAbs_FACE) {
Standard_TypeMismatch::Raise
("Point On Surface creation aborted : surface shape is not a face");
}
TopoDS_Face F = TopoDS::Face(aRefShape);
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(F);
Standard_Real U1,U2,V1,V2;
//aSurf->Bounds(U1,U2,V1,V2);
ShapeAnalysis::GetFaceUVBounds(F,U1,U2,V1,V2);
Standard_Real U = U1 + (U2-U1) * aPI.GetParameter();
Standard_Real V = V1 + (V2-V1) * aPI.GetParameter2();
aPnt = aSurf->Value(U,V);
}
else if (aType == POINT_LINES_INTERSECTION) {
Handle(GEOM_Function) aRef1 = aPI.GetLine1();
Handle(GEOM_Function) aRef2 = aPI.GetLine2();

View File

@ -98,6 +98,7 @@
#define POINT_XYZ_REF 2
#define POINT_CURVE_PAR 3
#define POINT_LINES_INTERSECTION 4
#define POINT_SURFACE_PAR 5
//#define POINT_FACE_PAR 5
#define VECTOR_TWO_PNT 1

View File

@ -138,6 +138,7 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnLinesIntersection
return GetObject(anObject);
}
//=============================================================================
/*!
* MakePointOnCurve
@ -169,6 +170,39 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurve
return GetObject(anObject);
}
//=============================================================================
/*!
* MakePointOnSurface
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnSurface
(GEOM::GEOM_Object_ptr theSurface,
CORBA::Double theUParameter,
CORBA::Double theVParameter)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
if (theSurface == NULL) return aGEOMObject._retn();
//Get the reference surface
Handle(GEOM_Object) aRefernce = GetOperations()->GetEngine()->GetObject
(theSurface->GetStudyID(), theSurface->GetEntry());
if (aRefernce.IsNull()) return aGEOMObject._retn();
//Create the point
Handle(GEOM_Object) anObject =
GetOperations()->MakePointOnSurface(aRefernce, theUParameter, theVParameter);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
return GetObject(anObject);
}
//=============================================================================
/*!
* MakeTangentOnCurve

View File

@ -53,6 +53,10 @@ class GEOM_I_EXPORT GEOM_IBasicOperations_i :
GEOM::GEOM_Object_ptr MakePointOnCurve (GEOM::GEOM_Object_ptr theCurve,
CORBA::Double theParameter);
GEOM::GEOM_Object_ptr MakePointOnSurface (GEOM::GEOM_Object_ptr theSurface,
CORBA::Double theUParameter,
CORBA::Double theVParameter);
GEOM::GEOM_Object_ptr MakePointOnLinesIntersection (GEOM::GEOM_Object_ptr theLine1,
GEOM::GEOM_Object_ptr theLine2);

View File

@ -473,3 +473,151 @@ CORBA::Double GEOM_IMeasureOperations_i::GetAngle (GEOM::GEOM_Object_ptr theShap
// Get the angle
return GetOperations()->GetAngle(aShape1, aShape2);
}
//=============================================================================
/*!
* CurveCurvatureByParam
*/
//=============================================================================
CORBA::Double GEOM_IMeasureOperations_i::CurveCurvatureByParam
(GEOM::GEOM_Object_ptr theCurve, CORBA::Double theParam)
{
//Set a not done flag
GetOperations()->SetNotDone();
if(theCurve==NULL) return -1.0;
//Get the reference shape
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
(theCurve->GetStudyID(), theCurve->GetEntry());
if(aShape.IsNull()) return -1.0;
return GetOperations()->CurveCurvatureByParam(aShape,theParam);
}
//=============================================================================
/*!
* CurveCurvatureByPoint
*/
//=============================================================================
CORBA::Double GEOM_IMeasureOperations_i::CurveCurvatureByPoint
(GEOM::GEOM_Object_ptr theCurve, GEOM::GEOM_Object_ptr thePoint)
{
//Set a not done flag
GetOperations()->SetNotDone();
if( theCurve==NULL || thePoint==NULL ) return -1.0;
//Get the reference shape
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
(theCurve->GetStudyID(), theCurve->GetEntry());
Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
(thePoint->GetStudyID(), thePoint->GetEntry());
if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
return GetOperations()->CurveCurvatureByPoint(aShape,aPoint);
}
//=============================================================================
/*!
* MaxSurfaceCurvatureByParam
*/
//=============================================================================
CORBA::Double GEOM_IMeasureOperations_i::MaxSurfaceCurvatureByParam
(GEOM::GEOM_Object_ptr theSurf,
CORBA::Double theUParam,
CORBA::Double theVParam)
{
//Set a not done flag
GetOperations()->SetNotDone();
if(theSurf==NULL) return -1.0;
//Get the reference shape
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
(theSurf->GetStudyID(), theSurf->GetEntry());
if(aShape.IsNull()) return -1.0;
return GetOperations()->MaxSurfaceCurvatureByParam(aShape,theUParam,theVParam);
}
//=============================================================================
/*!
* MaxSurfaceCurvatureByPoint
*/
//=============================================================================
CORBA::Double GEOM_IMeasureOperations_i::MaxSurfaceCurvatureByPoint
(GEOM::GEOM_Object_ptr theSurf, GEOM::GEOM_Object_ptr thePoint)
{
//Set a not done flag
GetOperations()->SetNotDone();
if( theSurf==NULL || thePoint==NULL ) return -1.0;
//Get the reference shape
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
(theSurf->GetStudyID(), theSurf->GetEntry());
Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
(thePoint->GetStudyID(), thePoint->GetEntry());
if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
return GetOperations()->MaxSurfaceCurvatureByPoint(aShape,aPoint);
}
//=============================================================================
/*!
* MinSurfaceCurvatureByParam
*/
//=============================================================================
CORBA::Double GEOM_IMeasureOperations_i::MinSurfaceCurvatureByParam
(GEOM::GEOM_Object_ptr theSurf,
CORBA::Double theUParam,
CORBA::Double theVParam)
{
//Set a not done flag
GetOperations()->SetNotDone();
if(theSurf==NULL) return -1.0;
//Get the reference shape
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
(theSurf->GetStudyID(), theSurf->GetEntry());
if(aShape.IsNull()) return -1.0;
return GetOperations()->MinSurfaceCurvatureByParam(aShape,theUParam,theVParam);
}
//=============================================================================
/*!
* MinSurfaceCurvatureByPoint
*/
//=============================================================================
CORBA::Double GEOM_IMeasureOperations_i::MinSurfaceCurvatureByPoint
(GEOM::GEOM_Object_ptr theSurf, GEOM::GEOM_Object_ptr thePoint)
{
//Set a not done flag
GetOperations()->SetNotDone();
if( theSurf==NULL || thePoint==NULL ) return -1.0;
//Get the reference shape
Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
(theSurf->GetStudyID(), theSurf->GetEntry());
Handle(GEOM_Object) aPoint = GetOperations()->GetEngine()->GetObject
(thePoint->GetStudyID(), thePoint->GetEntry());
if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
return GetOperations()->MinSurfaceCurvatureByPoint(aShape,aPoint);
}

View File

@ -94,6 +94,28 @@ class GEOM_I_EXPORT GEOM_IMeasureOperations_i :
CORBA::Double GetAngle (GEOM::GEOM_Object_ptr theShape1,
GEOM::GEOM_Object_ptr theShape2);
// Methods for recieving radiuses of curvature of curves and surfaces
// in the given point
CORBA::Double CurveCurvatureByParam (GEOM::GEOM_Object_ptr theCurve,
CORBA::Double theParam);
CORBA::Double CurveCurvatureByPoint (GEOM::GEOM_Object_ptr theCurve,
GEOM::GEOM_Object_ptr thePoint);
CORBA::Double MaxSurfaceCurvatureByParam (GEOM::GEOM_Object_ptr theSurf,
CORBA::Double theUParam,
CORBA::Double theVParam);
CORBA::Double MaxSurfaceCurvatureByPoint (GEOM::GEOM_Object_ptr theSurf,
GEOM::GEOM_Object_ptr thePoint);
CORBA::Double MinSurfaceCurvatureByParam (GEOM::GEOM_Object_ptr theSurf,
CORBA::Double theUParam,
CORBA::Double theVParam);
CORBA::Double MinSurfaceCurvatureByPoint (GEOM::GEOM_Object_ptr theSurf,
GEOM::GEOM_Object_ptr thePoint);
::GEOMImpl_IMeasureOperations* GetOperations()
{ return (::GEOMImpl_IMeasureOperations*)GetImpl(); }
};

View File

@ -215,6 +215,19 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakePointOnCurve", self.BasicOp)
return anObj
## Create a point, corresponding to the given parameters on the
# given surface.
# @param theRefSurf The referenced surface.
# @param theUParameter Value of U-parameter on the referenced surface.
# @param theVParameter Value of V-parameter on the referenced surface.
# @return New GEOM_Object, containing the created point.
#
# Example: see GEOM_TestAll.py
def MakeVertexOnSurface(self,theRefSurf, theUParameter, theVParameter):
anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
RaiseIfFailed("MakePointOnSurface", self.BasicOp)
return anObj
## Create a point on intersection of two lines.
# @param theRefLine1, theRefLine2 The referenced lines.
# @return New GEOM_Object, containing the created point.
@ -2109,6 +2122,40 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("GetAngle", self.MeasuOp)
return anAngle
## Methods for recieving radius of curvature of curves
# in the given point
#
# Example: see GEOM_TestMeasures.py
def CurveCurvatureByParam(self, theCurve, theParam):
aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
return aCurv
def CurveCurvatureByPoint(self, theCurve, thePoint):
aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
return aCurv
## Methods for recieving max and min radius of curvature of surfaces
# in the given point
#
# Example: see GEOM_TestMeasures.py
def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
return aSurf
def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
return aSurf
def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
return aSurf
def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
return aSurf
## Get min and max tolerances of sub-shapes of theShape
# @param theShape Shape, to get tolerances of.
# @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]