Open CASCADE Technology  6.9.0
Public Member Functions | Protected Member Functions | Protected Attributes

ShapeConstruct_ProjectCurveOnSurface Class Reference

This tool provides a method for computing pcurve by projecting 3d curve onto a surface. Projection is done by 23 or more points (this number is changed for B-Splines according to the following rule: the total number of the points is not less than number of spans * (degree + 1); it is increased recursively starting with 23 and is added with 22 until the condition is fulfilled). Isoparametric cases (if curve corresponds to U=const or V=const on the surface) are recognized with the given precision. More...

#include <ShapeConstruct_ProjectCurveOnSurface.hxx>

Inheritance diagram for ShapeConstruct_ProjectCurveOnSurface:
Inheritance graph
[legend]

Public Member Functions

 ShapeConstruct_ProjectCurveOnSurface ()
 Empty constructor. More...
 
virtual void Init (const Handle< Geom_Surface > &surf, const Standard_Real preci)
 Initializes the object with all necessary parameters, i.e. surface and precision. More...
 
virtual void Init (const Handle< ShapeAnalysis_Surface > &surf, const Standard_Real preci)
 Initializes the object with all necessary parameters, i.e. surface and precision. More...
 
void SetSurface (const Handle< Geom_Surface > &surf)
 Loads a surface (in the form of Geom_Surface) to project on. More...
 
void SetSurface (const Handle< ShapeAnalysis_Surface > &surf)
 Loads a surface (in the form of ShapeAnalysis_Surface) to project on. More...
 
void SetPrecision (const Standard_Real preci)
 Sets value for current precision. More...
 
Standard_BooleanBuildCurveMode ()
 Returns (modifiable) the build-curve-3d mode, by default False If True, if the projected curve has been recomputed by interpolation, the 3d curve is also rebuild by interpolation. More...
 
Standard_IntegerAdjustOverDegenMode ()
 Returns (modifiable) the flag specifying to which side of parametrical space adjust part of pcurve which lies on seam. This is required in very rare case when 3d curve which is to be projected goes partly along the seam on the closed surface with singularity (e.g. sphere), goes through the degenerated point and paerly lies on internal area of surface. More...
 
Standard_Boolean Status (const ShapeExtend_Status Status) const
 Returns the status of last Peform. More...
 
virtual Standard_Boolean Perform (Handle< Geom_Curve > &c3d, const Standard_Real First, const Standard_Real Last, Handle< Geom2d_Curve > &c2d, const GeomAbs_Shape continuity=GeomAbs_C1, const Standard_Integer maxdeg=12, const Standard_Integer nbinterval=-1)
 Computes the projection of 3d curve onto a surface using the standard algorithm from ProjLib. Returns False if standard projector fails or raises an exception or cuts the curve by parametrical bounds of the surface. Else, if pcurve computed successfully, returns True. The continuity, maxdeg and nbinterval are parameters of call to Approx_CurveOnSurface. If nbinterval is equal to -1 (default), this value is computed depending on source 3d curve and surface. More...
 
Standard_Boolean PerformByProjLib (Handle< Geom_Curve > &c3d, const Standard_Real First, const Standard_Real Last, Handle< Geom2d_Curve > &c2d, const GeomAbs_Shape continuity=GeomAbs_C1, const Standard_Integer maxdeg=12, const Standard_Integer nbinterval=-1)
 Computes the projection of 3d curve onto a surface using the standard algorithm from ProjLib. Returns False if standard projector fails or raises an exception or cuts the curve by parametrical bounds of the surface. Else, if pcurve computed successfully, returns True. The continuity, maxdeg and nbinterval are parameters of call to Approx_CurveOnSurface. If nbinterval is equal to -1 (default), this value is computed depending on source 3d curve and surface. More...
 
Standard_Boolean PerformAdvanced (Handle< Geom_Curve > &c3d, const Standard_Real First, const Standard_Real Last, Handle< Geom2d_Curve > &c2d)
 Computes the projection of 3d curve onto a surface using either standard projector (method PerformByStandard()) or internal one (method Perform()). The selection is done by analyzing the surface and 3d curve and is aimed to filter the cases potentially dangerous for the standard projector. If the standard projector fails, internal one is used. More...
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const Handle_Standard_Type &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Protected Member Functions

Handle< Geom2d_CurvegetLine (const TColgp_Array1OfPnt &points, const TColStd_Array1OfReal &params, TColgp_Array1OfPnt2d &points2d, const Standard_Real theTol, Standard_Boolean &IsRecompute) const
 Try to approximate 3D curve by Geom2d_Line or Geom2d_BsplineCurve with degree 1 with specified tolerance. points - points obtained from 3d curve. params - parameters corresponding points on 3d curves points2d - 2d points lies on line in parametric space theTol - tolerance used for compare initial points 3d and 3d points obtained from line lying in parameric space of surface. More...
 

Protected Attributes

Handle< ShapeAnalysis_SurfacemySurf
 
Standard_Real myPreci
 
Standard_Boolean myBuild
 
Standard_Integer myStatus
 
Standard_Integer myAdjustOverDegen
 
Standard_Integer myNbCashe
 
gp_Pnt myCashe3d [2]
 
gp_Pnt2d myCashe2d [2]
 

Detailed Description

This tool provides a method for computing pcurve by projecting 3d curve onto a surface. Projection is done by 23 or more points (this number is changed for B-Splines according to the following rule: the total number of the points is not less than number of spans * (degree + 1); it is increased recursively starting with 23 and is added with 22 until the condition is fulfilled). Isoparametric cases (if curve corresponds to U=const or V=const on the surface) are recognized with the given precision.

