ug4
ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t > Struct Template Reference

#include <ntree.h>

Public Types

typedef int box_t
 
typedef int real_t
 
typedef int vector_t
 

Static Public Member Functions

static bool box_box_intersection (const box_t &box1, const box_t &box2)
 returns true if the given boxes intersect More...
 
static bool box_contains_point (const box_t &box, const vector_t &point)
 
static vector_t box_diagonal (const box_t &box)
 
static void calculate_bounding_box (box_t &boxOut, const elem_t &e, const common_data_t &commonData)
 
static void calculate_center (vector_t &centerOut, const elem_t &e, const common_data_t &commonData)
 
static bool contains_point (const elem_t &e, const vector_t &point, const common_data_t &commonData)
 
static void grow_box (box_t &boxOut, const box_t &box, const vector_t &offset)
 adds the given offset to box.max and subtracts it from box.min More...
 
static void merge_boxes (box_t &boxOut, const box_t &box1, const box_t &box2)
 returns the smallest box that contains both box1 and box2 More...
 
static void split_box (box_t *boxesOut, const box_t &box, const vector_t &splitPoint)
 splits the given box into (2^tree_dim sub-boxes). More...
 

Detailed Description

template<int tree_dim, int world_dim, class elem_t, class common_data_t>
struct ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t >

The following methods have to be provided for the given vector-type:

void VecSet(vector_t& vOut, real_t value); // sets all components of 'v' to 'value'.
void VecAdd(vector_t& vOut, const vector_t& v1, const vector_t& v2); // performs vOut = v1 + v2.
void VecScale(vector_t& vOut, const vector_t& v, real_t s); // performs vOut = s * v.
void VecSet(vector_t &vInOut, typename vector_t::value_type s)
Set each vector component to scalar (componentwise)
Definition: math_vector_functions_common_impl.hpp:539
void VecAdd(vector_t &vOut, const vector_t &v1, const vector_t &v2)
adds two MathVector<N>s and stores the result in a third one
Definition: math_vector_functions_common_impl.hpp:185
void VecScale(vector_t &vOut, const vector_t &v, typename vector_t::value_type s)
scales a MathVector<N>
Definition: math_vector_functions_common_impl.hpp:252
int real_t
Definition: ntree.h:50
int vector_t
Definition: ntree.h:51

Member Typedef Documentation

◆ box_t

template<int tree_dim, int world_dim, class elem_t , class common_data_t >
typedef int ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t >::box_t

◆ real_t

template<int tree_dim, int world_dim, class elem_t , class common_data_t >
typedef int ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t >::real_t

◆ vector_t

template<int tree_dim, int world_dim, class elem_t , class common_data_t >
typedef int ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t >::vector_t

Member Function Documentation

◆ box_box_intersection()

template<int tree_dim, int world_dim, class elem_t , class common_data_t >
static bool ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t >::box_box_intersection ( const box_t box1,
const box_t box2 
)
static

returns true if the given boxes intersect

◆ box_contains_point()

template<int tree_dim, int world_dim, class elem_t , class common_data_t >
static bool ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t >::box_contains_point ( const box_t box,
const vector_t point 
)
static

◆ box_diagonal()

template<int tree_dim, int world_dim, class elem_t , class common_data_t >
static vector_t ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t >::box_diagonal ( const box_t box)
static

◆ calculate_bounding_box()

template<int tree_dim, int world_dim, class elem_t , class common_data_t >
static void ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t >::calculate_bounding_box ( box_t boxOut,
const elem_t &  e,
const common_data_t &  commonData 
)
static

◆ calculate_center()

template<int tree_dim, int world_dim, class elem_t , class common_data_t >
static void ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t >::calculate_center ( vector_t centerOut,
const elem_t &  e,
const common_data_t &  commonData 
)
static

◆ contains_point()

template<int tree_dim, int world_dim, class elem_t , class common_data_t >
static bool ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t >::contains_point ( const elem_t &  e,
const vector_t point,
const common_data_t &  commonData 
)
static

todo: the following methods should go into special traverser traits. ** required for ContainsPointTraverser.*‍/

◆ grow_box()

template<int tree_dim, int world_dim, class elem_t , class common_data_t >
static void ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t >::grow_box ( box_t boxOut,
const box_t box,
const vector_t offset 
)
static

adds the given offset to box.max and subtracts it from box.min

◆ merge_boxes()

template<int tree_dim, int world_dim, class elem_t , class common_data_t >
static void ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t >::merge_boxes ( box_t boxOut,
const box_t box1,
const box_t box2 
)
static

returns the smallest box that contains both box1 and box2

◆ split_box()

template<int tree_dim, int world_dim, class elem_t , class common_data_t >
static void ug::ntree_traits< tree_dim, world_dim, elem_t, common_data_t >::split_box ( box_t boxesOut,
const box_t box,
const vector_t splitPoint 
)
static

splits the given box into (2^tree_dim sub-boxes).

The split should be performed so that the given split-point is the only common point of all boxes. The union of all boxes in boxesOut has to overlap the given input-box.


The documentation for this struct was generated from the following file: