Update suitable examples and tests to use blank mode
[shapes.git] / source / upsamplers.h
blob373a0b0eb39b80e8939020c62350e91ac77ee36c
1 /* This file is part of Shapes.
3 * Shapes is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * any later version.
8 * Shapes is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright 2008 Henrik Tidefelt
19 #pragma once
21 #include "bezier.h"
22 #include "elementarycoords.h"
24 #include <vector>
26 namespace Shapes
28 namespace Computation
30 class Upsampler2D
32 public:
33 Upsampler2D( ){ }
34 virtual ~Upsampler2D( ){ }
35 virtual void operator () ( std::vector< double > * dst, const Bezier::ControlPoints< Concrete::Coords2D > & controls ) const = 0;
38 class Upsampler3D
40 public:
41 Upsampler3D( ){ }
42 virtual ~Upsampler3D( ){ }
43 virtual void operator () ( std::vector< double > * dst, const Bezier::ControlPoints< Concrete::Coords3D > & controls ) const = 0;
46 class UpsampleInflections : public Upsampler2D
48 public:
49 UpsampleInflections( ){ }
50 virtual ~UpsampleInflections( ){ }
51 virtual void operator () ( std::vector< double > * dst, const Bezier::ControlPoints< Concrete::Coords2D > & controls ) const;
54 class UpsampleBends : public Upsampler2D
56 double maxAngle_;
57 public:
58 UpsampleBends( double maxAngle )
59 : maxAngle_( maxAngle )
60 { }
61 virtual ~UpsampleBends( ){ }
62 virtual void operator () ( std::vector< double > * dst, const Bezier::ControlPoints< Concrete::Coords2D > & controls ) const;
65 class UpsampleEvery2D : public Upsampler2D
67 Concrete::Length period_;
68 public:
69 UpsampleEvery2D( Concrete::Length period )
70 : period_( period )
71 { }
72 virtual ~UpsampleEvery2D( ){ }
73 virtual void operator () ( std::vector< double > * dst, const Bezier::ControlPoints< Concrete::Coords2D > & controls ) const;
76 class UpsampleEvery3D : public Upsampler3D
78 Concrete::Length period_;
79 public:
80 UpsampleEvery3D( Concrete::Length period )
81 : period_( period )
82 { }
83 virtual ~UpsampleEvery3D( ){ }
84 virtual void operator () ( std::vector< double > * dst, const Bezier::ControlPoints< Concrete::Coords3D > & controls ) const;
87 class UpsampleDifferentiably2D : public Upsampler2D
89 public:
90 UpsampleDifferentiably2D( ){ }
91 virtual ~UpsampleDifferentiably2D( ){ }
92 virtual void operator () ( std::vector< double > * dst, const Bezier::ControlPoints< Concrete::Coords2D > & controls ) const;
95 class UpsampleDifferentiably3D : public Upsampler3D
97 public:
98 UpsampleDifferentiably3D( ){ }
99 virtual ~UpsampleDifferentiably3D( ){ }
100 virtual void operator () ( std::vector< double > * dst, const Bezier::ControlPoints< Concrete::Coords3D > & controls ) const;