int_cur
List of: Classes
Subjects: Construction Geometry, SAT Save and Restore
Contents: Kernel

Purpose: Defines interpolated curves.

Derivation: int_cur : subtrans_object : subtype_object : ACIS_OBJECT : -

SAT Identifier: int_cur

Filename: kern/kernel/kerngeom/curve/intdef.hxx

Description: This class defines interpolated curves, which are defined to allow the use of use-counts to avoid copying and to allow derivation to construct curves only approximated by the intcurve.


This class is supported by virtual functions that depend on the true definition of the curve. The virtual functions allow the derived curves to implement the functionality on their own. For curves with an exact bs3_curve, there is no need to implement the functionality because the methods written for the base class are sufficient.

References: KERN discontinuity_info, summary_bs3_curve, surface

by KERN intcurve, summary_bs3_curve

BASE SPAinterval

Data: protected bs2_curve pcur1_data;

A parametric-space curve with respect to the give surface. It is non-NULL only if the corresponding surface exists, and it is parametric.


protected bs2_curve pcur2_data;

A parametric-space curve with respect to the give surface. It is non-NULL only if the corresponding surface exists, and it is parametric.


protected bs3_curve cur_data;

The object-space approximation to the true curve.


protected closed_forms closure;

Takes the value OPEN, CLOSED or PERIODIC (or unset if the int_cur is undefined). If an approximating curve is present (int_cur_data) then the closure of the approximating curve will be consistent.


protected discontinuity_info disc_info;

Discontinuity information. If the supporting surfaces of the curve has discontinuities, or if the curve has a default (tangent) extension, then it will have discontinuities. These are stored here. Note that this is a copy of the data stored in the corresponding spl_sur, but with values outside the subset range removed. It is necessary to keep a separate copy to provide a read-only array to the data because the curve may be periodic, and the subset may span the periodic joins, resulting in discontinuities which may be outside the periodic range.


protected double fitol_data;

The precision to which the spline approximates to the true object-space curve.


protected int bs1_properties;

Refer to bs2_curve_properties below.


protected int bs2_properties;

Defines the following properties of the bs2_curves:


a. Whether or not all of the bs2_curve knots lie on the int_cur.


b. Whether all of the bs2_curve hull turning angles are not too sharp.


c. Whether the bs2_curve hull is known to self-intersect or not.


d. Whether the bs2_curve hull fully encloses the int_cur.

It has a value consisting of four digits.

The first digit has the following values :


0 if Knots on curve property is unknown


1 if Knots on curve property is FALSE


2 if Knots on curve property is TRUE

The second digit has the following values :


0 if Turning angles ok property is unknown


1 if Turning angles ok property is FALSE


2 if Turning angles ok property is TRUE

The third digit has the following values :


0 if Hull self-intersection property is unknown


1 if Hull self-intersection property is FALSE


2 if Hull self-intersection property is TRUE

The fourth digit has the following values :


0 if Hull enclosure property is unknown


1 if Hull enclosure property is FALSE


2 if Hull enclosure property is TRUE


protected SPAinterval range;

The full range of the int_cur, as returned by param_range. If an approximating curve is present (int_cur_data) then range and bs3_curve_range( cur_data ) should be identical.


protected SPAinterval safe_range;

A sub-range of the curve that avoids any terminators at the ends of the curve is safe for relaxation. Outside this range, but inside the full curve range, the approximating curve is taken to define the curve. Typically when no terminators or surface singularities are present, the safe_range is the full range; if a terminator is present, the safe_range stops just short of it. The base class administers the safe_range; for example it updates it following re-parameterization. It is the responsibility of the derived class to set it initially.


protected logical calling_make_approx;

Prevents recursion to make_approx( ).


protected summary_bs3_curve* summary_data;

bs3_curve data in summary form. This field may be set on restore, if the full curve is not available. It may be used to make the actual bs3_curve.


protected surface *surf1_data;

The first of up to two surfaces defining the true curve. Derived classes may use this in different ways, but in the base class, the true curve lies on any surface specified here.


protected surface *surf2_data;

The second surface defining the true curve. Derived classes may use this in different ways, but in the base class, the true curve lies on any surface specified here.

Constructor: protected: int_cur::int_cur ();


C++ allocation constructor requests memory for this object but does not populate it.


Initializes safe_range to initialize interval infinite fitol_data to 0 and all other data to NULL. This provides flexibility for the constructors for derived curve classes to set the common data members in the most convenient way.






protected: int_cur::int_cur (


bs3_curve,

// given curve


double,

// fit tolerance


surface const&,

// first surface


surface const&,

// second surface


bs2_curve,

// pcurve for






// 1st surface


bs2_curve,

// pcurve for






// 2nd surface


const SPAinterval&

// safe ranges



= * (SPAinterval*) NULL_REF,


const discontinuity_info&
// discontinuity



= * (discontinuity_info*) NULL_REF


);


C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.


This constructor cannot be called directly to make an int_int_cur; however, the following procedure can be used to make an object of the int_int_cur class type.


1. Make an object of type int_int_interp (refer to the definition of int_int_interp in the curve_interp class description).

2. Call the int_int_interp method, make_int_cur. This method returns an int_cur class object.






protected: int_cur::int_cur (


const int_cur& // intersection curve


);


C++ copy constructor requests memory for this object and populates it with the data from the object supplied as an argument.






protected: int_cur::int_cur (


SPAinterval,

// interval


closed_forms,

// OPEN, CLOSED,






// PERIODIC,






// or undefined


surface const&,

// 1st surface


surface const&,

// 2nd surface


bs2_curve,

// pcurve for






// 1st surface


bs2_curve,

// pcurve for






// 2nd surface


const SPAinterval&

// safe ranges



= * (SPAinterval*)NULL_REF,


const discontinuity_info&
// discontinuity



= * (discontinuity_info*)NULL_REF


);


A version of the constructor which takes the range and closure instead of the approximating curve. Available for derived class constructors.




Destructor: protected: virtual int_cur::~int_cur ();


C++ destructor, deleting an int_cur. Eliminates all the dependent spline curve and surface data. Each derived class must have a destructor if it adds further dependent data.



Methods: protected: virtual int int_cur::accurate_derivs (


SPAinterval const&
// int_cur interval



= * (SPAinterval*) NULL_REF


) const;


Returns the number of derivatives that evaluate can find accurately and directly, rather than by finite differencing, over the given portion of the curve. If there is no limit to the number of accurate derivatives, this method returns the value, ALL_CURVE_DERIVATIVES.






protected: virtual void int_cur::append (


int_cur& // curves to be joined


);


Concatenates the contents of two curves into one. The curves are guaranteed to be the same base or derived type, and to have contiguous parameter ranges ("this" is the beginning part of the combined curve, the argument gives the end part).






protected: virtual SPAbox int_cur::bound (


SPAinterval const&
// range



= * (SPAinterval*) NULL_REF


) const;


Finds an object-space bounding box, for the subset of the curve within the given parameter bounds. The default finds the bound on the spline approximation of the appropriate subset of the curve, expanded by the fit tolerance, so it is suitable for most derived classes.






protected: int int_cur::bs1_hull_angles_ok () const;


Returns 1 if the bs1_curve hull turning angles are known to be acceptable, 0 if they are not acceptable, and -1 if unknown.






protected: int


int_cur::bs1_hull_self_intersects () const;


Returns 1 if the bs1_curve hull is known to self intersect, 0 if it does not, and -1 if unknown.






protected: int int_cur::bs1_knots_on_curve () const;


Returns 1 if the bs1_curve knots are known to lie on the curve, 0 if they do not, and -1 if unknown.






protected: int int_cur::bs2_hull_angles_ok () const;


Returns 1 if the bs2_curve hull turning angles are known to be acceptable, 0 if they are not acceptable, and -1 if unknown.






protected: int


int_cur::bs2_hull_self_intersects () const;


Returns 1 if the bs2_curve hull is known to self intersect, 0 if it does not, and -1 if unknown.






protected: int int_cur::bs2_knots_on_curve () const;


Returns 1 if the bs2_curve knots are known to lie on the curve, 0 if they do not, and -1 if unknown.






protected: closed_forms


int_cur::calculate_closure ();


Calculates the closure of the curve from geometric tests.






public: virtual void


int_cur::calculate_disc_info ();


Calculates the discontinuity information for the int_cur if none had been stored in disc_info. This function is intended to support restore of old versions of int_cur.






protected: virtual


check_status_list* int_cur::check (


const check_fix& input

// flags for



= * (const check_fix*)
// allowed



NULL_REF,

// fixes


check_fix& result

// fixes



= * (check_fix*) NULL_REF, // applied


const check_status_list*

// list of



= (const check_status_list*) // checks to



NULL_REF

// be made


);


Check for any data errors in the curve, and correct the errors if possible. The various arguments provide control over which checks are made, which fixes can be applied and which fixes were actually applied. The function returns a list of errors that remain in the curve on exit.


The default for the set of flags which say which fixes are allowable is none (nothing is fixed). If the list of checks to be made is null, then every possible check will be made. Otherwise, the function will only check for things in the list. The return value for the function will then be a subset of this list.






public: logical int_cur::closed () const;


Indicate whether a curve is closed, that is joins itself (smoothly or not) at the ends of its principal parameter range. This method always returns TRUE if periodic returns TRUE. The default version uses the corresponding function for the approximating spline.






protected: virtual void int_cur::closest_point (


SPAposition const& pos,

// position


SPAposition& foot,

// foot position


SPAparameter const& param_guess // input guess



= * (SPAparameter* )NULL_REF,// value of






// param


SPAparameter& param_actual
// actual value



= * (SPAparameter* )NULL_REF // of param


) const;


Finds the closest point on the curve (the foot) to the given point, and optionally its parameter value. If an input parameter value is supplied (as the first parameter argument), the foot found is only a local solution nearest to the supplied parameter position. Any of the return value arguments may be a NULL reference, in which case it is simply ignored.






protected: void int_cur::


closest_point_with_cache (


SPAposition const& pos,

// position


SPAposition& foot,

// foot position


SPAparameter const&

// input guess



= * (SPAparameter* )NULL_REF,// value of






// param


SPAparameter&

// actual value



= * (SPAparameter* )NULL_REF // of param


) const;


This method, rather than closest_point, should be called by classes derived from int_cur, to get the benefit of caching.






protected: virtual subtrans_object*


int_cur::copy () const = 0;


Construct a new object as a copy of an old object. Duplication cannot be done by the constructor.






protected: bs3_curve int_cur::cur () const;


Returns underlying curve information.






protected: virtual void int_cur::debug (


char const*, // class-identifying line


logical, // option to suppress too




// much detail


FILE* // file name


) const = 0;


Prints out a class-specific identifying line to standard output or to the specified file.






protected: void int_cur::debug_data (


char const*, // class-identifying line


logical, // option to suppress too




// much detail


FILE* // file name


) const;


Prints out the details. The debug_data derived class can call its parent's version first, to put out the common data. If the derived class has no additional data it need not define its own version of debug_data, and it may use its parent's instead. A string argument provides the introduction to each displayed line after the first, and a logical sets brief output (normally removing detailed subsidiary curve and surface definitions).






public: virtual int_cur* int_cur::deep_copy (


pointer_map* pm // list of items within



= NULL // the entity that are




// already deep copied


) const = 0;


Creates a copy of an item that does not share any data with the original. Allocates new storage for all member data and any pointers. Returns a pointer to the copied item.


In a deep copy, all the information about the copied item is self-contained in a new memory block. By comparison, a shallow copy stores only the first instance of the item in memory, and increments the reference count for each copy.


The pointer_map keeps a list of all pointers in the original object that have already been deep copied. For example, a deep_copy of a complex model results in self contained data, but identical sub-parts within the model are allowed to share a single set of data.






protected: void int_cur::delete_summary_data ();


Allows derived classes to delete summary_data when it goes out of date.






protected: void int_cur::disc_from_surfs ();


This function sets discontinuity information in the curve corresponding to discontinuities in the underlying surfaces.






protected: virtual curve_boundcyl


int_cur::enclosing_cylinder (


const SPAinterval&
// bounding interval



= * (SPAinterval*) NULL_REF


) const;


Returns a cylinder which encloses the portion of the curve bounded by the interval.






protected: save_approx_level int_cur::enquire_save_approx_level () const;


Gets the default level at which the approximating surface should be be stored.






protected: virtual void int_cur::eval (


double,
// given parameter


SPAposition&,
// position returned


SPAvector&
// 1st derivative



= * (SPAvector* ) NULL_REF,


SPAvector&
// 2nd derivative



= * (SPAvector* ) NULL_REF,


logical
// approx. results?



= FALSE


) const;


Finds the position and the first and second derivative on a curve at a given parameter value. Either eval or evaluate should be implemented for every derived curve class. If any return value is NULL, that value is not computed. If logical is TRUE, approximate results are returned.






protected: virtual int int_cur::evaluate (


double,
// parameter


SPAposition&,
// point on curve at





// parameter


SPAvector**
// array of vectors



= NULL,


int

// # derivatives



= 0,


evaluate_curve_side
// eval. location



= evaluate_curve_unknown


) const;


Calculate derivatives. Once calculated the derivatives are stored in vectors provided by the user. This method returns the number it was able to calculate; this equals the number requested in all but the most exceptional circumstances. A certain number are evaluated directly and accurately; higher derivatives are automatically calculated by finite differencing; the accuracy of these decreases with the order of the derivative, as the cost increases.






protected: virtual int int_cur::evaluate_iter (


double,
// parameter


curve_evaldata*,
// data supplying





// initial values,





// and set to reflect





// the results of





// this evaluation


SPAposition&,
// point on curve at





// given parameter


SPAvector**
// array of pointers



= NULL,
// to vectors, of





// size nd. Any of





// the pointers may





// be null, in which





// case the





// corresponding





// derivative will





// not be returned


int

// number of



= 0,
// derivatives





// required (nd)


evaluate_curve_side
// evaluation





// location - above,





// below or don't



= evaluate_curve_unknown // care


) const;


The evaluate_iter function is just like evaluate, but is supplied with a data object which contains results from a previous close evaluation, for use as initial values for any iteration involved.






protected: int int_cur::evaluate_iter_with_cache (


double,
// parameter


curve_evaldata*,
// data supplying





// initial values,





// and set to reflect





// the results of





// this evaluation


SPAposition&,
// point on curve at





// given parameter


SPAvector**
// array of pointers



= NULL,
// to vectors, of





// size nd. Any of





// the pointers may





// be null, in which





// case the





// corresponding





// derivative will





// not be returned


int

// number of



= 0,
// derivatives





// required (nd)


evaluate_curve_side
// evaluation





// location - above,





// below,don't care



= evaluate_curve_unknown,


logical
// approximations ok



= FALSE


) const;


This non-virtual function looks in the cache for position and nd derivatives at the given parameter value. If found it returns them. Otherwise it computes them, puts them in the cache, and returns them. The evaluate_with_cache method instead of evaluate, should be called by classes derived from int_cur in order to get the benefit of caching.






public: virtual int int_cur::evaluate_surfs(


double,
// Parameter


SPAposition&,
// Point on curve at





// parameter


SPAvector*,
// Derivatives


int& nd_cu,
// Number of curve





// derivs required or





// calculated


int& nd_sf,
// Number of surface





// derivs required or





// calculated


evaluate_curve_side
// eval location



= evaluate_curve_unknown,


SPAposition &
// Point on support



= *(SPAposition*) NULL_REF,// surface 1


SPAvector*
// Derivs of first



= NULL,
// support surface


SPAposition&
// Point on support



= *(SPAposition*) NULL_REF,// surface 2


SPAvector*
// Derivs of second



= NULL,
// support surface


SPApar_pos&
// Params on



= * (SPApar_pos*) NULL_REF,// surface 1


SPApar_vec*
// Derivs of params



= NULL,
// on surface 1


SPApar_pos&
// Params on



= * (SPApar_pos*) NULL_REF,// surface 2


SPApar_vec*
// Derivs of params



= NULL,
// on surface 2


SPApar_pos const&
// opt. guess value



= * (SPApar_pos* )NULL_REF,// for 1st par_pos


SPApar_pos const&
// opt. guess value



= * (SPApar_pos* )NULL_REF// for 2nd par_pos


) const;


An evaluator that takes surface arguments in addition to curve arguments. As well as returning curve position and derivatives, it returns the derivatives of the surface wrt t (these will often but not always be equal to the curve derivs) and also the derivatives of the surface parameters with respect to t. The array of vectors to return the curve derivatives must be of length at least nd_cu, and the various arrays of vectors to return the surface data can either be null, indicating that this particular derivative is not required, or be of length at least nd_sf.


The caller must supply an array of length nd_cu or NULL to indicate that derivatives are not required for vector.


Unlike the other evaluators, this function OVERWRITES the integer arguments specifying the numbers of derivatives required, with the number actually obtained. The function itself returns information about the surface data that was calculated:


0 => no surface data (e.g. exact_int_cur)

1 => data for first surface only

2 => data for second surface only

3 => data for both surfaces


This is the default implementation of the function, and is inefficient. It should be implemented for each int_cur type.