Constructor & Destructor Documentation

ShapeConstruct_ProjectCurveOnSurface::ShapeConstruct_ProjectCurveOnSurface ( )

Empty constructor.

Member Function Documentation

Standard_Integer& ShapeConstruct_ProjectCurveOnSurface::AdjustOverDegenMode ( )

Returns (modifiable) the flag specifying to which side of parametrical space adjust part of pcurve which lies on seam. This is required in very rare case when 3d curve which is to be projected goes partly along the seam on the closed surface with singularity (e.g. sphere), goes through the degenerated point and paerly lies on internal area of surface.

If this flag is True, the seam part of such curve will be adjusted to the left side of parametric space (on sphere U=0), else to the right side (on sphere U=2*PI) Default value is True

Standard_Boolean& ShapeConstruct_ProjectCurveOnSurface::BuildCurveMode ( )

Returns (modifiable) the build-curve-3d mode, by default False If True, if the projected curve has been recomputed by interpolation, the 3d curve is also rebuild by interpolation.

Handle< Geom2d_Curve > ShapeConstruct_ProjectCurveOnSurface::getLine ( const TColgp_Array1OfPnt points,
const TColStd_Array1OfReal params,
TColgp_Array1OfPnt2d points2d,
const Standard_Real  theTol,
Standard_Boolean IsRecompute 
) const
protected

Try to approximate 3D curve by Geom2d_Line or Geom2d_BsplineCurve with degree 1 with specified tolerance. points - points obtained from 3d curve. params - parameters corresponding points on 3d curves points2d - 2d points lies on line in parametric space theTol - tolerance used for compare initial points 3d and 3d points obtained from line lying in parameric space of surface.

virtual void ShapeConstruct_ProjectCurveOnSurface::Init ( const Handle< Geom_Surface > &  surf,
const Standard_Real  preci 
)
virtual

Initializes the object with all necessary parameters, i.e. surface and precision.

virtual void ShapeConstruct_ProjectCurveOnSurface::Init ( const Handle< ShapeAnalysis_Surface > &  surf,
const Standard_Real  preci 
)
virtual

Initializes the object with all necessary parameters, i.e. surface and precision.

virtual Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Perform ( Handle< Geom_Curve > &  c3d,
const Standard_Real  First,
const Standard_Real  Last,
Handle< Geom2d_Curve > &  c2d,
const GeomAbs_Shape  continuity = GeomAbs_C1,
const Standard_Integer  maxdeg = 12,
const Standard_Integer  nbinterval = -1 
)
virtual

Computes the projection of 3d curve onto a surface using the standard algorithm from ProjLib. Returns False if standard projector fails or raises an exception or cuts the curve by parametrical bounds of the surface. Else, if pcurve computed successfully, returns True. The continuity, maxdeg and nbinterval are parameters of call to Approx_CurveOnSurface. If nbinterval is equal to -1 (default), this value is computed depending on source 3d curve and surface.

Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformAdvanced ( Handle< Geom_Curve > &  c3d,
const Standard_Real  First,
const Standard_Real  Last,
Handle< Geom2d_Curve > &  c2d 
)

Computes the projection of 3d curve onto a surface using either standard projector (method PerformByStandard()) or internal one (method Perform()). The selection is done by analyzing the surface and 3d curve and is aimed to filter the cases potentially dangerous for the standard projector. If the standard projector fails, internal one is used.

Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib ( Handle< Geom_Curve > &  c3d,
const Standard_Real  First,
const Standard_Real  Last,
Handle< Geom2d_Curve > &  c2d,
const GeomAbs_Shape  continuity = GeomAbs_C1,
const Standard_Integer  maxdeg = 12,
const Standard_Integer  nbinterval = -1 
)

Computes the projection of 3d curve onto a surface using the standard algorithm from ProjLib. Returns False if standard projector fails or raises an exception or cuts the curve by parametrical bounds of the surface. Else, if pcurve computed successfully, returns True. The continuity, maxdeg and nbinterval are parameters of call to Approx_CurveOnSurface. If nbinterval is equal to -1 (default), this value is computed depending on source 3d curve and surface.

void ShapeConstruct_ProjectCurveOnSurface::SetPrecision ( const Standard_Real  preci)

Sets value for current precision.

void ShapeConstruct_ProjectCurveOnSurface::SetSurface ( const Handle< Geom_Surface > &  surf)

Loads a surface (in the form of Geom_Surface) to project on.

void ShapeConstruct_ProjectCurveOnSurface::SetSurface ( const Handle< ShapeAnalysis_Surface > &  surf)

Loads a surface (in the form of ShapeAnalysis_Surface) to project on.

Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Status ( const ShapeExtend_Status  Status) const

Returns the status of last Peform.

Field Documentation

Standard_Integer ShapeConstruct_ProjectCurveOnSurface::myAdjustOverDegen
protected
Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::myBuild
protected
gp_Pnt2d ShapeConstruct_ProjectCurveOnSurface::myCashe2d[2]
protected
gp_Pnt ShapeConstruct_ProjectCurveOnSurface::myCashe3d[2]
protected
Standard_Integer ShapeConstruct_ProjectCurveOnSurface::myNbCashe
protected
Standard_Real ShapeConstruct_ProjectCurveOnSurface::myPreci
protected
Standard_Integer ShapeConstruct_ProjectCurveOnSurface::myStatus
protected
Handle< ShapeAnalysis_Surface > ShapeConstruct_ProjectCurveOnSurface::mySurf
protected

The documentation for this class was generated from the following file: