In file contour/Constraints2D.h:

class TopologyContour2DConstraint : public Constraint

a class corresponding to a position constraint where intersecting edges are merged which entails topology changes

Inheritance:


Public Methods

virtual void apply ()
the apply fonction that adds or removes vertices depending on minimumDistance and maximumDistance
double getGridSize () const
returns the minimum distance between two vertices
void setGridSize (const double size)
sets the minimum distance between two vertices
unsigned int getMinimumNumberVertices () const
returns the minimum number of vertices for the creation of a new contour
void setMinimumNumberVertices (const unsigned int _minNumberVertices)
sets the minimum number of vertices for the creation of a new contour
bool getFuseDifferentContours () const
returns the boolean indicating if 2 contours should be fused
void setFuseDifferentContours (const bool _fuseDifferentContours)
sets the boolean indicating if 2 contours should be fused
void detectIntersectingEdges (const bool fuse, unsigned int minNbVertices)
the routine called by the topologyConstraint apply() function that modifies the contour topology if several connected component intersect
bool detectEdgeIntersection (Contour2D::EdgeGridPixel *e1, Contour2D::EdgeGridPixel *e2, EdgeActiveContour2D * &edge1, EdgeActiveContour2D * &edge2)
test if two edge grid pixels actually intersect and if so finds the contour edge that really intersect

Public

constructor
TopologyContour2DConstraint (const unsigned int freq, const double size, ActiveContour2D *c, const unsigned int _minNumberVertices=8, const bool _fuseDifferentContours=true) throw(MissingContour)
create a topology constraint
destructor
virtual ~TopologyContour2DConstraint (void)
empty destructor

Private Fields

double gridSize
the minimum Distance between two vertices : may be set to zero
constructor
MissingContour (const std::string& from)
constructor from a string
ActiveContour2D* contour
the ActiveContour2D where the constraint is applied
unsigned int minNumberVertices
the minimum Number of vertices to create a new contour line
bool fuseDifferentContours
whether two different contours should be fused or not

Private Methods

void topologyMergeEdges (EdgeActiveContour2D *e1, EdgeActiveContour2D *e2, std::multimap<EdgeActiveContour2D *, EdgeContourIntersection *> &map, unsigned int minNbVertices )
routine that merge 2 edges corresponding to contour intersection : if the 2 edges belong to the same contour and are too close to each other then no topological operation is performed
void topologyAlignEdges (EdgeContourIntersection *i1, EdgeContourIntersection *i2)
aligns the vertices position between the two edge intersection stored in i1 and i2 along a line segment : this routine is called when the merging between two different connected component is forbidden

Documentation

a class corresponding to a position constraint where intersecting edges are merged which entails topology changes
double gridSize
the minimum Distance between two vertices : may be set to zero

constructor

MissingContour(const std::string& from)
constructor from a string
Parameters:
from - a string indicating where the exception where thrown

ActiveContour2D* contour
the ActiveContour2D where the constraint is applied

unsigned int minNumberVertices
the minimum Number of vertices to create a new contour line

bool fuseDifferentContours
whether two different contours should be fused or not

virtual void apply()
the apply fonction that adds or removes vertices depending on minimumDistance and maximumDistance

double getGridSize() const
returns the minimum distance between two vertices

void setGridSize(const double size)
sets the minimum distance between two vertices

unsigned int getMinimumNumberVertices() const
returns the minimum number of vertices for the creation of a new contour

void setMinimumNumberVertices(const unsigned int _minNumberVertices)
sets the minimum number of vertices for the creation of a new contour

bool getFuseDifferentContours() const
returns the boolean indicating if 2 contours should be fused

void setFuseDifferentContours(const bool _fuseDifferentContours)
sets the boolean indicating if 2 contours should be fused

constructor

TopologyContour2DConstraint(const unsigned int freq, const double size, ActiveContour2D *c, const unsigned int _minNumberVertices=8, const bool _fuseDifferentContours=true) throw(MissingContour)
create a topology constraint
Throws:
MissingContour thrown when c is NULL
Parameters:
freq - the frequency at which the constraint is applied
size - the size of the regular grid used to detect intersection
c - the contour on which the constraint applies
_minNumberVertices - the minimum number of vertices allowed for creating a new connected component
_fuseDifferentContours - indicate if two different connected components should be fused

destructor

virtual ~TopologyContour2DConstraint(void)
empty destructor

void topologyMergeEdges(EdgeActiveContour2D *e1, EdgeActiveContour2D *e2, std::multimap<EdgeActiveContour2D *, EdgeContourIntersection *> &map, unsigned int minNbVertices )
routine that merge 2 edges corresponding to contour intersection : if the 2 edges belong to the same contour and are too close to each other then no topological operation is performed. Otherwise, the two edges are merged
Parameters:
e1 - the first edge
e2 - the second edge
map - the hash table containing the intersection between two edges
minNbVertices - the minimum number of vertices to create a new connected component

void topologyAlignEdges(EdgeContourIntersection *i1, EdgeContourIntersection *i2)
aligns the vertices position between the two edge intersection stored in i1 and i2 along a line segment : this routine is called when the merging between two different connected component is forbidden
Parameters:
i1 - the first edge intersection
i2 - the second edge intersection

void detectIntersectingEdges(const bool fuse, unsigned int minNbVertices)
the routine called by the topologyConstraint apply() function that modifies the contour topology if several connected component intersect
Parameters:
fuse - whether two different connected component should be merged
minNbVertices - the minimum number of vertices to create a new connected component

bool detectEdgeIntersection(Contour2D::EdgeGridPixel *e1, Contour2D::EdgeGridPixel *e2, EdgeActiveContour2D * &edge1, EdgeActiveContour2D * &edge2)
test if two edge grid pixels actually intersect and if so finds the contour edge that really intersect
Returns:
boolean set to true if the two grid edges intersect
Parameters:
e1 - the first edge grid
e2 - the second edge grid
edge1 - the contour edge associated with e1 which intersect with e2
edge2 - the contour edge associated with e2 which intersect with e1


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de