protected: int int_cur::evaluate_with_cache (


double,
// parameter


SPAposition&,
// point on curve at





// parameter


SPAvector**
// array of vectors



= NULL,


int

// # derivatives



= 0,


evaluate_curve_side
// eval. location



= evaluate_curve_unknown,


logical
// approximations OK



= FALSE


) const;


This non-virtual function looks in the cache for position and nd derivatives at the given parameter value. If found, it returns them. Otherwise it computes them, puts them in the cache, and returns them. The evaluate_with_cache, instead of evaluate, should be called by classes derived from int_cur in order to get the benefit of caching.






protected: virtual SPAvector int_cur::eval_curvature (


double, // parameter value


logical // approx. results ?



= FALSE


) const;


Find the curvature on a curve at a given point. If logical is TRUE, approximate results are returned.






protected: virtual SPAvector int_cur::eval_deriv (


double, // parameter value


logical // approx. results ?



= FALSE


) const;


Finds the parametric derivative, magnitude, and direction on a given curve at the given parameter value. If logical is TRUE, approximate results are returned.






protected: virtual SPAunit_vector


int_cur::eval_direction (


double, // given direction


logical // approx. results ?



= FALSE


) const;


Find the tangent direction at the given parameter value on the curve. Default uses eval_deriv.






protected: virtual SPAposition int_cur::eval_position (


double, // given parameter


logical // approx. results ?



= FALSE


) const;


Finds the position on the curve at a given parameter value. If logical is TRUE, approximate results are returned.






protected: void int_cur::eval_with_cache (


double,
// given parameter


SPAposition&,
// point found


SPAvector&
// first derivative



= * (SPAvector*) NULL_REF,


SPAvector&
// second derivative



= * (SPAvector*) NULL_REF,


logical
// approximations ok



= FALSE


) const;


This non-virtual function looks in the cache for position and first and second derivatives at the given parameter value. If found it returns them, otherwise it computes them, puts them in the cache, and returns them.


The eval_with_cache method, rather than eval, should be called by classes derived from int_cur, so as to get the benefit of caching.






protected: virtual curve_extremum*


int_cur::find_extrema (


SPAunit_vector const& // unit direction vector


) const;


Finds the extrema of an intersection curve in a given direction. This method ignores its ends unless it is closed. The default version uses the corresponding function for the approximating spline.






protected: double int_cur::fitol () const;


Returns fit tolerance data about the curve.






protected: int int_cur::hull1_enclosure () const;


Returns 1 if the bs1_curve hull is known to enclose the curve, 0 if it does not, and -1 if unknown.






protected: int int_cur::hull2_enclosure () const;


Returns 1 if the bs2_curve hull is known to enclose the curve, 0 if it does not, and -1 if unknown.






public: virtual law* int_cur::law_form ();


Returns the law form of an int_cur.






protected: virtual double int_cur::length (


double, // start parameter


double // end parameter


) const;


Returns the algebraic distance along the curve between the given parameters. If the sign is positive, the parameter values are given in increasing order; if the sign is negative,they are given in decreasing order. The result is undefined if either parameter value is outside the parameter range of a bounded curve. For a periodic curve, the parameters are not reduced to the principal range, and so the portion of the curve evaluated may include several complete circuits. This function is always a monotonically increasing function of its second argument if the first is held constant, and a decreasing function of its first argument if the second is held constant. The default version uses the corresponding function for the approximating spline.






protected: virtual double int_cur::length_param (


double, // datum parameter


double // arc length


) const;


Returns the parameter value of the point on the curve at the given algebraic arc length from that defined by the datum parameter, which is the inverse of the length function. The result is not defined for a bounded nonperiodic curve if the datum parameter is outside the parameter range, or if the length is outside the range bounded by the values for the ends of the parameter range. The default version uses the corresponding function for the approximating spline.






protected: SPAparameter int_cur::limit_param (


SPAparameter const& param // parameter value


) const;


Shifts the supplied parameter to be within the principle period of a periodic curve. This is used to ensure that bs2_curves are evaluated within their defined ranges.






protected: virtual void int_cur::make_approx (


double fit, // fit


const intcurve& ic // intcurve



= * (intcurve*) NULL_REF


) const;


Make or remake the approximating curve. The intcurve argument 'ic' may be NULL but if it is supplied the function may be a little faster. The function stores the approximating curve and the actual fit error that was achieved in the int_cur, overriding the declared const of the method to do this.






