Purpose:
|
Represents an exact spline curve in the parameter space of a surface.
|
|
Derivation:
|
par_int_cur : int_cur : subtrans_object : subtype_object : ACIS_OBJECT : -
|
|
SAT Identifier:
|
"parcur"
|
|
Filename:
|
kern/kernel/kerngeom/intcur/par_int.hxx
|
|
Description:
|
This class represents a 3D spline curve as a 2D parameter curve on a spline surface. The spline surface is used to map the 2D parameter curve from (u,v) parameter space into (x,y,z) euclidean space. The approximate parameter curve is everywhere within the fit tolerance of the exact parameter curve.
|
|
Constructor:
|
public: par_int_cur::par_int_cur
(
|
|
|
bs3_curve,
|
|
|
// spline curve
|
|
|
double,
|
|
|
// fit tolerance
|
|
|
surface const&,
|
|
|
// surface where
|
|
|
|
|
|
|
// curve lies
|
|
|
bs2_curve,
|
|
|
// surface curve
|
|
|
|
|
|
|
// in parameter
|
|
|
|
|
|
|
// space
|
|
|
logical
|
|
|
// surface
|
|
|
|
= TRUE,
|
|
|
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.
|
|
|
Constructs a general parameter curve, given an exact
bs2_curve and an approximate
bs3_curve. If
logical is
TRUE, the surface is made the first surface of the
int_cur; if it is
FALSE, the surface is made the second surface of the
int_cur.
|
|
|
|
|
|
|
public: par_int_cur::par_int_cur
(
|
|
|
bs3_curve,
|
|
|
// spline curve
|
|
|
double,
|
|
|
// fit tolerance
|
|
|
surface const&,
|
|
|
// 1st surface
|
|
|
|
|
|
|
// for curve
|
|
|
surface const&,
|
|
|
// 2nd surface
|
|
|
|
|
|
|
// for curve
|
|
|
bs2_curve,
|
|
|
// 1st curve on
|
|
|
|
|
|
|
// surface
|
|
|
bs2_curve,
|
|
|
// 2nd curve on
|
|
|
|
|
|
|
// surface
|
|
|
logical
|
|
|
// surface
|
|
|
|
|
|
|
// surface
|
|
|
|
= TRUE,
|
|
|
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.
|
|
|
Constructs a general parameter curve, with and additional surface and parameter curve. If
logical is
TRUE, the surface is made the first surface of the
int_cur; if it is
FALSE, the surface is made the second surface of the
int_cur.
|
|
|
|
|
|
|
public: par_int_cur::par_int_cur
(
|
|
|
spline const&,
|
|
|
// surface where
|
|
|
|
|
|
|
// curve lies
|
|
|
par_int_cur_dir,
|
|
|
// select u or v
|
|
|
|
|
|
|
// direction
|
|
|
double,
|
|
|
// constant u or
|
|
|
|
|
|
|
// v parameter
|
|
|
logical
|
|
|
// surface
|
|
|
|
= TRUE,
|
|
|
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.
|
|
|
Constructs a constant parameter curve. If
logical is
TRUE, the surface is made the first surface of the
int_cur; if it is
FALSE, the surface is made the second surface of the
int_cur.
|
|
|
|
|
|
|
public: par_int_cur::par_int_cur
(
|
|
|
const par_int_cur&
|
// par_int_curve
|
|
|
);
|
|
|
C++ copy constructor requests memory for this object and populates it with the data from the object supplied as an argument.
|
|
|
|
Methods:
|
protected: virtual int par_int_cur::accurate_derivs
(
|
|
|
SPAinterval const&
|
|
|
// part of curve
|
|
|
|
= * (SPAinterval*)NULL_REF
|
// to evaluate
|
|
|
) const;
|
|
|
Returns the number of derivatives which evaluate() can find "accurately" (and fairly 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.
|
|
|
|
|
|
|
public: virtual void
|
|
|
par_int_cur::calculate_disc_info ();
|
|
|
Calculates the discontinuity information if it was never stored. This function is intended to support restore of old versions of
int_curs.
|
|
|
|
|
|
|
protected: virtual check_status_list*
|
|
|
par_int_cur::check (
|
|
|
const check_fix& input
|
|
|
// flags for
|
|
|
|
= * (const check_fix*)
|
|
// the allowed
|
|
|
|
NULL_REF,
|
|
|
// fixes
|
|
|
check_fix& result
|
|
|
// fixes applied
|
|
|
|
= * (check_fix*) NULL_REF,
|
|
|
const check_status_list*
|
|
// checks to be
|
|
|
|
= (const check_status_list*)
|
// made. Default
|
|
|
|
NULL_REF
|
|
|
// is none
|
|
);
|
|
|
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.
|
|
|
|
|
|
|
protected: virtual void par_int_cur::debug
(
|
|
|
char const*,
|
// title line
|
|
|
logical,
|
// brief: sets amount
|
|
|
|
|
// of debug returned
|
|
|
FILE*
|
// debug file
|
|
|
) const;
|
|
|
Outputs a title line and the details of the class for inspection to standard output or to the specified file.
|
|
|
|
|
|
|
protected: void par_int_cur::debug_data
(
|
|
|
char const*,
|
// title line
|
|
|
logical,
|
// brief: sets amount
|
|
|
|
|
// of debug returned
|
|
|
FILE*
|
// debug file
|
|
|
) const;
|
|
|
Debug printout. As for save and restore we split the operation into two parts; the virtual function "debug" prints a class-specific identifying line, then calls the ordinary function "debug_data" to put out the details. It is done this way so that a derived class'
debug_data can call its parent's version first, to put out the common data. Indeed, if the derived class has no additional data it need not define its own version of
debug_data and 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* par_int_cur::deep_copy
(
|
|
|
pointer_map* pm
|
// list of items within
|
|
|
|
= NULL
|
// the entity that are
|
|
|
|
|
// already deep copied
|
|
|
) const;
|
|
|
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.
|
|
|
|
|
|
|
protected: virtual void par_int_cur::eval
(
|
|
|
double,
|
// parameter
|
|
|
SPAposition&,
|
// position
|
|
|
SPAvector&,
|
// 1st derivative
|
|
|
SPAvector&,
|
// 2nd derivative
|
|
|
logical
|
// needs precise eval?
|
|
|
) const;
|
|
|
Finds the position and first and second derivative on a curve at the given parameter value.
|
|
|
|
|
|
|
protected: virtual int par_int_cur::evaluate
(
|
|
|
double,
|
|
// parameter
|
|
|
SPAposition&,
|
|
// point on curve at
|
|
|
|
|
|
// given parameter
|
|
|
SPAvector**
|
|
// array of pointers
|
|
|
|
= NULL,
|
|
// to vectors
|
|
|
int
|
|
|
// no. of derivatives
|
|
|
|
= 0,
|
|
// required
|
|
|
evaluate_curve_side
|
|
// eval. location:
|
|
|
|
= evaluate_curve_unknown
|
// above, below or
|
|
|
|
|
|
// don't care
|
|
|
) const;
|
|
|
This function calculates derivatives, of any order up to the number requested, and stores them in vectors provided by the user. It returns the number it was able to calculate. This will be equal to the number requested in all but the most exceptional circumstances. A certain number will be evaluated directly and (more or less) accurately; higher derivatives will be automatically calculated by finite differencing; the accuracy of these decreases with the order of the derivative, as the cost increases.
|
|
|
Any of the pointers in the array of pointers to vectors may be null, in which case the corresponding derivative will not be returned.
|
|
|
|
|
|
|
public: virtual int par_int_cur::evaluate_surfs
(
|
|
|
double,
|
|
|
// parameter
|
|
|
SPAposition&,
|
|
|
// point on curve
|
|
|
|
|
|
|
// at given
|
|
|
|
|
|
|
// parameter
|
|
|
SPAvector*,
|
|
|
// derivatives of
|
|
|
|
|
|
|
// off_int_cur
|
|
|
int& nd_cu,
|
|
|
// no. of curve
|
|
|
|
|
|
|
// derivatives
|
|
|
|
|
|
|
// required/calc.
|
|
|
int& nd_sf,
|
|
|
// no. of surface
|
|
|
|
|
|
|
// derivatives
|
|
|
|
|
|
|
// required/calc.
|
|
|
evaluate_curve_side
|
|
|
// the evaluation
|
|
|
|
= evaluate_curve_unknown,
|
// location
|
|
|
|
|
|
|
// above, below
|
|
|
|
|
|
|
// or don't care
|
|
|
SPAposition&
|
|
|
// point on
|
|
|
|
= * (SPAposition*) NULL_REF,
|
// support
|
|
|
|
|
|
|
// surface 1
|
|
|
SPAvector*
|
|
|
// derivatives of
|
|
|
|
= NULL,
|
|
|
// 1st support
|
|
|
|
|
|
|
// surface
|
|
|
SPAposition&
|
|
|
// point on
|
|
|
|
= * (SPAposition*) NULL_REF,
|
// support
|
|
|
|
|
|
|
// surface 2
|
|
|
SPAvector*
|
|
|
// derivatives of
|
|
|
|
= NULL,
|
|
|
// 2nd support
|
|
|
|
|
|
|
// surface
|
|
|
SPApar_pos&
|
|
|
// Parameters on
|
|
|
|
= * (SPApar_pos*) NULL_REF,
|
// surface 1
|
|
|
SPApar_vec*
|
|
|
// derivatives of
|
|
|
|
= NULL,
|
|
|
// parameters on
|
|
|
|
|
|
|
// surface 1
|
|
|
SPApar_pos&
|
|
|
// Parameters on
|
|
|
|
= * (SPApar_pos*) NULL_REF,
|
// surface 2
|
|
|
SPApar_vec*
|
|
|
// derivatives of
|
|
|
|
= NULL,
|
|
|
// parameters on
|
|
|
|
|
|
|
// surface 2
|
|
|
SPApar_pos const&
|
|
|
// optional guess
|
|
|
|
= * (SPApar_pos* )NULL_REF,
|
// value for 1st
|
|
|
|
|
|
|
// par_pos
|
|
|
SPApar_pos const&
|
|
|
// optional guess
|
|
|
|
= * (SPApar_pos* )NULL_REF
|
// value for 2nd
|
|
|
|
|
|
|
// par_pos
|
|
|
) const;
|
|
|
An evaluator that takes surface arguments in addition to the usual 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 wrt 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.
|
|
|
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
|
|
|
|
|
|
|
public: static int par_int_cur::id
();
|
|
|
Returns the ID for the
par_int_cur list.
|
|
|
|
|
|
|
protected: virtual void par_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 returns the approximating curve but does not store it, so that it can be a const function.
|
|
|
|
|
|
|
protected: virtual curve_evaldata*
|
|
|
par_int_cur::make_evaldata () const;
|
|
|
Constructs 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 double par_int_cur::param
(
|
|
|
SPAposition const&,
|
// position
|
|
|
SPAparameter const&
|
// parameter
|
|
|
) const;
|
|
|
Parameter value for a given point on a curve.
|
|
|
|
|
|
|
private: void par_int_cur::restore_data ();
|
|
|
Restores the information for the
par_int_cur from the save file. This method is never called directly. It is called by a higher hierarchical function if an item in the SAT file is determined to be of this class type. An instance of this class will already have been created through the allocation constructor. This method then populates the class instance with the appropriate data from the SAT file.
|
|
|
int_cur::restore_common_data
|
Restore the underlying interpolated curve
|
|
if (restore_version_number >= PARCUR_VERSION)
|
|
|
read_logical
|
|
|
Either "surf2" or "surf1"
|
|
|
|
|
|
|
public: virtual void par_int_cur::save_data
() const;
|
|
|
Saves the information for the
par_int_cur to the save file. Stores the information from this class to the save file. This method is never called directly. It is called by a higher hierarchical function if an item in the SAT file is determined to be of this class type.
|
|
|
|
|
|
|
protected: virtual void par_int_cur::split
(
|
|
|
double,
|
// parameter value
|
|
|
SPAposition const&,
|
// position of split
|
|
|
int_cur* [ 2 ]
|
// 2 pieces after split
|
|
|
);
|
|
|
Divides an intersection curve into two pieces at a given parameter value, possibly adjusting the spline approximations to an exact value at the split point.
|
|
|
|
|
|
|
public: virtual int par_int_cur::type
() const;
|
|
|
Returns the type of
par_int_cur.
|
|
|
|
|
|
|
public: virtual char const*
|
|
|
par_int_cur::type_name () const;
|
|
|
Returns the string "parcur".
|
|
Internal Use:
|
evaluate_iter, full_size
|
|
|
|
|
Related Fncs:
|
restore_par_int_cur
|