Home

curve Class Reference
[curves]

Provides methods and data common to all curve subclasses. More...

#include <curdef.hxx>

Inheritance diagram for curve:

Inheritance graph
[legend]
Collaboration diagram for curve:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual int accurate_derivs (const SPAinterval &range=*(SPAinterval *) NULL_REF) const
 Returns the number of derivatives of this curve that can be found accurately and relatively directly.
virtual const double * all_discontinuities (int &n_discont, int order)
 Returns the number and parameter values of all discontinuities of this curve, up to the given order (maximum three).
virtual double approx_error () const
 Returns the maximum error between the approximate evaluation of this curve and the true evaluation of it.
SPAbox bound (double start, double end, const SPAtransf &transf=*(SPAtransf *) NULL_REF) const
 Retained temporarily for historical reasons.
virtual SPAbox bound (const SPAbox &region, const SPAtransf &transf=*(SPAtransf *) NULL_REF) const =0
 Returns an object space bounding box surrounding the portion of this curve within the given box.
virtual SPAbox bound (const SPAinterval &range, const SPAtransf &transf=*(SPAtransf *) NULL_REF) const =0
 Returns a box surrounding the portion of this curve between two parameter values.
virtual SPAbox bound (const SPAposition &pos1, const SPAposition &pos2, const SPAtransf &transf=*(SPAtransf *) NULL_REF) const =0
 Finds a box around this curve, or portion thereof, bounded by points on the curve increasing in parameter value.
virtual void change_event ()
 Notifies the derived type that this curve has been changed.
virtual check_status_listcheck (const check_fix &input=*(const check_fix *) NULL_REF, check_fix &result=*(check_fix *) NULL_REF, const check_status_list *chks=(const check_status_list *) NULL_REF)
 Checks for any data errors in this curve, and corrects the errors if possible.
virtual logical closed () const =0
 Indicates whether this curve is closed.
virtual void closest_point (const SPAposition &pos, SPAposition &foot, const SPAparameter &param_guess=*(SPAparameter *) NULL_REF, SPAparameter &param_actual=*(SPAparameter *) NULL_REF) const
 Finds the closest point on this curve (the foot) to the given point.
curvecopy_curve () const
 Makes a copy of this curve.
 curve ()
 Constructs a curve (default constructor).
virtual void debug (const char *lead, FILE *fp=debug_file_ptr) const =0
 Writes a description of this curve to a file.
virtual curvedeep_copy (pointer_map *pm=NULL) const =0
 Creates a copy of this object that does not share any data with the original.
virtual const double * discontinuities (int &n_discont, int order) const
 Returns the number and parameter values of discontinuities of this curve, of the given order (maximum three), in a read-only array.
virtual int discontinuous_at (double t) const
 Determines whether a particular parameter value represents a discontinuity of this curve.
virtual curve_boundcyl enclosing_cylinder (const SPAinterval &range=*(SPAinterval *) NULL_REF) const =0
 Returns a cylinder that encloses the portion of this curve bounded by the given parameter interval.
virtual void eval (double param, SPAposition &pos, SPAvector &first_deriv=*(SPAvector *) NULL_REF, SPAvector &second_deriv=*(SPAvector *) NULL_REF, logical eval_repeated=FALSE, logical approx_ok=FALSE) const
 Evaluates this curve at a given parameter value, returning the position and the first and second derivatives (all optionally).
virtual SPAvector eval_curvature (double param, logical eval_repeated=FALSE, logical approx_ok=FALSE) const
 Finds the curvature at the given parameter value on this curve.
virtual SPAvector eval_deriv (double param, logical eval_repeated=FALSE, logical approx_ok=FALSE) const
 Finds the derivative (direction and magnitude) at the given parameter value on this curve.
virtual double eval_deriv_len (double param, logical eval_repeated=FALSE, logical approx_ok=FALSE) const
 Finds the magnitude of the derivative at the given parameter value on this curve.
virtual SPAunit_vector eval_direction (double param, logical eval_repeated=FALSE, logical approx_ok=FALSE) const
 Finds the tangent direction at the given parameter value on this curve.
virtual SPAposition eval_position (double param, logical eval_repeated=FALSE, logical approx_ok=FALSE) const
 Finds the point on this curve corresponding to a given parameter value.
virtual int evaluate (double param, SPAposition &pos, SPAvector **derivs=NULL, int num=0, evaluate_curve_side side=evaluate_curve_unknown) const
 Calculates derivatives, of any order up to the number requested, and store them in vectors provided by the user.
virtual int evaluate_iter (double param, curve_evaldata *ini_data, SPAposition &pos, SPAvector **derivs=NULL, int num=0, evaluate_curve_side side=evaluate_curve_unknown) const
 Calculates derivatives, of any order up to the number requested, in an iterative fashion.
virtual curve_extremum * find_extrema (const SPAunit_vector &dir) const =0
 Finds the extrema of this curve in a given direction.
virtual const discontinuity_infoget_disc_info () const
 Returns read-only access to a discontinuity_info object, if there is one.
virtual int high_curvature (double k, SPAinterval *&spans) const
 Finds regions of high curvature of this curve.
virtual lawlaw_form ()
 Returns a pointer to the law form of this curve, or else NULL.
virtual double length (double param1, double param2, logical approx_ok=TRUE) const =0
 Returns the algebraic distance (arc length) along this curve between the two given parameters.
virtual double length_param (double param, double length, logical approx_ok=TRUE) const =0
 Returns the parameter value of the point on this curve at the given algebraic arc length from that defined by the given parameter.
void limit (const SPAinterval &range)
 Subsets this curve in place, ensuring canonical results if the underlying curve is bounded or periodic.
virtual curvemake_copy () const =0
 Makes a copy of this curve.
virtual curve_evaldata * make_evaldata () const
 Constructs a data object to retain evaluation information across calls to the evaluate_iter method.
virtual logical need_save_as_approx (int save_to_version, logical check_progenitors) const
 Queries whether the object needs to be saved to an old version as an approximation.
virtual curvenegate ()=0
 Reverses the sense of this curve.
logical operator!= (const curve &cur) const
 Tests this curve for inequality to another curve.
virtual curveoperator*= (const SPAtransf &transf)=0
 Transforms this curve.
virtual logical operator== (const curve &cur) const
 Tests this curve for equality to another curve.
virtual double param (const SPAposition &pos, const SPAparameter &param_guess=*(SPAparameter *) NULL_REF) const =0
 Finds the parameter value of a given position on the curve.
virtual double param_period () const =0
 Returns the period of a periodic curve, or 0 if this curve is not periodic.
virtual SPAinterval param_range (const SPAbox &region=*(SPAbox *) NULL_REF) const =0
 Returns the principal parameter range of this curve.
virtual pcurvepcur (int n, logical copy_curve=FALSE) const
 Returns the nth parametric curve.
virtual logical pcur_present (int n) const
 Determines if the nth parameter-space curve is defined for this curve.
virtual logical periodic () const =0
 Indicates if this curve is periodic.
virtual SPAvector point_curvature (const SPAposition &pos, const SPAparameter &param_guess=*(SPAparameter *) NULL_REF) const =0
 Finds the curvature of this curve at the given point.
virtual SPAunit_vector point_direction (const SPAposition &pos, const SPAparameter &param_guess=*(SPAparameter *) NULL_REF) const =0
 Finds tangent direction of this curve at the given point.
void point_perp (const SPAposition &point, SPAposition &foot, const SPAparameter &param_guess=*(SPAparameter *) NULL_REF, SPAparameter &param_actual=*(SPAparameter *) NULL_REF, logical f_weak=FALSE) const
 Finds the foot of the perpendicular from the given point to this curve and the corresponding parameter value.
void point_perp (const SPAposition &point, SPAposition &foot, SPAunit_vector &tangent, const SPAparameter &param_guess=*(SPAparameter *) NULL_REF, SPAparameter &param_actual=*(SPAparameter *) NULL_REF, logical f_weak=FALSE) const
 Finds the foot of the perpendicular from the given point to this curve, the tangent to the curve at that point, and the corresponding parameter value.
virtual void point_perp (const SPAposition &point, SPAposition &foot, SPAunit_vector &tangent, SPAvector &curvature, const SPAparameter &param_guess=*(SPAparameter *) NULL_REF, SPAparameter &actual_param=*(SPAparameter *) NULL_REF, logical f_weak=FALSE) const =0
 Finds the foot of the perpendicular from the given point to this curve, the tangent and curvature of the curve at that point, and the corresponding parameter value.
void restore_data ()
 Restores the data for this curve, according to its type.
virtual void save () const =0
 Saves a curve of unknown type, together with its type code for later retrieval.
void save_curve () const
 Saves a curve of unknown type, or NULL.
void save_data () const
 Saves a curve of a known type.
virtual curvesplit (double param, const SPAposition &pos=*(SPAposition *) NULL_REF)
 Splits this curve at the given parameter value, if possible.
curvesubset (const SPAinterval &range) const
 Constructs a subsetted copy of this curve.
logical subsetted () const
 Indicates whether this curve has a significant subset range.
virtual curve_tancone tangent_cone (const SPAinterval &range, logical approx_OK=FALSE, const SPAtransf &transf=*(SPAtransf *) NULL_REF) const =0
 Returns a cone bounding the tangent direction of this curve.
logical test_point (const SPAposition &pos, const SPAparameter &param_guess=*(SPAparameter *) NULL_REF, SPAparameter &param_actual=*(SPAparameter *) NULL_REF) const
 Tests point-on-curve, optionally returning the exact parameter value if the point is on this curve.
virtual logical test_point_tol (const SPAposition &pos, double tol=0, const SPAparameter &param_guess=*(SPAparameter *) NULL_REF, SPAparameter &param_actual=*(SPAparameter *) NULL_REF) const =0
 Tests point-on-curve to a given precision, optionally returning the exact parameter value if the point is on this curve.
