ug4
collision_triangles_node.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-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__COLLSISION_TRIANGLES_NODE__
34 #define __H__UG__NODE_TREE__COLLSISION_TRIANGLES_NODE__
35 
36 #include <vector>
37 #include "node.h"
38 #include "collision_element_info.h"
39 
40 namespace ug{
41 namespace node_tree
42 {
43 class CollisionTrianglesNode;
44 
48 
50 // CollisionTrianglesNode
52 
61 {
62  public:
64 
65  virtual ~CollisionTrianglesNode();
66 
67  virtual void add_triangle(int ind1, int ind2, int ind3);
68  virtual void add_triangle(int ind1, int ind2, int ind3,
69  CollisionElementID triID);
70 
72  virtual void add_triangles(int* pIndices, size_t numTris);
73 
75  virtual void add_triangles(int* pIndices,
76  CollisionElementID* pTriIDs,
77  size_t numTris);
78 
79  virtual size_t num_triangles() const;
80 
81  virtual void get_triangle(size_t index, int& ind1Out,
82  int& ind2Out, int& ind3Out) const;
83 
84  virtual const int* get_triangles() const;
85 
86  virtual void set_triangle_id(size_t triInd,
87  CollisionElementID triID);
88 
90  virtual CollisionElementID get_triangle_id(size_t triInd);
91 
92  protected:
94 
95  protected:
96  typedef std::vector<int> IndexVec;
97  typedef std::vector<CollisionElementID> IDVec;
98 
101 
103 };
104 
105 }// end of namespace node_tree
106 }// end of namespace ug
107 
108 #endif
Definition: smart_pointer.h:108
holds index tuples defining triangles.
Definition: collision_triangles_node.h:61
virtual void set_triangle_id(size_t triInd, CollisionElementID triID)
Definition: collision_triangles_node.cpp:168
static SPCollisionTrianglesNode create()
Definition: collision_triangles_node.cpp:40
std::vector< CollisionElementID > IDVec
Definition: collision_triangles_node.h:97
CollisionTrianglesNode()
Definition: collision_triangles_node.cpp:48
IDVec m_vTriIDs
Definition: collision_triangles_node.h:100
virtual void get_triangle(size_t index, int &ind1Out, int &ind2Out, int &ind3Out) const
Definition: collision_triangles_node.cpp:152
virtual const int * get_triangles() const
Definition: collision_triangles_node.cpp:161
IndexVec m_vTris
Definition: collision_triangles_node.h:99
virtual void add_triangle(int ind1, int ind2, int ind3)
Definition: collision_triangles_node.cpp:59
std::vector< int > IndexVec
Definition: collision_triangles_node.h:96
bool m_bTriangleIDsSupplied
Definition: collision_triangles_node.h:102
virtual CollisionElementID get_triangle_id(size_t triInd)
if no identifier has been set for an edge -1 is returned.
Definition: collision_triangles_node.cpp:185
virtual ~CollisionTrianglesNode()
Definition: collision_triangles_node.cpp:54
virtual size_t num_triangles() const
Definition: collision_triangles_node.cpp:145
virtual void add_triangles(int *pIndices, size_t numTris)
pIndices has to be of size numTris*3
Definition: collision_triangles_node.cpp:92
Nodes serve as base-objects for items of wich a scene-graph consists.
Definition: node.h:72
SmartPtr< CollisionTrianglesNode > SPCollisionTrianglesNode
the smartpointer used to encapsulate the node
Definition: collision_triangles_node.h:43
the ug namespace
Definition: collision_element_info.h:53