Open CASCADE Technology  7.2.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 theStatus) 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 Standard_Real TolFirst=-1, const Standard_Real TolLast=-1)
 Computes the projection of 3d curve onto a surface using the specialized algorithm. Returns False if projector fails, otherwise, if pcurve computed successfully, returns True. The output curve 2D is guaranteed to be same-parameter with input curve 3D on the interval [First, Last]. If the output curve lies on a direct line the infinite line is returned, in the case same-parameter condition is satisfied. TolFirst and TolLast are the tolerances at the ends of input curve 3D. 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...
 
- 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 void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::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 opencascade::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...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Protected Member Functions

Handle< Geom2d_CurvegetLine (const TColgp_SequenceOfPnt &points, const TColStd_SequenceOfReal &params, TColgp_SequenceOfPnt2d &points2d, const Standard_Real theTol, Standard_Boolean &IsRecompute, Standard_Boolean &isFromCashe) 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]
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

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::ShapeConstruct_ProjectCurveOnSurface ( )

Empty constructor.

Member Function Documentation

◆ AdjustOverDegenMode()

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

◆ BuildCurveMode()

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.

◆ getLine()

Handle< Geom2d_Curve > ShapeConstruct_ProjectCurveOnSurface::getLine ( const TColgp_SequenceOfPnt points,
const TColStd_SequenceOfReal params,
TColgp_SequenceOfPnt2d points2d,
const Standard_Real  theTol,
Standard_Boolean IsRecompute,
Standard_Boolean isFromCashe 
) 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.

◆ Init() [1/2]

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.

◆ Init() [2/2]

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.

◆ Perform()

virtual Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Perform ( Handle< Geom_Curve > &  c3d,
const Standard_Real  First,
const Standard_Real  Last,
Handle< Geom2d_Curve > &  c2d,
const Standard_Real  TolFirst = -1,
const Standard_Real  TolLast = -1 
)
virtual

Computes the projection of 3d curve onto a surface using the specialized algorithm. Returns False if projector fails, otherwise, if pcurve computed successfully, returns True. The output curve 2D is guaranteed to be same-parameter with input curve 3D on the interval [First, Last]. If the output curve lies on a direct line the infinite line is returned, in the case same-parameter condition is satisfied. TolFirst and TolLast are the tolerances at the ends of input curve 3D.

◆ PerformByProjLib()

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.

◆ SetPrecision()

void ShapeConstruct_ProjectCurveOnSurface::SetPrecision ( const Standard_Real  preci)

Sets value for current precision.

◆ SetSurface() [1/2]

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

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

◆ SetSurface() [2/2]

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

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

◆ Status()

Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Status ( const ShapeExtend_Status  theStatus) const

Returns the status of last Peform.

Field Documentation

◆ myAdjustOverDegen

Standard_Integer ShapeConstruct_ProjectCurveOnSurface::myAdjustOverDegen
protected

◆ myBuild

Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::myBuild
protected

◆ myCashe2d

gp_Pnt2d ShapeConstruct_ProjectCurveOnSurface::myCashe2d[2]
protected

◆ myCashe3d

gp_Pnt ShapeConstruct_ProjectCurveOnSurface::myCashe3d[2]
protected

◆ myNbCashe

Standard_Integer ShapeConstruct_ProjectCurveOnSurface::myNbCashe
protected

◆ myPreci

Standard_Real ShapeConstruct_ProjectCurveOnSurface::myPreci
protected

◆ myStatus

Standard_Integer ShapeConstruct_ProjectCurveOnSurface::myStatus
protected

◆ mySurf

Handle< ShapeAnalysis_Surface > ShapeConstruct_ProjectCurveOnSurface::mySurf
protected

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