virtual int type () const =0
 Returns an identifier that specifies the curve type.
virtual char const * type_name () const =0
 Returns the string "curve".
virtual logical undef () const
 Indicates whether this curve is properly defined.
logical undefined () const
 Indicates whether this curve is properly defined.
void unlimit ()
 Removes the parameter limits from this curve.
curveunsubset () const
 Constructs a copy of the unbounded curve underlying this one.
virtual ~curve ()
 C++ destructor, deleting a curve.

Protected Member Functions

virtual int finite_difference_derivatives (double param, SPAposition &pos, SPAvector **derivs, int nd, int nfound, double dt, evaluate_curve_side side) const
 Evaluate higher derivatives than are available accurately in evaluate by finite differencing.

Protected Attributes

SPAinterval subset_range
 Range to which this curve is subsetted.

Friends

curverestore_curve ()
 Restores a curve.


Detailed Description

Provides methods and data common to all curve subclasses.


Role: The curve class is a base class from which all specific curve geometry classes (straight, ellipse, helix, and intcurve) are derived. It defines a large variety of virtual functions for generic interaction with curves.

Consider each curve in ACIS as a parametric curve that maps an interval of the real line into a 3D vector space (object space). The mapping is continuous and one-to-one, except for closed curves.

Considered as a function of its parameter, a curve is assumed to have a continuous first derivative whose length is bounded above and below by nonzero constants. There is no hard and fast rule about the values of these bounds or about the rate of change of the length of the derivative.

The curve class defines virtual functions having the following functionality:

See also:
BDY_GEOM_PLANE, blend_spl_sur, blend_support, bounded_curve, curve_law_data, rot_spl_sur, subset_int_cur, sum_spl_sur, surf_surf_int, sweep_spl_sur, wire_law_data, SPAinterval

Constructor & Destructor Documentation

curve::curve (  )  [inline]

Constructs a curve (default constructor).



Role: Requests memory for this object but does not populate it.

virtual curve::~curve (  )  [virtual]

C++ destructor, deleting a curve.



Role: Ensures a derived class destructor is consulted when destroying a curve.


Member Function Documentation

virtual int curve::accurate_derivs ( const SPAinterval range = *(SPAinterval *) NULL_REF  )  const [virtual]

Returns the number of derivatives of this curve that can be found accurately and relatively directly.



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

Parameters:
range portion of the curve to be considered (optional).

Reimplemented in ellipse, helix, intcurve, and straight.

virtual const double* curve::all_discontinuities ( int &  n_discont,
int  order 
) [virtual]

Returns the number and parameter values of all discontinuities of this curve, up to the given order (maximum three).



Role: The returned array is read-only.

Parameters:
n_discont number of discontinuities found.
order maximum order of the discontinuities.

Reimplemented in intcurve.

virtual double curve::approx_error (  )  const [virtual]

Returns the maximum error between the approximate evaluation of this curve and the true evaluation of it.

Reimplemented in intcurve.

SPAbox curve::bound ( double  start,
double  end,
const SPAtransf transf = *(SPAtransf*)NULL_REF 
) const [inline]

Retained temporarily for historical reasons.



Parameters:
start start parameter.
end end parameter.
transf transformation.

Reimplemented in ellipse, intcurve, and straight.

virtual SPAbox curve::bound ( const SPAbox region,
const SPAtransf transf = *(SPAtransf *) NULL_REF 
) const [pure virtual]

Returns an object space bounding box surrounding the portion of this curve within the given box.



Role: There is no guarantee that the box will be minimal.

Parameters:
region the region of interest.
transf optional transformation.

Implemented in ellipse, helix, intcurve, and straight.

virtual SPAbox curve::bound ( const SPAinterval range,
const SPAtransf transf = *(SPAtransf *) NULL_REF 
) const [pure virtual]

Returns a box surrounding the portion of this curve between two parameter values.



Role: The resulting box is not necessarily the minimal one.

Parameters:
range the range of interest.
transf optional transformation.

Implemented in ellipse, helix, intcurve, and straight.

virtual SPAbox curve::bound ( const SPAposition pos1,
const SPAposition pos2,
const SPAtransf transf = *(SPAtransf *) NULL_REF 
) const [pure virtual]

Finds a box around this curve, or portion thereof, bounded by points on the curve increasing in parameter value.



Role: The points lie on the curve as supplied, not as transmitted. The resulting box is not necessarily the minimal one.

Parameters:
pos1 first bounding position.
pos2 second bounding position.
transf optional transformation.

Implemented in ellipse, helix, intcurve, and straight.

virtual void curve::change_event (  )  [virtual]

Notifies the derived type that this curve has been changed.



Role: Used when the subset_range has changed, so that the curve can update itself. The default version of this method does nothing.

Reimplemented in intcurve.

virtual check_status_list* curve::check ( const check_fix &  input = *(const check_fix *) NULL_REF,
check_fix &  result = *(check_fix *) NULL_REF,
const check_status_list chks = (const check_status_list *) NULL_REF 
) [virtual]

Checks for any data errors in this curve, and corrects the errors if possible.



Role: 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 allowed fixes is none (nothing 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.

Parameters:
input set of flags for fixes allowed.
result fixes applied.
chks checks to be made (default is none).

Reimplemented in helix, and intcurve.

virtual logical curve::closed (  )  const [pure virtual]

Indicates whether this curve is closed.



Role: A closed curve joins itself (smoothly or not) at the ends of its principal parameter range. This function should always return TRUE if periodic returns TRUE.

Implemented in ellipse, helix, intcurve, and straight.

virtual void curve::closest_point ( const SPAposition pos,
SPAposition foot,
const SPAparameter param_guess = *(SPAparameter*)NULL_REF,
SPAparameter param_actual = *(SPAparameter*)NULL_REF 
) const [inline, virtual]

Finds the closest point on this curve (the foot) to the given point.



Role: Optionally finds its parameter value as well. If an input parameter is supplied (as the first SPAparameter argument), the foot found is only the local solution nearest to the supplied parameter's position. Any of the return value arguments may be a NULL reference, in which case it is simply ignored.

Parameters:
pos position whose closest curve point is desired.
foot closest position on the curve.
param_guess parameter guess.
param_actual actual parameter.

Reimplemented in ellipse, and intcurve.

curve* curve::copy_curve (  )  const [inline]

Makes a copy of this curve.

virtual void curve::debug ( const char *  lead,
FILE *  fp = debug_file_ptr 
) const [pure virtual]

Writes a description of this curve to a file.



Parameters:
lead leader string.
fp FILE pointer.

Implemented in ellipse, helix, intcurve, and straight.

virtual curve* curve::deep_copy ( pointer_map pm = NULL  )  const [pure virtual]

Creates a copy of this object that does not share any data with the original.



Role: 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.

Parameters:
pm list of items within the object that are already deep copied.

Implemented in ellipse, helix, intcurve, and straight.

virtual const double* curve::discontinuities ( int &  n_discont,
int  order 
) const [virtual]

Returns the number and parameter values of discontinuities of this curve, of the given order (maximum three), in a read-only array.



Parameters:
n_discont number of discontinuities found.
order order of the discontinuities.

Reimplemented in intcurve.

virtual int curve::discontinuous_at ( double  t  )  const [virtual]

Determines whether a particular parameter value represents a discontinuity of this curve.



Role: If there is a discontinuity at the given parameter value, returns the order of the discontinuity. Otherwise, returns 0.

Parameters:
t parameter value to test.

Reimplemented in intcurve.

virtual curve_boundcyl curve::enclosing_cylinder ( const SPAinterval range = *(SPAinterval *) NULL_REF  )  const [pure virtual]

Returns a cylinder that encloses the portion of this curve bounded by the given parameter interval.



Parameters:
range region of interest.

Implemented in ellipse, helix, intcurve, and straight.

virtual void curve::eval ( double  param,
SPAposition pos,
SPAvector first_deriv = *(SPAvector *) NULL_REF,
SPAvector second_deriv = *(SPAvector *) NULL_REF,
logical  eval_repeated = FALSE,
logical  approx_ok = FALSE 
) const [virtual]

Evaluates this curve at a given parameter value, returning the position and the first and second derivatives (all optionally).



Role: The first logical argument, if TRUE, is a guarantee from the calling code that the most recent call to any curve or surface member function was in fact to the routine for the same curve as the current call. It allows an implementation to cache useful intermediate results to speed up repeated calculations, but must be used with extreme care.

The second logical argument may be set to TRUE if an approximate return value is acceptable. Here "approximate" is not well-defined, but may be assumed to be sufficient for visual inspection of the curve.

Parameters:
param parameter value at which to perform the evaluation.
pos position on curve at the specified parameter.
first_deriv first derivative at the specified parameter.
second_deriv second derivative at the specified parameter.
eval_repeated flag to signal a repeated evaluation.
approx_ok flag to signal that approximate results are OK.

Reimplemented in ellipse, helix, intcurve, and straight.

virtual SPAvector curve::eval_curvature ( double  param,
logical  eval_repeated = FALSE,
logical  approx_ok = FALSE 
) const [virtual]

Finds the curvature at the given parameter value on this curve.



Role: See the description of the eval method regarding the two logical arguments.

Parameters:
param parameter value at which to perform the evaluation.
eval_repeated flag to signal a repeated evaluation.
approx_ok flag to signal that approximate results are OK.

Reimplemented in intcurve, and straight.

virtual SPAvector curve::eval_deriv ( double  param,
logical  eval_repeated = FALSE,
logical  approx_ok = FALSE 
) const [virtual]

Finds the derivative (direction and magnitude) at the given parameter value on this curve.



Role: See the description of the eval method regarding the two logical arguments.

Parameters:
param parameter value at which to perform the evaluation.
eval_repeated flag to signal a repeated evaluation.
approx_ok flag to signal that approximate results are OK.

Reimplemented in intcurve.

virtual double curve::eval_deriv_len ( double  param,
logical  eval_repeated = FALSE,
logical  approx_ok = FALSE 
) const [virtual]

Finds the magnitude of the derivative at the given parameter value on this curve.



Role: See the description of the eval method regarding the two logical arguments.

Parameters:
param parameter value at which to perform the evaluation.
eval_repeated flag to signal a repeated evaluation.
approx_ok flag to signal that approximate results are OK.

Reimplemented in straight.

virtual SPAunit_vector curve::eval_direction ( double  param,
logical  eval_repeated = FALSE,
logical  approx_ok = FALSE 
) const [virtual]

Finds the tangent direction at the given parameter value on this curve.



Role: See the description of the eval method regarding the two logical arguments.

Parameters:
param parameter value at which to perform the evaluation.
eval_repeated flag to signal a repeated evaluation.
approx_ok flag to signal that approximate results are OK.

Reimplemented in intcurve.

virtual SPAposition curve::eval_position ( double  param,
logical  eval_repeated = FALSE,
logical  approx_ok = FALSE 
) const [virtual]

Finds the point on this curve corresponding to a given parameter value.



Role: See the description of the eval method regarding the two logical arguments.

Parameters:
param parameter value at which to perform the evaluation.
eval_repeated flag to signal a repeated evaluation.
approx_ok flag to signal that approximate results are OK.

Reimplemented in intcurve.

virtual int curve::evaluate ( double  param,
SPAposition pos,
SPAvector **  derivs = NULL,
int  num = 0,
evaluate_curve_side  side = evaluate_curve_unknown 
) const [virtual]

Calculates derivatives, of any order up to the number requested, and store them in vectors provided by the user.



Role: This function returns the number it was able to calculate; this is equal to the number requested in all but the most exceptional circumstances. A certain number are evaluated directly and (more or less) accurately; higher derivatives are automatically calculated by finite differencing. The accuracy of these decreases with the order of the derivative, as the cost increases.

Any of the derivs pointers may be NULL, in which case the corresponding derivative will not be returned.

Parameters:
param the parameter at which the curve is to be evaluated.
pos point on the curve at the given parameter.
derivs pointer arrays of derivatives.
num the number of derivatives required.
side the evaluation location - above, below, or "don't care".

Reimplemented in ellipse, helix, intcurve, and straight.

virtual int curve::evaluate_iter ( double  param,
curve_evaldata *  ini_data,
SPAposition pos,
SPAvector **  derivs = NULL,
int  num = 0,
evaluate_curve_side  side = evaluate_curve_unknown 
) const [virtual]

Calculates derivatives, of any order up to the number requested, in an iterative fashion.



Role: The purpose of this method is the same as that of evaluate, but evaluate_iter is additionally supplied with a data object that contains results from a previous close evaluation, for use as initial values for any iteration involved. This object may furthermore be updated to reflect the results of this evaluation. The default implementation simply ignores this object and calls evaluate.

Parameters:
param the parameter at which the curve is to be evaluated.
ini_data data supplying initial values.
pos point on the curve at the given parameter.
derivs pointer arrays of derivatives.
num the number of derivatives required.
side the evaluation location - above, below, or "don't care".

Reimplemented in intcurve.

virtual curve_extremum* curve::find_extrema ( const SPAunit_vector dir  )  const [pure virtual]

Finds the extrema of this curve in a given direction.



Parameters:
dir direction in which to find the extrema.

Implemented in ellipse, helix, intcurve, and straight.

virtual int curve::finite_difference_derivatives ( double  param,
SPAposition pos,
SPAvector **  derivs,
int  nd,
int  nfound,
double  dt,
evaluate_curve_side  side 
) const [protected, virtual]

Evaluate higher derivatives than are available accurately in evaluate by finite differencing.



Role: Any of the derivs pointers may be NULL, in which case the corresponding derivative will not be returned.

Parameters:
param the parameter at which the curve is to be evaluated.
pos point on the curve at the given parameter.
derivs pointer arrays of derivatives.
nd the number of derivatives required.
nfound the number of derivatives already evaluated, and directly evaluable in the neighborhood of the param.
dt the finite differencing step to use.
side the evaluation location - above, below, or "don't care".

virtual const discontinuity_info& curve::get_disc_info (  )  const [virtual]

Returns read-only access to a discontinuity_info object, if there is one.



Role: The default version of this method returns NULL.

Reimplemented in intcurve.

virtual int curve::high_curvature ( double  k,
SPAinterval *&  spans 
) const [virtual]

Finds regions of high curvature of this curve.



Role: This method creates an array of intervals in the spans argument, to signify ranges over which the curvature exceeds the given value, k. It returns the number of intervals in the array. The array of intervals is created on the heap and it is the responsibility of the caller to provide for the destruction of this array.

Parameters:
k given curvature value.
spans the array of intervals.

Reimplemented in ellipse, helix, and straight.

virtual law* curve::law_form (  )  [inline, virtual]

Returns a pointer to the law form of this curve, or else NULL.

Reimplemented in ellipse, helix, intcurve, and straight.

virtual double curve::length ( double  param1,
double  param2,
logical  approx_ok = TRUE 
) const [pure virtual]

Returns the algebraic distance (arc length) along this curve between the two given parameters.



Role: The sign is positive if the parameter values are given in increasing order and negative if they are in decreasing order.

Parameters:
param1 first parameter bounding the arc.
param2 second parameter bounding the arc.
approx_ok If approx_ok is true, and the curve has a B-spline approximation, then this approximation is used in the length calculation.

Implemented in ellipse, helix, intcurve, and straight.

virtual double curve::length_param ( double  param,
double  length,
logical  approx_ok = TRUE 
) const [pure virtual]

Returns the parameter value of the point on this curve at the given algebraic arc length from that defined by the given parameter.



Role: This method is the inverse of the length method. The result is not defined for a bounded nonperiodic curve if the param argument is outside the parameter range, or if the length argument is outside the range bounded by the values for the ends of the parameter range.

Parameters:
param datum parameter value.
length arc length.
approx_ok If approx_ok is true, and the curve has a B-spline approximation, then this approximation is used in the length calculation.

Implemented in ellipse, helix, intcurve, and straight.

void curve::limit ( const SPAinterval range  ) 

Subsets this curve in place, ensuring canonical results if the underlying curve is bounded or periodic.



Parameters:
range subset range.

virtual curve* curve::make_copy (  )  const [pure virtual]

Makes a copy of this curve.



Role: This is a pure virtual function to ensure that each derived class defines its own.

Implemented in ellipse, helix, intcurve, and straight.

virtual curve_evaldata* curve::make_evaldata (  )  const [virtual]

Constructs a data object to retain evaluation information across calls to the evaluate_iter method.



Role: 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. The default returns NULL, indicating that no special information is required or usable.

Reimplemented in intcurve.

virtual logical curve::need_save_as_approx ( int  save_to_version,
logical  check_progenitors 
) const [virtual]

Queries whether the object needs to be saved to an old version as an approximation.



Role: Called by SAT save APIs with check_progenitors == TRUE to determine if an object needs to be tolerantly simplified before being saved to an old version. The check_progenitors flag indicates that the object should call need_save_as_approx on any curve or surface construction geometry upon which it depends, and return TRUE if any of the progenitors do. Customers with their own derived curve or surface types should override this routine to return TRUE whenever they want their geometry to be imported (as a B-spline approximation) into other applications or when saving to a version of their application before the derived geometry type in question existed.

Parameters:
save_to_version ACIS version to which the object will be saved
check_progenitors if TRUE, query construction geometry and base class as well

Reimplemented in helix, and intcurve.

virtual curve& curve::negate (  )  [pure virtual]

Reverses the sense of this curve.

Implemented in ellipse, helix, intcurve, and straight.

logical curve::operator!= ( const curve cur  )  const [inline]

Tests this curve for inequality to another curve.



Parameters:
cur curve to compare for inequality.

virtual curve& curve::operator*= ( const SPAtransf transf  )  [pure virtual]

Transforms this curve.



Parameters:
transf transformation to apply.

Implemented in ellipse, helix, intcurve, and straight.

virtual logical curve::operator== ( const curve cur  )  const [virtual]

Tests this curve for equality to another curve.



Role: This method is not guaranteed to return TRUE for effectively-equal curves, but is guaranteed to return FALSE if the curves are not equal. The result can be used for optimization. The default is FALSE.

Parameters:
cur curve to compare for equality.

Reimplemented in ellipse, helix, intcurve, and straight.

virtual double curve::param ( const SPAposition pos,
const SPAparameter param_guess = *(SPAparameter *) NULL_REF 
) const [pure virtual]

Finds the parameter value of a given position on the curve.



Parameters:
pos the position for which the parameter value is to be found.
param_guess parameter guess.

Implemented in ellipse, helix, intcurve, and straight.

virtual double curve::param_period (  )  const [pure virtual]

Returns the period of a periodic curve, or 0 if this curve is not periodic.

Implemented in ellipse, helix, intcurve, and straight.

virtual SPAinterval curve::param_range ( const SPAbox region = *(SPAbox *) NULL_REF  )  const [pure virtual]

Returns the principal parameter range of this curve.



Role: The definition of a periodic curve is extended to all parameter values by reducing the given parameter modulo the period into this principal range. For an open unbounded curve, the principal range is conventionally the empty interval. For bounded open or nonperiodic curves the curve evaluation functions are defined only for parameter values in this range. If a region of interest is provided, a valid range is always returned, even for an unbounded curve, representing a portion of the curve that is guaranteed to include all segments that lie within the region of interest.

Parameters:
region region of interest.

Implemented in ellipse, helix, intcurve, and straight.

virtual pcurve* curve::pcur ( int  n,
logical  copy_curve = FALSE 
) const [virtual]

Returns the nth parametric curve.



Role: If this curve is defined with respect to n or more surfaces and the nth is parametric, this method returns the corresponding pcurve; otherwise, NULL is returned. If the argument is negative, this method returns the pcurve corresponding to the absolute value of the argument, but reversed in sense.

Parameters:
n integer denoting the parameter-space curve.
copy_curve flag indicating whether the pcurve returned is temporary - if so, the bs2_curve will not be copied, improving performance.

Reimplemented in intcurve.

virtual logical curve::pcur_present ( int  n  )  const [virtual]

Determines if the nth parameter-space curve is defined for this curve.



Parameters:
n integer denoting the parameter-space curve.

Reimplemented in intcurve.

virtual logical curve::periodic (  )  const [pure virtual]

Indicates if this curve is periodic.



Role: If so, it joins itself smoothly at the ends of its principal parameter range, so that EDGEs span the seam.

Implemented in ellipse, helix, intcurve, and straight.

virtual SPAvector curve::point_curvature ( const SPAposition pos,
const SPAparameter param_guess = *(SPAparameter *) NULL_REF 
) const [pure virtual]

Finds the curvature of this curve at the given point.



Parameters:
pos position of the point at which the curvature is to be found.
param_guess parameter guess.

Implemented in ellipse, helix, intcurve, and straight.

virtual SPAunit_vector curve::point_direction ( const SPAposition pos,
const SPAparameter param_guess = *(SPAparameter *) NULL_REF 
) const [pure virtual]

Finds tangent direction of this curve at the given point.



Parameters:
pos position of the point at which the tangent direction is to be found.
param_guess parameter guess.

Implemented in ellipse, helix, intcurve, and straight.

void curve::point_perp ( const SPAposition point,
SPAposition foot,
const SPAparameter param_guess = *(SPAparameter *) NULL_REF,
SPAparameter param_actual = *(SPAparameter *) NULL_REF,
logical  f_weak = FALSE 
) const

Finds the foot of the perpendicular from the given point to this curve and the corresponding parameter value.



Role: And its parameter value. If an input parameter value is supplied (as the first parameter argument), the perpendicular found is the one nearest to the supplied parameter position; otherwise, it is the one that the curve is nearest to the given point. Any of the return value arguments may be a NULL reference, in which case it is simply ignored.

Parameters:
point the input position.
foot the position on the curve.
param_guess parameter guess.
param_actual the actual parameter.
f_weak weak flag.

Reimplemented in ellipse, helix, intcurve, and straight.

void curve::point_perp ( const SPAposition point,
SPAposition foot,
SPAunit_vector tangent,
const SPAparameter param_guess = *(SPAparameter *) NULL_REF,
SPAparameter param_actual = *(SPAparameter *) NULL_REF,
logical  f_weak = FALSE 
) const

Finds the foot of the perpendicular from the given point to this curve, the tangent to the curve at that point, and the corresponding parameter value.



Role: If an input parameter value is supplied (as the param_guess argument), the perpendicular found is the one nearest to the corresponding 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 it is ignored.

Parameters:
point the input position.
foot the position on the curve.
tangent the returned tangent.
param_guess parameter guess.
param_actual the actual parameter.
f_weak weak flag.

Reimplemented in ellipse, helix, intcurve, and straight.

virtual void curve::point_perp ( const SPAposition point,
SPAposition foot,
SPAunit_vector tangent,
SPAvector curvature,
const SPAparameter param_guess = *(SPAparameter *) NULL_REF,
SPAparameter actual_param = *(SPAparameter *) NULL_REF,
logical  f_weak = FALSE 
) const [pure virtual]

Finds the foot of the perpendicular from the given point to this curve, the tangent and curvature of the curve at that point, and the corresponding parameter value.



Role: If an input parameter value is supplied (as the param_guess argument), the perpendicular found is the one nearest to the corresponding 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 it is ignored.

Parameters:
point the input position.
foot the position on the curve.
tangent the returned tangent.
curvature the curvature at the curve position.
param_guess parameter guess.
param_actual the actual parameter.
f_weak weak flag.

Implemented in ellipse, helix, intcurve, and straight.

void curve::restore_data (  ) 

Restores the data for this curve, according to its type.



Role: The base class version of this method only restores the subset_range member. For convenience, it can be called by derived class versions.

The restore operation switches on a table defined by static instances. This invokes a simple friend function which constructs an object of the right derived type. Then it calls the appropriate base class member function to do the actual work. The restore_data function for each class can be called in circumstances when it is known what type of curve is to be expected and a curve of that type is on hand to be filled in.

    if (restore_version_number >= BNDCUR_VERSION)
       read_interval		Interval for the subset range. 

Reimplemented in ellipse, helix, intcurve, and straight.

virtual void curve::save (  )  const [pure virtual]

Saves a curve of unknown type, together with its type code for later retrieval.

Implemented in ellipse, helix, intcurve, and straight.

void curve::save_curve (  )  const

Saves a curve of unknown type, or NULL.



Role: Simply checks for NULL, then calls save.

void curve::save_data (  )  const

Saves a curve of a known type.



Role: The context determines the curve type, so that no type code is necessary. The base class version simply saves the subset_range member - for convenience, it can be called by derived class versions.

Reimplemented in ellipse, helix, intcurve, and straight.

virtual curve* curve::split ( double  param,
const SPAposition pos = *(SPAposition *) NULL_REF 
) [virtual]

Splits this curve at the given parameter value, if possible.



Role: If the curve is splittable, constructs a new curve coincident with and with the same parameterization as the given curve and modifies the given curve to represent only the remainder of the curve. If the curve cannot be split, returns NULL. The default behavior is for the curve to be nonsplittable.

Parameters:
param parameter value at which to split.
pos position on the curve.

Reimplemented in intcurve.

curve* curve::subset ( const SPAinterval range  )  const

Constructs a subsetted copy of this curve.

This method constructs a new curve on the heap and it is the responsibility of the caller to provide for the destruction of this curve.

Parameters:
range the subset range.

Reimplemented in intcurve.

logical curve::subsetted (  )  const

Indicates whether this curve has a significant subset range.

virtual curve_tancone curve::tangent_cone ( const SPAinterval range,
logical  approx_OK = FALSE,
const SPAtransf transf = *(SPAtransf *) NULL_REF 
) const [pure virtual]

Returns a cone bounding the tangent direction of this curve.



Role: The cone is deemed to have its apex at the origin and have a given axis direction and (positive) half angle. If the logical argument is TRUE, then a quick approximation may be found. The approximate result may lie wholly within or wholly outside the guaranteed bound (obtained with a FALSE argument), but 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.

Parameters:
range the given range.
approx_OK approximate result is ok.
transf transformation to apply.

Implemented in ellipse, helix, intcurve, and straight.

logical curve::test_point ( const SPAposition pos,
const SPAparameter param_guess = *(SPAparameter*)NULL_REF,
SPAparameter param_actual = *(SPAparameter*)NULL_REF 
) const [inline]

Tests point-on-curve, optionally returning the exact parameter value if the point is on this curve.



Role: This method tests to standard system precision.

Parameters:
pos position of the point to test.
param_guess parameter guess.
param_actual actual parameter.

virtual logical curve::test_point_tol ( const SPAposition pos,
double  tol = 0,
const SPAparameter param_guess = *(SPAparameter *) NULL_REF,
SPAparameter param_actual = *(SPAparameter *) NULL_REF 
) const [pure virtual]

Tests point-on-curve to a given precision, optionally returning the exact parameter value if the point is on this curve.



Parameters:
pos position of the point to test.
tol tolerance within which to test.
param_guess parameter guess.
param_actual actual parameter.

Implemented in ellipse, helix, intcurve, and straight.

virtual int curve::type (  )  const [pure virtual]

Returns an identifier that specifies the curve type.

Implemented in ellipse, helix, intcurve, and straight.

virtual char const* curve::type_name (  )  const [pure virtual]

Returns the string "curve".

Implemented in ellipse, helix, intcurve, and straight.

virtual logical curve::undef (  )  const [virtual]

Indicates whether this curve is properly defined.



Role: A NULL or generic curve is always undefined - other curves depend on their contents.

Reimplemented in ellipse, helix, intcurve, and straight.

logical curve::undefined (  )  const [inline]

Indicates whether this curve is properly defined.



Role: A NULL or generic curve is always undefined - other curves depend on their contents.

void curve::unlimit (  ) 

Removes the parameter limits from this curve.

curve* curve::unsubset (  )  const

Constructs a copy of the unbounded curve underlying this one.


Friends And Related Function Documentation

curve* restore_curve (  )  [friend]

Restores a curve.



Role: Although this internal function is intended strictly for ACIS usage, a minimal amount of information about this function is provided for the sole purpose of being able to understand and trace restoration from a SAT file. This function should never be called directly, because it makes assumptions about the availability of a SAT file, the location of the input pointer into the SAT file, and the validity of SAT data it expects to read in. It also may start a lengthy process of nested function or class method calls, which have many of the same assumptions.

The restore function does the actual work of restoring the curve. It calls the base class, then reads the selector, if the save file is new enough. This reads the curve type and then switches in the run-time table to the correct restore routine.

    if (restore_version_number < CURVE_VERSION)
       read_int            Integer for the type of curve.
       dispatch_restore_cu Supply the number for the type of curve.
    else
       read_id             Reads in the string associated with the curve identification.
       dispatch_restore_cu Supply the curve identification for the type of curve.


Member Data Documentation

Range to which this curve is subsetted.