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

#include <polygons.h>

Classes

class  t_polygon_item
 

Public Member Functions

void append_point (number x, number y, int id)
 appends a point to an existing polygon, or creates a new polygon
 
bool get_id_by_pnt (number x, number y, int &id) const
 checks, in which polygon (x, y) is (if in any)
 
int get_id_by_pnt_dv (number x, number y, int dv) const
 returns the polygon id, where (x, y) is, or a given default value
 
void load_points_from (const char *file_name)
 loads points and polygon descriptsions from a file
 
 PolygonalRegions ()
 class constructor
 
 ~PolygonalRegions ()
 class destructor
 

Private Member Functions

bool good () const
 checks whether the specified polygons are OK
 
void load_points_from (std::istream &input)
 loads points and polygon descriptsions from a stream
 
t_polygon_itempolygon_by_id (int id) const
 gets polygon by id
 

Private Attributes

t_polygon_itemm_polygons
 polygons
 

Detailed Description

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

Constructor & Destructor Documentation

◆ PolygonalRegions()

ug::d3f::PolygonalRegions::PolygonalRegions ( )
inline

class constructor

◆ ~PolygonalRegions()

ug::d3f::PolygonalRegions::~PolygonalRegions ( )
inline

class destructor

References m_polygons, s, and ug::d3f::PolygonalRegions::t_polygon_item::tl.

Member Function Documentation

◆ append_point()

void ug::d3f::PolygonalRegions::append_point ( number  x,
number  y,
int  id 
)
inline

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

References ug::d3f::PolygonalRegions::t_polygon_item::append(), m_polygons, and polygon_by_id().

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

◆ get_id_by_pnt()

bool ug::d3f::PolygonalRegions::get_id_by_pnt ( number  x,
number  y,
int &  id 
) const
inline

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

References m_polygons, and ug::d3f::PolygonalRegions::t_polygon_item::tl.

Referenced by get_id_by_pnt_dv().

◆ get_id_by_pnt_dv()

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

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

References get_id_by_pnt().

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

◆ good()

bool ug::d3f::PolygonalRegions::good ( ) const
inlineprivate

checks whether the specified polygons are OK

References m_polygons, and ug::d3f::PolygonalRegions::t_polygon_item::tl.

Referenced by load_points_from().

◆ load_points_from() [1/2]

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

loads points and polygon 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::PolygonalRegions::load_points_from ( std::istream &  input)
private

loads points and polygon descriptsions from a stream

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

References append_point(), good(), and UG_THROW.

◆ polygon_by_id()

t_polygon_item * ug::d3f::PolygonalRegions::polygon_by_id ( int  id) const
inlineprivate

Member Data Documentation

◆ m_polygons

t_polygon_item* ug::d3f::PolygonalRegions::m_polygons
private

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