ug4
ug::node_tree::Traverser_IntersectFaces Class Reference

traverses a node-tree and intersect a given face with the contained geometry. More...

#include <traverser_intersect_faces.h>

+ Inheritance diagram for ug::node_tree::Traverser_IntersectFaces:

Public Member Functions

void clear_ignore_list ()
 clears the ignore list More...
 
const std::vector< CollisionElementID > & get_intersected_element_ids () const
 
void ignore_element (const CollisionElementID &elemID)
 adds an element to the ignore list More...
 
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. More...
 
 Traverser_IntersectFaces ()
 
virtual ~Traverser_IntersectFaces ()
 

Protected Member Functions

virtual void handle_boxed_group (BoxedGroupNode *boxedGroup)
 
virtual void handle_collision_triangles (CollisionTrianglesNode *colTrisNode)
 
- Protected Member Functions inherited from ug::node_tree::Traverser_CollisionTree
CollisionTreeRootNodeget_current_root_node ()
 
virtual void handle_collision_edges (CollisionEdgesNode *colEdgesNode)
 
virtual void handle_collision_tree_root (CollisionTreeRootNode *colTreeRootNode)
 
 Traverser_CollisionTree ()
 
virtual ~Traverser_CollisionTree ()
 
- Protected Member Functions inherited from ug::node_tree::Traverser
void apply (SPNode &node)
 
virtual void handle_group (GroupNode *group)
 
template<typename HandlerType >
void register_handler_function (unsigned int oc, HandlerType func)
 
void traverse_object (Object *obj)
 
 Traverser ()
 
virtual ~Traverser ()
 

Private Attributes

std::vector< CollisionElementIDm_ignoreList
 
std::vector< CollisionElementIDm_intersectedElementIDs
 
int m_numVrts
 
vector3 m_vrts [4]
 

Detailed Description

traverses a node-tree and intersect a given face with the contained geometry.

Currently only triangles are supported.

Todo:
A list with local coordinates of intersections should be created during intersect_tri. This list should then be available to the user.

Constructor & Destructor Documentation

◆ Traverser_IntersectFaces()

ug::node_tree::Traverser_IntersectFaces::Traverser_IntersectFaces ( )

◆ ~Traverser_IntersectFaces()

ug::node_tree::Traverser_IntersectFaces::~Traverser_IntersectFaces ( )
virtual

Member Function Documentation

◆ clear_ignore_list()

void ug::node_tree::Traverser_IntersectFaces::clear_ignore_list ( )

clears the ignore list

◆ get_intersected_element_ids()

const std::vector< CollisionElementID > & ug::node_tree::Traverser_IntersectFaces::get_intersected_element_ids ( ) const

after the intersection with the geometry has been performed, this function returns the ids of the intersected elements.

◆ handle_boxed_group()

void ug::node_tree::Traverser_IntersectFaces::handle_boxed_group ( BoxedGroupNode boxedGroup)
protectedvirtual

◆ handle_collision_triangles()

◆ ignore_element()

void ug::node_tree::Traverser_IntersectFaces::ignore_element ( const CollisionElementID elemID)

adds an element to the ignore list

Make sure that the ignore list won't get too big, since for each it has to be traversed for each triangle that intersects. Use clear_ignore_list to clear the list.

◆ intersect_tri()

bool ug::node_tree::Traverser_IntersectFaces::intersect_tri ( const vector3 v0,
const vector3 v1,
const vector3 v2,
SPNode  nodeGraph 
)
virtual

intersects the given triangle with all faces in the given nodeGraph.

returns true if an intersection was found, false if not. After each run the intersected faces can be accessed using get_intersected_element_ids().

Member Data Documentation

◆ m_ignoreList

std::vector<CollisionElementID> ug::node_tree::Traverser_IntersectFaces::m_ignoreList
private

◆ m_intersectedElementIDs

std::vector<CollisionElementID> ug::node_tree::Traverser_IntersectFaces::m_intersectedElementIDs
private

◆ m_numVrts

int ug::node_tree::Traverser_IntersectFaces::m_numVrts
private

◆ m_vrts

vector3 ug::node_tree::Traverser_IntersectFaces::m_vrts[4]
private

The documentation for this class was generated from the following files: