00001 /* $NoKeywords: $ */ 00002 /* 00003 // 00004 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. 00005 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert 00006 // McNeel & Associates. 00007 // 00008 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. 00009 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF 00010 // MERCHANTABILITY ARE HEREBY DISCLAIMED. 00011 // 00012 // For complete openNURBS copyright information see <http://www.opennurbs.org>. 00013 // 00015 */ 00016 00017 #if !defined(OPENNURBS_CURVE_ON_SURFACE_INC_) 00018 #define OPENNURBS_CURVE_ON_SURFACE_INC_ 00019 00020 class ON_CurveOnSurface; 00021 class ON_CLASS ON_CurveOnSurface : public ON_Curve 00022 { 00023 ON_OBJECT_DECLARE(ON_CurveOnSurface); 00024 00025 public: 00026 ON_CurveOnSurface(); 00027 00028 /* 00029 Parameters: 00030 p2dCurve - [in] ~ON_CurveOnSurface() will delete this curve. 00031 Use an ON_CurveProxy if you don't want the original deleted. 00032 p3dCurve - [in] ~ON_CurveOnSurface() will delete this curve. 00033 Use an ON_CurveProxy if you don't want the original deleted. 00034 pSurface - [in] ~ON_CurveOnSurface() will delete this surface. 00035 Use an ON_SurfaceProxy if you don't want the original deleted. 00036 */ 00037 ON_CurveOnSurface( ON_Curve* p2dCurve, // required 2d curve 00038 ON_Curve* p3dCurve, // optional 3d curve 00039 ON_Surface* pSurface // required surface 00040 ); 00041 ON_CurveOnSurface(const ON_CurveOnSurface&); // no implementation 00042 ON_CurveOnSurface& operator=(const ON_CurveOnSurface&); // no implementation 00043 00044 /* 00045 Remarks: 00046 Deletes m_c2, m_c3, and m_s. Use ON_CurveProxy or ON_SurfaceProxy 00047 if you need to use curves or a surface that you do not want deleted. 00048 */ 00049 virtual ~ON_CurveOnSurface(); 00050 00051 // virtual ON_Object::SizeOf override 00052 unsigned int SizeOf() const; 00053 00054 00056 // ON_Object overrides 00057 00058 /* 00059 Description: 00060 Tests an object to see if its data members are correctly 00061 initialized. 00062 Parameters: 00063 text_log - [in] if the object is not valid and text_log 00064 is not NULL, then a brief englis description of the 00065 reason the object is not valid is appened to the log. 00066 The information appended to text_log is suitable for 00067 low-level debugging purposes by programmers and is 00068 not intended to be useful as a high level user 00069 interface tool. 00070 Returns: 00071 @untitled table 00072 true object is valid 00073 false object is invalid, uninitialized, etc. 00074 Remarks: 00075 Overrides virtual ON_Object::IsValid 00076 */ 00077 ON_BOOL32 IsValid( ON_TextLog* text_log = NULL ) const; 00078 00079 void Dump( ON_TextLog& ) const; // for debugging 00080 00081 ON_BOOL32 Write( 00082 ON_BinaryArchive& // open binary file 00083 ) const; 00084 00085 ON_BOOL32 Read( 00086 ON_BinaryArchive& // open binary file 00087 ); 00088 00090 // ON_Geometry overrides 00091 00092 int Dimension() const; 00093 00094 ON_BOOL32 GetBBox( // returns true if successful 00095 double*, // minimum 00096 double*, // maximum 00097 ON_BOOL32 = false // true means grow box 00098 ) const; 00099 00100 ON_BOOL32 Transform( 00101 const ON_Xform& 00102 ); 00103 00104 // (optional - default uses Transform for 2d and 3d objects) 00105 ON_BOOL32 SwapCoordinates( 00106 int, int // indices of coords to swap 00107 ); 00108 00110 // ON_Curve overrides 00111 00112 ON_Interval Domain() const; 00113 00114 int SpanCount() const; // number of smooth spans in curve 00115 00116 ON_BOOL32 GetSpanVector( // span "knots" 00117 double* // array of length SpanCount() + 1 00118 ) const; // 00119 00120 int Degree( // returns maximum algebraic degree of any span 00121 // ( or a good estimate if curve spans are not algebraic ) 00122 ) const; 00123 00124 00125 // (optional - override if curve is piecewise smooth) 00126 ON_BOOL32 GetParameterTolerance( // returns tminus < tplus: parameters tminus <= s <= tplus 00127 double, // t = parameter in domain 00128 double*, // tminus 00129 double* // tplus 00130 ) const; 00131 00132 ON_BOOL32 IsLinear( // true if curve locus is a line segment between 00133 // between specified points 00134 double = ON_ZERO_TOLERANCE // tolerance to use when checking linearity 00135 ) const; 00136 00137 ON_BOOL32 IsArc( // ON_Arc.m_angle > 0 if curve locus is an arc between 00138 // specified points 00139 const ON_Plane* = NULL, // if not NULL, test is performed in this plane 00140 ON_Arc* = NULL, // if not NULL and true is returned, then arc parameters 00141 // are filled in 00142 double = ON_ZERO_TOLERANCE // tolerance to use when checking 00143 ) const; 00144 00145 ON_BOOL32 IsPlanar( 00146 ON_Plane* = NULL, // if not NULL and true is returned, then plane parameters 00147 // are filled in 00148 double = ON_ZERO_TOLERANCE // tolerance to use when checking 00149 ) const; 00150 00151 ON_BOOL32 IsInPlane( 00152 const ON_Plane&, // plane to test 00153 double = ON_ZERO_TOLERANCE // tolerance to use when checking 00154 ) const; 00155 00156 ON_BOOL32 IsClosed( // true if curve is closed (either curve has 00157 void // clamped end knots and euclidean location of start 00158 ) const; // CV = euclidean location of end CV, or curve is 00159 // periodic.) 00160 00161 ON_BOOL32 IsPeriodic( // true if curve is a single periodic segment 00162 void 00163 ) const; 00164 00165 ON_BOOL32 Reverse(); // reverse parameterizatrion 00166 // Domain changes from [a,b] to [-b,-a] 00167 00168 ON_BOOL32 Evaluate( // returns false if unable to evaluate 00169 double, // evaluation parameter 00170 int, // number of derivatives (>=0) 00171 int, // array stride (>=Dimension()) 00172 double*, // array of length stride*(ndir+1) 00173 int = 0, // optional - determines which side to evaluate from 00174 // 0 = default 00175 // < 0 to evaluate from below, 00176 // > 0 to evaluate from above 00177 int* = 0 // optional - evaluation hint (int) used to speed 00178 // repeated evaluations 00179 ) const; 00180 00181 int GetNurbForm( // returns 0: unable to create NURBS representation 00182 // with desired accuracy. 00183 // 1: success - returned NURBS parameterization 00184 // matches the curve's to wthe desired accuracy 00185 // 2: success - returned NURBS point locus matches 00186 // the curve's to the desired accuracy but, on 00187 // the interior of the curve's domain, the 00188 // curve's parameterization and the NURBS 00189 // parameterization may not match to the 00190 // desired accuracy. 00191 ON_NurbsCurve&, 00192 double = 0.0, 00193 const ON_Interval* = NULL // OPTIONAL subdomain of 2d curve 00194 ) const; 00195 00197 // Interface 00198 00199 // ~ON_CurveOnSurface() deletes these classes. Use a 00200 // ON_CurveProxy and/or ON_SurfaceProxy wrapper if you don't want 00201 // the destructor to destroy the curves 00202 ON_Curve* m_c2; // REQUIRED parameter space (2d) curve 00203 ON_Curve* m_c3; // OPTIONAL 3d curve (approximation) to srf(crv2(t)) 00204 ON_Surface* m_s; 00205 }; 00206 00207 00208 #endif