cgma
|
00001 //------------------------------------------------------------------------- 00002 // Filename : SubCurve.hpp 00003 // 00004 // Purpose : 00005 // 00006 // Special Notes : 00007 // 00008 // Creator : Jason Kraftcheck 00009 // 00010 // Creation Date : 04/10/02 00011 //------------------------------------------------------------------------- 00012 00013 #ifndef SUB_CURVE_HPP 00014 #define SUB_CURVE_HPP 00015 00016 #include "PartitionCurve.hpp" 00017 00018 class SubCurve : public PartitionCurve 00019 { 00020 00021 public: 00022 00023 PartitionCurve* split( double param ); 00024 CubitStatus combine( PartitionCurve* dead_curve ); 00025 00026 00027 SubCurve( Curve* curve_ptr ); 00028 SubCurve( SubCurve* curve_ptr, double start_param ); 00029 00030 ~SubCurve(); 00031 00032 Curve* real_curve() const; 00033 00034 int num_partitions() const; 00035 void get_all_partitions( DLIList<TopologyBridge*>& curves ) const; 00036 00037 CubitStatus get_graphics( GMem& result, 00038 double angle_tolerance = 0, 00039 double distance_tolernace = 0, 00040 double max_edge_length = 0); 00041 00042 void reverse_sense(); 00043 00044 virtual CubitStatus save(CubitSimpleAttrib&); 00045 00046 /*** Methods from GeometryEntity ***/ 00047 00048 CubitBox bounding_box() const; 00049 double measure(); 00050 GeometryType geometry_type(); 00051 00052 /*** Methods from Curve ***/ 00053 00054 CubitStatus closest_point( CubitVector const& from, CubitVector& closest, 00055 CubitVector* tangent = 0, CubitVector* curvature = 0, 00056 double* param = 0 ); 00057 CubitPointContainment point_containment( const CubitVector& point ); 00058 CubitBoolean is_position_on( const CubitVector& position ); 00059 CubitBoolean G1_discontinuous( double u, CubitVector* minus_tangent = 0, 00060 CubitVector* plus_tangent = 0 ); 00061 CubitStatus get_interior_extrema( DLIList<CubitVector*>& points, CubitSense& sense ); 00062 CubitStatus get_center_radius( CubitVector& center, double& radius ); 00063 00064 CubitBoolean get_param_range( double& lower, double& upper ); 00065 double start_param(); 00066 double end_param(); 00067 CubitBoolean is_periodic( double& period ); 00068 00069 double length_from_u( double u1, double u2 ); 00070 double u_from_position( const CubitVector& position ); 00071 CubitStatus position_from_u( double u, CubitVector& result ); 00072 double u_from_arc_length( double root, double length ); 00073 00074 //R CubitStatus 00075 //O- true or false if spline is rational or not. 00076 //O- the degree of this spline 00077 //O- the control points 00078 //O- If rational, weight for each control point 00079 //O- whether underlying spline is reversed 00080 virtual CubitStatus get_spline_params( bool &rational, 00081 int °ree, 00082 DLIList<CubitVector> &cntrl_pts, 00083 DLIList<double> &cntrl_pt_weights, 00084 DLIList<double> &knots, 00085 bool &spline_is_reversed 00086 ) const; 00087 //R CubitStatus 00088 //O- center - ellipse center point 00089 //O- normal - normal of the plane of the ellipse 00090 //O- major_axis - major axis of the ellipse 00091 //O- radius_ratio - ratio of the length of the major to minor axis. 00092 virtual CubitStatus get_ellipse_params( CubitVector ¢er, 00093 CubitVector &normal, 00094 CubitVector &major_axis, 00095 double &radius_ratio ) const; 00096 private: 00097 00098 void fixup_periodic_param( double& param ) const; 00099 CubitBoolean get_ordered_param_range( double& lower, double& upper ); 00100 00101 double startParam, endParam; 00102 }; 00103 00104 inline Curve* SubCurve::real_curve() const 00105 { return dynamic_cast<Curve*>(partitioned_entity()); } 00106 00107 00108 #endif