Merge branch 'master' of ssh://swordfish/srv/www/htdocs/git/engrid
[engrid.git] / src / beziertriangle.h
blob278a3b4d127e0e1f8362ed839cf84d3100f08f3b
1 //
2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + +
4 // + This file is part of enGrid. +
5 // + +
6 // + Copyright 2008,2009 Oliver Gloth +
7 // + +
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. +
12 // + +
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. +
17 // + +
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/>. +
20 // + +
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
36 public:
37 vec3_t m_X_200;
38 vec3_t m_X_020;
39 vec3_t m_X_002;
40 vec3_t m_X_011;
41 vec3_t m_X_101;
42 vec3_t m_X_110;
44 public:
45 BezierTriangle();
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);
65 #endif