CFx SDK Documentation  2023 SP0
GeNurbCurve2d.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 
25 #ifndef OD_GENURB2d_H
26 #define OD_GENURB2d_H
28 #include "Ge/GeSplineEnt2d.h"
29 #include "OdPlatformSettings.h"
30 
31 class OdGeNurbCurve2dImpl;
32 class OdGePolyline2d;
33 class OdGeEllipArc2d;
34 class OdGeLineSeg2d;
35 class OdGeKnotVector;
36 
37 #include "TD_PackPush.h"
38 
50 {
51 public:
52 
53 
70  const OdGeNurbCurve2d& source);
72  int degree,
73  const OdGeKnotVector& knots,
74  const OdGePoint2dArray& controlPoints,
75  bool isPeriodic = false);
77  int degree,
78  const OdGeKnotVector& knots,
79  const OdGePoint2dArray& controlPoints,
80  const OdGeDoubleArray& weights,
81  bool isPeriodic = false);
83  int degree,
84  const OdGePolyline2d& fitPolyline,
85  bool isPeriodic = false);
87  const OdGePoint2dArray& fitPoints,
88  const OdGeVector2d& startTangent,
89  const OdGeVector2d& endTangent,
90  bool startTangentDefined = true,
91  bool endTangentDefined = true,
92  const OdGeTol& fitTolerance = OdGeContext::gTol);
94  const OdGePoint2dArray& fitPoints,
95  const OdGeTol& fitTolerance = OdGeContext::gTol);
97  const OdGePoint2dArray& fitPoints,
98  const OdGeVector2dArray& fitTangents,
99  const OdGeTol& fitTolerance = OdGeContext::gTol,
100  bool isPeriodic = false);
102  const OdGeEllipArc2d& ellipse);
104  const OdGeLineSeg2d& linSeg);
105 
107  const OdGePoint2dArray& fitPoints,
108  const OdGeVector2d& startTangent,
109  const OdGeVector2d& endTangent,
110  bool startTangentDefined,
111  bool endTangentDefined,
112  OdGeKnotParameterization knotParam,
113  const OdGeTol& fitTol = OdGeContext::gTol);
114 
115 
116  int numFitPoints() const;
117 
126  int index,
127  OdGePoint2d& point) const;
128 
137  OdGeTol& fitTolerance) const;
138 
147  OdGeVector2d& startTangent,
148  OdGeVector2d& endTangent) const;
149 
164  OdGePoint2dArray& fitPoints,
165  OdGeTol& fitTolerance,
166  bool& tangentsExist,
167  OdGeVector2d& startTangent,
168  OdGeVector2d& endTangent) const;
169 
188  OdGePoint2dArray& fitPoints,
189  OdGeTol& fitTolerance,
190  bool& tangentsExist,
191  OdGeVector2d& startTangent,
192  OdGeVector2d& endTangent,
193  OdGeKnotParameterization& knotParam) const;
194 
204 
219  int& degree,
220  bool& rational,
221  bool& periodic,
222  OdGeKnotVector& knots,
223  OdGePoint2dArray& controlPoints,
224  OdGeDoubleArray& weights) const;
225 
232  int numWeights() const;
233 
239  double weightAt(
240  int weightIndex) const;
241 
248  bool evalMode() const;
249 
255  const OdGeTol& tol = OdGeContext::gTol) const;
256 
262  const OdGeTol& tol = OdGeContext::gTol) const;
263 
271  int index,
272  const OdGePoint2d& point);
273 
282  int index,
283  const OdGePoint2d& point);
284 
294  int index);
295 
305  const OdGeTol& fitTol = OdGeContext::gTol);
306 
317  const OdGeVector2d& startTangent,
318  const OdGeVector2d& endTangent);
319 
329 
339  const OdGePoint2dArray& fitPoints,
340  const OdGeVector2d& startTangent,
341  const OdGeVector2d& endTangent,
342  const OdGeTol& fitTol = OdGeContext::gTol);
343 
353  const OdGeKnotVector& fitKnots,
354  const OdGePoint2dArray& fitPoints,
355  const OdGeVector2d& startTangent,
356  const OdGeVector2d& endTangent,
357  const OdGeTol& fitTol = OdGeContext::gTol,
358  bool isPeriodic = false);
359 
367  int degree,
368  const OdGePoint2dArray& fitPoints,
369  const OdGeTol& fitTol = OdGeContext::gTol);
370 
380  const OdGePoint2dArray& fitPoints,
381  const OdGeVector2d& startTangent,
382  const OdGeVector2d& endTangent,
383  OdGeKnotParameterization knotParam,
384  const OdGeTol& fitTol = OdGeContext::gTol);
385 
393  bool purgeFitData();
394 
401  double newKnot);
402 
409  double newKnot);
410 
418  int controlPointIndex,
419  double weight);
420 
428  bool evalMode = false);
429 
437  const OdGeNurbCurve2d& curve);
438 
446  double newStartParam,
447  double newEndParam);
448 
460  double weight = 1.0);
461 
469 
477 
485 
493 
501  int plusDegree);
502 
504  const OdGeNurbCurve2d& spline);
505 
519  bool addControlPointAt(double newKnot, const OdGePoint2d& point, double weight = 1.0);
520 
530 
531 
533  // Overrides :
534 
536  // TD Special :
537 
550  const OdGeLine2d &line2d,
551  OdGePoint2dArray &pnts2d,
552  const OdGeTol& tol = OdGeContext::gTol,
553  OdGeDoubleArray *params = NULL) const;
554 
572  void set(
573  int degree,
574  const OdGeKnotVector& knots,
575  const OdGePoint2dArray& controlPoints,
576  const OdGeDoubleArray& weights,
577  bool isPeriodic = false);
578 
579 //FELIX_CHANGE_BEGIN
580  static OdGeNurbCurve2d* convertFrom(const OdGeCurve2d* source, const OdGeTol& tol = OdGeContext::gTol, bool sameParametrization = false);
581 //FELIX_CHANGE_END
582 
583 protected:
584  friend class OdDbGeEdgesDwgIO;
585  friend class OdDbGeEdgesDxfIO;
586 
587  void set(int degree, const OdGeKnotVector& knots,
588  const OdGePoint2dArray& cntrlPnts, const OdGeDoubleArray& weights, bool isPeriodic,
589  const OdGePoint2dArray& fitPoints,
590  const OdGeVector2d& startTangent,
591  const OdGeVector2d& endTangent);
592 };
593 
594 #include "TD_PackPop.h"
595 
596 #endif
597 
tol
Definition: DimVarDefs.h:2287
#define GE_TOOLKIT_EXPORT
Definition: GeExport.h:49
#define NULL
Definition: GsProperties.h:177
bool getFitTolerance(OdGeTol &fitTolerance) const
OdGeNurbCurve2d & makePeriodic()
OdGeNurbCurve2d & addKnot(double newKnot)
bool setFitKnotParameterization(OdGeKnotParameterization knotParam)
OdGeNurbCurve2d(const OdGeLineSeg2d &linSeg)
OdGeNurbCurve2d & makeNonPeriodic()
int numFitPoints() const
void set(int degree, const OdGeKnotVector &knots, const OdGePoint2dArray &cntrlPnts, const OdGeDoubleArray &weights, bool isPeriodic, const OdGePoint2dArray &fitPoints, const OdGeVector2d &startTangent, const OdGeVector2d &endTangent)
bool setFitPointAt(int index, const OdGePoint2d &point)
OdGeNurbCurve2d(const OdGePoint2dArray &fitPoints, const OdGeVector2dArray &fitTangents, const OdGeTol &fitTolerance=OdGeContext::gTol, bool isPeriodic=false)
bool addControlPointAt(double newKnot, const OdGePoint2d &point, double weight=1.0)
static OdGeNurbCurve2d * convertFrom(const OdGeCurve2d *source, const OdGeTol &tol=OdGeContext::gTol, bool sameParametrization=false)
OdGeNurbCurve2d(const OdGePoint2dArray &fitPoints, const OdGeTol &fitTolerance=OdGeContext::gTol)
OdGeNurbCurve2d(const OdGePoint2dArray &fitPoints, const OdGeVector2d &startTangent, const OdGeVector2d &endTangent, bool startTangentDefined=true, bool endTangentDefined=true, const OdGeTol &fitTolerance=OdGeContext::gTol)
OdGeNurbCurve2d & setFitData(const OdGePoint2dArray &fitPoints, const OdGeVector2d &startTangent, const OdGeVector2d &endTangent, OdGeKnotParameterization knotParam, const OdGeTol &fitTol=OdGeContext::gTol)
bool getFitKnotParameterization(OdGeKnotParameterization &knotParam) const
OdGeNurbCurve2d & elevateDegree(int plusDegree)
int numWeights() const
OdGeNurbCurve2d & setFitData(int degree, const OdGePoint2dArray &fitPoints, const OdGeTol &fitTol=OdGeContext::gTol)
bool getFitData(OdGePoint2dArray &fitPoints, OdGeTol &fitTolerance, bool &tangentsExist, OdGeVector2d &startTangent, OdGeVector2d &endTangent) const
bool getParamsOfC1Discontinuity(OdGeDoubleArray &params, const OdGeTol &tol=OdGeContext::gTol) const
OdGeNurbCurve2d & insertKnot(double newKnot)
OdGeNurbCurve2d(int degree, const OdGePolyline2d &fitPolyline, bool isPeriodic=false)
bool setFitTangents(const OdGeVector2d &startTangent, const OdGeVector2d &endTangent)
void set(int degree, const OdGeKnotVector &knots, const OdGePoint2dArray &controlPoints, const OdGeDoubleArray &weights, bool isPeriodic=false)
OdGeNurbCurve2d & hardTrimByParams(double newStartParam, double newEndParam)
OdGeNurbCurve2d & setEvalMode(bool evalMode=false)
OdGeNurbCurve2d & setFitData(const OdGeKnotVector &fitKnots, const OdGePoint2dArray &fitPoints, const OdGeVector2d &startTangent, const OdGeVector2d &endTangent, const OdGeTol &fitTol=OdGeContext::gTol, bool isPeriodic=false)
bool getFitPointAt(int index, OdGePoint2d &point) const
bool deleteControlPointAt(int index)
OdGeSplineEnt2d & setWeightAt(int controlPointIndex, double weight)
OdGeNurbCurve2d(const OdGeEllipArc2d &ellipse)
double weightAt(int weightIndex) const
OdGeNurbCurve2d(int degree, const OdGeKnotVector &knots, const OdGePoint2dArray &controlPoints, const OdGeDoubleArray &weights, bool isPeriodic=false)
OdGeNurbCurve2d(int degree, const OdGeKnotVector &knots, const OdGePoint2dArray &controlPoints, bool isPeriodic=false)
bool getFitData(OdGePoint2dArray &fitPoints, OdGeTol &fitTolerance, bool &tangentsExist, OdGeVector2d &startTangent, OdGeVector2d &endTangent, OdGeKnotParameterization &knotParam) const
bool getFitTangents(OdGeVector2d &startTangent, OdGeVector2d &endTangent) const
bool setFitTolerance(const OdGeTol &fitTol=OdGeContext::gTol)
bool addFitPointAt(int index, const OdGePoint2d &point)
void getDefinitionData(int &degree, bool &rational, bool &periodic, OdGeKnotVector &knots, OdGePoint2dArray &controlPoints, OdGeDoubleArray &weights) const
OdGeNurbCurve2d(const OdGeNurbCurve2d &source)
OdGeNurbCurve2d & makeRational(double weight=1.0)
OdGeNurbCurve2d & makeClosed()
OdGeNurbCurve2d & setFitData(const OdGePoint2dArray &fitPoints, const OdGeVector2d &startTangent, const OdGeVector2d &endTangent, const OdGeTol &fitTol=OdGeContext::gTol)
bool evalMode() const
bool intersectWith(const OdGeLine2d &line2d, OdGePoint2dArray &pnts2d, const OdGeTol &tol=OdGeContext::gTol, OdGeDoubleArray *params=NULL) const
OdGeNurbCurve2d & joinWith(const OdGeNurbCurve2d &curve)
OdGeNurbCurve2d & makeOpen()
bool getParamsOfG1Discontinuity(OdGeDoubleArray &params, const OdGeTol &tol=OdGeContext::gTol) const
OdGeNurbCurve2d(const OdGePoint2dArray &fitPoints, const OdGeVector2d &startTangent, const OdGeVector2d &endTangent, bool startTangentDefined, bool endTangentDefined, OdGeKnotParameterization knotParam, const OdGeTol &fitTol=OdGeContext::gTol)
bool deleteFitPointAt(int index)
OdGeSplineEnt2d & operator=(const OdGeSplineEnt2d &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:282