-
Notifications
You must be signed in to change notification settings - Fork 1
/
mybsurface.h
99 lines (71 loc) · 3.29 KB
/
mybsurface.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
90
91
92
93
94
95
96
97
98
99
/**********************************************************************************
**
** 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_MyBSurface_H
#define GM_PARAMETRICS_CURVES_MyBSurface_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 MyBSurface : public GMlib::PSurf<T,3> {
GM_SCENEOBJECT(MyBSurface)
public:
MyBSurface( PSurf<T,3> *s, int n1, int n2);
MyBSurface( const MyBSurface<T>& copy );
virtual ~MyBSurface();
// Public local functions
//****************************************
//****** Virtual public functions ******
//****************************************
// from PCurve
bool isClosedU() const override;
bool isClosedV() const override;
protected:
// Virtual function from PCurve that has to be implemented locally
void eval( T u, T v, int d1, int d2, bool lu = true, bool lv = true ) const override;
T getStartPV() const override;
T getEndPV() const override;
T getStartPU() const override;
T getEndPU() const override;
//void localSimulate(double dt) override;
// Protected data for the curve
DMatrix<PSurf<T,3>*> _S; //values of each part of local surfaces
DVector<T> _u; //knot vector for U
DVector<T> _v; //knot vector for V
int _d; //degree
T _su;
T _eu;
T _sv;
T _ev;
bool _isclosedU;
bool _isclosedV;
private:
T _W(int i, int d, T t,const DVector<T>& knot) const;
T _B(T t) const;
T _BDeriv(T t) const;
int _findIndex(T t,const DVector<T>& knot) const;
void _makeKnotVectors(DVector<T>& t,int n,T start,T end,bool isclosed);
void _createLocalSurfaces(PSurf<T, 3>* s,int n1,int n2);
}; // END class MyBSurface
} // END namepace GMlib
// Include MyBSurface class function implementations
#include "mybsurface.c"
#endif // GM_PARAMETRICS_CURVES_MyBSurface_H