In file contour/ActiveContour2D.h:

class ActiveContour2D : public Contour2D, public DeformableModel2D

class of a 2D active contour also called "snakes"

Inheritance:


Public Classes

class InvalidContour : public Exception
Exception thrown when a contour has not enough vertices
enum TimeDiscretizationScheme
the method for the time discretization of the pde : - implicit methods requires to solve a linear system at each iteration - explicit methods are simpler but may not be stable

Public Fields

typedef mtl::matrix , mtl::compressed<>, mtl::row_major> ::type SparseMatrix
the type of sparse matrix used to store the rigidity matrix

Public Methods

ActiveLine2DIterator firstLine (void) const
returns a line Iterator of type ActiveLine2DIterator on AContourLine2D
ActiveLine2DIterator lastLine (void) const
returns a line Iterator of type ActiveLine2DIterator on AContourLine2D
ActiveVertexContour2DIterator firstVertex () const
returns a VertexIterator of type ActiveVertexContour2D belonging to the contour
void computeEdgeDirection ()
The internal force init function
void computeSimplexAngle () throw(ContourLine2D::IllegalGeometry)
The internal force init function
void computeCurvature () throw(ContourLine2D::IllegalGeometry)
compute the curvature for all vertices
void setSpringRestLengths ()
sets the current edge length as the rest length
void setMetricParameters ()
sets the current metric parameters as the reference metric parameters
void resetMetricParameters ()
sets the reference metric parameters to 0.5
void topologyHasChanged ()
called when a vertex has been removed or added or when a vertex mobility (fixed member) has been modified
void initInternalForce ()
create internal force types
void computeMaximumRigidity ()
computes the maximum rigidity
ActiveContour2D::TimeDiscretizationScheme getTimeScheme (void) const
return the time integration scheme
void setTimeScheme (const ActiveContour2D::TimeDiscretizationScheme ts)
set the time integration scheme
void computeInternalForce ()
compute the internal force for all contour vertices by calling internalForce->computeInternalForce(this)
void setInternalForce (InternalForceContour2D *ft)
set a given internal force as the internal force applying on all contour vertices : call the unsetInternalForce() of the previous internal force and call ft->setInternalForce()
void setInternalForce (char *forceName)
find the internal force corresponding to its name
virtual void computeExternalForce ()
compute the external force on all contour vertices
void updatePosition ()
update the position of all contour vertices by calling the corresponding function v->updatePosition
void iterate (const unsigned int n)
the routine called when the scene activates all active items : it computes the internal, external force, force constraint and update the position of all vertices
SparseMatrix* getRigidityMatrix () const
returns the contour rigidity matrix
mtl::dense1D * getForceVector () const
returns the contour rigidity matrix
bool hasTopologyChanged () const
indicates if the contour has changed in the previous iteration such that rigidity matrices must be updated
double getMinimumEdgeLength () const
returns the mean edge distance in the contour
double getMedianEdgeLength () const
returns the median edge length in the contour
double getMeanEdgeLength () const
returns the mean edge distance in the contour
double getMeanEdgeSquareLength () const
returns the mean edge square distance of the contour
InternalForceContour2D* getInternalForce () const
returns the internal force type applying on the whole contour
virtual bool continueDeformation ()
whether this deformable model should still be deformed
virtual ContourLine* createLine (ContourLine::Topology top)
create a new line : use a virtual function in order to create inherited lines
AContourLine2D* getFirstLine (void) const
returns the first Line of type L *
void applyLine (void (AContourLine2D::*fn)(void))
Apply a function on all lines of a contour
void applyLine (void (AContourLine2D::*fn) (void) const)
Apply a function on all lines of a contour
void applyVertex (void (ActiveVertexContour2D::*fn)(void))
Apply a function on all vertices of a contour @psaram fn a function of prototype void (ActiveVertexContour2D::*fn)(void) that is a member function of type T that must be derived class of VertexContour
void applyVertex (void (ActiveVertexContour2D::*fn)(const double), const double v)
Apply a function on all vertices of a contour
void applyVertexUInt (void (ActiveVertexContour2D::*fn)(const unsigned int), const unsigned int v)
Apply a function on all vertices of a contour
void readMainModule (GFInput &input) throw(InvalidContour)
the function that read the contour topology and geometry
void skipMainModule (GFInput &input)
the function that skip the contour topology and geometry
void writeMainModule (GFOutput &output)
the function that write the contour topology and geometry
void readInternalForceModule (GFInput &input)
the function that reads the internal force set on all contour vertices
void skipInternalForceModule (GFInput &input)
the function that skips the internal force set on all contour vertices
void writeInternalForceModule (GFOutput &output)
the function that writes the internal force set on all contour vertices
void readPositionConstraintModule (GFInput &input)
the function that reads the position constraint existing on the contour
void skipPositionConstraintModule (GFInput &input)
the function that skips the position constraint existing on the contour
void writePositionConstraintModule (GFOutput &output)
the function that writes the position constraint existing on the contour
void readForceConstraintModule (GFInput &input)
the function that reads the force constraint existing on the contour
void skipForceConstraintModule (GFInput &input)
the function that skips the force constraint existing on the contour
void writeForceConstraintModule (GFOutput &output)
the function that writes the force constraint existing on the contour
void readAlphaModule (GFInput &input)
the function that reads the internal force weight for each contour vertex
void skipDoubleVertexModule (GFInput &input)
the function that skips the internal force weight for each contour vertex
void writeAlphaModule (GFOutput &output)
the function that writes the internal force weight for each contour vertex
void readBetaModule (GFInput &input)
the function that reads the external force weight for each contour vertex
void writeBetaModule (GFOutput &output)
the function that writes the external force weight for each contour vertex
void readRigidityModule (GFInput &input)
the function that reads the rigidity parameter for each contour vertex
void skipIntVertexModule (GFInput &input)
the function that skip an integer value written for each contour vertex
void writeRigidityModule (GFOutput &output)
the function that writes the rigidity parameter for each contour vertex
void readShapePositionModule (GFInput &input)
the function that reads the shape position for each contour vertex
void skipVectorVertexModule (GFInput &input)
the function that skip a 2D vector written for each contour vertex
void writeShapePositionModule (GFOutput &output)
the function that write the shape position for each contour vertex
void readRangeInformation (GFInput &input)
the function that reads the range Information stored at some vertices
void skipRangeInformation (GFInput &input)
the function that skips the range Information stored at some vertices
void writeRangeInformation (GFOutput &output)
the function that writes a 2D vector written for each contour vertex
void readMobilityModule (GFInput &input)
the function that reads the mobility (if the vertex is fixed or not) for each contour vertex
void writeMobilityModule (GFOutput &output)
the function that writes the mobility (if the vertex is fixed or not) for each contour vertex
void addContour (const ActiveContour2D *contour)
add in the current contour a copy of another contour
RangeInformation* getRangeInformation () const
get the range information applied on all vertices
void setRangeInformation ( RangeInformation * ri)
set the range information applied on all vertices
virtual void mergeEdges (EdgeActiveContour2D *e1, EdgeActiveContour2D *e2)
Merge two edges belonging
TclObject* getTclInterface () const
returns the interface associated with the contour
virtual void translate (const Vec2& t)
translate the contour
virtual void scale (const double scale)
scale the active contour
virtual void rotate (const Rotation2D &rotation)
rotate the active contour
virtual void redraw (Camera2D *cam)
the redraw function
ActiveVertexContour2D* getSelectedActiveVertex () const
gives the selected vertex as an ActiveVertexContour2D
void getSelectedEdgeColor (float &r, float &g, float &b) const
Returns the display color of the selected edge
float getSelectedEdgeWidth () const
Returns the width of the selected edge
EdgeActiveContour2D* getSelectedEdge () const
Returns the selected edge
EdgeActiveContour2D* getPreviousSelectedEdge () const
Returns the previous selected edge
void setSelectedEdgeColor (const float r, const float g, const float b)
Sets the display color of selected edge
void setSelectedEdgeWidth (const float w)
Sets the width of the selected Edge
void setSelectedEdge (EdgeActiveContour2D *e)
sets the selected edge of a contour
void setShowClosestPoint (const bool b)
sets the boolean indicating if the closest points should be displayed
void setShowRangeDistance (const bool b)
sets the boolean indicating if the range distance should be displayed
bool getShowRangeDistance () const
returns the boolean indicating if the range distance should be displayed
bool getShowClosestPoint () const
returns the boolean indicating if the closest points should be displayed
ActiveVertexContour2D* getSelectedActiveVertex2D () const
returns the selected active vertex
AContourLine2D* getSelectedActiveLine2D () const
returns the selected active line
void selectEdge (const Vec2 &pixel, Camera2D *cam)
select the closest edge from a given pixel position
void grabVertex (const Vec2 &pixel, Camera2D *cam)
applies an external force that attract the closest contour vertex towards a pixel position
virtual void selectObject (const Vec2 pixel, Camera2D *cam)
a function that allows to perform a task on a data object from a mouse click

Public

Constructors
ActiveContour2D (Scene2D *scene=NULL)
Builds a basic contour without any vertices and lines
ActiveContour2D (const TclString filename, Scene2D *scene=NULL)
Builds an active contour from a file
ActiveContour2D (const unsigned int nbLines, const unsigned int *nbVertices, Vec2 **array, const ContourLine::Topology *top, Scene2D *scene=NULL)
Builds an active contour given a set of lines
ActiveContour2D (const ActiveContour2D * _contour)
Builds an active contour given another active contour

Protected Fields

bool topologyChanged
tells if the contour topology has been modified in the previous iteration
RangeInformation* rangeInformation
the range information used for all vertices
SparseMatrix* rigidityMatrix
rigidity matrix used by implicit scheme resolution
mtl::dense1D * forceVector
vector used to store all external forces applied on vertices
mtl::dense1D * resultVector
vector used to store the solution of the linear equation used by implicit scheme resolution
EdgeActiveContour2D* selectedEdge
the selected Edge
EdgeActiveContour2D* previousSelectedEdge
the selected Edge
float selectedEdgeColor [3]
the color of the selected edge
static const float defaultSelectedEdgeColor [3]
the default color of the selected edge
float selectedEdgeWidth
the width of the selected edge
static const float defaultSelectedEdgeWidth
the default width of the selected edge
static const bool defaultShowClosestPoint
the default value of showClosestPoint
bool showClosestPoint
Should the closest point be displayed?
static const bool defaultShowRangeDistance
the default value of showRangeDistance
bool showRangeDistance
Should the range distance be displayed

Protected Methods

void initGeneralFormat ()
sets the general format routines
void initActiveContour ()
calls all init routines once the contour has been loaded in memory
void initColor (void)
initializes the selected edge graphics color and width

Private Fields

TimeDiscretizationScheme timeScheme
the time discretization scheme may be implicit or explicit
InternalForceContour2D* internalForce
the internal force that applies on most contour vertices

Private Methods

void initGeometry ()
routine that computes basic geometric information such as the contour center or radius

Inherited from Contour2D:

Public Classes

class EdgeGridIntersection
enum IntersectionType
does the intersection corresponds to the intersection between a contour edge with a row or column ?
Vec2 position
the intersection position
IntersectionType type
the type of intersection
VertexContour2D* previousVertex
the previous vertex defining the edge
Vec2 getPosition() const
returns the intersection position
VertexContour2D* getPreviousVertex() const
returns the previous vertex defining the edge
Constructors
EdgeGridIntersection(IntersectionType t, Vec2 &pos, VertexContour2D *v)
Build an edge intersection knowing if it is occurs along a row or column edge, it position along the edge and the corresponding edge of the contour (through v->edge)
Destructor
virtual ~EdgeGridIntersection()
empty destructor
class EdgeGridPixel: public ListElement<EdgeGridPixel>
VertexContour2D* vertex
the vertex may be a VertexContour2D when it corresponds to the end of the contour
EdgeGridIntersection* edgeIntersection
the vertex may also be a EdgeGridIntersection
Constructors
GridPixelVertex(VertexContour2D *v)
Build a GridPixelVertex consisting of a single vertex
GridPixelVertex(EdgeGridIntersection *e)
Build a GridPixelVertex consisting of a grid intersection
GridPixelVertex()
Build a GridPixelVertex without any vertex
GridPixelVertex(GridPixelVertex &iv)
Build a GridPixelVertex given another GridPixelVertex
Destructor
virtual ~GridPixelVertex()
empty destructor
void setVertex(VertexContour2D *v)
set the vertex as a VertexContour2D
void setEdgeIntersection(EdgeGridIntersection *e)
set the vertex as a EdgeGridIntersection
VertexContour2D* getVertex() const
returns the vertex as a VertexContour2D (may be 0)
EdgeGridIntersection* getEdgeIntersection() const
returns the vertex as a EdgeGridIntersection (may be 0)
Vec2 getPosition() const
returns the position of the vertex
ContourLine* getLine() const
return the line where the pixel vertex belongs
GridPixelVertex vertex[2]
the 2 extremities of the edge
Constructors
EdgeGridPixel(GridPixelVertex &iv1, GridPixelVertex &iv2 )
Create a EdgeGridPixel given its 2 extremities
Destructor
virtual ~EdgeGridPixel()
empty destructor
bool isValid() const
test if the edge is valid i
Vec2 getPosition(unsigned int i) const
returns the position of the vertex
VertexContour2D* getVertex(unsigned int i) const
returns the VertexContour2D associated with one its extremity (may be 0)
EdgeGridIntersection* getEdgeIntersection(unsigned int i) const
returns the EdgeGridIntersection associated with one its extremity (may be 0)
class GridPixel
ObjectsList <EdgeGridPixel> edgeList
the list of grid edges
const int row
the row index of the pixel
const int col
the column index of the pixel
Constructors
GridPixel(const int r, const int c)
constructor based on the pixel row and column index
Destructor
virtual ~GridPixel()
empty destructor
int getRowIndex() const
returns the row index of the grid pixel
int getColumnIndex() const
returns the column index of the grid pixel
unsigned int getNbEdges() const
returns the number of edges in the pixel grid
ObjectsList <EdgeGridPixel> ::iterator firstEdge()
returns an iterator on the first edge
ObjectsList <EdgeGridPixel> ::iterator lastEdge()
returns an iterator on the last edge

Public Methods

void read(TclString filename)
void write(TclString filename)
std::map GridPixel *, std::less > & getPixelTable()
Vec2 computeCenter() const
void updateCenter(Vec2& center, unsigned int& n)
double updateRadius(const Vec2& center)
virtual void translateLine(const Vec2& t)
virtual void scaleLine(const double scale)
virtual void rotateLine(const Rotation2D &rotation)
void computeBoundingBox(double &minx, double &maxx, double &miny, double &minz) const
void buildGridIntersection(double distance)
void removeGridIntersectionInformation(void)
void readModule(GFInput &input) throw(ContourLine2D::EmptyLine)
void skipModule(GFInput &input)
void writeModule(GFOutput &output)
void computeTangent()
void saveAsMapleFile(const char *name)
VertexContour2D* getSelectedVertex() const
ContourLine2D* getSelectedLine() const
void updateBoundingBox()
void drawLine(Camera2D *c, TclCamera2D *cam, ContourLine2D *l)
double computeClosestDistance(DataTypes::MouseClick& mc) const
virtual void selectLine(const Vec2& pixel, Camera2D *cam)
virtual void moveVertex(const Vec2& pixel, Camera2D *cam)
virtual void addVertex(const Vec2& pixel, Camera2D *cam)
virtual void insertVertex(const Vec2& pixel, Camera2D *cam)
void setSelectedLine(ContourLine2D *l)
void setSelectedVertex(VertexContour2D *v)
virtual void selectVertex(const Vec2& pixel, Camera2D *cam)

Public

Destructor

virtual ~Contour2D()
destructor of a 2D contour

Protected Fields

std::list <EdgeGridIntersection *> edgeIntersectionList
std::map GridPixel *, std::less > pixelTable
VertexContour2D* selectedVertex
ContourLine2D* selectedLine

Private Methods

void initFormat()

Inherited from Contour:

Public Classes

template class VertexIterator
const Contour* contour
the contour where are the vertices
ObjectsList <ContourLine> :: iterator currentLine
the current Line pointed by the iterator
ObjectsList <VertexContour> :: iterator currentVertex
the current vertex pointed by the iterator
constructor
VertexIterator(const Contour *c)
Build a VertexIterator given a Contour
T* operator++(int) throw(ObjectsList<ContourLine>::iterator::AccessBeyondList)
Operator ++ that pre-increment the iterator
T* operator++(void) throw(ObjectsList<ContourLine>::iterator::AccessBeyondList)
Operator ++ that post-increment the iterator
T* operator *(void) const throw(ObjectsList<ContourLine>::iterator::AccessBeyondList)
Operator () that returns the pointed element
void first(void)
set the iterator to point on the first vertex
bool isAtEnd(void)
returns true if list end was reached and there is no current element anymore
enum DisplayMode
enum VertexDisplayMode
enum SelectionMode

Public Methods

ObjectsList <ContourLine> ::iterator firstLineContour() const
ObjectsList <ContourLine> ::iterator lastLineContour() const
void addLine(ContourLine *l)
unsigned int getNbLines() const
unsigned int getNbVertices() const
void getLineColor(float &r, float &g, float &b) const
void getSelectedLineColor(float &r, float &g, float &b) const
void getVertexColor(float &r, float &g, float &b) const
void getSelectedVertexColor(float &r, float &g, float &b) const
float getLineWidth() const
float getVertexSize() const
DisplayMode getDisplayMode() const
SelectionMode getSelectionMode() const
VertexDisplayMode getVertexDisplayMode() const
void setLineColor(const float r, const float g, const float b)
void setSelectedLineColor(const float r, const float g, const float b)
void setVertexColor(const float r, const float g, const float b)
void setSelectedVertexColor(const float r, const float g, const float b)
void setLineWidth(const float w)
void setVertexSize(const float s)
void setDisplayMode(const DisplayMode mode)
void setVertexDisplayMode(const VertexDisplayMode mode)
void setSelectionMode(const SelectionMode mode)

Public

constructor

Contour()
Build a contour

destructor

virtual ~Contour()
empty

Protected Fields

ObjectsList <ContourLine> lineList
float lineColor[3]
static const float defaultLineColor[3]
float selectedLineColor[3]
static const float defaultSelectedLineColor[3]
float selectedVertexColor[3]
static const float defaultSelectedVertexColor[3]
float vertexColor[3]
static const float defaultVertexColor[3]
float lineWidth
static const float defaultLineWidth
float vertexSize
static const float defaultVertexSize
DisplayMode displayMode
VertexDisplayMode vertexDisplayMode
SelectionMode selectionMode

Documentation

class of a 2D active contour also called "snakes"
typedef mtl::matrix , mtl::compressed<>, mtl::row_major> ::type SparseMatrix
the type of sparse matrix used to store the rigidity matrix

class InvalidContour: public Exception
Exception thrown when a contour has not enough vertices

enum TimeDiscretizationScheme
the method for the time discretization of the pde : - implicit methods requires to solve a linear system at each iteration - explicit methods are simpler but may not be stable

TimeDiscretizationScheme timeScheme
the time discretization scheme may be implicit or explicit

InternalForceContour2D* internalForce
the internal force that applies on most contour vertices

void initGeometry()
routine that computes basic geometric information such as the contour center or radius

bool topologyChanged
tells if the contour topology has been modified in the previous iteration

RangeInformation* rangeInformation
the range information used for all vertices

SparseMatrix* rigidityMatrix
rigidity matrix used by implicit scheme resolution

mtl::dense1D * forceVector
vector used to store all external forces applied on vertices

