bounded_curve
List of: Classes
Subjects: Model Geometry
Contents: Kernel

Purpose: Defines a bounded curve.

Derivation: bounded_curve : ACIS_OBJECT : -

Filename: kern/kernel/geomhusk/bnd_crv.hxx

Description: This class defines bounded curves. A bounded curve is a curve with a start and end parameters that specify the bounds of the curve. This class makes it easy to extract data from wireframe geometry. This class supports most of the functions, such as evaluation, curve length, etc., that are provided in the curve class.

References: KERN curve

Data: protected curve* acis_curve;

The pointer to an ACIS curve.


protected double end_param;

The end parameter of the ACIS curve.


protected double start_param;

The start parameter of the ACIS curve.

Constructor: public: bounded_curve::bounded_curve ();


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






public: bounded_curve::bounded_curve (


const bounded_curve& // given bounded curve


);


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






public: bounded_curve::bounded_curve (


const curve*, // curve


const SPAposition&, // start position


const SPAposition& // end position


);


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


Creates a bounded curve, given a curve and start and end positions. The bounded curve created by this constructor does not own the curve, and it must be deleted explicitly, if needed.






public: bounded_curve::bounded_curve (


const curve*, // curve


double, // start parameter


double // end parameter


);


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


Creates a bounded curve, given a curve and start and end parameters.






public: bounded_curve::bounded_curve (


EDGE*, // given edge


const SPAtransf* // transformation


);


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




Destructor: public: virtual bounded_curve::~bounded_curve ();


C++ destructor, deleting a bounded_curve.



Methods: public: int bounded_curve::acis_type () const;


Returns the type of underlying curve.






public: double bounded_curve::adjust_parameter (


double t // param value to adjust


) const;


Adjusts a parameter value so that it is within the principle range of a periodic curve. If the curve is not periodic, this method returns the input parameter. For a periodic curve, this method returns a parameter value between the start parameter and end parameter.






public: virtual double


bounded_curve::approx_error () const;


Returns a distance value, that represents the greatest discrepancy between positions calculated by calls to eval or eval_position with the approx_OKlogical set by turns to TRUE and FALSE. This method returns 0 as the default for curves that do not distinguish between these cases.






public: SPAbox bounded_curve::bound () const;


Computes a bounding box around the curve. There is no guarantee that the bound is minimal.






public: virtual logical


bounded_curve::change_end_pt (


const SPAposition& // end point


);


Moves the end point of a curve to a new location. For some types of curves this may not be possible; in which case, this method acts the same as set_end_pt.






public: virtual logical


bounded_curve::change_start_pt (


const SPAposition& // start point


);


Moves the start point of a curve to a new location. For some types of curves this may not be possible; in which case, this method acts the same as set_start_pt.






public: virtual logical


bounded_curve::closed () const;


Indicates if a curve is closed. This method joins itself (smoothly or not) at the ends of its principal parameter range. If the periodic method returns TRUE, this method also returns TRUE.






public: virtual bounded_curve* bounded_curve::copy (


const SPAtransf* transform // transformation



= NULL


) const;


Copies the bounded curve, and applies the transform, if given, to the copy.






public: virtual void bounded_curve::debug (


char const*, // indentation


FILE* // file name



= debug_file_ptr


) const;


Writes the debug output for a bounded curve.






public: virtual void bounded_curve::eval (


double, // parameter value


SPAposition*, // point on curve


SPAvector* // first derivative



= NULL,


SPAvector* // second derivative



= NULL,


logical // repeated evaluation?



= FALSE,


logical // approx. results OK?



= FALSE


) const;


Evaluates a curve at a given parameter value, returning the position and the first and second derivatives.


For this and the following inquiry methods, there are two optional logical arguments. The first, if TRUE, is a guarantee from the calling code that the most recent call to any curve or surface member method was in fact to one of these six methods for the same curve as the current call. It allows an implementation to cache useful intermediate results to speed up repeated evaluations, but use it with extreme care. The second logical argument may be set TRUE if an approximate return value is acceptable. Here, approximate may be assumed to be sufficient for visual inspection of the curve.






public: virtual SPAvector


bounded_curve::eval_curvature (


double, // parameter value


logical // repeated evaluation?



= FALSE,


logical // approx. results OK?



= FALSE


) const;


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






public: virtual SPAvector bounded_curve::eval_deriv (


double, // parameter value


logical // repeated evaluation?



= FALSE,


logical // approx. results OK?



= FALSE


) const;


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






public: virtual double


bounded_curve::eval_deriv_len (


double, // parameter value


logical // repeated evaluation?



= FALSE,


logical // approx. results OK?



= FALSE


) const;


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






public: SPAunit_vector bounded_curve::eval_direction (


double, // parameter value


logical // repeated evaluation?



= FALSE,


logical // approx. results OK?



= FALSE


) const;


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






public: virtual SPAposition


bounded_curve::eval_position (


double, // parameter value


logical // repeated evaluation?



= FALSE,


logical // approx. results OK?



= FALSE


) const;


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






public: virtual double bounded_curve::eval_t (


const pick_ray& // pick ray


) const;


Finds the closest point on a curve to a given pick location and return the curve parameter value.






public: virtual curve_extremum*


bounded_curve::find_extrema (


SPAunit_vector const& // unit vector


) const;


Finds the extrema of a curve in a given direction. curve_extremum is defined in kernel/curve/curdef.hxx.






public: curve*


bounded_curve::get_acis_curve () const;


Returns the underlying curve.






public: SPAunit_vector


bounded_curve::get_end_dir () const;


Returns the end direction.






public: double bounded_curve::get_end_param () const;


Returns the end parameter.






public: SPAposition bounded_curve::get_end_pt () const;


Returns the end point.






public: bounded_curve*


bounded_curve::get_full_curve () const;


Returns a copy of this curve. If the curve is a subset of a curve as a result of setting the parameter range, this method returns the full curve.






public: virtual SPAunit_vector


bounded_curve::get_normal () const;


Returns the vector normal to the curve. This method returns the zero vector if the curve is straight or is nonplanar.






public: double


bounded_curve::get_parameter_tolerance (


double t, // tolerance parameter


double tol // tolerance for points


) const;


Returns a tolerance to use for comparing if two parameter values evaluate to the same point.






public: double bounded_curve::get_range () const;


Returns the parameter range.






public: int bounded_curve::get_side (


const SPAunit_vector&, // unit vector for plane


const SPAposition& // point


);


Determines which side of the curve a given point is on relative to a plane defined by a SPAunit_vector. This method returns +1 for right and -1 for left.






public: SPAunit_vector


bounded_curve::get_start_dir () const;


Returns the start direction.






public: double


bounded_curve::get_start_param () const;


Returns the start parameter.






public: SPAposition


bounded_curve::get_start_pt () const;


Returns the start point.






public: virtual logical


bounded_curve::is_arc () const;


Returns TRUE if the given ENTITY is a bounded_curve arc; otherwise, it returns FALSE.






public: virtual logical


bounded_curve::is_in_parallel_plane (


const SPAunit_vector& // unit vector


) const;


Returns TRUE if the given ENTITY if a curve lies in a plane that is perpendicular to the given SPAunit_vector.; otherwise, it returns FALSE.






public: virtual logical bounded_curve::is_in_plane (


const SPAposition&, // position


const SPAunit_vector& // normal to plane


) const;


Returns TRUE if the given ENTITY if a curve lies in a plane; otherwise, it returns FALSE.






public: virtual logical


bounded_curve::is_line () const;


Checks for the line subclass.


Returns TRUE if the given ENTITY is a bounded_curve line; otherwise, it returns FALSE.






public: virtual logical bounded_curve::is_point () const;


Returns TRUE if the given bounded_curve is a bounded_point; otherwise, it returns FALSE. The existence of this method makes the base class aware of some of the derived classes. One often wants to know if a bounded curve is really a line or an arc to do special operations. This is added as a convenience.






public: virtual double bounded_curve::length (


double t0, // first parameter


double t1 // second parameter


) const;


Returns the algebraic distance along the curve between the given parameters. The sign is positive if the parameter values are given in increasing order, and negative if they are 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 method is always a monotonically increasing function of t1 if t0 is held constant, and a decreasing function of t0 if t1 is held constant.






public: virtual double bounded_curve::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. This method is the inverse of the length method. 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.






public: bs3_curve


bounded_curve::make_bs3_curve () const;


