libsurf
Programmer's Documentation

revosurf.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_REVOSURF_H
16 #define SURF_REVOSURF_H
17 
18 #include "surface.h"
19 #include "curve.h"
20 
29 class RevoSurf : public Surface
30 {
31 public:
32 
34  RevoSurf(const std::string & s = "RevoSurf")
35  : Surface(s), startAngle(0.0), termAngle(2*PI) {}
36 
38  Vct3 eval(Real u, Real v) const;
39 
41  Vct3 derive(Real u, Real v, uint du, uint dv) const;
42 
44  void plane(Real u, Real v, Vct3 &S, Vct3 &Su, Vct3 &Sv) const;
45 
47  int toIges(IgesFile & file, int tfi = 0) const;
48 
50  bool fromIges(const IgesFile & file, const IgesDirEntry & dir);
51 
53  RevoSurf *clone() const;
54 
56  XmlElement toXml(bool share) const;
57 
59  void fromXml(const XmlElement &xe);
60 
62  void apply();
63 
64 protected:
65 
67  void buildRotation();
68 
69 protected:
70 
72  Vct3 pax1, pax2;
73 
75  CurvePtr genCurve;
76 
78  Real startAngle, termAngle;
79 
81  Mtx33 rot90;
82 };
83 
84 #endif // REVOSURF_H
Surface of revolution.
Definition: revosurf.h:29
void buildRotation()
reconstruct 90 degree rotation from axis
Definition: revosurf.cpp:166
Mtx33 rot90
helper : rotation by 90 degree about axis
Definition: revosurf.h:81
void apply()
apply transformation
Definition: revosurf.cpp:152
void fromXml(const XmlElement &xe)
recover from XML representation
Definition: revosurf.cpp:187
Data in each directory entry of an IGES file.
Definition: igesdirentry.h:31
Vct3 eval(Real u, Real v) const
evaluate surface
Definition: revosurf.cpp:21
Real startAngle
start and end angles
Definition: revosurf.h:78
Main interface to IGES files.
Definition: igesfile.h:32
bool fromIges(const IgesFile &file, const IgesDirEntry &dir)
extract surface of revolution from IGES file
Definition: revosurf.cpp:116
RevoSurf * clone() const
generate a clone
Definition: revosurf.cpp:161
void plane(Real u, Real v, Vct3 &S, Vct3 &Su, Vct3 &Sv) const
evaluate linear approximation
Definition: revosurf.cpp:73
int toIges(IgesFile &file, int tfi=0) const
append to IGES file and return the directory entry index, if implemented
Definition: revosurf.cpp:95
XmlElement toXml(bool share) const
create XML representation
Definition: revosurf.cpp:172
CurvePtr genCurve
generatrix curve
Definition: revosurf.h:75
Vct3 pax1
two points define axis of revolution
Definition: revosurf.h:72
Surface interface.
Definition: surface.h:37
Vct3 derive(Real u, Real v, uint du, uint dv) const
evaluate derivatives
Definition: revosurf.cpp:37
RevoSurf(const std::string &s="RevoSurf")
create undefined surface
Definition: revosurf.h:34
Generated on Wed Jan 19 2022 03:03:15 for libsurf by   doxygen 1.8.5