CFx SDK Documentation  2020SP3
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 
OdGeNurbCurve3d::insertKnot
OdGeNurbCurve3d & insertKnot(double newKnot)
OdGeNurbCurve3d::setFitPointAt
bool setFitPointAt(int fitPointIndex, const OdGePoint3d &point)
OdGeNurbCurve3d::buildFitData
bool buildFitData(OdGeKnotParameterization knotParam=OdGe::kChord)
OdGeVector3d
Definition: GeVector3d.h:54
OdGeNurbCurve3d::set
void set(int degree, const OdGeKnotVector &knots, const OdGePoint3dArray &controlPoints, const OdGeDoubleArray &weights, bool isPeriodic=false)
OdGeNurbCurve3d::setData
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)
OdGeCurve3d::evalPoint
OdGePoint3d evalPoint(double param) const
convertFrom
GE_TOOLKIT_EXPORT OdGeNurbCurve3d * convertFrom(const OdGeCurve3d *source, const OdGeTol &tol=OdGeContext::gTol, bool sameParametrization=false)
OdGeSplineEnt3d::operator=
OdGeSplineEnt3d & operator=(const OdGeSplineEnt3d &spline)
OdGe::kChord
@ kChord
Definition: Ge.h:282
tol
tol
Definition: DimVarDefs.h:2287
OdGeNurbCurve3d::OdGeNurbCurve3d
OdGeNurbCurve3d(const OdGeNurbCurve3d &source)
OdGeNurbCurve3d::OdGeNurbCurve3d
OdGeNurbCurve3d(int degree, const OdGeKnotVector &knots, const OdGePoint3d *controlPoints, OdUInt32 numControlPoints, const double *weights, OdUInt32 numWeights, bool isPeriodic=false)
OdGeNurbCurve3d::OdGeNurbCurve3d
OdGeNurbCurve3d(const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, bool startTangentDefined, bool endTangentDefined, OdGeKnotParameterization knotParam, const OdGeTol &fitTolerance=OdGeContext::gTol)
OdGeNurbCurve3d::evalPoint
OdGePoint3d evalPoint(double param, int hint) const
OdGeNurbCurve3d::numWeights
int numWeights() const
OdGeNurbCurve3d::makeClosed
OdGeNurbCurve3d & makeClosed()
OdGeNurbCurve3d::purgeFitData
bool purgeFitData()
OdGeNurbCurve3d::getParamsOfG1Discontinuity
bool getParamsOfG1Discontinuity(OdGeDoubleArray &params, const OdGeTol &tol=OdGeContext::gTol) const
OdGeNurbCurve3d::setFitData
OdGeNurbCurve3d & setFitData(const OdGeKnotVector &fitKnots, const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, const OdGeTol &fitTol=OdGeContext::gTol, bool isPeriodic=false)
OdGeNurbCurve3d::getFitTangents
bool getFitTangents(OdGeVector3d &startTangent, OdGeVector3d &endTangent, bool &startTangentDefined, bool &endTangentDefined) const
source
GLsizei GLsizei GLchar * source
Definition: gles2_ext.h:282
OdGeNurbCurve3d::makePeriodic
OdGeNurbCurve3d & makePeriodic()
OdGeNurbCurve3d::OdGeNurbCurve3d
OdGeNurbCurve3d(const OdGeLineSeg3d &lineSeg)
OdGeNurbCurve3d::joinWith
OdGeNurbCurve3d & joinWith(const OdGeNurbCurve3d &curve)
OdGeNurbCurve3d::getFitTolerance
bool getFitTolerance(OdGeTol &fitTolerance) const
OdGeNurbCurve3d::getFitTangents
bool getFitTangents(OdGeVector3d &startTangent, OdGeVector3d &endTangent) const
OdArray< OdGePoint3d, OdMemoryAllocator< OdGePoint3d > >
OdGeNurbCurve3d::addControlPointAt
bool addControlPointAt(double newKnot, const OdGePoint3d &point, double weight=1.0)
TD_PackPop.h
OdGeNurbCurve3d::makeNonPeriodic
OdGeNurbCurve3d & makeNonPeriodic()
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGeNurbCurve3d::setFitData
OdGeNurbCurve3d & setFitData(const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, OdGeKnotParameterization knotParam, const OdGeTol &fitTol=OdGeContext::gTol)
index
GLuint index
Definition: gles2_ext.h:265
OdGeNurbCurve3d::makeOpen
OdGeNurbCurve3d & makeOpen()
OdGeNurbCurve3d::setFitKnotParameterization
bool setFitKnotParameterization(OdGeKnotParameterization knotParam)
OdGe::OdGeKnotParameterization
OdGeKnotParameterization
Definition: Ge.h:281
OdGeNurbCurve3d::getParamsOfC1Discontinuity
bool getParamsOfC1Discontinuity(OdGeDoubleArray &params, const OdGeTol &tol=OdGeContext::gTol) const
OdGeNurbCurve3d::OdGeNurbCurve3d
OdGeNurbCurve3d(int degree, const OdGeKnotVector &knots, const OdGePoint3dArray &controlPoints, const OdGeDoubleArray &weights, bool isPeriodic=false)
OdGeNurbCurve3d::setKnotTolerance
void setKnotTolerance(double tol)
GeSplineEnt3d.h
OdGeNurbCurve3d::OdGeNurbCurve3d
OdGeNurbCurve3d(const OdGePoint3dArray &fitPoints, const OdGeVector3dArray &fitTangents, const OdGeTol &fitTolerance=OdGeContext::gTol, bool isPeriodic=false)
OdGeEllipArc3d
Definition: GeEllipArc3d.h:60
OdGePoint3d
Definition: GePoint3d.h:55
OdGeNurbCurve3d::modifyPositionAndTangent
bool modifyPositionAndTangent(double param, const OdGePoint3d &point, const OdGeVector3d *deriv)
OdGeNurbCurve3d::getFitData
bool getFitData(OdGePoint3dArray &fitPoints, OdGeTol &fitTolerance, bool &tangentsExist, OdGeVector3d &startTangent, OdGeVector3d &endTangent, OdGeKnotParameterization &knotParam) const
OdGeNurbCurve3d::OdGeNurbCurve3d
OdGeNurbCurve3d(int degree, const OdGeKnotVector &knots, const OdGePoint3dArray &controlPoints, bool isPeriodic=false)
OdGeNurbCurve3d::makeRational
OdGeNurbCurve3d & makeRational(double weight=1.0)
OdGeNurbCurve3d::addFitPointAt
bool addFitPointAt(int fitPointIndex, const OdGePoint3d &point)
OdGeNurbCurve3d::makeClosedFit
void makeClosedFit()
OdPlatformSettings.h
TD_PackPush.h
OdGeNurbCurve3d
Definition: GeNurbCurve3d.h:49
OdGeNurbCurve3d::setFitTangents
bool setFitTangents(const OdGeVector3d &startTangent, const OdGeVector3d &endTangent)
OdGeKnotVector
Definition: GeKnotVector.h:44
params
GLenum GLint * params
Definition: gles2_ext.h:184
OdGeNurbCurve3d::deleteControlPointAt
bool deleteControlPointAt(int index)
OdGeNurbCurve3d::setFitData
OdGeNurbCurve3d & setFitData(const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, const OdGeTol &fitTol=OdGeContext::gTol)
OdGeNurbCurve3d::OdGeNurbCurve3d
OdGeNurbCurve3d(const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, bool startTangentDefined=true, bool endTangentDefined=true, const OdGeTol &fitTol=OdGeContext::gTol)
OdGeNurbCurve3d::addKnot
OdGeNurbCurve3d & addKnot(double newKnot)
OdGeNurbCurve3d::OdGeNurbCurve3d
OdGeNurbCurve3d(int degree, const OdGePolyline3d &fitPolyline, bool isPeriodic=false)
OdGeNurbCurve3d::weightAt
double weightAt(int weightIndex) const
OdGeNurbCurve3d::numFitPoints
int numFitPoints() const
OdGeNurbCurve3d::setEvalMode
OdGeNurbCurve3d & setEvalMode(bool evalMode=false)
OdGeNurbCurve3d::getFitPointAt
bool getFitPointAt(int fitPointIndex, OdGePoint3d &point) const
OdGeCurve3d
Definition: GeCurve3d.h:56
OdGeNurbCurve3d::setFitTolerance
bool setFitTolerance(const OdGeTol &fitTol=OdGeContext::gTol)
OdGeNurbCurve3d::setWeightAt
OdGeSplineEnt3d & setWeightAt(int fitPointIndex, double weight)
OdGeContext::gTol
static GE_STATIC_EXPORT OdGeTol gTol
Definition: GeGbl.h:60
GE_TOOLKIT_EXPORT
#define GE_TOOLKIT_EXPORT
Definition: GeExport.h:49
OdGeNurbCurve3d::evalPointDivider
void evalPointDivider(double param, OdGePoint3d &point, double &divider, int hint) const
OdGeLineSeg3d
Definition: GeLineSeg3d.h:44
OdGeNurbCurve3d::getFitKnotParameterization
bool getFitKnotParameterization(OdGeKnotParameterization &knotParam) const
OdGeNurbCurve3d::OdGeNurbCurve3d
OdGeNurbCurve3d(const OdGeEllipArc3d &ellipse, int numSpans=0)
OdGeNurbCurve3d::deleteFitPointAt
bool deleteFitPointAt(int fitPointIndex)
OdGeSplineEnt3d
Definition: GeSplineEnt3d.h:40
OdGeNurbCurve3d::setFitData
OdGeNurbCurve3d & setFitData(int degree, const OdGePoint3dArray &fitPoints, const OdGeTol &fitTol=OdGeContext::gTol)
OdGeNurbCurve3d::setFitTangents
bool setFitTangents(const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, bool startTangentDefined, bool endTangentDefined)
OdGeTol
Definition: GeTol.h:49
OdGeNurbCurve3d::getFitData
bool getFitData(OdGePoint3dArray &fitPoints, OdGeTol &fitTolerance, bool &tangentsExist, OdGeVector3d &startTangent, OdGeVector3d &endTangent) const
OdGeNurbCurve3d::getDefinitionData
void getDefinitionData(int &degree, bool &rational, bool &periodic, OdGeKnotVector &knots, OdGePoint3dArray &controlPoints, OdGeDoubleArray &weights) const
OdGeNurbCurve3d::TD_USING
TD_USING(OdGeSplineEnt3d::evalPoint)
OdGeNurbCurve3d::hardTrimByParams
OdGeNurbCurve3d & hardTrimByParams(double newStartParam, double newEndParam)
OdGeNurbCurve3d::OdGeNurbCurve3d
OdGeNurbCurve3d(const OdGePoint3dArray &fitPoints, const OdGeTol &fitTolerance=OdGeContext::gTol)
OdGePolyline3d
Definition: GePolyline3d.h:40
OdGeNurbCurve3d::OdGeNurbCurve3d
OdGeNurbCurve3d()
OdGeNurbCurve3d::elevateDegree
OdGeNurbCurve3d & elevateDegree(int plusDegree)
OdGeNurbCurve3d::evalMode
bool evalMode() const