libsurf
Programmer's Documentation

rationalsplinecurve.h (r6227/r5385)
1 
2 /* Copyright (C) 2015 David Eller <david@larosterna.com>
3  *
4  * Commercial License Usage
5  * Licensees holding valid commercial licenses may use this file in accordance
6  * with the terms contained in their respective non-exclusive license agreement.
7  * For further information contact david@larosterna.com .
8  *
9  * GNU General Public License Usage
10  * Alternatively, this file may be used under the terms of the GNU General
11  * Public License version 3.0 as published by the Free Software Foundation and
12  * appearing in the file gpl.txt included in the packaging of this file.
13  */
14 
15 #ifndef SURF_RATIONALSPLINECURVE_H
16 #define SURF_RATIONALSPLINECURVE_H
17 
18 #include <genua/splinebasis.h>
19 #include "abstractcurve.h"
20 
32 {
33 public:
34 
36  RationalSplineCurve(const std::string & s = "")
37  : AbstractCurve(s), kfront(0.0), kback(1.0), tstart(0.0), tend(1.0) {}
38 
40  void createCircle();
41 
43  void createCircle(const Vct3 & ctr, const Vct3 & pnrm, Real radius);
44 
46  Vct3 eval(Real u) const;
47 
49  Vct3 derive(Real u, uint du) const;
50 
52  void tgline(Real t, Vct3 & c, Vct3 & dc) const;
53 
55  void apply();
56 
58  void initGrid(Vector &t) const;
59 
61  XmlElement toXml(bool share=false) const;
62 
64  void fromXml(const XmlElement & xe);
65 
67  bool fromIges(const IgesFile & file, const IgesDirEntry & entry);
68 
70  int toIges(IgesFile & file, int tfi = 0) const;
71 
73  RationalSplineCurve *clone() const;
74 
75 protected:
76 
78  Real tmap(Real tx) const {return tstart + tx*(tend - tstart);}
79 
80 private:
81 
84 
87 
89  Real kfront, kback;
90 
92  Real tstart, tend;
93 };
94 
95 #endif // RATIONALSPLINECURVE_H
void createCircle()
create unit circle in xy-plane
Definition: rationalsplinecurve.cpp:32
RationalSplineCurve * clone() const
generate a clone
Definition: rationalsplinecurve.cpp:301
Base class for all curve objects.
Definition: abstractcurve.h:31
Vct3 eval(Real u) const
evaluation interface
Definition: rationalsplinecurve.cpp:74
Vct3 derive(Real u, uint du) const
derive at (u,v)
Definition: rationalsplinecurve.cpp:91
RationalSplineCurve(const std::string &s="")
create empty spline curve
Definition: rationalsplinecurve.h:36
bool fromIges(const IgesFile &file, const IgesDirEntry &entry)
extract from IGES entity 128
Definition: rationalsplinecurve.cpp:228
Data in each directory entry of an IGES file.
Definition: igesdirentry.h:31
SplineBasis ub
spline basis
Definition: rationalsplinecurve.h:83
Main interface to IGES files.
Definition: igesfile.h:32
Real kfront
original knot value range (defined by IGES import)
Definition: rationalsplinecurve.h:89
PointList< 4 > cp
control point list, homogeneous coordinates (x,y,z,w)
Definition: rationalsplinecurve.h:86
XmlElement toXml(bool share=false) const
XML output.
Definition: rationalsplinecurve.cpp:187
void initGrid(Vector &t) const
discretization
Definition: rationalsplinecurve.cpp:180
void tgline(Real t, Vct3 &c, Vct3 &dc) const
optimization for common case
Definition: rationalsplinecurve.cpp:144
Real tmap(Real tx) const
remap parameter value
Definition: rationalsplinecurve.h:78
NURBS curve.
Definition: rationalsplinecurve.h:31
void fromXml(const XmlElement &xe)
XML input.
Definition: rationalsplinecurve.cpp:205
Real tstart
define knot region mapped by [0,1]
Definition: rationalsplinecurve.h:92
int toIges(IgesFile &file, int tfi=0) const
append to IGES file and return the directory entry index, if implemented
Definition: rationalsplinecurve.cpp:277
void apply()
coordinate transformation
Definition: rationalsplinecurve.cpp:167
Generated on Mon Jan 24 2022 03:03:16 for libsurf by   doxygen 1.8.5