2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 // + This file is part of enGrid. +
6 // + Copyright 2008,2009 Oliver Gloth +
8 // + enGrid is free software: you can redistribute it and/or modify +
9 // + it under the terms of the GNU General Public License as published by +
10 // + the Free Software Foundation, either version 3 of the License, or +
11 // + (at your option) any later version. +
13 // + enGrid is distributed in the hope that it will be useful, +
14 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
15 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
16 // + GNU General Public License for more details. +
18 // + You should have received a copy of the GNU General Public License +
19 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 #ifndef BEZIERTRIANGLE_H
24 #define BEZIERTRIANGLE_H
26 #include "math/mathvector.h"
27 #include "math/linsolve.h"
28 #include "math/smallsquarematrix.h"
30 #include "egvtkobject.h"
32 #include <vtkUnstructuredGrid.h>
34 class BezierTriangle
: public EgVtkObject
46 BezierTriangle(vec3_t X_200
, vec3_t X_020
, vec3_t X_002
, vec3_t X_011
, vec3_t X_101
, vec3_t X_110
);
48 void setControlPoints(vec3_t X_200
, vec3_t X_020
, vec3_t X_002
, vec3_t X_011
, vec3_t X_101
, vec3_t X_110
);
49 void getControlPoints(vec3_t
& X_200
, vec3_t
& X_020
, vec3_t
& X_002
, vec3_t
& X_011
, vec3_t
& X_101
, vec3_t
& X_110
);
50 vec2_t
BaryCentric2xy(vec3_t barycoords
);
51 vec3_t
xy2BaryCentric(vec2_t xycoords
);
52 vec3_t
Bezier(vec2_t xycoords
);
53 vec3_t
Bezier(vec3_t barycoords
);
54 vec3_t
Projection(vec2_t xycoords
);
55 vec3_t
Projection(vec3_t barycoords
);
56 mat2_t
JacobiMatrix();
57 vec2_t
FixedPointFunction(vec2_t xycoords
);
58 void writeBezierSurface();
59 // vtkIdType addBezierSurface(vtkUnstructuredGrid* bezier, int offset, int N);
60 vec3_t
QuadraticBezierTriangle(double u
, double v
, double w
);
61 vec3_t
QuadraticBezierTriangle(vec2_t M
);
62 vec3_t
projectOnQuadraticBezierTriangle(vec3_t M
);