politopix  5.0.0
VoronoiWithProperties Class Reference

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

#include <Voronoi_Rn.h>

Inheritance diagram for VoronoiWithProperties:
Inheritance graph
Collaboration diagram for VoronoiWithProperties:
Collaboration graph

Public Member Functions

 VoronoiWithProperties (const boost::shared_ptr< Polytope_Rn > &is, const std::vector< Point_Rn > &lop, const std::vector< int > &listOfProp, double percent)
 
virtual ~VoronoiWithProperties ()
 Destructor. More...
 
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)
 
unsigned int numberOfNonConvexPolytope () const
 
boost::shared_ptr< NonConvexPolytopegetNonConvexPolytope (unsigned int idx)
 
unsigned int getNonConvexPolytopeProperty (unsigned int idx)
 
bool fuseCellsWithSameProperty ()
 Run the whole algorithm: refer to the base class. More...
 
bool fuseCellsWithSameProperty (std::vector< std::vector< unsigned int > > &newListOfNonConvexPolytopes)
 Unite two neighbour cells when they share the same property. More...
 
bool fuseCellsWithSameProperty (std::vector< std::vector< boost::shared_ptr< Polytope_Rn > > > &newListOfNonConvexPolytopes)
 Unite two neighbour cells when they share the same property. More...
 
- Public Member Functions inherited from CellByCellVoronoiDistNgb
 CellByCellVoronoiDistNgb (const boost::shared_ptr< Polytope_Rn > &is, const std::vector< Point_Rn > &lop)
 Constructor. More...
 
 CellByCellVoronoiDistNgb (const boost::shared_ptr< Polytope_Rn > &is, const std::vector< Point_Rn > &lop, double percent)
 
virtual ~CellByCellVoronoiDistNgb ()
 Destructor. More...
 
virtual bool compute ()
 Run the whole algorithm. More...
 
virtual bool compute (std::vector< Point_Rn >::const_iterator iteBeg, std::vector< Point_Rn >::const_iterator iteEnd)
 Run the algorithm on a sub list from iteBeg to iteEnd. More...
 
const std::vector< std::vector< std::pair< boost::shared_ptr< HalfSpace_Rn >, unsigned int > > > & getFacetNeighbours () const
 
void dumpFacetNeighbours (std::ostream &this_ostream) const
 
virtual void updateFacetNeighbours (const std::vector< std::pair< double, unsigned int > > &allDistances, boost::shared_ptr< Polytope_Rn > newVoronoiCell, unsigned int counter, unsigned int newTruncationStep)
 
void dumpNgb (std::ostream &this_ostream) const
 
- Public Member Functions inherited from CellByCellVoronoiDist
 CellByCellVoronoiDist (const boost::shared_ptr< Polytope_Rn > &is, const std::vector< Point_Rn > &lop)
 Constructor. More...
 
 CellByCellVoronoiDist (const boost::shared_ptr< Polytope_Rn > &is, const std::vector< Point_Rn > &lop, double percent)
 
virtual ~CellByCellVoronoiDist ()
 Destructor. More...
 
void processDistances (std::vector< std::pair< double, unsigned int > > &allDistances, std::vector< Point_Rn >::const_iterator newVoronoiSeed, boost::shared_ptr< Polytope_Rn > newVoronoiCell)
 The distance criterion is going to be used to classify partially or globally the way in which we process the cells' half-spaces. More...
 
void setAverageNumberOfNeighbours (double pc)
 When we want to do a partial sort so try to assess the average number of facet neighbours for each cell. More...
 
- Public Member Functions inherited from CellByCellVoronoi
 CellByCellVoronoi (const boost::shared_ptr< Polytope_Rn > &is, const std::vector< Point_Rn > &lop)
 Constructor. More...
 
virtual ~CellByCellVoronoi ()
 Destructor. More...
 
- Public Member Functions inherited from Voronoi_Rn
 Voronoi_Rn (const boost::shared_ptr< Polytope_Rn > &inputSpace, const std::vector< Point_Rn > &listOfPoints)
 Refers to the class WithProperties. More...
 
virtual ~Voronoi_Rn ()
 Destructor. More...
 
boost::shared_ptr< HalfSpace_RncomputeMidPlane (std::vector< Point_Rn >::const_iterator seed1, std::vector< Point_Rn >::const_iterator seed2)
 Compute the half-space containing seed1, in between seed1 and seed2, according to the growing seed property. More...
 
const std::vector< boost::shared_ptr< Polytope_Rn > > & getVoronoiCells () const
 
std::vector< boost::shared_ptr< Polytope_Rn > > getVoronoiCells ()
 
const std::vector< Point_Rn > & getListOfSeeds () const
 
bool checkTopologyAndGeometry () const
 
void dump (std::ostream &out) const
 Dump the cell structure on the given output. More...
 
void gnuplot (std::ostream &out) const
 

Protected Member Functions

void propagate (std::vector< bool > &listOfAlreadyProcessedSeeds, unsigned int nbCell, unsigned int nbProperty)
 

