Plugins
Loading...
Searching...
No Matches
ug::d3f::UnionsOfBoxes Class Reference

#include <boxunions.h>

Classes

class  t_box_union_item
 

Public Member Functions

void append_point (number x, number y, int ident)
 appends a point to an existing union, or creates a new union
 
bool get_id_by_pnt (number x, number y, int &ident) const
 checks, in which union (x, y) is (if in any)
 
int get_id_by_pnt_dv (number x, number y, int dv) const
 returns the union id, where (x, y) is, or a given default value
 
void load_points_from (const char *file_name)
 loads point and union descriptsions from a file
 
void set_grid_sizes (size_t dir, number dx, number dy)
 sets the grid sizes and the agglomeration direction
 
 UnionsOfBoxes ()
 class constructor
 
 ~UnionsOfBoxes ()
 class destructor
 

Private Member Functions

void load_points_from (std::istream &input)
 loads points and union descriptsions from a stream
 
t_box_union_itemunion_by_id (int ident) const
 gets a union by id
 

Private Attributes

t_box_union_itemm_box_unions
 unions
 
size_t m_dir
 direction of the agglomeration (0 = x, 1 = y, otherwise none)
 
number m_dx
 x-size of the boxes
 
number m_dy
 y-size of the boxes
 

Detailed Description

This class provides a facility to inquire, in which of given union of boxes a given point lyes. The class keeps a list of the unions identified by integers.

Constructor & Destructor Documentation

◆ UnionsOfBoxes()

ug::d3f::UnionsOfBoxes::UnionsOfBoxes ( )
inline

class constructor

◆ ~UnionsOfBoxes()

ug::d3f::UnionsOfBoxes::~UnionsOfBoxes ( )
inline

class destructor

References m_box_unions, s, and ug::d3f::UnionsOfBoxes::t_box_union_item::tl.

Member Function Documentation

◆ append_point()

void ug::d3f::UnionsOfBoxes::append_point ( number  x,
number  y,
int  ident 
)
inline

appends a point to an existing union, or creates a new union

References ug::d3f::UnionsOfBoxes::t_box_union_item::append(), m_box_unions, m_dir, m_dx, m_dy, and union_by_id().

Referenced by ug::d3f::Functionality::Common(), and load_points_from().

◆ get_id_by_pnt()

bool ug::d3f::UnionsOfBoxes::get_id_by_pnt ( number  x,
number  y,
int &  ident 
) const
inline

checks, in which union (x, y) is (if in any)

References m_box_unions, and ug::d3f::UnionsOfBoxes::t_box_union_item::tl.

Referenced by get_id_by_pnt_dv().

◆ get_id_by_pnt_dv()

int ug::d3f::UnionsOfBoxes::get_id_by_pnt_dv ( number  x,
number  y,
int  dv 
) const
inline

returns the union id, where (x, y) is, or a given default value

References get_id_by_pnt().

Referenced by ug::d3f::Functionality::Common().

◆ load_points_from() [1/2]

void ug::d3f::UnionsOfBoxes::load_points_from ( const char *  file_name)

loads point and union descriptsions from a file

Loads polygon corners and id's from a given file.

References ug::FindFileInStandardPaths(), load_points_from(), and UG_COND_THROW.

Referenced by ug::d3f::Functionality::Common(), and load_points_from().

◆ load_points_from() [2/2]

void ug::d3f::UnionsOfBoxes::load_points_from ( std::istream &  input)
private

loads points and union descriptsions from a stream

Loads polygon corners and id's from a given stream.

References append_point(), and UG_THROW.

◆ set_grid_sizes()

void ug::d3f::UnionsOfBoxes::set_grid_sizes ( size_t  dir,
number  dx,
number  dy 
)
inline

sets the grid sizes and the agglomeration direction

Parameters
dirdirection of the agglomeration (0 = x, 1 = y, otherwise none)
dxx-size of the boxes
dyy-size of the boxes

References m_dir, m_dx, and m_dy.

Referenced by ug::d3f::Functionality::Common().

◆ union_by_id()

t_box_union_item * ug::d3f::UnionsOfBoxes::union_by_id ( int  ident) const
inlineprivate

Member Data Documentation

◆ m_box_unions

t_box_union_item* ug::d3f::UnionsOfBoxes::m_box_unions
private

◆ m_dir

size_t ug::d3f::UnionsOfBoxes::m_dir
private

direction of the agglomeration (0 = x, 1 = y, otherwise none)

Referenced by append_point(), and set_grid_sizes().

◆ m_dx

number ug::d3f::UnionsOfBoxes::m_dx
private

x-size of the boxes

Referenced by append_point(), and set_grid_sizes().

◆ m_dy

number ug::d3f::UnionsOfBoxes::m_dy
private

y-size of the boxes

Referenced by append_point(), and set_grid_sizes().


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