protected: virtual curve_evaldata*


int_cur::make_evaldata () const;


Construct a data object to retain evaluation information across calls to evaluate_iter. This is to allow subsidiary calls within an iterative evaluator to start iteration much closer to the required result than is possible just using the curve information itself.






protected: virtual void int_cur::operator*= (


SPAtransf const& // transformation matrix


);


Transforms the bs3_curve and the tolerance. The default transforms the spline approximation and the surfaces, and scales the fit tolerance.






public: virtual int_cur& int_cur::operator= (


int_cur const& // address for int_cur


);


Copies all the underlying information.






protected: virtual logical int_cur::operator== (


subtype_object const& // object subtype


) const;


Tests for equality. This is sufficient for many derived classes, and can be used by most others to check the basic representation. It does not guarantee that all effectively equal surfaces are determined to be equal, but it does guarantee that different surfaces are correctly identified as such. The default version checks the splines and surfaces, and checks that the derived types are the same. This may be sufficient for simple derived types;others may find it useful to call this as part of the operation.






protected: virtual double int_cur::param (


SPAposition const&,

// given point


SPAparameter const&

// initial



= * (SPAparameter*) NULL_REF // param guess


) const;


Returns the parameter values for a given point on the curve. Drops a perpendicular to the spline approximation and returns the parameter value of the foot.






public: double int_cur::param_period () const;


Finds the parametric period of the interpolated curve, returning exactly 0 if the curve is not periodic. The default version uses the corresponding function for the approximating spline.






public: SPAinterval int_cur::param_range (


SPAbox const& // bounding box



= * (SPAbox*)NULL_REF //


) const;


Finds the parameter range of the interpolated curve as an interface. The default version uses the corresponding function for the approximating spline.






protected: double int_cur::param_with_cache (


SPAposition const&,
// point found


SPAparameter const&
// first derivative



= * (SPAparameter*) NULL_REF


);


This non-virtual function looks in the cache for a given position. If found it returns it; otherwise it computes it, puts it in the cache, and returns it.


The param_with_cache method, rather than paraml, should be called by classes derived from int_cur, so as to get the benefit of caching.






protected: virtual pcurve* int_cur::pcur (


int
// index for surface




// defining intcurve


) const;


Returns parametric curves with respect to the surfaces defining this intcurve. The argument may be 1 or 2, representing the two surfaces in order. The default uses pcur1 or pcur2, surf1 or surf2, and fitol, and it is suitable for most derived classes.






protected: virtual bs2_curve int_cur::pcur1 (


logical force // surface force return



= FALSE


) const;


Returns curve in parameter space of surface returned by surf1 or surf2 respectively, if the surface is parametric. Returns NULL if the surface (as returned by the functions above) is NULL or not parametric.






protected: virtual bs2_curve int_cur::pcur2 (


logical force // surface force return



= FALSE


) const;


Returns curve in parameter space of surface returned by surf1 or surf2 respectively, if the surface is parametric. Returns NULL if the surface (as returned by the functions above) is NULL or not parametric.






public: virtual logical int_cur::pcur_present (


int
// parameter-space index




// curve


) const;


Returns TRUE if the nth parameter-space curve is defined (i.e., pcur returns a non-NULL pcurve pointer); otherwise, it returns FALSE. The default tests the result of pcur1 or pcur2 as appropriate, and so it suffices for most derived classes. The argument may be 1 or 2 representing the two surfaces in order.






public: logical int_cur::periodic () const;


Indicates whether the curve is periodic, that is joins itself smoothly at the ends of its principal parameter range, so that edges may span the seam. The default version uses the corresponding function for the approximating spline.






protected: virtual SPAvector int_cur::point_curvature (


SPAposition const&,

// given point


SPAparameter const&

// initial



= * (SPAparameter*) NULL_REF // param guess


) const;


Finds the curvature on a curve at a given point.






protected: virtual SPAunit_vector


int_cur::point_direction (


SPAposition const&,

// given point


SPAparameter const&

// initial



= * (SPAparameter*) NULL_REF // param guess


) const;


Finds the tangent direction to a curve at a given point, which is assumed to be on the curve.






protected: virtual void int_cur::point_perp (


SPAposition const&,

// given point


SPAposition&,

// point on curve


SPAunit_vector&,

// tangent






// returned


SPAvector&,

// curvature






// returned


SPAparameter const&

// initial



= * (SPAparameter*) NULL_REF,// param guess


SPAparameter&

// actual param



= * (SPAparameter*) NULL_REF,// returned


logical f_weak

// for future use



= FALSE


) const;


