QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
opennurbs_curveonsurface.h
Go to the documentation of this file.
1/* $NoKeywords: $ */
2/*
3//
4// Copyright (c) 1993-2007 Robert McNeel & Associates. All rights reserved.
5// Rhinoceros is a registered trademark of Robert McNeel & Assoicates.
6//
7// THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
8// ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
9// MERCHANTABILITY ARE HEREBY DISCLAIMED.
10//
11// For complete openNURBS copyright information see <http://www.opennurbs.org>.
12//
14*/
15
16#if !defined(OPENNURBS_CURVE_ON_SURFACE_INC_)
17#define OPENNURBS_CURVE_ON_SURFACE_INC_
18
21{
23
24public:
26
27 /*
28 Parameters:
29 p2dCurve - [in] ~ON_CurveOnSurface() will delete this curve.
30 Use an ON_CurveProxy if you don't want the original deleted.
31 p3dCurve - [in] ~ON_CurveOnSurface() will delete this curve.
32 Use an ON_CurveProxy if you don't want the original deleted.
33 pSurface - [in] ~ON_CurveOnSurface() will delete this surface.
34 Use an ON_SurfaceProxy if you don't want the original deleted.
35 */
36 ON_CurveOnSurface( ON_Curve* p2dCurve, // required 2d curve
37 ON_Curve* p3dCurve, // optional 3d curve
38 ON_Surface* pSurface // required surface
39 );
40 ON_CurveOnSurface(const ON_CurveOnSurface&); // no implementation
41 ON_CurveOnSurface& operator=(const ON_CurveOnSurface&); // no implementation
42
43 /*
44 Remarks:
45 Deletes m_c2, m_c3, and m_s. Use ON_CurveProxy or ON_SurfaceProxy
46 if you need to use curves or a surface that you do not want deleted.
47 */
48 virtual ~ON_CurveOnSurface();
49
50 // virtual ON_Object::SizeOf override
51 unsigned int SizeOf() const;
52
53
55 // ON_Object overrides
56
57 /*
58 Description:
59 Tests an object to see if its data members are correctly
60 initialized.
61 Parameters:
62 text_log - [in] if the object is not valid and text_log
63 is not NULL, then a brief englis description of the
64 reason the object is not valid is appened to the log.
65 The information appended to text_log is suitable for
66 low-level debugging purposes by programmers and is
67 not intended to be useful as a high level user
68 interface tool.
69 Returns:
70 @untitled table
71 true object is valid
72 false object is invalid, uninitialized, etc.
73 Remarks:
74 Overrides virtual ON_Object::IsValid
75 */
76 ON_BOOL32 IsValid( ON_TextLog* text_log = NULL ) const;
77
78 void Dump( ON_TextLog& ) const; // for debugging
79
81 ON_BinaryArchive& // open binary file
82 ) const;
83
85 ON_BinaryArchive& // open binary file
86 );
87
89 // ON_Geometry overrides
90
91 int Dimension() const;
92
93 ON_BOOL32 GetBBox( // returns true if successful
94 double*, // minimum
95 double*, // maximum
96 ON_BOOL32 = false // true means grow box
97 ) const;
98
100 const ON_Xform&
101 );
102
103 // (optional - default uses Transform for 2d and 3d objects)
105 int, int // indices of coords to swap
106 );
107
109 // ON_Curve overrides
110
111 ON_Interval Domain() const;
112
113 int SpanCount() const; // number of smooth spans in curve
114
115 ON_BOOL32 GetSpanVector( // span "knots"
116 double* // array of length SpanCount() + 1
117 ) const; //
118
119 int Degree( // returns maximum algebraic degree of any span
120 // ( or a good estimate if curve spans are not algebraic )
121 ) const;
122
123
124 // (optional - override if curve is piecewise smooth)
125 ON_BOOL32 GetParameterTolerance( // returns tminus < tplus: parameters tminus <= s <= tplus
126 double, // t = parameter in domain
127 double*, // tminus
128 double* // tplus
129 ) const;
130
131 ON_BOOL32 IsLinear( // true if curve locus is a line segment between
132 // between specified points
133 double = ON_ZERO_TOLERANCE // tolerance to use when checking linearity
134 ) const;
135
136 ON_BOOL32 IsArc( // ON_Arc.m_angle > 0 if curve locus is an arc between
137 // specified points
138 const ON_Plane* = NULL, // if not NULL, test is performed in this plane
139 ON_Arc* = NULL, // if not NULL and true is returned, then arc parameters
140 // are filled in
141 double = ON_ZERO_TOLERANCE // tolerance to use when checking
142 ) const;
143
145 ON_Plane* = NULL, // if not NULL and true is returned, then plane parameters
146 // are filled in
147 double = ON_ZERO_TOLERANCE // tolerance to use when checking
148 ) const;
149
151 const ON_Plane&, // plane to test
152 double = ON_ZERO_TOLERANCE // tolerance to use when checking
153 ) const;
154
155 ON_BOOL32 IsClosed( // true if curve is closed (either curve has
156 void // clamped end knots and euclidean location of start
157 ) const; // CV = euclidean location of end CV, or curve is
158 // periodic.)
159
160 ON_BOOL32 IsPeriodic( // true if curve is a single periodic segment
161 void
162 ) const;
163
164 ON_BOOL32 Reverse(); // reverse parameterizatrion
165 // Domain changes from [a,b] to [-b,-a]
166
167 ON_BOOL32 Evaluate( // returns false if unable to evaluate
168 double, // evaluation parameter
169 int, // number of derivatives (>=0)
170 int, // array stride (>=Dimension())
171 double*, // array of length stride*(ndir+1)
172 int = 0, // optional - determines which side to evaluate from
173 // 0 = default
174 // < 0 to evaluate from below,
175 // > 0 to evaluate from above
176 int* = 0 // optional - evaluation hint (int) used to speed
177 // repeated evaluations
178 ) const;
179
180 int GetNurbForm( // returns 0: unable to create NURBS representation
181 // with desired accuracy.
182 // 1: success - returned NURBS parameterization
183 // matches the curve's to wthe desired accuracy
184 // 2: success - returned NURBS point locus matches
185 // the curve's to the desired accuracy but, on
186 // the interior of the curve's domain, the
187 // curve's parameterization and the NURBS
188 // parameterization may not match to the
189 // desired accuracy.
191 double = 0.0,
192 const ON_Interval* = NULL // OPTIONAL subdomain of 2d curve
193 ) const;
194
196 // Interface
197
198 // ~ON_CurveOnSurface() deletes these classes. Use a
199 // ON_CurveProxy and/or ON_SurfaceProxy wrapper if you don't want
200 // the destructor to destroy the curves
201 ON_Curve* m_c2; // REQUIRED parameter space (2d) curve
202 ON_Curve* m_c3; // OPTIONAL 3d curve (approximation) to srf(crv2(t))
204};
205
206
207#endif
@ Transform
Definition RSMetaType.h:67
Definition opennurbs_arc.h:34
Definition opennurbs_archive.h:152
Definition opennurbs_curve.h:88
virtual ON_BOOL32 IsArc(const ON_Plane *plane=NULL, ON_Arc *arc=NULL, double tolerance=ON_ZERO_TOLERANCE) const
Definition opennurbs_curve.cpp:248
virtual int GetNurbForm(ON_NurbsCurve &nurbs_curve, double tolerance=0.0, const ON_Interval *subdomain=NULL) const
Definition opennurbs_curve.cpp:2625
virtual ON_BOOL32 Evaluate(double t, int der_count, int v_stride, double *v, int side=0, int *hint=0) const =0
ON_Curve & operator=(const ON_Curve &)
Definition opennurbs_curve.cpp:26
virtual int Degree() const =0
unsigned int SizeOf() const
Definition opennurbs_curve.cpp:52
virtual ON_BOOL32 IsPeriodic() const
Definition opennurbs_curve.cpp:444
virtual ON_BOOL32 IsClosed() const
Definition opennurbs_curve.cpp:408
virtual ON_BOOL32 Reverse()=0
virtual int SpanCount() const =0
virtual ON_BOOL32 GetSpanVector(double *knots) const =0
virtual ON_BOOL32 IsLinear(double tolerance=ON_ZERO_TOLERANCE) const
Definition opennurbs_curve.cpp:184
virtual ON_BOOL32 IsPlanar(ON_Plane *plane=NULL, double tolerance=ON_ZERO_TOLERANCE) const
Definition opennurbs_curve.cpp:317
virtual ON_Interval Domain() const =0
virtual ON_BOOL32 IsInPlane(const ON_Plane &test_plane, double tolerance=ON_ZERO_TOLERANCE) const =0
virtual ON_BOOL32 GetParameterTolerance(double t, double *tminus, double *tplus) const
Definition opennurbs_curve.cpp:161
Definition opennurbs_curveonsurface.h:21
ON_OBJECT_DECLARE(ON_CurveOnSurface)
ON_Surface * m_s
Definition opennurbs_curveonsurface.h:203
ON_Curve * m_c3
Definition opennurbs_curveonsurface.h:202
ON_Curve * m_c2
Definition opennurbs_curveonsurface.h:201
virtual ON_BOOL32 GetBBox(double *boxmin, double *boxmax, int bGrowBox=false) const =0
virtual ON_BOOL32 SwapCoordinates(int i, int j)
Definition opennurbs_geometry.cpp:135
virtual int Dimension() const =0
Definition opennurbs_point.h:46
Definition opennurbs_nurbscurve.h:27
virtual void Dump(ON_TextLog &) const
Definition opennurbs_object.cpp:1695
virtual ON_BOOL32 IsValid(ON_TextLog *text_log=NULL) const =0
virtual ON_BOOL32 Read(ON_BinaryArchive &binary_archive)
Definition opennurbs_object.cpp:1734
virtual ON_BOOL32 Write(ON_BinaryArchive &binary_archive) const
Definition opennurbs_object.cpp:1714
Definition opennurbs_plane.h:20
Definition opennurbs_surface.h:58
Definition opennurbs_textlog.h:20
Definition opennurbs_xform.h:28
#define ON_ZERO_TOLERANCE
Definition opennurbs_defines.h:238
#define ON_CLASS
Definition opennurbs_defines.h:91
#define NULL
Definition opennurbs_system.h:256
int ON_BOOL32
Definition opennurbs_system.h:362