CFx SDK Documentation  2022 SP0
GeNurbCurve3d.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef OD_GENURB3D_H
25 #define OD_GENURB3D_H
27 class OdGeEllipArc3d;
28 class OdGeLineSeg3d;
29 class OdGePolyline3d;
30 class OdGeKnotVector;
31 class OdGeNurbCurve3dImpl;
32 
33 #include "Ge/GeSplineEnt3d.h"
34 #include "OdPlatformSettings.h"
35 
36 #include "TD_PackPush.h"
37 
49 {
50 public:
51 
52 
81  const OdGeNurbCurve3d& source);
83  int degree,
84  const OdGeKnotVector& knots,
85  const OdGePoint3dArray& controlPoints,
86  bool isPeriodic = false);
88  int degree,
89  const OdGeKnotVector& knots,
90  const OdGePoint3dArray& controlPoints,
91  const OdGeDoubleArray& weights,
92  bool isPeriodic = false);
93  // TD Special
95  int degree,
96  const OdGeKnotVector& knots,
97  const OdGePoint3d* controlPoints,
98  OdUInt32 numControlPoints,
99  const double* weights,
100  OdUInt32 numWeights,
101  bool isPeriodic = false);
102  //
104  int degree,
105  const OdGePolyline3d& fitPolyline,
106  bool isPeriodic = false);
108  const OdGePoint3dArray& fitPoints,
109  const OdGeVector3d& startTangent,
110  const OdGeVector3d& endTangent,
111  bool startTangentDefined = true,
112  bool endTangentDefined = true,
113  const OdGeTol& fitTol = OdGeContext::gTol);
115  const OdGePoint3dArray& fitPoints,
116  const OdGeTol& fitTolerance = OdGeContext::gTol);
118  const OdGePoint3dArray& fitPoints,
119  const OdGeVector3dArray& fitTangents,
120  const OdGeTol& fitTolerance = OdGeContext::gTol,
121  bool isPeriodic = false);
122 
124  const OdGePoint3dArray& fitPoints,
125  const OdGeVector3d& startTangent,
126  const OdGeVector3d& endTangent,
127  bool startTangentDefined,
128  bool endTangentDefined,
129  OdGeKnotParameterization knotParam,
130  const OdGeTol& fitTolerance = OdGeContext::gTol);
131  // numSpans - the number of knot spans in nurbs curve
132  // if numSpans == 0 (default) it is automatically calculated from
133  // ellipse domain
134 
135 
137  const OdGeEllipArc3d& ellipse,
138  int numSpans = 0);
139 
141  const OdGeLineSeg3d& lineSeg);
142 
146  int numFitPoints() const;
147 
154 
163  int fitPointIndex,
164  OdGePoint3d& point) const;
165 
174  OdGeTol& fitTolerance) const;
175 
184  OdGeVector3d& startTangent,
185  OdGeVector3d& endTangent) const;
186 
197  OdGeVector3d& startTangent,
198  OdGeVector3d& endTangent,
199  bool& startTangentDefined,
200  bool& endTangentDefined) const;
201 
216  OdGePoint3dArray& fitPoints,
217  OdGeTol& fitTolerance,
218  bool& tangentsExist,
219  OdGeVector3d& startTangent,
220  OdGeVector3d& endTangent) const;
221 
237  OdGePoint3dArray& fitPoints,
238  OdGeTol& fitTolerance,
239  bool& tangentsExist,
240  OdGeVector3d& startTangent,
241  OdGeVector3d& endTangent,
242  OdGeKnotParameterization& knotParam) const;
243 
244  // NURBS data query functions
245 
260  int& degree,
261  bool& rational,
262  bool& periodic,
263  OdGeKnotVector& knots,
264  OdGePoint3dArray& controlPoints,
265  OdGeDoubleArray& weights) const;
266 
273  int numWeights() const;
274 
280  double weightAt(
281  int weightIndex) const;
282 
289  bool evalMode() const;
290 
296  const OdGeTol& tol = OdGeContext::gTol) const;
297 
303  const OdGeTol& tol = OdGeContext::gTol) const;
304 
305  // Fit data edit functions
306 
317  int fitPointIndex,
318  const OdGePoint3d& point);
319 
328  int fitPointIndex,
329  const OdGePoint3d& point);
330 
344  bool addControlPointAt(double newKnot, const OdGePoint3d& point, double weight = 1.0);
345 
355 
365  int fitPointIndex);
366 
373 
383  const OdGeTol& fitTol = OdGeContext::gTol);
384 
395  const OdGeVector3d& startTangent,
396  const OdGeVector3d& endTangent);
397 
410  const OdGeVector3d& startTangent,
411  const OdGeVector3d& endTangent,
412  bool startTangentDefined,
413  bool endTangentDefined);
414 
424  const OdGePoint3dArray& fitPoints,
425  const OdGeVector3d& startTangent,
426  const OdGeVector3d& endTangent,
427  const OdGeTol& fitTol = OdGeContext::gTol);
428 
442  const OdGeKnotVector& fitKnots,
443  const OdGePoint3dArray& fitPoints,
444  const OdGeVector3d& startTangent,
445  const OdGeVector3d& endTangent,
446  const OdGeTol& fitTol = OdGeContext::gTol,
447  bool isPeriodic = false);
448 
449 
457  int degree,
458  const OdGePoint3dArray& fitPoints,
459  const OdGeTol& fitTol = OdGeContext::gTol);
460 
470  const OdGePoint3dArray& fitPoints,
471  const OdGeVector3d& startTangent,
472  const OdGeVector3d& endTangent,
473  OdGeKnotParameterization knotParam,
474  const OdGeTol& fitTol = OdGeContext::gTol);
475 
476 
484  bool purgeFitData();
485 
491  OdGeNurbCurve3d& addKnot(double newKnot);
492 
493 
499  OdGeNurbCurve3d& insertKnot(double newKnot);
500 
508  int fitPointIndex,
509  double weight);
510 
518  bool evalMode = false);
519 
527  const OdGeNurbCurve3d& curve);
528 
536  double newStartParam,
537  double newEndParam);
538 
549  double weight = 1.0);
550 
558 
566 
574 
582 
588  OdGeNurbCurve3d& elevateDegree(int plusDegree);
589 
590  // Assignment operator.
592  const OdGeNurbCurve3d& spline);
593 
595  // TD Special :
596 
598 
599  // This is only for internal use
602  double param,
603  int hint) const;
604 
605  // This is need in surface (for rational case only)
608  double param,
609  OdGePoint3d& point,
610  double& divider,
611  int hint) const;
612 
613  // NURBS data edit functions
614 
632  void set(
633  int degree,
634  const OdGeKnotVector& knots,
635  const OdGePoint3dArray& controlPoints,
636  const OdGeDoubleArray& weights,
637  bool isPeriodic = false);
638 
649 
650 protected:
661  bool modifyPositionAndTangent(double param, const OdGePoint3d& point, const OdGeVector3d* deriv);
663 
664 protected:
665 
666  void setData(int degree, const OdGePoint3dArray& controlPoints, const OdGeKnotVector& knots, const OdGeDoubleArray& weights
667  , const OdGePoint3dArray& fitPoints, const OdGeVector3d& startTangent, const OdGeVector3d& endTangent
668  , bool isStartTangentDefined, bool isEndTangentDefined, bool isPeriodic, const OdGeTol& fitTol);
669 
670  void setKnotTolerance(double tol);
671 };
672 
673 GE_TOOLKIT_EXPORT OdGeNurbCurve3d* convertFrom( const OdGeCurve3d* source, const OdGeTol& tol = OdGeContext::gTol, bool sameParametrization = false );
674 
675 #include "TD_PackPop.h"
676 
677 #endif // OD_GENURB3D_H
678 
tol
Definition: DimVarDefs.h:2287
#define GE_TOOLKIT_EXPORT
Definition: GeExport.h:49
GE_TOOLKIT_EXPORT OdGeNurbCurve3d * convertFrom(const OdGeCurve3d *source, const OdGeTol &tol=OdGeContext::gTol, bool sameParametrization=false)
unsigned int OdUInt32
OdGePoint3d evalPoint(double param) const
bool setFitKnotParameterization(OdGeKnotParameterization knotParam)
OdGeNurbCurve3d & makeRational(double weight=1.0)
void setKnotTolerance(double tol)
int numFitPoints() const
bool getFitTangents(OdGeVector3d &startTangent, OdGeVector3d &endTangent, bool &startTangentDefined, bool &endTangentDefined) const
OdGeNurbCurve3d & addKnot(double newKnot)
bool evalMode() const
OdGePoint3d evalPoint(double param, int hint) const
OdGeNurbCurve3d & setFitData(const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, const OdGeTol &fitTol=OdGeContext::gTol)
OdGeNurbCurve3d & setFitData(const OdGeKnotVector &fitKnots, const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, const OdGeTol &fitTol=OdGeContext::gTol, bool isPeriodic=false)
int numWeights() const
void evalPointDivider(double param, OdGePoint3d &point, double &divider, int hint) const
bool getFitData(OdGePoint3dArray &fitPoints, OdGeTol &fitTolerance, bool &tangentsExist, OdGeVector3d &startTangent, OdGeVector3d &endTangent) const
bool getParamsOfC1Discontinuity(OdGeDoubleArray &params, const OdGeTol &tol=OdGeContext::gTol) const
OdGeNurbCurve3d(const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, bool startTangentDefined, bool endTangentDefined, OdGeKnotParameterization knotParam, const OdGeTol &fitTolerance=OdGeContext::gTol)
void setData(int degree, const OdGePoint3dArray &controlPoints, const OdGeKnotVector &knots, const OdGeDoubleArray &weights, const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, bool isStartTangentDefined, bool isEndTangentDefined, bool isPeriodic, const OdGeTol &fitTol)
bool getFitPointAt(int fitPointIndex, OdGePoint3d &point) const
bool addFitPointAt(int fitPointIndex, const OdGePoint3d &point)
bool buildFitData(OdGeKnotParameterization knotParam=OdGe::kChord)
void set(int degree, const OdGeKnotVector &knots, const OdGePoint3dArray &controlPoints, const OdGeDoubleArray &weights, bool isPeriodic=false)
OdGeNurbCurve3d(const OdGePoint3dArray &fitPoints, const OdGeVector3dArray &fitTangents, const OdGeTol &fitTolerance=OdGeContext::gTol, bool isPeriodic=false)
OdGeNurbCurve3d(const OdGePoint3dArray &fitPoints, const OdGeTol &fitTolerance=OdGeContext::gTol)
double weightAt(int weightIndex) const
bool getParamsOfG1Discontinuity(OdGeDoubleArray &params, const OdGeTol &tol=OdGeContext::gTol) const
bool setFitTangents(const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, bool startTangentDefined, bool endTangentDefined)
OdGeNurbCurve3d(int degree, const OdGeKnotVector &knots, const OdGePoint3dArray &controlPoints, const OdGeDoubleArray &weights, bool isPeriodic=false)
void getDefinitionData(int &degree, bool &rational, bool &periodic, OdGeKnotVector &knots, OdGePoint3dArray &controlPoints, OdGeDoubleArray &weights) const
OdGeNurbCurve3d & makePeriodic()
OdGeNurbCurve3d & setFitData(const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, OdGeKnotParameterization knotParam, const OdGeTol &fitTol=OdGeContext::gTol)
OdGeNurbCurve3d & insertKnot(double newKnot)
OdGeNurbCurve3d & elevateDegree(int plusDegree)
OdGeNurbCurve3d(const OdGeNurbCurve3d &source)
OdGeNurbCurve3d(int degree, const OdGePolyline3d &fitPolyline, bool isPeriodic=false)
bool getFitKnotParameterization(OdGeKnotParameterization &knotParam) const
OdGeNurbCurve3d & hardTrimByParams(double newStartParam, double newEndParam)
bool setFitTangents(const OdGeVector3d &startTangent, const OdGeVector3d &endTangent)
bool deleteFitPointAt(int fitPointIndex)
TD_USING(OdGeSplineEnt3d::evalPoint)
bool deleteControlPointAt(int index)
bool getFitTolerance(OdGeTol &fitTolerance) const
void makeClosedFit()
OdGeNurbCurve3d(int degree, const OdGeKnotVector &knots, const OdGePoint3dArray &controlPoints, bool isPeriodic=false)
OdGeNurbCurve3d(const OdGeEllipArc3d &ellipse, int numSpans=0)
OdGeNurbCurve3d & makeClosed()
OdGeNurbCurve3d(const OdGeLineSeg3d &lineSeg)
OdGeNurbCurve3d & makeOpen()
OdGeNurbCurve3d & joinWith(const OdGeNurbCurve3d &curve)
OdGeSplineEnt3d & setWeightAt(int fitPointIndex, double weight)
bool setFitPointAt(int fitPointIndex, const OdGePoint3d &point)
bool getFitTangents(OdGeVector3d &startTangent, OdGeVector3d &endTangent) const
bool addControlPointAt(double newKnot, const OdGePoint3d &point, double weight=1.0)
bool setFitTolerance(const OdGeTol &fitTol=OdGeContext::gTol)
OdGeNurbCurve3d(const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, bool startTangentDefined=true, bool endTangentDefined=true, const OdGeTol &fitTol=OdGeContext::gTol)
bool getFitData(OdGePoint3dArray &fitPoints, OdGeTol &fitTolerance, bool &tangentsExist, OdGeVector3d &startTangent, OdGeVector3d &endTangent, OdGeKnotParameterization &knotParam) const
OdGeNurbCurve3d & setFitData(int degree, const OdGePoint3dArray &fitPoints, const OdGeTol &fitTol=OdGeContext::gTol)
OdGeNurbCurve3d & setEvalMode(bool evalMode=false)
OdGeNurbCurve3d(int degree, const OdGeKnotVector &knots, const OdGePoint3d *controlPoints, OdUInt32 numControlPoints, const double *weights, OdUInt32 numWeights, bool isPeriodic=false)
OdGeNurbCurve3d & makeNonPeriodic()
bool modifyPositionAndTangent(double param, const OdGePoint3d &point, const OdGeVector3d *deriv)
OdGeSplineEnt3d & operator=(const OdGeSplineEnt3d &spline)
Definition: GeTol.h:49
GLenum GLint * params
Definition: gles2_ext.h:184
GLuint index
Definition: gles2_ext.h:265
GLsizei GLsizei GLchar * source
Definition: gles2_ext.h:282
static GE_STATIC_EXPORT OdGeTol gTol
Definition: GeGbl.h:60
OdGeKnotParameterization
Definition: Ge.h:281
@ kChord
Definition: Ge.h:282