Creates a bs3_curve from this bounded curve.






public: virtual EDGE*


bounded_curve::make_edge () const;


Creates an EDGE from this curve.






protected: void bounded_curve::make_valid (


logical signal_error // signal an error?



= FALSE


);


Ensures that the data in a curve is valid. This method helps to avoid checking for a valid curve pointer in acis_curve or the zero parameter range. If logical is TRUE, then this method causes an error to generate.






public: virtual bounded_curve&


bounded_curve::negate ();


Reverses the direction of the curve.






public: virtual bounded_curve&


bounded_curve::operator*= (


SPAtransf const& // transformation


);


Transforms a curve.






public: virtual double bounded_curve::param (


const SPAposition&, // point on the curve


const double* // approx. param value



= NULL


) const;


Finds the parameter value of a point on a curve, corresponding to the given point. The results of this method are only guaranteed to be valid for points on the curve, though particular curve types may give useful curve-dependent results for other points.






public: double bounded_curve::param_from_01 (


double t // parameters


);


Converts from parameters ranging from 0 to 1 to the double range.






public: virtual double


bounded_curve::param_period () const;


Returns the period of a periodic curve. This method returns 0 if the curve is not periodic.






public: double bounded_curve::param_to_01 (


double // parameters


);


Converts to parameters ranging from 0 to 1 to the double range.






public: virtual logical


bounded_curve::periodic () const;


Indicates if a curve is periodic. This method joins itself smoothly at the ends of its principal parameter range, so that edges may span the seam.






public: virtual void bounded_curve::point_perp (


const SPAposition&, // position


SPAposition*, // returned point


SPAunit_vector*, // returned normal


double const* // guess parameter



= NULL,


double* // actual parameter



= NULL,


logical f_weak // weak flag



= FALSE


) const;


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


If an input parameter value is supplied (as the fourth 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 it is ignored.






public: bounded_curve*


bounded_curve::project_to_plane (


const plane& // plane


) const;


Returns a curve that is the projection of this curve onto a plane.






protected: logical bounded_curve::set_acis_curve (


curve* // curve


);


Sets the ACIS curve for this bounded curve.






public: double bounded_curve::set_end_param (


double // end parameter


);


Sets the end parameter.






public: double bounded_curve::set_end_t (


const SPAposition&, // position


const double* // approximate parameter



= NULL // position


);


Sets the end points of a curve. This method assumes that the given position lies on the curve, and it modifies the curve so it ends at that position. If the position is not on the curve, the closest position on the curve is used.






public: void bounded_curve::set_parameter_range (


double, // start parameter


double // end parameter


);


Sets the parameter range.






public: double bounded_curve::set_start_param (


double // start parameter


);


Sets the start parameter.






public: double bounded_curve::set_start_t (


const SPAposition&, // position


const double* // approximate parameter



= NULL // position


);


Sets the start points of a curve. This method assumes that the given position lies on the curve, and it modifies the curve so it starts at that position. If the position is not on the curve, the closest position on the curve is used.


For curves, these methods take an object of class SPAparameter as input for an approximation. For consistency, these methods all use doubles for curve parameters.






public: virtual bounded_curve* bounded_curve::split (


double, // parameter value


SPAposition const& // position curve passes


);


Splits a curve at given parameter value. If the curve is splittable (not closed-in practice one defined or approximated by one or more splines). This method returns a new curve for the low-parameter part, and the old one as the high-parameter part. For a nonsplittable curve, it leaves the old one alone and returns NULL. The default is to make the curve nonsplittable.






public: logical bounded_curve::test_point (


const SPAposition& pos,
// point


const double* param_guess // guess value



= NULL,


double* param_actual
// actual value



= NULL


) const;


Tests point-on-curve, optionally returning the exact parameter value if the point is on the curve. This method tests to standard system precision.






public: virtual logical


bounded_curve::test_point_tol (


const SPAposition&, // position


double // tolerance



= 0,


const double* // guess value



= NULL,


double* // actual value



= NULL


) const;


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






public: const char*


bounded_curve::type_name () const;


Returns the string "bounded_curve".




Related Fncs: get_bounded_curve, new_ellipse
PDF/KERN/28CLB.PDF
HTM/DATA/KERN/KERN/28CLB/0005.HTM