-
Notifications
You must be signed in to change notification settings - Fork 1
/
myblendcurve.h
89 lines (61 loc) · 2.74 KB
/
myblendcurve.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**********************************************************************************
**
** Copyright (C) 1994 Narvik University College
** Contact: GMlib Online Portal at http://episteme.hin.no
**
** This file is part of the Geometric Modeling Library, GMlib.
**
** GMlib is free software: you can redistribute it and/or modify
** it under the terms of the GNU Lesser General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** GMlib is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public License
** along with GMlib. If not, see <http://www.gnu.org/licenses/>.
**
**********************************************************************************/
#ifndef GM_PARAMETRICS_CURVES_MyBlendCurve_H
#define GM_PARAMETRICS_CURVES_MyBlendCurve_H
#include "C:/STE6245/gmlib-50e676222977fbf777a43302e74828ed87558300/gmlib.git/modules/parametrics/src/gmpcurve.h"
#include "C:/STE6245/gmlib-50e676222977fbf777a43302e74828ed87558300/gmlib.git/modules/scene/src/selector/gmselector.h"
namespace GMlib {
template <typename T>
class MyBlendCurve : public PCurve<T,3> {
GM_SCENEOBJECT(MyBlendCurve)
public:
MyBlendCurve( PCurve<T,3> *c1, PCurve<T,3> *c2, T x);
//MyBlendCurve( const DVector<Vector<T,3>> &c, int d, int n);
virtual ~MyBlendCurve();
// Public local functions
//****************************************
//****** Virtual public functions ******
//****************************************
// from PCurve
bool isClosed() const override;
protected:
// Virtual function from PCurve that has to be implemented locally
void eval(T t, int d, bool l) const override;
T getStartP() const override;
T getEndP() const override;
// Protected data for the curve
// DVector<PCurve<T,3>*>_C; //local curves
// DVector<T> _t; //knot vector
T _x;
PCurve<T,3> * _C1;
PCurve<T,3> * _C2;
private:
T _W(int i, int d, T t) const;
T _B(T t) const;
int _findIndex(T t) const;
void _makeKnotVector(int n);
void _createControlPoints(const DVector<Vector<T,3>> &p,int n);
}; // END class MyBlendCurve
} // END namepace GMlib
// Include MyBlendCurve class function implementations
#include "myblendcurve.c"
#endif // GM_PARAMETRICS_CURVES_MyBlendCurve_H