0020098: EDF 899 GEOM : Point on curve/surface with X,Y,Z coordinates.

This commit is contained in:
ptv 2009-08-27 13:02:59 +00:00
parent 3d7b37578a
commit 664761d8f9
6 changed files with 170 additions and 0 deletions

View File

@ -154,6 +154,36 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurve
return GetObject(anObject);
}
//=============================================================================
/*!
* MakePointOnCurveByCoord
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurveByCoord
(GEOM::GEOM_Object_ptr theCurve,
CORBA::Double theXParameter,
CORBA::Double theYParameter,
CORBA::Double theZParameter)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
//Get the reference curve
Handle(GEOM_Object) aReference = GetObjectImpl(theCurve);
if (aReference.IsNull()) return aGEOMObject._retn();
//Create the point
Handle(GEOM_Object) anObject =
GetOperations()->MakePointOnCurveByCoord(aReference, theXParameter,
theYParameter, theZParameter);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
return GetObject(anObject);
}
//=============================================================================
/*!
* MakePointOnSurface
@ -182,6 +212,36 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnSurface
return GetObject(anObject);
}
//=============================================================================
/*!
* MakePointOnSurfaceByCoord
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnSurfaceByCoord
(GEOM::GEOM_Object_ptr theSurface,
CORBA::Double theXParameter,
CORBA::Double theYParameter,
CORBA::Double theZParameter)
{
GEOM::GEOM_Object_var aGEOMObject;
//Set a not done flag
GetOperations()->SetNotDone();
//Get the reference surface
Handle(GEOM_Object) aReference = GetObjectImpl(theSurface);
if (aReference.IsNull()) return aGEOMObject._retn();
//Create the point
Handle(GEOM_Object) anObject =
GetOperations()->MakePointOnSurfaceByCoord(aReference, theXParameter,
theYParameter, theZParameter);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
return GetObject(anObject);
}
//=============================================================================
/*!

View File

@ -54,10 +54,20 @@ class GEOM_I_EXPORT GEOM_IBasicOperations_i :
GEOM::GEOM_Object_ptr MakePointOnCurve (GEOM::GEOM_Object_ptr theCurve,
CORBA::Double theParameter);
GEOM::GEOM_Object_ptr MakePointOnCurveByCoord (GEOM::GEOM_Object_ptr theCurve,
CORBA::Double theXParameter,
CORBA::Double theYParameter,
CORBA::Double theZParameter);
GEOM::GEOM_Object_ptr MakePointOnSurface (GEOM::GEOM_Object_ptr theSurface,
CORBA::Double theUParameter,
CORBA::Double theVParameter);
GEOM::GEOM_Object_ptr MakePointOnSurfaceByCoord (GEOM::GEOM_Object_ptr theSurface,
CORBA::Double theXParameter,
CORBA::Double theYParameter,
CORBA::Double theZParameter);
GEOM::GEOM_Object_ptr MakePointOnLinesIntersection (GEOM::GEOM_Object_ptr theLine1,
GEOM::GEOM_Object_ptr theLine2);

View File

@ -574,6 +574,58 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointOnCurve (GEOM::GEOM_Object_ptr the
return anObj;
}
//=============================================================================
// MakePointOnCurveByCoord
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointOnCurveByCoord (GEOM::GEOM_Object_ptr theRefCurve,
CORBA::Double theXParameter,
CORBA::Double theYParameter,
CORBA::Double theZParameter)
{
beginService( " GEOM_Superv_i::MakePointOnCurveByCoord" );
MESSAGE("GEOM_Superv_i::MakePointOnCurveByCoord");
getBasicOp();
GEOM::GEOM_Object_ptr anObj =
myBasicOp->MakePointOnCurveByCoord(theRefCurve, theXParameter,
theYParameter, theZParameter);
endService( " GEOM_Superv_i::MakePointOnCurveByCoord" );
return anObj;
}
//=============================================================================
// MakePointOnSurface:
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointOnSurface (GEOM::GEOM_Object_ptr theRefSurface,
CORBA::Double theUParameter,
CORBA::Double theVParameter)
{
beginService( " GEOM_Superv_i::MakePointOnSurface" );
MESSAGE("GEOM_Superv_i::MakePointOnSurface");
getBasicOp();
GEOM::GEOM_Object_ptr anObj =
myBasicOp->MakePointOnSurface(theRefSurface, theUParameter, theVParameter);
endService( " GEOM_Superv_i::MakePointOnSurface" );
return anObj;
}
//=============================================================================
// MakePointOnSurfaceByCoord
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointOnSurfaceByCoord (GEOM::GEOM_Object_ptr theRefSurface,
CORBA::Double theXParameter,
CORBA::Double theYParameter,
CORBA::Double theZParameter)
{
beginService( " GEOM_Superv_i::MakePointOnSurfaceByCoord" );
MESSAGE("GEOM_Superv_i::MakePointOnSurfaceByCoord");
getBasicOp();
GEOM::GEOM_Object_ptr anObj =
myBasicOp->MakePointOnSurfaceByCoord(theRefSurface, theXParameter,
theYParameter, theZParameter);
endService( " GEOM_Superv_i::MakePointOnSurfaceByCoord" );
return anObj;
}
//=============================================================================
// MakePointOnLinesIntersection:
//=============================================================================

View File

@ -148,6 +148,17 @@ public:
CORBA::Double theZ);
GEOM::GEOM_Object_ptr MakePointOnCurve (GEOM::GEOM_Object_ptr theRefCurve,
CORBA::Double theParameter);
GEOM::GEOM_Object_ptr MakePointOnCurveByCoord (GEOM::GEOM_Object_ptr theRefCurve,
CORBA::Double theXParameter,
CORBA::Double theYParameter,
CORBA::Double theZParameter);
GEOM::GEOM_Object_ptr MakePointOnSurface (GEOM::GEOM_Object_ptr theRefSurface,
CORBA::Double theUParameter,
CORBA::Double theVParameter);
GEOM::GEOM_Object_ptr MakePointOnSurfaceByCoord (GEOM::GEOM_Object_ptr theRefSurface,
CORBA::Double theXParameter,
CORBA::Double theYParameter,
CORBA::Double theZParameter);
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,

View File

@ -109,6 +109,7 @@ def TestAll (geompy, math):
#Test point on curve creation
p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25) #(GEOM_Object_ptr, Double)->GEOM_Object_ptr
p_on_arc2 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10 ) #(GEOM_Object_ptr, Double)->GEOM_Object_ptr
#Test point on lines intersection
p_on_l1l2 = geompy.MakeVertexOnLinesIntersection(Line1, Line2) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
@ -176,6 +177,7 @@ def TestAll (geompy, math):
#Test point on surface creation
p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8) #(GEOM_Object_ptr, Double, Double)->GEOM_Object_ptr
p_on_face2 = geompy.MakeVertexOnSurface(Face, 0., 0., 0.) #(GEOM_Object_ptr, Double, Double)->GEOM_Object_ptr
# Test plane from existing face creation
Plane2 = geompy.MakePlaneFace(Face, trimsize) #(GEOM_Object_ptr, Double)->GEOM_Object_ptr
@ -323,6 +325,8 @@ def TestAll (geompy, math):
id_Sketcher3d = geompy.addToStudy(Sketcher3d, "Sketcher 3D")
id_p_on_arc = geompy.addToStudy(p_on_arc, "Vertex on Arc (0.25)")
id_p_on_arc2 = geompy.addToStudy(p_on_arc2, "Vertex on Arc at(100, -10, 10)" )
id_p_on_l1l2 = geompy.addToStudy(p_on_l1l2, "Vertex on Lines Intersection")
id_tan_on_arc = geompy.addToStudy(tan_on_arc, "Tangent on Arc (0.7)")
@ -359,6 +363,7 @@ def TestAll (geompy, math):
id_Shell = geompy.addToStudy(Shell, "Shell")
id_p_on_face = geompy.addToStudy(p_on_face, "Vertex on Face (0.1, 0.8)")
id_p_on_face2 = geompy.addToStudy(p_on_face2, "Vertex on Face at(0., 0., 0.)")
id_Prism1 = geompy.addToStudy(Prism1, "Prism by Two Pnt")
id_Shell1 = geompy.addToStudy(Shell1, "Shell from Prism1 faces")

View File

@ -366,6 +366,22 @@ class geompyDC(GEOM._objref_GEOM_Gen):
anObj.SetParameters(Parameters)
return anObj
## Create a point by projection give coordinates on the given curve
# @param theRefCurve The referenced curve.
# @param theX X-coordinate in 3D space
# @param theY Y-coordinate in 3D space
# @param theZ Z-coordinate in 3D space
# @return New GEOM_Object, containing the created point.
#
# @ref tui_creation_point "Example"
def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
# Example: see GEOM_TestAll.py
theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
anObj.SetParameters(Parameters)
return anObj
## Create a point, corresponding to the given parameters on the
# given surface.
# @param theRefSurf The referenced surface.
@ -382,6 +398,22 @@ class geompyDC(GEOM._objref_GEOM_Gen):
anObj.SetParameters(Parameters);
return anObj
## Create a point by projection give coordinates on the given surface
# @param theRefSurf The referenced surface.
# @param theX X-coordinate in 3D space
# @param theY Y-coordinate in 3D space
# @param theZ Z-coordinate in 3D space
# @return New GEOM_Object, containing the created point.
#
# @ref swig_MakeVertexOnSurfaceByCoord "Example"
def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
# Example: see GEOM_TestAll.py
anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
anObj.SetParameters(Parameters);
return anObj
## Create a point on intersection of two lines.
# @param theRefLine1, theRefLine2 The referenced lines.
# @return New GEOM_Object, containing the created point.