libsurf
Programmer's Documentation

cylinder.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_CYLINDER_H
16 #define SURF_CYLINDER_H
17 
18 #include "surface.h"
19 
27 class Cylinder : public Surface
28 {
29 public:
30 
32  Cylinder(const std::string & s) : Surface(s) {}
33 
35  Cylinder(const std::string & name, const Vct3 & pbot, const Vct3 & ptop, const Vct3 & vrad);
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 apply();
45 
47  XmlElement toXml(bool share=false) const;
48 
50  void fromXml(const XmlElement & xe);
51 
53  Cylinder *clone() const {return new Cylinder(*this);}
54 
55  // protected:
56 
58  void initGridPattern(Vector & up, Vector & vp) const;
59 
61  void isSymmetric(bool & usym, bool & vsym) const;
62 
63 private:
64 
66  Vct3 bot, top, r1, r2;
67 };
68 
69 #endif
Vct3 eval(Real u, Real v) const
evaluate at (u,v) - u is circumferential and v is axial coordinate
Definition: cylinder.cpp:32
Vct3 derive(Real u, Real v, uint du, uint dv) const
compute derivatives
Definition: cylinder.cpp:40
Cylinder surface.
Definition: cylinder.h:27
XmlElement toXml(bool share=false) const
XML output.
Definition: cylinder.cpp:71
const std::string & name() const
return name
Definition: surface.h:82
void apply()
transformation
Definition: cylinder.cpp:62
Cylinder(const std::string &s)
empty initialization
Definition: cylinder.h:32
void isSymmetric(bool &usym, bool &vsym) const
return if surface is symmetric in u- or v-direction
Definition: cylinder.cpp:111
void fromXml(const XmlElement &xe)
XML input.
Definition: cylinder.cpp:86
Vct3 bot
bottom, top points and radius
Definition: cylinder.h:66
Cylinder * clone() const
generate a clone
Definition: cylinder.h:53
Surface interface.
Definition: surface.h:37
void initGridPattern(Vector &up, Vector &vp) const
return an initial discretization pattern to start with
Definition: cylinder.cpp:100
Generated on Mon Jan 24 2022 03:03:16 for libsurf by   doxygen 1.8.5