Protected Attributes

std::vector< int > _listOfSeedProperties
 The list of properties associated to the seeds. More...
 
std::vector< boost::shared_ptr< NonConvexPolytope > > _listOfNonConvexPolytopes
 The list of properties associated to the seeds. More...
 
std::vector< int > _listOfNonConvexPolytopeProperties
 
- Protected Attributes inherited from CellByCellVoronoiDistNgb
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...
 
- Protected Attributes inherited from CellByCellVoronoiDist
double _percentageOfSortedHalfSpaces
 The amount of half-spaces we want to sort. More...
 
std::vector< boost::shared_ptr< HalfSpace_Rn > > _allHalfSpaces
 For each seed, the list of the half-spaces used to build its cell. More...
 
- Protected Attributes inherited from Voronoi_Rn
const boost::shared_ptr< Polytope_Rn > & _inputSpace
 The original space to be divided. More...
 
const 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...
 

Additional Inherited Members

- Public Types inherited from Voronoi_Rn
enum  TypeOfAlgorithm {
  Incremental = 0, CellByCell = 1, CellByCellDist = 2, CellByCellDistNgb = 3,
  CellByCellDistNgb_1pc = 4, CellByCellDistNgb_10pc = 5, CellByCellDistNgb_20pc = 6, CellByCellDistNgb_30pc = 7,
  CellByCellDistNgb_40pc = 8, WithProperties = 10
}
 Choose the kind of algorithm to be run. More...
 

Detailed Description

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

Definition at line 338 of file Voronoi_Rn.h.

Constructor & Destructor Documentation

◆ VoronoiWithProperties()

VoronoiWithProperties::VoronoiWithProperties ( const boost::shared_ptr< Polytope_Rn > &  is,
const std::vector< Point_Rn > &  lop,
const std::vector< int > &  listOfProp,
double  percent 
)
inline

Constructor

Parameters
isThe input space in which the Voronoi diagram is computed
lopThe list of Voronoi seeds
percentThe percentage of seeds to be sorted according to distance criteria

Definition at line 346 of file Voronoi_Rn.h.

Here is the call graph for this function:

◆ ~VoronoiWithProperties()

virtual VoronoiWithProperties::~VoronoiWithProperties ( )
inlinevirtual

Destructor.

Definition at line 352 of file Voronoi_Rn.h.

Member Function Documentation

◆ addHalfSpaceAndNeighbour()

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

Definition at line 359 of file Voronoi_Rn.h.

◆ allocateFacetNeighbours()

void VoronoiWithProperties::allocateFacetNeighbours ( )
inlinevirtual

Reimplemented from CellByCellVoronoiDistNgb.

Definition at line 354 of file Voronoi_Rn.h.

Here is the caller graph for this function:

◆ dumpFacetNeighbours()

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

Definition at line 736 of file Voronoi_Rn.cpp.

◆ dumpNeighbours()

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

Definition at line 721 of file Voronoi_Rn.cpp.

◆ fuseCellsWithSameProperty() [1/3]

bool VoronoiWithProperties::fuseCellsWithSameProperty ( )

Run the whole algorithm: refer to the base class.

Unite two neighbour cells when they share the same property.

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

Definition at line 900 of file Voronoi_Rn.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fuseCellsWithSameProperty() [2/3]

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

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:

◆ fuseCellsWithSameProperty() [3/3]

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

Unite two neighbour cells when they share the same property.

Definition at line 751 of file Voronoi_Rn.cpp.

◆ getNonConvexPolytope()

boost::shared_ptr< NonConvexPolytope > VoronoiWithProperties::getNonConvexPolytope ( unsigned int  idx)
inline

Definition at line 369 of file Voronoi_Rn.h.

◆ getNonConvexPolytopeProperty()

unsigned int VoronoiWithProperties::getNonConvexPolytopeProperty ( unsigned int  idx)
inline

Definition at line 371 of file Voronoi_Rn.h.

◆ numberOfNonConvexPolytope()

unsigned int VoronoiWithProperties::numberOfNonConvexPolytope ( ) const
inline

Definition at line 367 of file Voronoi_Rn.h.

◆ propagate()

void VoronoiWithProperties::propagate ( std::vector< bool > &  listOfAlreadyProcessedSeeds,
unsigned int  nbCell,
unsigned int  nbProperty 
)
protected

Definition at line 851 of file Voronoi_Rn.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _listOfNonConvexPolytopeProperties

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

Definition at line 394 of file Voronoi_Rn.h.

◆ _listOfNonConvexPolytopes

std::vector< boost::shared_ptr< NonConvexPolytope > > VoronoiWithProperties::_listOfNonConvexPolytopes
protected

The list of properties associated to the seeds.

Definition at line 393 of file Voronoi_Rn.h.

◆ _listOfSeedProperties

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

The list of properties associated to the seeds.

Definition at line 391 of file Voronoi_Rn.h.


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