libsurf
Programmer's Documentation

wingletblend.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_WINGLETBLEND_H
16 #define SURF_WINGLETBLEND_H
17 
18 #include "curve.h"
19 #include "surface.h"
20 
30 class WingletBlend : public Surface
31 {
32  public:
33 
35  WingletBlend(const std::string & s): Surface(s) {}
36 
39 
41  void init(const Curve & a, const Curve & b);
42 
44  Vct3 eval(Real u, Real v) const;
45 
47  void plane(Real u, Real v, Vct3 & S, Vct3 & Su, Vct3 & Sv) const;
48 
50  Vct3 normal(Real u, Real v) const;
51 
53  Vct3 derive(Real u, Real v, uint du, uint dv) const;
54 
56  void apply();
57 
59  XmlElement toXml(bool share=false) const;
60 
62  void fromXml(const XmlElement & xe);
63 
65  WingletBlend *clone() const {return new WingletBlend(*this);}
66 
67  protected:
68 
70  void initGridPattern(Vector & up, Vector & vp) const;
71 
73  void isSymmetric(bool & usym, bool & vsym) const;
74 
75  private:
76 
78  void initRotation();
79 
80  private:
81 
83  CurvePtr c0, c1;
84 
86  Vct3 lp, ldir;
87 
89  Mtx22 csm;
90 
92  Real theta0, theta1;
93 };
94 
95 #endif
WingletBlend(const std::string &s)
initialize with name
Definition: wingletblend.h:35
Vct3 lp
rotation axis
Definition: wingletblend.h:86
CurvePtr c0
baseline curves at v=0 and v=1
Definition: wingletblend.h:83
WingletBlend * clone() const
generate a clone
Definition: wingletblend.h:65
void apply()
coordinate transformation
Definition: wingletblend.cpp:217
Vct3 normal(Real u, Real v) const
compute normal vector
Definition: wingletblend.cpp:154
XmlElement toXml(bool share=false) const
XML output.
Definition: wingletblend.cpp:229
void initGridPattern(Vector &up, Vector &vp) const
return an initial discretization pattern to start with
Definition: wingletblend.cpp:255
Elliptic arc surface for blended winglets.
Definition: wingletblend.h:30
Cubic section curve.
Definition: curve.h:35
Vct3 eval(Real u, Real v) const
evaluate blend surface
Definition: wingletblend.cpp:89
Real theta0
angular parameters
Definition: wingletblend.h:92
void plane(Real u, Real v, Vct3 &S, Vct3 &Su, Vct3 &Sv) const
compute point and tangent derivatives at (u,v), for efficiency
Definition: wingletblend.cpp:118
~WingletBlend()
destructor
Definition: wingletblend.h:38
Mtx22 csm
constant transformation matrix
Definition: wingletblend.h:89
void fromXml(const XmlElement &xe)
XML input.
Definition: wingletblend.cpp:239
Surface interface.
Definition: surface.h:37
void isSymmetric(bool &usym, bool &vsym) const
return if surface is symmetric in u- or v-direction
Definition: wingletblend.cpp:261
void initRotation()
compute rotation parameters from flat base surface
Definition: wingletblend.cpp:35
void init(const Curve &a, const Curve &b)
construct from two curves (throws on failure)
Definition: wingletblend.cpp:27
Vct3 derive(Real u, Real v, uint du, uint dv) const
derive at (u,v)
Definition: wingletblend.cpp:163
Generated on Wed Jan 19 2022 03:03:15 for libsurf by   doxygen 1.8.5