Polyhedral-net Splines
Loading...
Searching...
No Matches
PatchConsumer.hpp
1/* copyright(c)Jorg Peters [jorg.peters@gmail.com] */
2
3#pragma once
4
5#include "../Patch/Patch.hpp"
6
7/*
8 * Inheriting from this class allows us to change
9 * what we do with the patches. e.g. customize output format.
10 * We use BVWriter by default and provide IGSWriter as another example.
11 *
12 * Other Example (commented code snippet):
13 * compute the derivative of a BB-patch in the u direction
14 * by scaling, by the degree in u, the difference of BB-coefficients [i][j] and [i-1][j]
15 * in a double loop over all BB-coefficients (that have an [i-1] neighbor)
16 *
17 * std::vector<std::vector<double>> get_du(const Patch& a_Patch)
18 * {
19 * std::vector<std::vector<double>> t_Du;
20 * for(int i=1; i<a_Patch.m_DegU+1; i++) // note: start at 1 so that [i-1] is well-defined
21 * {
22 * std::vector<double> t_DuRow;
23 * for(int j=0; j<a_Patch.m_DegV+1; j++)
24 * {
25 * // scaling, by the degree in u, the difference of BB-coefficients [i][j] and [i-1][j]
26 * t_DuRow.push_back(a_Patch.m_DegU * (a_Patch.m_BBcoefs[i][j] - a_Patch.m_BBcoefs[i-1][j]));
27 * }
28 * t_Du.push_back(t_DuRow);
29 * }
30 * return t_Du;
31 * }
32 *
33 */
35{
36public:
37 virtual ~PatchConsumer() = default;
38 virtual void start() = 0;
39 virtual void stop() = 0;
40 virtual void consume(Patch a_Patch) = 0;
41};
Definition PatchConsumer.hpp:35
A class representing a Bézier patch.
Definition Patch.hpp:20