Finds the foot of the perpendicular from the given point to the curve, tangent to the curve at that point, and its parameter value, and returns the curvature. If an input parameter value is supplied (as the fifth argument), the perpendicular found is the one nearest to the supplied parameter position; otherwise, it is the one at which the curve is nearest to the given point. Any of the return value arguments may be a NULL reference, in which case they are ignored.






protected: void int_cur::point_perp_with_cache(


SPAposition const&,
// given point


SPAposition&,
// resulting foot


SPAunit_vector&,
// direction


SPAvector&,
// curvature


SPAparameter const&
// parameter guess



= * (SPAparameter*)NULL_REF,


SPAparameter &
// parameter returned



= * (SPAparameter*)NULL_REF,


logical f_weak
// for future use



= FALSE


) const;


This non-virtual function looks in the cache for a given position and parameter guess if any. If found it returns the foot, direction, curvature and parameter. Otherwise it uses point_perp to find the result, places them in the cache, and returns them. The point_perp_with_cache method, rather than point_perp, should be called by classes derived from int_cur, so as to get the benefit of caching.






protected: virtual void int_cur::reparam (


double, // start parameter


double // end parameter


);


Performs a linear transformation on the parameterization, so that it starts and ends at the given parameter values, which must be in increasing order.






protected: void int_cur::restore_common_data ();


Restores member function to do the actual work. This will normally be invoked as the first action of the corresponding function for a derived class, to read the common data, as well as doing all the work for the base class.


if ( restore_version_number >= APPROX_SUMMARY_VERSION )

read_enum Read the enumeration for save_approx_level.

if ( level == save_approx_full )

bs3_curve_restore Parameter space curve on first surface

read_real fit tolerance

else if ( level == save_approx_summary )

summary_bs3_curve::restore Parameter space curve

read_real fit tolerance

read_enum Read the enumeration for closed_forms

else

read_interval Range for curve

read_enum Read the enumeration for closed_forms

restore_surface First surface for curve definition

restore_surface Second surface for curve definition

bs2_curve_restore Parameter space curve on second surface

bs2_curve_restore Parameter space curve on second surface

if ( restore_version_number >= SAFERANGE_VERSION )

read_interval Safe range for curve evaluation

else

\\ Set safe range for curve evaluation

if ( restore_version_number >= DISCONTINUITY_VERSION )


discontinuity_info::restore Parameter values of discontinuities






protected: void int_cur::save_as_approx () const;


Permits this int_cur to be saved in a sharable format. It may be called for a null object, in which case a recognizable ID is added.






protected: void int_cur::save_common_data (


save_approx_level // level at which int_cur




// is to be stored


) const;


Save data common to all int_curs.






protected: virtual void int_cur::save_data () const;


Saves the data associated with the int_cur to the SAT file.






protected: void int_cur::set_bs_hull_angles_ok (


int pcu_no, // enclosure


int hull_angles_ok // value


);


Sets the property of the hull not turning too sharply. The first argument should be 1 or 2 to indicate the curve which the enclosure is being set for, and the second integer argument should be -1, 0 or 1, to indicate that the property is unknown, FALSE or TRUE.






protected: void


int_cur::set_bs_hull_self_intersects (


int pcu_no, // enclosure


int hull_self_ints // value


);


Sets the property of the hull self intersecting. The first argument should be 1 or 2 to indicate the curve which the enclosure is being set for, and the second integer argument should be -1, 0 or 1, to indicate that the property is unknown, FALSE or TRUE.






protected: void int_cur::set_bs_knots_on_curve (


int pcu_no, // enclosure


int knots_on_cu // value


);


Sets the property of whether the knots lie on the curve. The first argument should be 1 or 2 to indicate the curve which the enclosure is being set for, and the second integer argument should be -1, 0 or 1, to indicate that the property is unknown, FALSE or TRUE.






protected: void int_cur::set_cur (


bs3_curve, // bs3 curve data


double tol // tolerance



= -1.0


);


Replaces the underlying bs3_curve with another.






protected: void int_cur::set_hull_enclosure (


int pcu_no, // enclosure


int encl // value


);


Sets the curve enclosure in the int_cur. The first argument should be 1 or 2, to indicate the bs2_curve which the enclosure is being set for, and the second integer argument should be -1, 0 or 1, to give the value for the hull enclosure.






