ug4
traverser_intersect_faces.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2015: G-CSC, Goethe University Frankfurt
3  * Author: Sebastian Reiter
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG__NODE_TREE__INTERSECT_FACES__
34 #define __H__UG__NODE_TREE__INTERSECT_FACES__
35 
36 #include <vector>
37 #include "common/math/ugmath.h"
39 
40 namespace ug{
41 namespace node_tree
42 {
45 
51 {
52  public:
54  virtual ~Traverser_IntersectFaces();
55 
57 
60  virtual bool intersect_tri(const vector3& v0, const vector3& v1,
61  const vector3& v2, SPNode nodeGraph);
62 
63  //todo: Add intersect_quad(...)
64 
66 
69  void ignore_element(const CollisionElementID& elemID);
70 
72  void clear_ignore_list();
73 
76  const std::vector<CollisionElementID>& get_intersected_element_ids() const;
77 
78  protected:
79  virtual void handle_boxed_group(BoxedGroupNode* boxedGroup);
80  virtual void handle_collision_triangles(CollisionTrianglesNode* colTrisNode);
81 
82  private:
83  // the element which shall be checked
85  int m_numVrts;
86 
87  // the intersecting elements will be stored here
88  std::vector<CollisionElementID> m_intersectedElementIDs;
89 
90  // an intersection is only recorded if the intersecting element is not
91  // contained in the ignore list.
92  std::vector<CollisionElementID> m_ignoreList;
93 };
94 
95 }// end of namespace node_tree
96 }// end of namespace ug
97 
98 #endif
Definition: smart_pointer.h:108
A group node featuring a bounding box.
Definition: boxed_group_node.h:56
holds index tuples defining triangles.
Definition: collision_triangles_node.h:61
Enhances the Traverser base-class by methods to traverse a collision tree.
Definition: traverser_collision_tree.h:62
traverses a node-tree and intersect a given face with the contained geometry.
Definition: traverser_intersect_faces.h:51
int m_numVrts
Definition: traverser_intersect_faces.h:85
void clear_ignore_list()
clears the ignore list
Definition: traverser_intersect_faces.cpp:124
virtual void handle_collision_triangles(CollisionTrianglesNode *colTrisNode)
Definition: traverser_intersect_faces.cpp:87
std::vector< CollisionElementID > m_ignoreList
Definition: traverser_intersect_faces.h:92
virtual ~Traverser_IntersectFaces()
Definition: traverser_intersect_faces.cpp:49
virtual bool intersect_tri(const vector3 &v0, const vector3 &v1, const vector3 &v2, SPNode nodeGraph)
intersects the given triangle with all faces in the given nodeGraph.
Definition: traverser_intersect_faces.cpp:54
void ignore_element(const CollisionElementID &elemID)
adds an element to the ignore list
Definition: traverser_intersect_faces.cpp:118
virtual void handle_boxed_group(BoxedGroupNode *boxedGroup)
Definition: traverser_intersect_faces.cpp:74
vector3 m_vrts[4]
Definition: traverser_intersect_faces.h:84
std::vector< CollisionElementID > m_intersectedElementIDs
Definition: traverser_intersect_faces.h:88
Traverser_IntersectFaces()
Definition: traverser_intersect_faces.cpp:45
const std::vector< CollisionElementID > & get_intersected_element_ids() const
Definition: traverser_intersect_faces.cpp:68
the ug namespace
Definition: collision_element_info.h:53