ug4
traverser_project_point.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__TRAVERSER_PROJECT_POINT__
34 #define __H__UG__NODE_TREE__TRAVERSER_PROJECT_POINT__
35 
36 #include "common/math/ugmath.h"
38 
39 namespace ug{
40 namespace node_tree
41 {
45 {
46  public:
48  virtual ~Traverser_ProjectPoint();
49 
50  virtual bool project(const vector3& point, SPNode nodeGraph,
51  vector3* pPointNormal = NULL);
52 
56 
58 
62 
63  inline number get_distance() {return m_distance;}
64 
66 
67  protected:
68  virtual void handle_group(GroupNode* group);
69  virtual void handle_boxed_group(BoxedGroupNode* boxedGroup);
70  virtual void handle_collision_edges(CollisionEdgesNode* colTrisNode);
71  virtual void handle_collision_triangles(CollisionTrianglesNode* colTrisNode);
72 
73  protected:
75  {
76  SEARCHING = 0,
78  GOT_ONE
79  };
80 
84 
85  private:
89 
92 
97 };
98 
99 }// end of namespace node_tree
100 }// end of namespace ug
101 
102 #endif
Definition: smart_pointer.h:108
A group node featuring a bounding box.
Definition: boxed_group_node.h:56
holds index pairs defining edges.
Definition: collision_edges_node.h:57
A group node featuring a bounding box and a set of points.
Definition: collision_tree_root_node.h:55
holds index tuples defining triangles.
Definition: collision_triangles_node.h:61
You can group nodes using the GroupNode.
Definition: group_node.h:56
Enhances the Traverser base-class by methods to traverse a collision tree.
Definition: traverser_collision_tree.h:62
traverses a node-tree and projects a given point to the contained geometry.
Definition: traverser_project_point.h:45
int get_closest_element_type()
returns the type of the element to which the closest distance was found.
virtual void handle_boxed_group(BoxedGroupNode *boxedGroup)
Definition: traverser_project_point.cpp:147
virtual void handle_group(GroupNode *group)
Definition: traverser_project_point.cpp:95
bool m_checkNormals
Definition: traverser_project_point.h:87
virtual bool project(const vector3 &point, SPNode nodeGraph, vector3 *pPointNormal=NULL)
Definition: traverser_project_point.cpp:68
int m_closestElemType
Definition: traverser_project_point.h:94
virtual void handle_collision_edges(CollisionEdgesNode *colTrisNode)
Definition: traverser_project_point.cpp:181
CollisionTreeRootNode * m_closestRootNode
Definition: traverser_project_point.h:96
CollisionElementID m_closestElemID
Definition: traverser_project_point.h:95
int m_closestElemIndices[3]
Definition: traverser_project_point.h:93
vector3 m_point
Definition: traverser_project_point.h:81
CollisionElementID get_closest_element_id()
Definition: traverser_project_point.cpp:90
vector3 m_closestPoint
Definition: traverser_project_point.h:82
Traverser_ProjectPoint()
Definition: traverser_project_point.cpp:57
SearchState m_searchState
Definition: traverser_project_point.h:86
vector3 m_boxMin
Definition: traverser_project_point.h:90
virtual void handle_collision_triangles(CollisionTrianglesNode *colTrisNode)
Definition: traverser_project_point.cpp:219
virtual ~Traverser_ProjectPoint()
Definition: traverser_project_point.cpp:63
number get_distance()
Definition: traverser_project_point.h:63
vector3 get_closest_point()
Definition: traverser_project_point.h:65
vector3 m_boxMax
Definition: traverser_project_point.h:91
number m_distance
Definition: traverser_project_point.h:83
SearchState
Definition: traverser_project_point.h:75
@ GOT_ONE
Definition: traverser_project_point.h:78
@ FORCE_FIND
Definition: traverser_project_point.h:77
@ SEARCHING
Definition: traverser_project_point.h:76
vector3 m_pointNormal
Definition: traverser_project_point.h:88
double number
Definition: types.h:124
the ug namespace
Definition: collision_element_info.h:53