libsurf
Programmer's Documentation

paver.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 
16 #ifndef SURF_PAVER_H
17 #define SURF_PAVER_H
18 
19 #include <genua/point.h>
20 #include "surface.h"
21 
27 class Paver
28 {
29  public:
30 
32  Paver(const Surface & s) : srf(s), loffset(0), hoffset(0) {}
33 
35  void nextRow(const PointList<2> & row);
36 
38  void nextVRow(Real v, const Vector & up);
39 
41  void fan(const Vct2 & ctr);
42 
44  const PointList<2> & vertices() const {return ppt;}
45 
47  const Indices & triangles() const {return itriangles;}
48 
50  void exportMesh(TriMesh &msh);
51 
53  void clear() {ppt.clear(); itriangles.clear();}
54 
55  private:
56 
58  bool pickLow(uint ilo, uint ihi) const;
59 
61  Vct3 eval(uint k) const {
62  return srf.eval(ppt[k][0], ppt[k][1]);
63  }
64 
65  private:
66 
68  const Surface & srf;
69 
72 
74  Indices itriangles;
75 
77  uint loffset, hoffset;
78 };
79 
80 #endif // PAVER_H
const Indices & triangles() const
access result
Definition: paver.h:47
void clear()
clear stored mesh
Definition: paver.h:53
uint loffset
offset pointer
Definition: paver.h:77
PointList< 2 > ppt
parameter space points
Definition: paver.h:71
bool pickLow(uint ilo, uint ihi) const
compute tangent to paving front
Definition: paver.cpp:83
void exportMesh(TriMesh &msh)
convenience interface
Definition: paver.cpp:100
Vct3 eval(uint k) const
evaluate parameter space vertex
Definition: paver.h:61
Generates a triangular mesh by rows.
Definition: paver.h:27
void clear()
void nextVRow(Real v, const Vector &up)
append a single row of vertices, mesh
Definition: paver.cpp:58
void fan(const Vct2 &ctr)
generate a fan as the last row
Definition: paver.cpp:67
Indices itriangles
triangle indices into ppt
Definition: paver.h:74
virtual Vct3 eval(Real u, Real v) const =0
evaluation interface
Surface interface.
Definition: surface.h:37
Paver(const Surface &s)
create a paver for surface s
Definition: paver.h:32
const PointList< 2 > & vertices() const
access result
Definition: paver.h:44
const Surface & srf
surface to pave
Definition: paver.h:68
void nextRow(const PointList< 2 > &row)
append a single row of vertices, mesh
Definition: paver.cpp:19
Generated on Mon Jan 24 2022 03:03:16 for libsurf by   doxygen 1.8.5