In file contour/ActiveContour3D.h:

class ActiveContour3D : public Contour3D, public DeformableModel3D

a 3D contour active contour that may have several connected components Each component is a ActiveContourLine object which may be an opened or closed line

Inheritance:


Public Methods

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 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 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 3D vector written for each contour vertex
void writeShapePositionModule (GFOutput &output)
the function that write the shape position for each contour vertex
void readConnectionsModule (GFInput &input)
the function that reads the shape position for each contour vertex
void skipConnectionsModule (GFInput &input)
the function that skip a 3D vector written for each contour vertex
void writeConnectionsModule (GFOutput &output)
the function that write the shape position for each contour vertex
void addContour (const ActiveContour3D *contour)
add in the current contour a copy of another contour
virtual ContourLine* createLine (ContourLine::Topology top)
create a new line : use a virtual function in order to create inherited lines
TclObject* getTclInterface () const
returns the interface associated with the contour
virtual void translate (const Vec3& t)
translate the contour
virtual void scale (const double scale)
scale the active contour
virtual void rotate (const Rotation3D &rotation)
rotate the active contour
virtual void redraw (Camera3D *cam)
the redraw function
ActiveVertexContour3D* getSelectedActiveVertex () const
gives the selected vertex as an ActiveVertexContour3D
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
EdgeActiveContour3D* getSelectedEdge () const
Returns the selected edge
EdgeActiveContour3D* 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 setSelectedEdge (EdgeActiveContour3D *e)
sets the selected edge of a contour
void setSelectedEdgeWidth (const float w)
Sets the width of the selected Edge
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
ActiveVertexContour3D* getSelectedActiveVertex3D () const
returns the selected active vertex
AContourLine3D* getSelectedActiveLine3D () const
returns the selected active line
void selectEdge (const Vec2 &pixel, Camera3D *cam)
select the closest edge from a given pixel position
void grabVertex (const Vec2 &pixel, Camera3D *cam)
applies an external force that attract the closest contour vertex towards a pixel position
virtual void selectObject (const Vec2 pixel, Camera3D *cam)
a function that allows to perform a task on a 3D active contour from a mouse click

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
EdgeActiveContour3D* selectedEdge
the selected Edge
EdgeActiveContour3D* 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
ActiveLine3DIterator firstLine (void) const
returns a line Iterator of type ContourLine2D on the first line
ActiveLine3DIterator lastLine (void) const
returns a line Iterator of type ContourLine2D on the last line
ActiveVertexContour3DIterator firstVertex () const
returns a VertexIterator of type ActiveVertexContour3D belonging to the contour
void applyLine (void (AContourLine3D::*fn)(void))
Apply a function on all lines of a contour
void applyLine (void (AContourLine3D::*fn) (void) const)
Apply a function on all lines of a contour
void applyVertex (void (ActiveVertexContour3D::*fn)(void))
Apply a function on all vertices of a contour
void applyVertexUInt (void (ActiveVertexContour3D::*fn)(const unsigned int), const unsigned int v)
Apply a function on all vertices of a contour
void applyVertex (void (ActiveVertexContour3D::*fn)(const double), const double v)
Apply a function on all vertices of a contour
void addLine (ContourLine *l)
add the line in the first position of the line list
void computeEdgeDirection ()
The internal force init function
void computeSimplexAngle () throw(ContourLine3D::IllegalGeometry)
The internal force init function
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
RangeInformation* getRangeInformation () const
get the range information applied on all vertices
void setRangeInformation ( RangeInformation * ri)
set the range information applied on all vertices
InternalForceContour3D* getInternalForce () const
returns the internal force type applying on the whole contour
void computeMaximumRigidity ()
computes the maximum rigidity
virtual RangeInformation* defaultRangeInformation () const
returns the default RangeInformation structure that should be stored in a active vertex
void computeInternalForce ()
compute the internal force for all contour vertices by calling internalForce->computeInternalForce(this)
void setInternalForce (InternalForceContour3D *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
virtual 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
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
virtual bool continueDeformation ()
whether this deformable model should still be deformed
void initColor (void)
initializes the selected edge graphics color and width

Protected

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

Private Fields

ObjectsList vertexConnectionList
list of connected vertices
InternalForceContour3D* internalForce
the internal force that applies on most contour vertices

Private Methods

void initGeometry ()
Geometric routines

Inherited from Contour3D:

Public Methods

void read(TclString filename)
void write(TclString filename)
Vec3 computeCenter() const
void updateCenter(Vec3& center, unsigned int& n)
double updateRadius(const Vec3& center)
void readModule(GFInput &input)
void skipModule(GFInput &input)
void writeModule(GFOutput &output)
void updateBoundingBox()
double computeClosestDistance(DataTypes::MouseClick &mc) const
void selectVertex(const Vec2 &pixel, Camera3D *cam)
void selectLine(const Vec2 &pixel, Camera3D *cam)
VertexContour3D* getSelectedVertex() const
void setSelectedLine(ContourLine3D *l)
void setSelectedVertex(VertexContour3D *v)
ContourLine3D* getSelectedLine() const

Public

Exception classes

class InvalidContour: public Exception
Exception when creating a 3D contour line without any vertices

Destructor

virtual ~Contour3D()
destructor of a 3D contour

Protected Fields

VertexContour3D* selectedVertex
ContourLine3D* 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

template L* getFirstLine(void) const
ObjectsList <ContourLine> ::iterator firstLineContour() const
ObjectsList <ContourLine> ::iterator lastLineContour() const
unsigned int getNbLines() const
unsigned int getNbVertices() const
virtual void mergeEdges(EdgeContour *e1, EdgeContour *e2)
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

a 3D contour active contour that may have several connected components Each component is a ActiveContourLine object which may be an opened or closed line
ObjectsList vertexConnectionList
list of connected vertices

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

void initGeometry()
Geometric routines

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

RangeInformation* rangeInformation
the range information used for all vertices

void initGeneralFormat()
sets the general format routines

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

Constructors

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

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

ActiveContour3D(const unsigned int nbLines, const unsigned int *nbVertices, Vec3 **array, const ContourLine::Topology *top, Scene3D *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 3D 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 Scene3D where the contour should be placed (since it is a Data3D and DeformableModel3D)

ActiveLine3DIterator firstLine(void) const
returns a line Iterator of type ContourLine2D on the first line
Returns:
a CastIterator of type ContourLine2D on the lines of a Contour

ActiveLine3DIterator lastLine(void) const
returns a line Iterator of type ContourLine2D on the last line
Returns:
a CastIterator of type ContourLine2D on the lines of a Contour

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

void applyLine(void (AContourLine3D::*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 (AContourLine3D::*fn) (void) const)
Apply a function on all lines of a contour
Parameters:
fn - a function of prototype void (AContourLine3D::*fn)(void)const that is a member function of type T that must be derived class of Contour::Line

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

void applyVertexUInt(void (ActiveVertexContour3D::*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 applyVertex(void (ActiveVertexContour3D::*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 addLine(ContourLine *l)
add the line in the first position of the line list

void computeEdgeDirection()
The internal force init function

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

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

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

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

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

void computeMaximumRigidity()
computes the maximum rigidity

virtual RangeInformation* defaultRangeInformation() const
returns the default RangeInformation structure that should be stored in a active vertex

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

void setInternalForce(InternalForceContour3D *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

virtual 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

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

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

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 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 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 3D vector written for each contour vertex

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

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

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

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

void addContour(const ActiveContour3D *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

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

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

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

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

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

EdgeActiveContour3D* selectedEdge
the selected Edge

EdgeActiveContour3D* 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(Camera3D *cam)
the redraw function

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

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

EdgeActiveContour3D* getSelectedEdge() const
Returns the selected edge

EdgeActiveContour3D* 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 setSelectedEdge(EdgeActiveContour3D *e)
sets the selected edge of a contour
Parameters:
e - an edge

void setSelectedEdgeWidth(const float w)
Sets the width of the selected 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

ActiveVertexContour3D* getSelectedActiveVertex3D() const
returns the selected active vertex

AContourLine3D* getSelectedActiveLine3D() const
returns the selected active line

void selectEdge(const Vec2 &pixel, Camera3D *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 3D camera

void grabVertex(const Vec2 &pixel, Camera3D *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 3D camera

virtual void selectObject(const Vec2 pixel, Camera3D *cam)
a function that allows to perform a task on a 3D active contour 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


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