politopix  4.1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
VoronoiWithProperties Class Reference

Fuse Voronoi cells when they share the same property and then get non convex polytopes. More...

#include <Voronoi_Rn.h>

Collaboration diagram for VoronoiWithProperties:
Collaboration graph

Public Member Functions

 VoronoiWithProperties ()
 
 VoronoiWithProperties (const std::vector< Point_Rn > &listOfSeeds, const std::vector< boost::shared_ptr< Polytope_Rn > > &listOfCells, const std::vector< int > &listOfProp)
 
 VoronoiWithProperties (const CellByCellVoronoiDistNgb &CBCVDN, const std::vector< int > &listOfProp)
 
virtual ~VoronoiWithProperties ()
 Destructor. More...
 
void loadCell (const std::string &filename) throw (std::ios_base::failure)
 
void loadSeeds (const std::string &filename) throw (std::ios_base::failure)
 
void loadSeeds (const std::vector< Point_Rn > &listOfPoints3D)
 
void loadProperties (const std::string &filename) throw (std::ios_base::failure)
 
void loadFacetNeighbours (const std::string &filename) throw (std::length_error,std::ios_base::failure)
 
void allocateFacetNeighbours ()
 
void dumpNeighbours (std::ostream &this_ostream) const
 
void dumpFacetNeighbours (std::ostream &this_ostream) const
 
void addHalfSpaceAndNeighbour (unsigned int cellCounter, boost::shared_ptr< HalfSpace_Rn > hs, unsigned int ngbCell)
 
bool fuseCellsWithSameProperty (std::vector< std::vector< unsigned int > > &newListOfNonConvexPolytopes) throw (std::length_error)
 Run the whole algorithm: refer to the base class. More...
 
bool fuseCellsWithSameProperty (std::vector< std::vector< boost::shared_ptr< Polytope_Rn > > > &newListOfNonConvexPolytopes) throw (std::length_error)
 Unite two neighbour cells when they share the same property. More...
 

Static Public Member Functions

static void loadProp (const std::string &filename, std::vector< int > &propList) throw (std::ios_base::failure)
 

Protected Attributes

std::vector< Point_Rn_listOfSeeds
 The list of input points. More...
 
std::vector< boost::shared_ptr
< Polytope_Rn > > 
_listOfVoronoiCells
 The list of polytopes partitioning the whole space. More...
 
std::vector< std::vector
< std::pair< boost::shared_ptr
< HalfSpace_Rn >, unsigned int > > > 
_facetNeighbours
 For the current cell, store its neighbour numbers. _facetNeighbours[i] = { (H0, i0), (H1, i1), ... }. More...
 
std::vector< int > _listOfSeedProperties
 The list of properties associated to the seeds. More...
 

Detailed Description

Fuse Voronoi cells when they share the same property and then get non convex polytopes.

Definition at line 271 of file Voronoi_Rn.h.

Constructor & Destructor Documentation

VoronoiWithProperties::VoronoiWithProperties ( )
inline

Definition at line 274 of file Voronoi_Rn.h.

VoronoiWithProperties::VoronoiWithProperties ( const std::vector< Point_Rn > &  listOfSeeds,
const std::vector< boost::shared_ptr< Polytope_Rn > > &  listOfCells,
const std::vector< int > &  listOfProp 
)
inline

Constructor

Parameters
listOfSeedsThe list of seeds
listOfCellsThe list of cells associated to each seed
listOfPropThe list of properties associated to each seed

Definition at line 280 of file Voronoi_Rn.h.

VoronoiWithProperties::VoronoiWithProperties ( const CellByCellVoronoiDistNgb CBCVDN,
const std::vector< int > &  listOfProp 
)
inline

Constructor

Parameters
CBCVDNThe previously computed Voronoi diagram
listOfPropThe list of properties associated to each seed

Definition at line 293 of file Voronoi_Rn.h.

Here is the call graph for this function:

virtual VoronoiWithProperties::~VoronoiWithProperties ( )
inlinevirtual

Destructor.

Definition at line 301 of file Voronoi_Rn.h.

Member Function Documentation

void VoronoiWithProperties::addHalfSpaceAndNeighbour ( unsigned int  cellCounter,
boost::shared_ptr< HalfSpace_Rn hs,
unsigned int  ngbCell 
)
inline

Definition at line 325 of file Voronoi_Rn.h.

void VoronoiWithProperties::allocateFacetNeighbours ( )
inline

Definition at line 320 of file Voronoi_Rn.h.

void VoronoiWithProperties::dumpFacetNeighbours ( std::ostream &  this_ostream) const

Definition at line 736 of file Voronoi_Rn.cpp.

void VoronoiWithProperties::dumpNeighbours ( std::ostream &  this_ostream) const

Definition at line 721 of file Voronoi_Rn.cpp.

bool VoronoiWithProperties::fuseCellsWithSameProperty ( std::vector< std::vector< unsigned int > > &  newListOfNonConvexPolytopes)
throw (std::length_error
)

Run the whole algorithm: refer to the base class.

Unite two neighbour cells when they share the same property.

Definition at line 751 of file Voronoi_Rn.cpp.

Here is the caller graph for this function:

bool VoronoiWithProperties::fuseCellsWithSameProperty ( std::vector< std::vector< boost::shared_ptr< Polytope_Rn > > > &  newListOfNonConvexPolytopes)
throw (std::length_error
)

Unite two neighbour cells when they share the same property.

Definition at line 831 of file Voronoi_Rn.cpp.

Here is the call graph for this function:

void VoronoiWithProperties::loadCell ( const std::string &  filename)
throw (std::ios_base::failure
)

Definition at line 682 of file Voronoi_Rn.cpp.

Here is the call graph for this function:

void VoronoiWithProperties::loadFacetNeighbours ( const std::string &  filename)
throw (std::length_error,
std::ios_base::failure
)

Definition at line 688 of file Voronoi_Rn.cpp.

void VoronoiWithProperties::loadProp ( const std::string &  filename,
std::vector< int > &  propList 
)
throw (std::ios_base::failure
)
static

Load the list of properties associated to the seeds.

Parameters
filenameThe file containing the properties
propListThe list to store properties after being cleared

Definition at line 618 of file Voronoi_Rn.cpp.

void VoronoiWithProperties::loadProperties ( const std::string &  filename)
throw (std::ios_base::failure
)

Definition at line 644 of file Voronoi_Rn.cpp.

void VoronoiWithProperties::loadSeeds ( const std::string &  filename)
throw (std::ios_base::failure
)

Definition at line 670 of file Voronoi_Rn.cpp.

Here is the call graph for this function:

void VoronoiWithProperties::loadSeeds ( const std::vector< Point_Rn > &  listOfPoints3D)
inline

Definition at line 312 of file Voronoi_Rn.h.

Member Data Documentation

std::vector< std::vector< std::pair<boost::shared_ptr<HalfSpace_Rn>, unsigned int> > > VoronoiWithProperties::_facetNeighbours
protected

For the current cell, store its neighbour numbers. _facetNeighbours[i] = { (H0, i0), (H1, i1), ... }.

Definition at line 346 of file Voronoi_Rn.h.

std::vector<int> VoronoiWithProperties::_listOfSeedProperties
protected

The list of properties associated to the seeds.

Definition at line 348 of file Voronoi_Rn.h.

std::vector< Point_Rn > VoronoiWithProperties::_listOfSeeds
protected

The list of input points.

Definition at line 342 of file Voronoi_Rn.h.

std::vector< boost::shared_ptr<Polytope_Rn> > VoronoiWithProperties::_listOfVoronoiCells
protected

The list of polytopes partitioning the whole space.

Definition at line 344 of file Voronoi_Rn.h.


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