CFx SDK Documentation  2022 SP0
DbSpline.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 
26 
27 #ifndef ODDB_DBSPLINE_H
28 #define ODDB_DBSPLINE_H
29 
30 #include "TD_PackPush.h"
31 
32 #include "DbCurve.h"
33 
34 class OdGeKnotVector;
35 
44 {
45 public:
47 
49 
53  bool isRational() const;
54 
60  int degree() const;
61 
65  void elevateDegree(int newDegree);
66 
70  int numControlPoints() const;
71 
79  int controlPointIndex,
80  OdGePoint3d& point) const;
81 
89  int controlPointIndex,
90  const OdGePoint3d& point);
91 
95  int numFitPoints() const;
96 
104  int fitPointIndex,
105  OdGePoint3d& point) const;
106 
114  int fitPointIndex,
115  const OdGePoint3d& point);
116 
129  int fitPointIndex,
130  const OdGePoint3d& point);
131 
138  int fitPointIndex);
139 
147  double fitTolerance() const;
148 
158  void setFitTol(
159  double fitTolerance);
160 
167  OdGeVector3d& startTangent,
168  OdGeVector3d& endTangent) const;
169 
176  const OdGeVector3d& startTangent,
177  const OdGeVector3d& endTangent);
178 
182  bool hasFitData() const;
183 
195  OdGePoint3dArray& fitPoints,
196  int& degree,
197  double& fitTolerance,
198  bool& tangentsExist,
199  OdGeVector3d& startTangent,
200  OdGeVector3d& endTangent ) const;
201 
214  OdGePoint3dArray& fitPoints,
215  int& degree,
216  double& fitTolerance,
217  bool& tangentsExist,
218  OdGeVector3d& startTangent,
219  OdGeVector3d& endTangent,
220  OdGe::OdGeKnotParameterization& knotParam) const;
221 
231  const OdGePoint3dArray& fitPoints,
232  int degree,
233  double fitTolerance,
234  const OdGeVector3d& startTangent,
235  const OdGeVector3d& endTangent );
236 
247  const OdGePoint3dArray& fitPoints,
248  int degree,
249  double fitTolerance,
250  const OdGeVector3d& startTangent,
251  const OdGeVector3d& endTangent,
253 
257  void purgeFitData();
258 
277  int& degree,
278  bool& rational,
279  bool& closed,
280  bool& periodic,
281  OdGePoint3dArray& controlPoints,
282  OdGeDoubleArray& knots,
283  OdGeDoubleArray& weights,
284  double& controlPtTol,
285  double& knotTol) const;
286 
299  int& degree,
300  bool& rational,
301  bool& closed,
302  bool& periodic,
303  OdGePoint3dArray& controlPoints,
304  OdGeKnotVector& knots,
305  OdGeDoubleArray& weights,
306  double& controlPtTol) const;
307 
329  void setNurbsData(int degree,
330  bool rational,
331  bool closed,
332  bool periodic,
333  const OdGePoint3dArray& controlPoints,
334  const OdGeDoubleArray& knots,
335  const OdGeDoubleArray& weights,
336  double controlPtTol,
337  double knotTol );
338 
359  int degree,
360  bool rational,
361  bool closed,
362  bool periodic,
363  const OdGePoint3dArray& controlPoints,
364  const OdGeKnotVector& knots,
365  const OdGeDoubleArray& weights,
366  double controlPtTol);
367 
372  double weightAt(
373  int weightIndex) const;
374 
381  int weightIndex,
382  double weight);
383 
387  void insertKnot(double param);
388 
396 
397 
399  void* pClsid) const;
400 
401  /*
402  void getOffsetCurvesGivenPlaneNormal(const OdGeVector3d& normal, //Replace OdRxObjectPtrArray
403  double offsetDist,
404  OdRxObjectPtrArray& offsetCurves ) const;
405  */
406 
408  OdDbDwgFiler* pFiler);
409 
410  virtual void dwgOutFields(
411  OdDbDwgFiler* pFiler) const;
412 
414  OdDbDxfFiler* pFiler);
415 
416  virtual void dxfOutFields(
417  OdDbDxfFiler* pFiler) const;
418 
419  virtual bool subWorldDraw(
420  OdGiWorldDraw* pWd) const;
421 
422  //FELIX_CHANGE_BEGIN
424  OdGeExtents3d& extents) const;
425  //FELIX_CHANGE_END
426 
428  const OdGeMatrix3d& xfm);
429 
430  virtual bool isPlanar() const;
431 
433  OdGePlane& plane,
434  OdDb::Planarity& planarity) const;
435 
436 
442  double param,
443  OdGePoint3d& pointOnCurve) const;
444 
446  const OdGePoint3d& pointOnCurve,
447  double& param) const;
448 
450  double& startParam) const;
451 
453  double& endParam) const;
454 
456  OdGePoint3d& startPoint) const;
457 
459  OdGePoint3d& endPoint) const;
460 
461  virtual OdResult getDistAtParam( double param, double& dist ) const;
462 
463  virtual OdResult getParamAtDist( double dist, double& param ) const;
464 
466  double param,
467  OdGeVector3d& firstDeriv) const;
468 
470  double param,
471  OdGeVector3d& secondDeriv) const;
472 
473  virtual OdResult getArea(
474  double& area) const;
475 
478 
492  const OdGeDoubleArray& params,
493  OdRxObjectPtrArray& entitySet) const;
494 
496 
498  OdDb::DwgVersion ver,
499  OdDbObjectId& replaceId,
500  bool& exchangeXData);
501 
506  {
507  kFitPoints = 0, // By fit points.
508  kControlPoints = 1 // By control points.
509  };
510 
514  SplineType type() const;
515 
529 
533  bool cvFrame() const;
534 
539  void setCvFrame(bool bVisible);
540 
554  OdResult insertControlPointAt(double knotParam, const OdGePoint3d& ctrlPt, double weight = 1.0);
555 
565 
569  bool isNull() const;
570 
581  bool modifyPositionAndTangent(double param, const OdGePoint3d& point, const OdGeVector3d* deriv);
582 
583  virtual OdResult getOdGeCurve(OdGeCurve3d*& pGeCurve, const OdGeTol& tol = OdGeContext::gTol) const;
584  virtual OdResult setFromOdGeCurve(const OdGeCurve3d& geCurve, OdGeVector3d *normal = NULL, const OdGeTol& tol = OdGeContext::gTol);
585 
602  virtual OdResult subExplode(OdRxObjectPtrArray& entitySet) const;
603 };
604 
609 
618 {
619 public:
621 
623  const OdDbCurve* pCurve,
624  const OdGePoint3d& pointOnCurve,
625  double& param) const = 0;
626 
627  virtual OdResult getArea(
628  const OdDbCurve* pCurve,
629  double& area) const = 0;
630 };
631 
636 
637 #include "TD_PackPop.h"
638 
639 #endif
640 
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbSpline > OdDbSplinePtr
Definition: DbSpline.h:608
OdSmartPtr< OdDbSplinePE > OdDbSplinePEPtr
Definition: DbSpline.h:635
tol
Definition: DimVarDefs.h:2287
#define NULL
Definition: GsProperties.h:177
OdResult
Definition: OdResult.h:29
virtual OdResult getSecondDeriv(double param, OdGeVector3d &secondDeriv) const
virtual OdResult getSplitCurves(const OdGeDoubleArray &params, OdRxObjectPtrArray &curveSegments) const
virtual OdResult getFirstDeriv(double param, OdGeVector3d &firstDeriv) const =0
void setFitData(const OdGePoint3dArray &fitPoints, int degree, double fitTolerance, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, OdGe::OdGeKnotParameterization knotParam)
double weightAt(int weightIndex) const
OdResult setType(SplineType type)
int degree() const
OdResult getFitTangents(OdGeVector3d &startTangent, OdGeVector3d &endTangent) const
bool modifyPositionAndTangent(double param, const OdGePoint3d &point, const OdGeVector3d *deriv)
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
void setControlPointAt(int controlPointIndex, const OdGePoint3d &point)
void setFitPointAt(int fitPointIndex, const OdGePoint3d &point)
double fitTolerance() const
TD_USING(OdDbCurve::getSecondDeriv)
virtual OdResult getOdGeCurve(OdGeCurve3d *&pGeCurve, const OdGeTol &tol=OdGeContext::gTol) const
void setWeightAt(int weightIndex, double weight)
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const
void setNurbsData(int degree, bool rational, bool closed, bool periodic, const OdGePoint3dArray &controlPoints, const OdGeKnotVector &knots, const OdGeDoubleArray &weights, double controlPtTol)
bool hasFitData() const
virtual OdResult subExplode(OdRxObjectPtrArray &entitySet) const
void getControlPointAt(int controlPointIndex, OdGePoint3d &point) const
virtual OdResult getPointAtParam(double param, OdGePoint3d &pointOnCurve) const
void setCvFrame(bool bVisible)
void elevateDegree(int newDegree)
virtual OdResult reverseCurve()
bool isRational() const
virtual OdResult getPlane(OdGePlane &plane, OdDb::Planarity &planarity) const
OdDbObjectPtr decomposeForSave(OdDb::DwgVersion ver, OdDbObjectId &replaceId, bool &exchangeXData)
bool cvFrame() const
virtual OdResult subGetGeomExtents(OdGeExtents3d &extents) const
TD_USING(OdDbCurve::getFirstDeriv)
void insertKnot(double param)
OdResult insertControlPointAt(double knotParam, const OdGePoint3d &ctrlPt, double weight=1.0)
OdResult getFitPointAt(int fitPointIndex, OdGePoint3d &point) const
virtual OdResult getParamAtDist(double dist, double &param) const
virtual OdResult getEndParam(double &endParam) const
SplineType type() const
virtual OdResult getSecondDeriv(double param, OdGeVector3d &secondDeriv) const
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm)
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
void removeFitPointAt(int fitPointIndex)
void setFitTangents(const OdGeVector3d &startTangent, const OdGeVector3d &endTangent)
TD_USING(OdDbCurve::getSplitCurves)
OdResult getFitData(OdGePoint3dArray &fitPoints, int &degree, double &fitTolerance, bool &tangentsExist, OdGeVector3d &startTangent, OdGeVector3d &endTangent, OdGe::OdGeKnotParameterization &knotParam) const
void setFitTol(double fitTolerance)
void setFitData(const OdGePoint3dArray &fitPoints, int degree, double fitTolerance, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent)
virtual bool isPlanar() const
void getNurbsData(int &degree, bool &rational, bool &closed, bool &periodic, OdGePoint3dArray &controlPoints, OdGeDoubleArray &knots, OdGeDoubleArray &weights, double &controlPtTol, double &knotTol) const
void getNurbsData(int &degree, bool &rational, bool &closed, bool &periodic, OdGePoint3dArray &controlPoints, OdGeKnotVector &knots, OdGeDoubleArray &weights, double &controlPtTol) const
virtual OdResult getStartPoint(OdGePoint3d &startPoint) const
OdResult removeControlPointAt(int index)
OdResult getFitData(OdGePoint3dArray &fitPoints, int &degree, double &fitTolerance, bool &tangentsExist, OdGeVector3d &startTangent, OdGeVector3d &endTangent) const
int numFitPoints() const
virtual OdResult getArea(double &area) const
virtual OdResult getDistAtParam(double param, double &dist) const
virtual OdResult getStartParam(double &startParam) const
int numControlPoints() const
virtual OdResult getFirstDeriv(double param, OdGeVector3d &firstDeriv) const
void purgeFitData()
void setNurbsData(int degree, bool rational, bool closed, bool periodic, const OdGePoint3dArray &controlPoints, const OdGeDoubleArray &knots, const OdGeDoubleArray &weights, double controlPtTol, double knotTol)
virtual OdResult getSplitCurves(const OdGeDoubleArray &params, OdRxObjectPtrArray &entitySet) const
void insertFitPointAt(int fitPointIndex, const OdGePoint3d &point)
virtual OdResult subGetClassID(void *pClsid) const
virtual OdResult getParamAtPoint(const OdGePoint3d &pointOnCurve, double &param) const
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
virtual OdResult setFromOdGeCurve(const OdGeCurve3d &geCurve, OdGeVector3d *normal=NULL, const OdGeTol &tol=OdGeContext::gTol)
bool isNull() const
virtual OdResult getEndPoint(OdGePoint3d &endPoint) const
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
ODDB_DECLARE_MEMBERS(OdDbSpline)
virtual OdResult getArea(const OdDbCurve *pCurve, double &area) const =0
ODRX_DECLARE_MEMBERS(OdDbSplinePE)
virtual OdResult getParamAtPoint(const OdDbCurve *pCurve, const OdGePoint3d &pointOnCurve, double &param) const =0
Definition: GeTol.h:49
GLenum GLint * params
Definition: gles2_ext.h:184
GLuint index
Definition: gles2_ext.h:265
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
DwgVersion
Definition: OdaDefs.h:46
Planarity
Definition: DbEntity.h:74
static GE_STATIC_EXPORT OdGeTol gTol
Definition: GeGbl.h:60
OdGeKnotParameterization
Definition: Ge.h:281