36 #ifndef EGS_TRIANGLE_MESH
37 #define EGS_TRIANGLE_MESH
50 #ifdef BUILD_EGS_TRIANGLE_MESH_DLL
51 #define EGS_TRIANGLE_MESH_EXPORT __declspec(dllexport)
53 #define EGS_TRIANGLE_MESH_EXPORT __declspec(dllimport)
55 #define EGS_TRIANGLE_MESH_LOCAL
59 #ifdef HAVE_VISIBILITY
60 #define EGS_TRIANGLE_MESH_EXPORT __attribute__ ((visibility ("default")))
61 #define EGS_TRIANGLE_MESH_LOCAL __attribute__ ((visibility ("hidden")))
63 #define EGS_TRIANGLE_MESH_EXPORT
64 #define EGS_TRIANGLE_MESH_LOCAL
77 a(a), b(b), c(c), n(n) {}
88 elements(std::move(elements)) {}
99 for (
auto &e: elements) {
106 std::size_t num_elements()
const {
107 return elements.size();
113 std::vector<EGS_TriangleMeshSpec::Triangle>
elements;
118 class EGS_TriangleMeshBbox;
119 class EGS_TriangleMeshNode;
120 class EGS_TriangleMesh_Octree;
231 const std::string &getType()
const override {
232 return EGS_TriangleMesh::type;
235 void setOctBool(
bool octset) {
236 octree_acc_on=octset;
239 return octree_acc_on;
241 void inctricheck_OHF() {
244 void inctricheck_OHN() {
247 void inctricheck_OIW() {
250 void inctricheck_NHF() {
253 void inctricheck_NHN() {
256 void inctricheck_NIW() {
264 EGS_Float &t,
int *newmed=0,
EGS_Vector *normal=0)
override;
265 EGS_Float hownear(
int ireg,
const EGS_Vector &x)
override;
266 void initializeOctree();
268 static const std::string type;
275 std::vector<std::array<EGS_Float, 3>> xs;
276 std::vector<std::array<EGS_Float, 3>> ys;
277 std::vector<std::array<EGS_Float, 3>> zs;
278 std::vector<EGS_Vector> ns;
281 std::unique_ptr<EGS_TriangleMeshBbox> bbox;
282 std::unique_ptr<EGS_TriangleMesh_Octree> surface_tree_;
284 int tri_check_OHF=0,tri_check_OHN=0,tri_check_OIW=0,tri_check_NHF=0,tri_check_NHN=0,tri_check_NIW=0;
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
A container for raw unstructured triangle surface mesh data.
void scale(EGS_Float factor)
Multiply all node coordinates by a constant factor.
std::vector< EGS_TriangleMeshSpec::Triangle > elements
Unique elements.
A triangular surface mesh geometry.
int num_triangles() const
const std::array< EGS_Float, 3 > & triangle_xs(int tri) const
Returns the three triangle node x-coordinates.
const EGS_Vector & triangle_normal(int tri) const
Returns the outward-facing triangle unit normal.
const std::array< EGS_Float, 3 > & triangle_zs(int tri) const
Returns the three triangle node z-coordinates.
const std::array< EGS_Float, 3 > & triangle_ys(int tri) const
Returns the three triangle node y-coordinates.
A class representing 3D vectors.
EGS_BaseGeometry class header file.
EGS_Vector methods for the manipulation of 3D vectors in cartesian co-ordinates.