protected: virtual void int_cur::set_safe_range ();


Sets the safe_range, which is used by the base class when it is uncertain how to process the base_range. The default version sets it to a NULL interval. Other implementations of this method are not available to the base class constructor, and they cannot be used when the curve is input from a data stream. Derived classes are responsible for setting the safe_range.






protected: virtual void int_cur::shift (


double // shift value


);


Shifts the parameter range of the spline curve by a given value. This is used only to move portions of a periodic curve by integral multiples of the period. The default just shifts the parameterization of the approximating splines.






protected: virtual void int_cur::split (


double, // parameter value


SPAposition const&, // split point


int_cur* [ 2 ] // two pieces of curve


) = 0;


Divides a curve into two pieces at a given parameter value, adjusting the spline approximations to an exact value at the split point if necessary. If the parameter value is at the beginning, it sets the first piece to NULL and places the original curve in the second slot. If the parameter value is at the end, it places the original curve in the first slot and sets the second to NULL. It is pure virtual to force derived classes to have their own, though many will be able to use split_int_cur (the following method) to do much of the hard work.






protected: logical int_cur::split_int_cur (


double, // parameter value


SPAposition const&, // split point


int_cur*, // input curve


int_cur* [ 2 ] // 2 piece of curve


);


Divides a curve into two pieces at a given parameter value, adjusting the spline approximations to an exact value at the split point if necessary, except that a newly-created, but empty, int_cur, is supplied.


The same specification as for split, except that a newly-created, but empty, int_cur (normally in fact a derived object) is supplied to be the second part of the split, if necessary. The method returns TRUE if the second int_cur was used; otherwise, it returns FALSE. This method assumes that the pcurve on any surface is the locus of the foot of the perpendicular from the curve to the surface. It is not called by any intcurve member function, but it is available for use by a derived class, split, to split the spline curves.






protected: virtual int_cur* int_cur::subset (


SPAinterval const& // parameter interval


) const;


Constructs a new curve that is a copy of the part of the given one within the given parameter bounds. If this means the whole curve, the original curve, or there is no overlap, this method returns NULL. It is always called with a bounded, positive-length parameter range completely within the curve's defined parameter range.






protected: const double*


int_cur::summary_knots () const;


Provides access to the summary_data for derived classes (so that they don't all have to be friends).






protected: int int_cur::summary_nknots () const;


Provides access to the summary_data for derived classes (so that they don't all have to be friends).






protected: virtual surface const* int_cur::surf1 (


logical force // surface force return



= FALSE


) const;


Returns the corresponding surface pointer only if the true curve lies in that surface.






protected: virtual surface const* int_cur::surf2 (


logical force // surface force return



= FALSE


) const;


Returns the corresponding surface pointer only if the true curve lies in that surface.






protected: virtual curve_tancone


int_cur::tangent_cone (


SPAinterval const&, // bounding interval


logical // inside or outside


) const;


Returns a cone bounding the tangent direction of the curve. The cone has its apex at the origin, and has a given axis direction and (positive) half-angle. If the logical is TRUE, then a quick approximation may be found. The approximate result may lie wholly within or wholly outside the guaranteed bound (obtained with FALSE), but it may not cross from inside to outside. Flags in the returned object indicate whether the cone is in fact the best available, and if not whether this result is inside or outside the best cone. The default finds the cone for the spline approximation to the curve, so will be suitable for most derived classes.






protected: virtual logical int_cur::test_point_tol (


SPAposition const&,

// point


double

// tolerance



= 0,


SPAparameter const&

// param guess



= * (SPAparameter* ) NULL_REF,


SPAparameter&

// actual param



= * (SPAparameter* ) NULL_REF


) const;


Tests if a point lies on the curve to a given precision. The default version uses the corresponding function for the approximating spline, to a tolerance expanded using the fit tolerance, and then tests the perpendicular to the true curve. It is suitable for most derived classes.






protected: virtual char const*


int_cur::type_name () const = 0;


Returns the string "int_cur".






protected: void int_cur::update_data (


bs3_curve // bs3_curve


);


Update the range and closure information from a bs3_curve.

Internal Use: deep_copy_elements, full_size




Related Fncs: restore_int_int_cur
PDF/KERN/32CLF.PDF
HTM/DATA/KERN/KERN/32CLF/0014.HTM