In file contour/Contour3D.h:

class Contour3D : public Contour, public Data3D, public GeneralFormat

a three-dimensional contour that only includes geometric information

Inheritance:


Public Methods

void read (TclString filename)
call the read function associated with the General Format Library
void write (TclString filename)
call the write function associated with the General Format Library
VertexContour3DIterator firstVertex () const
returns a VertexIterator of type VertexContour3D pointing on the contour
Line3DIterator firstLine (void) const
returns a line Iterator of type ContourLine2D on the first item
Line3DIterator lastLine (void) const
returns a line Iterator of type ContourLine2D on the last item
Vec3 computeCenter () const
updates and returns the center of the 3D contour but without updating the contour center private member
void updateCenter (Vec3& center, unsigned int& n)
updates the center position of the 3D contour
double updateRadius (const Vec3& center)
Given a 3D point, returns the smallest sphere radius enclosing the 3D contour @aparam center give the sphere center
void translate (const Vec3& t)
translate a 3D contour
void scale (const double scale)
scale a 3D contour
void rotate (const Rotation3D &rotation)
rotate a 3D contour around its center
void readModule (GFInput &input)
reads the geometric description of the 3D contour
void skipModule (GFInput &input)
skips the geometric description of the 3D contour
void writeModule (GFOutput &output)
writes the geometric description of the 3D contour
void addContour (const Contour3D *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
void updateBoundingBox ()
recompute the bounding box geometry
void redraw (Camera3D *cam)
redraw a 3D contour in a camera
double computeClosestDistance (DataTypes::MouseClick &mc) const
returns the distance between a mouse position and a given contour
void selectVertex (const Vec2 &pixel, Camera3D *cam)
select the contour vertex closest from a given position and set the selectedVertex variable
void selectLine (const Vec2 &pixel, Camera3D *cam)
select the contour line closest from a given position and set the selectedLine variable
virtual void selectObject (const Vec2 pixel, Camera3D *cam)
a function that allows to perform a task on a data object from a mouse click
VertexContour3D* getSelectedVertex () const
returns the selected Vertex
void setSelectedLine (ContourLine3D *l)
set the selected contour line
void setSelectedVertex (VertexContour3D *v)
set the selected vertex
ContourLine3D* getSelectedLine () const
returns the selected vertex

Public

Exception classes
class InvalidContour : public Exception
Exception when creating a 3D contour line without any vertices
Constructors
Contour3D (const TclString filename, Scene3D *scene=NULL)
create a 3D contour from a file
Contour3D (const Contour3D *_contour)
copy constructor : create a copy of a given 3D contour
Contour3D (Scene3D *scene=NULL)
create an empty 3D contour from a file
Contour3D (const unsigned int nbLines, std::list nbVertices, std::list< std::list< Vec3 > > array, std::list<ContourLine::Topology> top, Scene3D *scene=NULL)
create a 3D contour given an vector of vertex vector
Destructor
virtual ~Contour3D ()
destructor of a 3D contour

Protected Fields

VertexContour3D* selectedVertex
the selected vertex
ContourLine3D* selectedLine
the selected line

Protected Methods

virtual void initGeometry ()
function for updating geometric parameters when the geometry has been updated

Private Methods

void initFormat ()
the function creating the module for General Format I/O

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
void addLine(ContourLine *l)
unsigned int getNbLines() const
unsigned int getNbVertices() const
virtual void mergeEdges(EdgeContour *e1, EdgeContour *e2)
template void applyLine(void (T::*fn)(const unsigned int ), const unsigned int v)
template void applyVertex(void (T::*fn)(void))
template void applyVertex(void (T::*fn)(const double), const double v)
template void applyVertex(void (T::*fn)(const unsigned int ), const unsigned int v)
void initColor()
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 three-dimensional contour that only includes geometric information. Topological operators can be applied on this type of contours.
Exception classes

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

virtual void initGeometry()
function for updating geometric parameters when the geometry has been updated

void initFormat()
the function creating the module for General Format I/O

void read(TclString filename)
call the read function associated with the General Format Library

void write(TclString filename)
call the write function associated with the General Format Library

Constructors

Contour3D(const TclString filename, Scene3D *scene=NULL)
create a 3D contour from a file
Parameters:
filename - file name describing a 3D contour
scene - the 3D scene where the contour should be inserted. If the scene is NULL then the first exisiting scene is chosen

Contour3D(const Contour3D *_contour)
copy constructor : create a copy of a given 3D contour
Parameters:
_contour - another contour 3D

Contour3D(Scene3D *scene=NULL)
create an empty 3D contour from a file
Parameters:
scene - the 3D scene where the contour should be inserted. If the scene is NULL then the first exisiting scene is chosen

Contour3D(const unsigned int nbLines, std::list nbVertices, std::list< std::list< Vec3 > > array, std::list<ContourLine::Topology> top, Scene3D *scene=NULL)
create a 3D contour given an vector of vertex vector
Parameters:
nbLines - the number of lines in the contour
nbVertices - a vector describing the number of vertices for each line
array - a 3D vector describing the vertex position for each line : array[i][j] gives the position of the jth vertex of the ith line
top - a 3D vector describing the topology (closed or open) for each line
scene - the 3D scene where the contour should be inserted. If the scene is NULL then the first exisiting scene is chosen

Destructor

virtual ~Contour3D()
destructor of a 3D contour

VertexContour3DIterator firstVertex() const
returns a VertexIterator of type VertexContour3D pointing on the contour
Returns:
s the VertexIterator pointing on the first contour vertex

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

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

Vec3 computeCenter() const
updates and returns the center of the 3D contour but without updating the contour center private member

void updateCenter(Vec3& center, unsigned int& n)
updates the center position of the 3D contour
Parameters:
center - a vector that is set to the contour center : must be initialized as (0.0,0.0,0.0)
n - a integer that is set to the total number of contour vertices : it does not need to be initialized

double updateRadius(const Vec3& center)
Given a 3D point, returns the smallest sphere radius enclosing the 3D contour @aparam center give the sphere center

void translate(const Vec3& t)
translate a 3D contour
Parameters:
t - the 3D translation vector

void scale(const double scale)
scale a 3D contour
Parameters:
s - the scale factor (should be greater than 0)

void rotate(const Rotation3D &rotation)
rotate a 3D contour around its center
Parameters:
rotation - the 3D rotation

void readModule(GFInput &input)
reads the geometric description of the 3D contour

void skipModule(GFInput &input)
skips the geometric description of the 3D contour

void writeModule(GFOutput &output)
writes the geometric description of the 3D contour

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

VertexContour3D* selectedVertex
the selected vertex

ContourLine3D* selectedLine
the selected line

void updateBoundingBox()
recompute the bounding box geometry

void redraw(Camera3D *cam)
redraw a 3D contour in a camera
Parameters:
cam - the 3D camera where to draw the contour

double computeClosestDistance(DataTypes::MouseClick &mc) const
returns the distance between a mouse position and a given contour
Parameters:
mc - the structure containing the mouse position

void selectVertex(const Vec2 &pixel, Camera3D *cam)
select the contour vertex closest from a given position and set the selectedVertex variable
Parameters:
pixel - a pixel position given in camera coordinates (must be transformed with cam->mapToWorld())
cam - a 3D camera

void selectLine(const Vec2 &pixel, Camera3D *cam)
select the contour line closest from a given position and set the selectedLine variable
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 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

VertexContour3D* getSelectedVertex() const
returns the selected Vertex

void setSelectedLine(ContourLine3D *l)
set the selected contour line
Parameters:
l - a contour line

void setSelectedVertex(VertexContour3D *v)
set the selected vertex
Parameters:
v - a contour vertex

ContourLine3D* getSelectedLine() const
returns the selected vertex


Direct child classes:
ActiveContour3D

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