2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 // + This file is part of enGrid. +
6 // + Copyright 2008-2012 enGits GmbH +
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 CREATECADTESSELATION_H
24 #define CREATECADTESSELATION_H
26 #include "operation.h"
28 class CreateCadTesselation
: public Operation
31 protected: // attributes
46 int m_PreservationType
;
47 double m_SmallestFeatureSize
;
51 virtual bool shootRay(vec3_t x
, vec3_t v
, vec3_t
&x_in
, vec3_t
&x_out
, vec3_t
&n_in
, vec3_t
&n_out
) = 0;
52 virtual void operate();
54 void scan(bool create_grid
, int interlaces
= 0);
56 double getx(int i
) { return m_X1
[0] + i
*m_Dx
; }
57 double gety(int j
) { return m_X1
[1] + j
*m_Dy
; }
58 double getz(int k
) { return m_X1
[2] + k
*m_Dz
; }
59 vec3_t
getX(int i
, int j
, int k
) { return vec3_t(getx(i
), gety(j
), getz(k
)); }
60 int getIdx(int i
, int j
, int k
) { return i
+ j
*m_Ni
+ k
*m_Ni
*m_Nj
; }
64 CreateCadTesselation();
66 void setScanMemory(double mem
) { m_ScanMemory
= mem
; }
67 void setPreservationOff() { m_PreservationType
= 0; }
68 void setSolidPreservation() { m_PreservationType
= 1; }
69 void setFluidPreservation() { m_PreservationType
= 2; }
70 void setPreservationType(int t
) { m_PreservationType
= t
; }
71 void setSmoothingIterations(int n
) { m_NumIterations
= n
; }
72 bool preserveSolid() { return m_PreservationType
== 1; }
73 bool preserveFluid() { return m_PreservationType
== 2; }
74 void setSmallestFeatureSize(double sfs
) { m_SmallestFeatureSize
= sfs
; }
78 #endif // CREATECADTESSELATION_H