CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
GeNurbCurve3d.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 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
26
27class OdGeEllipArc3d;
28class OdGeLineSeg3d;
29class OdGePolyline3d;
30class OdGeKnotVector;
31
32#include "Ge/GeSplineEnt3d.h"
33#include "OdPlatformSettings.h"
34
35#include "TD_PackPush.h"
36
48{
49public:
51
56
63 const OdGeNurbCurve3d& source);
64
91 int degree,
92 const OdGeKnotVector& knots,
93 const OdGePoint3dArray& controlPoints,
94 bool isPeriodic = false);
95
128 int degree,
129 const OdGeKnotVector& knots,
130 const OdGePoint3dArray& controlPoints,
131 const OdGeDoubleArray& weights,
132 bool isPeriodic = false);
133 // TD Special
134
169 int degree,
170 const OdGeKnotVector& knots,
171 const OdGePoint3d* controlPoints,
173 const double* weights,
175 bool isPeriodic = false);
176 //
177
193 int degree,
194 const OdGePolyline3d& fitPolyline,
195 bool isPeriodic = false);
196
213 const OdGePoint3dArray& fitPoints,
214 const OdGeVector3d& startTangent,
215 const OdGeVector3d& endTangent,
216 bool startTangentDefined = true,
217 bool endTangentDefined = true,
218 const OdGeTol& fitTol = OdGeContext::gTol);
219
230 const OdGePoint3dArray& fitPoints,
231 const OdGeTol& fitTolerance = OdGeContext::gTol);
232
247 const OdGePoint3dArray& fitPoints,
248 const OdGeVector3dArray& fitTangents,
249 const OdGeTol& fitTolerance = OdGeContext::gTol,
250 bool isPeriodic = false);
251
271 const OdGePoint3dArray& fitPoints,
272 const OdGeVector3d& startTangent,
273 const OdGeVector3d& endTangent,
274 bool startTangentDefined,
275 bool endTangentDefined,
276 OdGeKnotParameterization knotParam,
277 const OdGeTol& fitTolerance = OdGeContext::gTol);
278
290 const OdGeEllipArc3d& ellipse,
291 int numSpans = 0);
292
302 const OdGeLineSeg3d& lineSeg);
303
310 int numFitPoints() const;
311
321
332 int fitPointIndex,
333 OdGePoint3d& point) const;
334
345 OdGeTol& fitTolerance) const;
346
358 OdGeVector3d& startTangent,
359 OdGeVector3d& endTangent) const;
360
374 OdGeVector3d& startTangent,
375 OdGeVector3d& endTangent,
376 bool& startTangentDefined,
377 bool& endTangentDefined) const;
378
396 OdGePoint3dArray& fitPoints,
397 OdGeTol& fitTolerance,
398 bool& tangentsExist,
399 OdGeVector3d& startTangent,
400 OdGeVector3d& endTangent) const;
401
420 OdGePoint3dArray& fitPoints,
421 OdGeTol& fitTolerance,
422 bool& tangentsExist,
423 OdGeVector3d& startTangent,
424 OdGeVector3d& endTangent,
425 OdGeKnotParameterization& knotParam) const;
426
427 // NURBS data query functions
428
459 int& degree,
460 bool& rational,
461 bool& periodic,
463 OdGePoint3dArray& controlPoints,
464 OdGeDoubleArray& weights) const;
465
475 int numWeights() const;
476
485 double weightAt(
486 int weightIndex) const;
487
503 int weightIndex,
504 double weight);
505
519 bool evalMode() const;
520
535 const OdGeTol& tol = OdGeContext::gTol) const;
536
551 const OdGeTol& tol = OdGeContext::gTol) const;
552
553 // Fit data edit functions
554
565 int fitPointIndex,
566 const OdGePoint3d& point);
567
579 int fitPointIndex,
580 const OdGePoint3d& point);
581
594 int fitPointIndex);
595
609 bool addControlPointAt(double newKnot, const OdGePoint3d& point, double weight = 1.0);
610
620
630
640 const OdGeTol& fitTol = OdGeContext::gTol);
641
652 const OdGeVector3d& startTangent,
653 const OdGeVector3d& endTangent);
654
667 const OdGeVector3d& startTangent,
668 const OdGeVector3d& endTangent,
669 bool startTangentDefined,
670 bool endTangentDefined);
671
689 const OdGePoint3dArray& fitPoints,
690 const OdGeVector3d& startTangent,
691 const OdGeVector3d& endTangent,
692 const OdGeTol& fitTol = OdGeContext::gTol);
693
714 const OdGeKnotVector& fitKnots,
715 const OdGePoint3dArray& fitPoints,
716 const OdGeVector3d& startTangent,
717 const OdGeVector3d& endTangent,
718 const OdGeTol& fitTol = OdGeContext::gTol,
719 bool isPeriodic = false);
720
740 int degree,
741 const OdGePoint3dArray& fitPoints,
742 const OdGeTol& fitTol = OdGeContext::gTol);
743
761 const OdGePoint3dArray& fitPoints,
762 const OdGeVector3d& startTangent,
763 const OdGeVector3d& endTangent,
764 OdGeKnotParameterization knotParam,
765 const OdGeTol& fitTol = OdGeContext::gTol);
766
778
787 OdGeNurbCurve3d& addKnot(double newKnot);
788
800 OdGeNurbCurve3d& insertKnot(double newKnot);
801
818 bool evalMode = false);
819
833 const OdGeNurbCurve3d& curve, const OdGeTol &iTolerance = OdGeContext::gTol);
834
845 double newStartParam,
846 double newEndParam);
847
860 double weight = 1.0);
861
873
881
892
900
910
920 const OdGeNurbCurve3d& spline);
921
923 // TD Special :
924
925 // These functions are only for internal use
926 //DOM-IGNORE-BEGIN
928
930 double param,
931 int hint) const;
932
933 // This is needed in surface (for rational case only)
935 double param,
936 OdGePoint3d& point,
937 double& divider,
938 int hint) const;
939 // NURBS data edit functions
940
972 int degree,
973 const OdGeKnotVector& knots,
974 const OdGePoint3dArray& controlPoints,
975 const OdGeDoubleArray& weights,
976 bool isPeriodic = false);
977
988
1004 static OdGeNurbCurve3d* convertFrom(const OdGeCurve3d* source, const OdGeInterval& domain, const OdGeTol& tol = OdGeContext::gTol, bool sameParametrization = false);
1005
1020 static OdGeNurbCurve3d* convertFrom(const OdGeCurve3d* source, const OdGeTol& tol = OdGeContext::gTol, bool sameParametrization = false);
1021
1022protected:
1033 bool modifyPositionAndTangent(double param, const OdGePoint3d& point, const OdGeVector3d* deriv);
1035
1054 OdGeNurbCurve3d& setData(int degree, const OdGePoint3dArray& controlPoints, const OdGeKnotVector& knots, const OdGeDoubleArray& weights,
1055 const OdGePoint3dArray& fitPoints, const OdGeVector3d& startTangent, const OdGeVector3d& endTangent,
1056 bool isStartTangentDefined, bool isEndTangentDefined, bool isPeriodic, const OdGeTol& fitTol);
1057
1063 void setKnotTolerance(double tol);
1064 //DOM-IGNORE-END
1065};
1066
1067GE_TOOLKIT_EXPORT OdGeNurbCurve3d* convertFrom( const OdGeCurve3d* source, const OdGeTol& tol = OdGeContext::gTol, bool sameParametrization = false );
1068
1069#include "TD_PackPop.h"
1070
1071#endif // OD_GENURB3D_H
1072
OdArray< OdGePoint3d, OdMemoryAllocator< OdGePoint3d > > OdGePoint3dArray
tol
OdGe::OdGeKnotParameterization OdGeKnotParameterization
Definition Ge.h:544
OdArray< double, OdMemoryAllocator< double > > OdGeDoubleArray
#define GE_TOOLKIT_EXPORT
Definition GeExport.h:35
GE_TOOLKIT_EXPORT OdGeNurbCurve3d * convertFrom(const OdGeCurve3d *source, const OdGeTol &tol=OdGeContext::gTol, bool sameParametrization=false)
OdArray< OdGeVector3d, OdMemoryAllocator< OdGeVector3d > > OdGeVector3dArray
unsigned int OdUInt32
bool isPeriodic(double &period) const
OdGePoint3d evalPoint(double param) const
bool setFitKnotParameterization(OdGeKnotParameterization knotParam)
OdGeNurbCurve3d & insertKnot(double newKnot)
void setKnotTolerance(double tol)
OdGeNurbCurve3d & addKnot(double newKnot)
int numFitPoints() const
OdGeNurbCurve3d & makePeriodic()
bool getFitTangents(OdGeVector3d &startTangent, OdGeVector3d &endTangent, bool &startTangentDefined, bool &endTangentDefined) const
static OdGeNurbCurve3d * convertFrom(const OdGeCurve3d *source, const OdGeInterval &domain, const OdGeTol &tol=OdGeContext::gTol, bool sameParametrization=false)
bool evalMode() const
OdGePoint3d evalPoint(double param, int hint) const
int numWeights() const
void evalPointDivider(double param, OdGePoint3d &point, double &divider, int hint) const
OdGeNurbCurve3d & setWeightAt(int weightIndex, double weight)
bool getFitData(OdGePoint3dArray &fitPoints, OdGeTol &fitTolerance, bool &tangentsExist, OdGeVector3d &startTangent, OdGeVector3d &endTangent) const
OdGeNurbCurve3d & makeClosed()
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)
bool getFitPointAt(int fitPointIndex, OdGePoint3d &point) const
bool addFitPointAt(int fitPointIndex, const OdGePoint3d &point)
bool buildFitData(OdGeKnotParameterization knotParam=OdGe::kChord)
OdGeNurbCurve3d & setFitData(const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, const OdGeTol &fitTol=OdGeContext::gTol)
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
static OdGeNurbCurve3d * convertFrom(const OdGeCurve3d *source, const OdGeTol &tol=OdGeContext::gTol, bool sameParametrization=false)
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 & set(int degree, const OdGeKnotVector &knots, const OdGePoint3dArray &controlPoints, const OdGeDoubleArray &weights, bool isPeriodic=false)
OdGeNurbCurve3d(const OdGeNurbCurve3d &source)
OdGeNurbCurve3d(int degree, const OdGePolyline3d &fitPolyline, bool isPeriodic=false)
OdGeNurbCurve3d & setFitData(const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, OdGeKnotParameterization knotParam, const OdGeTol &fitTol=OdGeContext::gTol)
bool getFitKnotParameterization(OdGeKnotParameterization &knotParam) const
bool setFitTangents(const OdGeVector3d &startTangent, const OdGeVector3d &endTangent)
bool deleteFitPointAt(int fitPointIndex)
TD_USING(OdGeSplineEnt3d::evalPoint)
bool deleteControlPointAt(int index)
OdGeNurbCurve3d & makeNonPeriodic()
OdGeNurbCurve3d & setFitData(int degree, const OdGePoint3dArray &fitPoints, const OdGeTol &fitTol=OdGeContext::gTol)
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(const OdGeLineSeg3d &lineSeg)
OdGeNurbCurve3d & setFitData(const OdGeKnotVector &fitKnots, const OdGePoint3dArray &fitPoints, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, const OdGeTol &fitTol=OdGeContext::gTol, bool isPeriodic=false)
OdGeNurbCurve3d & makeRational(double weight=1.0)
OdGeNurbCurve3d & hardTrimByParams(double newStartParam, double newEndParam)
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)
GE_OPERATORS_OVERRIDE_3D(OdGeNurbCurve3d)
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 & setEvalMode(bool evalMode=false)
OdGeNurbCurve3d & elevateDegree(int plusDegree)
OdGeNurbCurve3d(int degree, const OdGeKnotVector &knots, const OdGePoint3d *controlPoints, OdUInt32 numControlPoints, const double *weights, OdUInt32 numWeights, bool isPeriodic=false)
OdGeNurbCurve3d & joinWith(const OdGeNurbCurve3d &curve, const OdGeTol &iTolerance=OdGeContext::gTol)
OdGeNurbCurve3d & makeOpen()
OdGeNurbCurve3d & 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 modifyPositionAndTangent(double param, const OdGePoint3d &point, const OdGeVector3d *deriv)
int degree() const
OdGeSplineEnt3d & operator=(const OdGeSplineEnt3d &spline)
const OdGeKnotVector & knots() const
int numControlPoints() const
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:67
@ kChord
Definition Ge.h:517