libsurf
Programmer's Documentation

linearsurf.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_LINEARSURF_H
16 #define SURF_LINEARSURF_H
17 
18 #include <boost/shared_ptr.hpp>
19 #include "surface.h"
20 #include "curve.h"
21 
35 class LinearSurf : public Surface
36 {
37 public:
38 
40  LinearSurf(const std::string & s = "NoNameLinearSurf") : Surface(s) {}
41 
43  LinearSurf(const LinearSurf & a);
44 
46  Vector init(const CurvePtrArray & cv);
47 
49  Vector init(const CurvePtr &ca, const CurvePtr &cb);
50 
52  Vct3 eval(Real u, Real v) const;
53 
55  Vct3 derive(Real u, Real v, uint ku, uint kv) const;
56 
58  void plane(Real u, Real v, Vct3 & S, Vct3 & Su, Vct3 & Sv) const;
59 
61  void apply();
62 
64  void initMesh(const DnRefineCriterion & c, DnMesh & gnr) const;
65 
67  void simpleMesh(PointGrid<3,float> & pgrid,
68  PointGrid<3,float> & ngrid, uint pu=2, uint pv=2) const;
69 
71  XmlElement toXml(bool share=false) const;
72 
74  void fromXml(const XmlElement & xe);
75 
77  LinearSurf *clone() const {return new LinearSurf(*this);}
78 
80  const Vector & vsections() const {return vp;}
81 
83  int toIges(IgesFile & igfile, int tfi = 0) const;
84 
86  bool fromIges(const IgesFile & file, const IgesDirEntry & dir);
87 
89  uint segment(Real v) const;
90 
92  void dimStats(DimStat &stat) const;
93 
95  void initGridPattern(Vector & upi, Vector & vpi) const;
96 
98  void isSymmetric(bool & usym, bool & vsym) const;
99 
100 private:
101 
103  CurvePtrArray curves;
104 
106  Vector vp;
107 };
108 
109 typedef boost::shared_ptr<LinearSurf> LinearSurfPtr;
110 
111 #endif
112 
LinearSurf * clone() const
generate a clone
Definition: linearsurf.h:77
Vector init(const CurvePtrArray &cv)
create from curve array, surface will modify curves when transformed
Definition: linearsurf.cpp:54
Mesh generation engine.
Definition: dnmesh.h:47
LinearSurf(const std::string &s="NoNameLinearSurf")
empty definition
Definition: linearsurf.h:40
Data in each directory entry of an IGES file.
Definition: igesdirentry.h:31
void apply()
coordinate transformation
Definition: linearsurf.cpp:140
CurvePtrArray curves
curves which constitute sections between which to interpolate
Definition: linearsurf.h:103
Main interface to IGES files.
Definition: igesfile.h:32
XmlElement toXml(bool share=false) const
XML output.
Definition: linearsurf.cpp:270
Ruled surface with multiple sections.
Definition: linearsurf.h:35
void isSymmetric(bool &usym, bool &vsym) const
return if surface is symmetric in u- or v-direction
Definition: linearsurf.cpp:190
Vct3 eval(Real u, Real v) const
compute a surface point
Definition: linearsurf.cpp:84
bool fromIges(const IgesFile &file, const IgesDirEntry &dir)
fetch data from IGES entity 118
Definition: linearsurf.cpp:298
const Vector & vsections() const
read access to parametric positions of sections
Definition: linearsurf.h:80
Vct3 derive(Real u, Real v, uint ku, uint kv) const
derivation with respect to parameters
Definition: linearsurf.cpp:97
void initGridPattern(Vector &upi, Vector &vpi) const
return an initial discretization pattern to start with
Definition: linearsurf.cpp:151
int toIges(IgesFile &igfile, int tfi=0) const
generate multiple IGES entities 118
Definition: linearsurf.cpp:337
Surface interface.
Definition: surface.h:37
void plane(Real u, Real v, Vct3 &S, Vct3 &Su, Vct3 &Sv) const
compute point and tangents in one sweep (more efficient)
Definition: linearsurf.cpp:120
uint segment(Real v) const
find segment
Definition: linearsurf.cpp:70
Simplest mesh refinement criterion.
Definition: dnrefine.h:43
void initMesh(const DnRefineCriterion &c, DnMesh &gnr) const
initialize mesh generator (marks kink edges)
Definition: linearsurf.cpp:196
void dimStats(DimStat &stat) const
compute statistics
Definition: linearsurf.cpp:177
void fromXml(const XmlElement &xe)
XML input.
Definition: linearsurf.cpp:281
Vector vp
the corresponding parameters in v-direction, [0,1]
Definition: linearsurf.h:106
void simpleMesh(PointGrid< 3, float > &pgrid, PointGrid< 3, float > &ngrid, uint pu=2, uint pv=2) const
quadrilaterals for OpenGL display
Definition: linearsurf.cpp:202
Generated on Mon Jan 24 2022 03:03:16 for libsurf by   doxygen 1.8.5