ug4
collision_edges_node.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2015: Sebastian Reiter
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_EDGES_NODE__
34 #define __H__UG__NODE_TREE__COLLSISION_EDGES_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 CollisionEdgesNode;
44 
48 
50 // CollisionEdgesNode
52 
56 class CollisionEdgesNode : public Node
57 {
58  public:
60 
61  virtual ~CollisionEdgesNode();
62 
63  virtual void add_edge(int ind1, int ind2);
64  virtual void add_edge(int ind1, int ind2,
65  CollisionElementID edgeID);
66 
68  virtual void add_edges(int* pIndices, int numEdges);
69 
71  virtual void add_edges(int* pIndices,
72  CollisionElementID* pEdgeIDs,
73  int numEdges);
74 
75  virtual int num_edges() const;
76 
77  virtual void get_edge(int index, int& ind1Out, int& ind2Out) const;
78 
79  virtual const int* get_edges() const;
80 
81  virtual void set_edge_id(int edgeIndex,
82  CollisionElementID edgeID);
83 
85  virtual CollisionElementID get_edge_id(int edgeIndex);
86 
87  protected:
89 
90  protected:
91  typedef std::vector<int> IndexVec;
92  typedef std::vector<CollisionElementID> IDVec;
93 
96 
98 };
99 
100 }// end of namespace node_tree
101 }// end of namespace ug
102 
103 #endif
Definition: smart_pointer.h:108
holds index pairs defining edges.
Definition: collision_edges_node.h:57
virtual void add_edges(int *pIndices, int numEdges)
pIndices has to be of size numEdges*2
Definition: collision_edges_node.cpp:89
virtual void get_edge(int index, int &ind1Out, int &ind2Out) const
Definition: collision_edges_node.cpp:146
bool m_bEdgeIDsSupplied
Definition: collision_edges_node.h:97
virtual CollisionElementID get_edge_id(int edgeIndex)
if no identifier has been set for an edge -1 is returned.
Definition: collision_edges_node.cpp:175
IndexVec m_vEdges
Definition: collision_edges_node.h:94
std::vector< int > IndexVec
Definition: collision_edges_node.h:91
virtual ~CollisionEdgesNode()
Definition: collision_edges_node.cpp:54
virtual int num_edges() const
Definition: collision_edges_node.cpp:140
CollisionEdgesNode()
Definition: collision_edges_node.cpp:48
std::vector< CollisionElementID > IDVec
Definition: collision_edges_node.h:92
virtual void set_edge_id(int edgeIndex, CollisionElementID edgeID)
Definition: collision_edges_node.cpp:161
virtual const int * get_edges() const
Definition: collision_edges_node.cpp:154
static SPCollisionEdgesNode create()
Definition: collision_edges_node.cpp:40
virtual void add_edge(int ind1, int ind2)
Definition: collision_edges_node.cpp:59
IDVec m_vEdgeIDs
Definition: collision_edges_node.h:95
Nodes serve as base-objects for items of wich a scene-graph consists.
Definition: node.h:72
SmartPtr< CollisionEdgesNode > SPCollisionEdgesNode
the smartpointer used to encapsulate the node
Definition: collision_edges_node.h:43
the ug namespace
Definition: collision_element_info.h:53