CFx SDK Documentation  2020SP3
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 
OdDbSpline::getStartParam
virtual OdResult getStartParam(double &startParam) const
OdResult
OdResult
Definition: OdResult.h:29
OdDbSpline::setControlPointAt
void setControlPointAt(int controlPointIndex, const OdGePoint3d &point)
OdDbSpline::getFitPointAt
OdResult getFitPointAt(int fitPointIndex, OdGePoint3d &point) const
OdDbCurve::getFirstDeriv
virtual OdResult getFirstDeriv(double param, OdGeVector3d &firstDeriv) const =0
OdGePlane
Definition: GePlane.h:45
OdDbSpline::subGetGeomExtents
virtual OdResult subGetGeomExtents(OdGeExtents3d &extents) const
OdGeVector3d
Definition: GeVector3d.h:54
OdDbSpline::setCvFrame
void setCvFrame(bool bVisible)
NULL
#define NULL
Definition: GsProperties.h:177
OdDbSpline::setFitTangents
void setFitTangents(const OdGeVector3d &startTangent, const OdGeVector3d &endTangent)
OdDbSpline::SplineType
SplineType
Definition: DbSpline.h:506
OdDbSpline::getSecondDeriv
virtual OdResult getSecondDeriv(double param, OdGeVector3d &secondDeriv) const
OdDbSpline::subExplode
virtual OdResult subExplode(OdRxObjectPtrArray &entitySet) const
OdDbSpline::subTransformBy
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm)
OdDb::Planarity
Planarity
Definition: DbEntity.h:74
tol
tol
Definition: DimVarDefs.h:2287
OdDbSpline::getEndParam
virtual OdResult getEndParam(double &endParam) const
OdDbSpline::degree
int degree() const
OdDbSpline::isRational
bool isRational() const
type
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
OdDbSpline::setFitData
void setFitData(const OdGePoint3dArray &fitPoints, int degree, double fitTolerance, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent)
OdDbSpline::removeControlPointAt
OdResult removeControlPointAt(int index)
OdDbSpline::dxfInFields
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
OdRxObject
Definition: RxObject.h:564
OdDbObjectId
Definition: DbObjectId.h:99
OdDbSpline::setFromOdGeCurve
virtual OdResult setFromOdGeCurve(const OdGeCurve3d &geCurve, OdGeVector3d *normal=NULL, const OdGeTol &tol=OdGeContext::gTol)
OdDbSplinePE::getArea
virtual OdResult getArea(const OdDbCurve *pCurve, double &area) const =0
OdDbSpline
Definition: DbSpline.h:44
OdDbCurve::getSecondDeriv
virtual OdResult getSecondDeriv(double param, OdGeVector3d &secondDeriv) const
OdDbSpline::setFitPointAt
void setFitPointAt(int fitPointIndex, const OdGePoint3d &point)
OdDbSpline::setFitData
void setFitData(const OdGePoint3dArray &fitPoints, int degree, double fitTolerance, const OdGeVector3d &startTangent, const OdGeVector3d &endTangent, OdGe::OdGeKnotParameterization knotParam)
OdArray< OdGePoint3d, OdMemoryAllocator< OdGePoint3d > >
TD_PackPop.h
OdDbSpline::modifyPositionAndTangent
bool modifyPositionAndTangent(double param, const OdGePoint3d &point, const OdGeVector3d *deriv)
OdDbSpline::ODDB_DECLARE_MEMBERS
ODDB_DECLARE_MEMBERS(OdDbSpline)
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdDbSpline::getParamAtPoint
virtual OdResult getParamAtPoint(const OdGePoint3d &pointOnCurve, double &param) const
OdDbSpline::numControlPoints
int numControlPoints() const
index
GLuint index
Definition: gles2_ext.h:265
OdGe::OdGeKnotParameterization
OdGeKnotParameterization
Definition: Ge.h:281
OdDb::DwgVersion
DwgVersion
Definition: OdaDefs.h:46
OdDbSpline::dwgOutFields
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
OdDbSpline::getFitData
OdResult getFitData(OdGePoint3dArray &fitPoints, int &degree, double &fitTolerance, bool &tangentsExist, OdGeVector3d &startTangent, OdGeVector3d &endTangent, OdGe::OdGeKnotParameterization &knotParam) const
OdDbSpline::elevateDegree
void elevateDegree(int newDegree)
OdDbSpline::removeFitPointAt
void removeFitPointAt(int fitPointIndex)
OdDbSpline::getOdGeCurve
virtual OdResult getOdGeCurve(OdGeCurve3d *&pGeCurve, const OdGeTol &tol=OdGeContext::gTol) const
OdSmartPtr< OdDbObject >
OdDbSpline::TD_USING
TD_USING(OdDbCurve::getFirstDeriv)
OdGePoint3d
Definition: GePoint3d.h:55
OdDbSpline::getArea
virtual OdResult getArea(double &area) const
OdDbSpline::setNurbsData
void setNurbsData(int degree, bool rational, bool closed, bool periodic, const OdGePoint3dArray &controlPoints, const OdGeKnotVector &knots, const OdGeDoubleArray &weights, double controlPtTol)
OdDbSpline::getNurbsData
void getNurbsData(int &degree, bool &rational, bool &closed, bool &periodic, OdGePoint3dArray &controlPoints, OdGeDoubleArray &knots, OdGeDoubleArray &weights, double &controlPtTol, double &knotTol) const
OdDbSpline::TD_USING
TD_USING(OdDbCurve::getSplitCurves)
DbCurve.h
OdDbSpline::getPlane
virtual OdResult getPlane(OdGePlane &plane, OdDb::Planarity &planarity) const
OdDbSpline::dxfOutFields
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
OdDbSpline::insertControlPointAt
OdResult insertControlPointAt(double knotParam, const OdGePoint3d &ctrlPt, double weight=1.0)
OdDbSpline::hasFitData
bool hasFitData() const
OdDbSplinePE::getParamAtPoint
virtual OdResult getParamAtPoint(const OdDbCurve *pCurve, const OdGePoint3d &pointOnCurve, double &param) const =0
OdDbSpline::getFitData
OdResult getFitData(OdGePoint3dArray &fitPoints, int &degree, double &fitTolerance, bool &tangentsExist, OdGeVector3d &startTangent, OdGeVector3d &endTangent) const
OdDbSpline::setNurbsData
void setNurbsData(int degree, bool rational, bool closed, bool periodic, const OdGePoint3dArray &controlPoints, const OdGeDoubleArray &knots, const OdGeDoubleArray &weights, double controlPtTol, double knotTol)
OdDbDxfFiler
Definition: DbFiler.h:194
OdDbSpline::getFirstDeriv
virtual OdResult getFirstDeriv(double param, OdGeVector3d &firstDeriv) const
OdDbSplinePEPtr
OdSmartPtr< OdDbSplinePE > OdDbSplinePEPtr
Definition: DbSpline.h:635
OdDbSplinePtr
OdSmartPtr< OdDbSpline > OdDbSplinePtr
Definition: DbSpline.h:608
OdDbSpline::insertFitPointAt
void insertFitPointAt(int fitPointIndex, const OdGePoint3d &point)
TD_PackPush.h
OdDbSpline::getDistAtParam
virtual OdResult getDistAtParam(double param, double &dist) const
OdDbSpline::getEndPoint
virtual OdResult getEndPoint(OdGePoint3d &endPoint) const
OdDbSpline::isPlanar
virtual bool isPlanar() const
OdGeKnotVector
Definition: GeKnotVector.h:44
params
GLenum GLint * params
Definition: gles2_ext.h:184
OdGiWorldDraw
Definition: GiWorldDraw.h:44
OdDbSpline::OdDbSpline
OdDbSpline()
OdDbSpline::decomposeForSave
OdDbObjectPtr decomposeForSave(OdDb::DwgVersion ver, OdDbObjectId &replaceId, bool &exchangeXData)
OdDbSpline::setType
OdResult setType(SplineType type)
OdGeCurve3d
Definition: GeCurve3d.h:56
OdDbSpline::isNull
bool isNull() const
OdDbCurve
Definition: DbCurve.h:53
OdDbSpline::setFitTol
void setFitTol(double fitTolerance)
OdDbSpline::subWorldDraw
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const
OdDbSpline::getSplitCurves
virtual OdResult getSplitCurves(const OdGeDoubleArray &params, OdRxObjectPtrArray &entitySet) const
OdGeContext::gTol
static GE_STATIC_EXPORT OdGeTol gTol
Definition: GeGbl.h:60
OdGeExtents3d
Definition: GeExtents3d.h:45
OdDbSpline::cvFrame
bool cvFrame() const
OdDbSplinePE
Definition: DbSpline.h:618
OdDbSpline::TD_USING
TD_USING(OdDbCurve::getSecondDeriv)
OdDbSpline::setWeightAt
void setWeightAt(int weightIndex, double weight)
OdDbSpline::fitTolerance
double fitTolerance() const
OdDbSpline::subGetClassID
virtual OdResult subGetClassID(void *pClsid) const
OdDbSpline::purgeFitData
void purgeFitData()
TOOLKIT_EXPORT
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdDbSpline::getNurbsData
void getNurbsData(int &degree, bool &rational, bool &closed, bool &periodic, OdGePoint3dArray &controlPoints, OdGeKnotVector &knots, OdGeDoubleArray &weights, double &controlPtTol) const
OdDbSplinePE::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdDbSplinePE)
OdDbSpline::dwgInFields
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
OdDbSpline::getStartPoint
virtual OdResult getStartPoint(OdGePoint3d &startPoint) const
OdDbSpline::numFitPoints
int numFitPoints() const
OdGeTol
Definition: GeTol.h:49
OdDbSpline::type
SplineType type() const
OdDbSpline::insertKnot
void insertKnot(double param)
OdDbSpline::reverseCurve
virtual OdResult reverseCurve()
OdDbSpline::getControlPointAt
void getControlPointAt(int controlPointIndex, OdGePoint3d &point) const
OdDbSpline::getFitTangents
OdResult getFitTangents(OdGeVector3d &startTangent, OdGeVector3d &endTangent) const
OdDbSpline::weightAt
double weightAt(int weightIndex) const
OdDbCurve::getSplitCurves
virtual OdResult getSplitCurves(const OdGeDoubleArray &params, OdRxObjectPtrArray &curveSegments) const
OdDbSpline::getParamAtDist
virtual OdResult getParamAtDist(double dist, double &param) const
OdDbDwgFiler
Definition: DbFiler.h:1031
OdDbSpline::getPointAtParam
virtual OdResult getPointAtParam(double param, OdGePoint3d &pointOnCurve) const