mtl::dense1D * resultVector
vector used to store the solution of the linear equation used by implicit scheme resolution

void initGeneralFormat()
sets the general format routines

void initActiveContour()
calls all init routines once the contour has been loaded in memory

Constructors

ActiveContour2D(Scene2D *scene=NULL)
Builds a basic contour without any vertices and lines. It calls the basic constructor of Contour2D and DeformableModel2D and initializes the modules for the general format. It can only be called by inherited classes
Parameters:
scene - : the Scene2D where the contour should be placed (since it is a Data2D and DeformableModel2D)

ActiveContour2D(const TclString filename, Scene2D *scene=NULL)
Builds an active contour from a file
Parameters:
filename - the name of the file where is described the contour
scene - : the Scene2D where the contour should be placed (since it is a Data2D and DeformableModel2D)

ActiveContour2D(const unsigned int nbLines, const unsigned int *nbVertices, Vec2 **array, const ContourLine::Topology *top, Scene2D *scene=NULL)
Builds an active contour given a set of lines
Parameters:
nbLines - the number of lines that compose the active contour
nbVertices - the number of the vertices of each line. It is an array of size nbLines
array - the array of 2D vertices that are in each line. The first index of the array "lineIndex" is the index of the line (lineIndextop - the array describing the topology of each line (either closed or opened)
scene - : the Scene2D where the contour should be placed (since it is a Data2D and DeformableModel2D)

ActiveContour2D(const ActiveContour2D * _contour)
Builds an active contour given another active contour
Parameters:
_contour - a given active contour 2D

ActiveLine2DIterator firstLine(void) const
returns a line Iterator of type ActiveLine2DIterator on AContourLine2D

ActiveLine2DIterator lastLine(void) const
returns a line Iterator of type ActiveLine2DIterator on AContourLine2D

ActiveVertexContour2DIterator firstVertex() const
returns a VertexIterator of type ActiveVertexContour2D belonging to the contour
Returns:
s the VertexIterator pointing on the first contour vertex

void computeEdgeDirection()
The internal force init function

void computeSimplexAngle() throw(ContourLine2D::IllegalGeometry)
The internal force init function

void computeCurvature() throw(ContourLine2D::IllegalGeometry)
compute the curvature for all vertices

void setSpringRestLengths()
sets the current edge length as the rest length

void setMetricParameters()
sets the current metric parameters as the reference metric parameters

void resetMetricParameters()
sets the reference metric parameters to 0.5

void topologyHasChanged()
called when a vertex has been removed or added or when a vertex mobility (fixed member) has been modified

void initInternalForce()
create internal force types

void computeMaximumRigidity()
computes the maximum rigidity

ActiveContour2D::TimeDiscretizationScheme getTimeScheme(void) const
return the time integration scheme

void setTimeScheme(const ActiveContour2D::TimeDiscretizationScheme ts)
set the time integration scheme

void computeInternalForce()
compute the internal force for all contour vertices by calling internalForce->computeInternalForce(this)

void setInternalForce(InternalForceContour2D *ft)
set a given internal force as the internal force applying on all contour vertices : call the unsetInternalForce() of the previous internal force and call ft->setInternalForce()
Parameters:
ft - the internal force

void setInternalForce(char *forceName)
find the internal force corresponding to its name. If found call setInternalForce(ft)
Parameters:
forceName - the internal force name

virtual void computeExternalForce()
compute the external force on all contour vertices

void updatePosition()
update the position of all contour vertices by calling the corresponding function v->updatePosition

void iterate(const unsigned int n)
the routine called when the scene activates all active items : it computes the internal, external force, force constraint and update the position of all vertices

SparseMatrix* getRigidityMatrix() const
returns the contour rigidity matrix

mtl::dense1D * getForceVector() const
returns the contour rigidity matrix

bool hasTopologyChanged() const
indicates if the contour has changed in the previous iteration such that rigidity matrices must be updated

double getMinimumEdgeLength() const
returns the mean edge distance in the contour

double getMedianEdgeLength() const
returns the median edge length in the contour

double getMeanEdgeLength() const
returns the mean edge distance in the contour

double getMeanEdgeSquareLength() const
returns the mean edge square distance of the contour

InternalForceContour2D* getInternalForce() const
returns the internal force type applying on the whole contour

virtual bool continueDeformation()
whether this deformable model should still be deformed

virtual ContourLine* createLine(ContourLine::Topology top)
create a new line : use a virtual function in order to create inherited lines

AContourLine2D* getFirstLine(void) const
returns the first Line of type L *

void applyLine(void (AContourLine2D::*fn)(void))
Apply a function on all lines of a contour
Parameters:
fn - a function of prototype void (AContourLine2D::*fn)(void) that is a member function of type T that must be derived class of Contour::Line

void applyLine(void (AContourLine2D::*fn) (void) const)
Apply a function on all lines of a contour
Parameters:
fn - a function of prototype void (AContourLine2D::*fn)(void)const that is a member function of type T that must be derived class of Contour::Line

void applyVertex(void (ActiveVertexContour2D::*fn)(void))
Apply a function on all vertices of a contour @psaram fn a function of prototype void (ActiveVertexContour2D::*fn)(void) that is a member function of type T that must be derived class of VertexContour

void applyVertex(void (ActiveVertexContour2D::*fn)(const double), const double v)
Apply a function on all vertices of a contour
Parameters:
fn - a function of prototype void (ActiveVertexContour2D::*fn)(double) that is a member function of type T that must be derived class of VertexContour
v - a value to be passed to the member function

void applyVertexUInt(void (ActiveVertexContour2D::*fn)(const unsigned int), const unsigned int v)
Apply a function on all vertices of a contour
Parameters:
fn - a function of prototype void (ActiveVertexContour2D::*fn)(double) that is a member function of type T that must be derived class of VertexContour
v - a value to be passed to the member function

void readMainModule(GFInput &input) throw(InvalidContour)
the function that read the contour topology and geometry

void skipMainModule(GFInput &input)
the function that skip the contour topology and geometry

void writeMainModule(GFOutput &output)
the function that write the contour topology and geometry

void readInternalForceModule(GFInput &input)
the function that reads the internal force set on all contour vertices

void skipInternalForceModule(GFInput &input)
the function that skips the internal force set on all contour vertices

void writeInternalForceModule(GFOutput &output)
the function that writes the internal force set on all contour vertices

void readPositionConstraintModule(GFInput &input)
the function that reads the position constraint existing on the contour

void skipPositionConstraintModule(GFInput &input)
the function that skips the position constraint existing on the contour

void writePositionConstraintModule(GFOutput &output)
the function that writes the position constraint existing on the contour

void readForceConstraintModule(GFInput &input)
the function that reads the force constraint existing on the contour

void skipForceConstraintModule(GFInput &input)
the function that skips the force constraint existing on the contour

void writeForceConstraintModule(GFOutput &output)
the function that writes the force constraint existing on the contour

void readAlphaModule(GFInput &input)
the function that reads the internal force weight for each contour vertex

void skipDoubleVertexModule(GFInput &input)
the function that skips the internal force weight for each contour vertex

void writeAlphaModule(GFOutput &output)
the function that writes the internal force weight for each contour vertex

void readBetaModule(GFInput &input)
the function that reads the external force weight for each contour vertex

void writeBetaModule(GFOutput &output)
the function that writes the external force weight for each contour vertex

void readRigidityModule(GFInput &input)
the function that reads the rigidity parameter for each contour vertex

void skipIntVertexModule(GFInput &input)
the function that skip an integer value written for each contour vertex

void writeRigidityModule(GFOutput &output)
the function that writes the rigidity parameter for each contour vertex

void readShapePositionModule(GFInput &input)
the function that reads the shape position for each contour vertex

void skipVectorVertexModule(GFInput &input)
the function that skip a 2D vector written for each contour vertex

void writeShapePositionModule(GFOutput &output)
the function that write the shape position for each contour vertex

void readRangeInformation(GFInput &input)
the function that reads the range Information stored at some vertices

void skipRangeInformation(GFInput &input)
the function that skips the range Information stored at some vertices

void writeRangeInformation(GFOutput &output)
the function that writes a 2D vector written for each contour vertex

void readMobilityModule(GFInput &input)
the function that reads the mobility (if the vertex is fixed or not) for each contour vertex

void writeMobilityModule(GFOutput &output)
the function that writes the mobility (if the vertex is fixed or not) for each contour vertex

void addContour(const ActiveContour2D *contour)
add in the current contour a copy of another contour
Parameters:
contour - the contour whose vertices are to be copied and inserted in the current contour

RangeInformation* getRangeInformation() const
get the range information applied on all vertices

void setRangeInformation( RangeInformation * ri)
set the range information applied on all vertices

virtual void mergeEdges(EdgeActiveContour2D *e1, EdgeActiveContour2D *e2)
Merge two edges belonging

TclObject* getTclInterface() const
returns the interface associated with the contour

virtual void translate(const Vec2& t)
translate the contour

virtual void scale(const double scale)
scale the active contour

virtual void rotate(const Rotation2D &rotation)
rotate the active contour

EdgeActiveContour2D* selectedEdge
the selected Edge

EdgeActiveContour2D* previousSelectedEdge
the selected Edge

float selectedEdgeColor[3]
the color of the selected edge

static const float defaultSelectedEdgeColor[3]
the default color of the selected edge

float selectedEdgeWidth
the width of the selected edge

static const float defaultSelectedEdgeWidth
the default width of the selected edge

static const bool defaultShowClosestPoint
the default value of showClosestPoint

bool showClosestPoint
Should the closest point be displayed?

static const bool defaultShowRangeDistance
the default value of showRangeDistance

bool showRangeDistance
Should the range distance be displayed

virtual void redraw(Camera2D *cam)
the redraw function

ActiveVertexContour2D* getSelectedActiveVertex() const
gives the selected vertex as an ActiveVertexContour2D

void getSelectedEdgeColor(float &r, float &g, float &b) const
Returns the display color of the selected edge

float getSelectedEdgeWidth() const
Returns the width of the selected edge

EdgeActiveContour2D* getSelectedEdge() const
Returns the selected edge

EdgeActiveContour2D* getPreviousSelectedEdge() const
Returns the previous selected edge

void setSelectedEdgeColor(const float r, const float g, const float b)
Sets the display color of selected edge

void setSelectedEdgeWidth(const float w)
Sets the width of the selected Edge

void setSelectedEdge(EdgeActiveContour2D *e)
sets the selected edge of a contour
Parameters:
e - an edge

void setShowClosestPoint(const bool b)
sets the boolean indicating if the closest points should be displayed
Parameters:
b - a boolean

void setShowRangeDistance(const bool b)
sets the boolean indicating if the range distance should be displayed
Parameters:
b - a boolean

bool getShowRangeDistance() const
returns the boolean indicating if the range distance should be displayed

bool getShowClosestPoint() const
returns the boolean indicating if the closest points should be displayed

void initColor(void)
initializes the selected edge graphics color and width

ActiveVertexContour2D* getSelectedActiveVertex2D() const
returns the selected active vertex

AContourLine2D* getSelectedActiveLine2D() const
returns the selected active line

void selectEdge(const Vec2 &pixel, Camera2D *cam)
select the closest edge from a given pixel position
Parameters:
pixel - a pixel position given in camera coordinates (must be transformed with cam->mapToWorld())
cam - a 2D camera

void grabVertex(const Vec2 &pixel, Camera2D *cam)
applies an external force that attract the closest contour vertex towards a pixel position
Parameters:
pixel - a pixel position given in camera coordinates (must be transformed with cam->mapToWorld())
cam - a 2D camera

virtual void selectObject(const Vec2 pixel, Camera2D *cam)
a function that allows to perform a task on a data object from a mouse click
Parameters:
pixel - a pixel position given in camera coordinates (must be transformed with cam->mapToWorld())
cam - the camera *from which the object is selected


Direct child classes:
SliceActiveContour2D

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