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 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
26 #include "vtkIdList.h"
27 #include "vtkUnstructuredGrid.h"
28 #include "math/mathvector.h"
29 #include "math/smallsquarematrix.h"
34 vtkIdType id_a
, id_b
, id_c
;
39 double smallest_length
;
42 QVector
<bool> m_has_neighbour
; ///< True if edge i has a neighbour in the grid
46 Triangle(vec3_t a_a
, vec3_t a_b
, vec3_t a_c
);
47 Triangle(vtkUnstructuredGrid
* a_grid
, vtkIdType a_id_a
, vtkIdType a_id_b
, vtkIdType a_id_c
);
48 Triangle(vtkUnstructuredGrid
* a_grid
, vtkIdType a_id_cell
);
53 * Calculates the closest (NOT the projection!) point (xi,ri) of point xp on the triangle.
54 * @param xp Point to "project"
55 * @param xi Global 3D coordinates of the closest point on the triangle.
56 * @param ri Local 3D triangle coordinates of the closest point on the triangle. (0<=ri[0]<=1 and 0<=ri[1]<=1 and ri[2]=0)
57 * @param d Distance of xp to (xi,ri)
58 * @return True if (xi,ri) is the result of a direct projection on the triangle, else false.
60 bool projectOnTriangle(vec3_t xp
, vec3_t
&xi
, vec3_t
&ri
, double &d
, int& side
, bool restrict_to_triangle
);
62 vec3_t
local3DToGlobal3D(vec3_t l_M
);
63 vec3_t
global3DToLocal3D(vec3_t g_M
);
64 vec3_t
local2DToGlobal3D(vec2_t l_M
);
65 vec2_t
global3DToLocal2D(vec3_t g_M
);