libsurf
Programmer's Documentation

rotsurf.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_ROTSURF_H
16 #define SURF_ROTSURF_H
17 
18 #include "curve.h"
19 #include "surface.h"
20 
25 class RotSurf : public Surface
26 {
27  public:
28 
30  RotSurf(const std::string & s) : Surface(s) {}
31 
33  void init(const CurvePtr & c, const Vct3 & pa, const Vct3 & pb);
34 
36  Vct3 eval(Real u, Real v) const;
37 
39  Vct3 derive(Real u, Real v, uint ku, uint kv) const;
40 
42  void apply();
43 
45  XmlElement toXml(bool share=false) const;
46 
48  void fromXml(const XmlElement & xe);
49 
51  RotSurf *clone() const {return new RotSurf(*this);}
52 
53  // protected:
54 
56  void initGridPattern(Vector & up, Vector & vp) const;
57 
59  void isSymmetric(bool & usym, bool & vsym) const;
60 
61  private:
62 
64  CurvePtr corg;
65 
67  Curve cva, cvb;
68 
70  Vct3 org, rax;
71 };
72 
73 #endif
Curve cva
curves used for surface evaluation
Definition: rotsurf.h:67
RotSurf(const std::string &s)
init surface
Definition: rotsurf.h:30
CurvePtr corg
original outline curve
Definition: rotsurf.h:64
void isSymmetric(bool &usym, bool &vsym) const
return if surface is symmetric in u- or v-direction
Definition: rotsurf.cpp:126
Vct3 derive(Real u, Real v, uint ku, uint kv) const
derive spline surface
Definition: rotsurf.cpp:49
RotSurf * clone() const
generate clone
Definition: rotsurf.h:51
Rotational surface.
Definition: rotsurf.h:25
void apply()
coordinate transformation
Definition: rotsurf.cpp:74
void init(const CurvePtr &c, const Vct3 &pa, const Vct3 &pb)
rotate curve about axis through pa and pb
Definition: rotsurf.cpp:21
Vct3 org
origin and rotation axis
Definition: rotsurf.h:70
Vct3 eval(Real u, Real v) const
evaluate spline surface
Definition: rotsurf.cpp:37
Cubic section curve.
Definition: curve.h:35
void initGridPattern(Vector &up, Vector &vp) const
return an initial discretization pattern to start with
Definition: rotsurf.cpp:120
void fromXml(const XmlElement &xe)
XML input.
Definition: rotsurf.cpp:98
Surface interface.
Definition: surface.h:37
XmlElement toXml(bool share=false) const
XML output.
Definition: rotsurf.cpp:83
Generated on Wed Jan 19 2022 03:03:15 for libsurf by   doxygen 1.8.5