In file contour/Contour2DInit.h:

namespace yav class Contour2DInit : public Data2D

a class that defines 2D shape primitives that can be used to create several types of 2D contours

Inheritance:


Public Classes

enum PrimitiveType
the types of primitives
class Primitive : public ListElement<Primitive>
The basic primitive class
const PrimitiveType type
the type of the primitive
unsigned int reference
the index of the primitive used for display
Contour2DInit* parent
the object containing the primitive
const Contour2DInit* getParent () const
returns the parent Contour2DInit object
unsigned int getReference () const
returns the reference of the primitive
PrimitiveType getPrimitiveType () const
returns the type of primitive
virtual void draw (Camera2D *cam, DataTypes::RedrawOrigin f )
draws the primitive
virtual double getLength ()
returns the length of the primitive
Constructors
Primitive (const PrimitiveType &t, Contour2DInit *p)
create a primitive object
Destructor
virtual ~Primitive ()
dummy destructor
class CirclePrimitive : public Primitive
The circle primitive
Vec2 center
the center of the circle
double radius
the radius of the circle
void draw (Camera2D *cam, DataTypes::RedrawOrigin f)
draws the circle primitive
Constructors
CirclePrimitive (const Vec2 &c, const double r, Contour2DInit *p)
create a circle primitive
Destructor
virtual ~CirclePrimitive ()
dummy destructor
double getLength ()
returns the length of the circle
void setRadius (const double r)
set the radius of the circle
void setCenter (const Vec2 &c)
set the center of the circle
Vec2 getCenter () const
get the center of the circle
double getRadius () const
get the radius of the circle
class EllipsePrimitive : public Primitive
The ellipse primitive
Vec2 center
the center of the ellipse
double radiusX
the radius of the ellipse in the X direction
double radiusY
the radius of the ellipse in the Y direction
void draw (Camera2D *cam, DataTypes::RedrawOrigin f)
draws the circle primitive
Constructors
EllipsePrimitive (const Vec2 &c, const double rx, const double ry, Contour2DInit *p)
create a ellipse primitive
Destructor
virtual ~EllipsePrimitive ()
dummy destructor
double getLength ()
returns the length of the ellipse
void setRadiusX (const double rx)
set the X radius of the ellipse
void setRadiusY (const double ry)
set the Y radius of the ellipse
void setCenter (const Vec2 &c)
set the center of the ellipse
Vec2 getCenter () const
get the center of the ellipse
double getRadiusX () const
get the X radius of the ellipse
double getRadiusY () const
get the Y radius of the ellipse
class RectanglePrimitive : public Primitive
The rectangle primitive
Vec2 corner1
the first corner of the rectangle
Vec2 corner2
the second corner of the rectangle
void draw (Camera2D *cam, DataTypes::RedrawOrigin f)
draws the rectangle primitive
Constructors
RectanglePrimitive (const Vec2 &c1, const Vec2 &c2, Contour2DInit *p)
create a ellipse primitive
Destructor
virtual ~RectanglePrimitive ()
dummy destructor
double getLength ()
returns the length of the rectangle
void setFirstCorner (const Vec2 &c1)
set the first corner
void setSecondCorner (const Vec2 &c2)
set the second corner
Vec2 getFirstCorner () const
get the first corner of the rectangle
Vec2 getSecondCorner () const
get the second corner of the rectangle
class PolygonPrimitive : public Primitive
The polygon primitive i
std::list > vertexList
the list of vertices
bool closed
topology ie if the polygon is closed or opened
void draw (Camera2D *cam, DataTypes::RedrawOrigin f)
draws the circle primitive
Constructors
PolygonPrimitive (const bool isClosed, const Vec2 &c1, Contour2DInit *p)
create a polygon primitive
Destructor
virtual ~PolygonPrimitive ()
dummy destructor
double getLength ()
returns the length of the polygon
bool isClosed ()
is the polygon closed or opened
void addVertex (const Vec2 &v)
add a vertex to the list
Vec2 & getLastVertex ()
gets the last vertex
std::list > ::iterator firstVertex ()
get an iterator on the list of vertices from the first vertex
std::list > ::iterator lastVertex ()
get an iterator on the list of vertices starting from the last vertex

Public Methods

ObjectsList <Primitive> ::iterator firstPrimitive ()
returns the first item of the primitive list
ObjectsList <Primitive> ::iterator lastPrimitive ()
returns the last item of the primitive list
unsigned int getMaxNbVertices () const
get the maximum number of vertices when creating a Contour2D or ActiveContour2D
void setMaxNbVertices (const unsigned int max)
set the maximum number of vertices when creating a Contour2D or ActiveContour2D
TclObject* getTclInterface () const
get the contour Tcl interface
void getPrimitiveColor (double &r, double &g, double &b)
returns the color of primitives
void getSelectedPrimitiveColor (double &r, double &g, double &b)
returns the color of the selected primitive
Primitive* getSelectedPrimitive () const
gets the selected primitive
void setSelectedPrimitive (Primitive *p)
sets the selected primitive
virtual void redraw (Camera2D *c)
the redraw function
virtual void updateCenter (Vec2 ¢er, unsigned int &n)
Do not modifies the center of the scene
virtual double updateRadius (const Vec2 ¢er)
Do not modifies the radius of the scene
virtual double computeClosestDistance (MouseClick& mc) const
dummy routine for selecting the init contour that should neither be called

Public

Constructors
Contour2DInit (Scene2D *scene=NULL)
create an empty Contour2DInit
Destructor
virtual ~Contour2DInit ()
dummy destructor

Private Fields

ObjectsList <Primitive> primitiveList
the list of primitives
static const unsigned int defaultMaxNbVertices
the default maximum number of vertices
unsigned int maxNbVertices
the maximum number of vertices when creating a Contour2D or ActiveContour2D
Primitive* selectedPrimitive
the selected primitive
static const float defaultPrimitiveColor [3]
the default primitive color
float primitiveColor [3]
the primitive color
static const float defaultSelectedPrimitiveColor [3]
the default selected primitive color
float selectedPrimitiveColor [3]
the selected primitive color

Documentation

a class that defines 2D shape primitives that can be used to create several types of 2D contours
enum PrimitiveType
the types of primitives

class Primitive: public ListElement<Primitive>
The basic primitive class

const PrimitiveType type
the type of the primitive

unsigned int reference
the index of the primitive used for display

Contour2DInit* parent
the object containing the primitive

const Contour2DInit* getParent() const
returns the parent Contour2DInit object

unsigned int getReference() const
returns the reference of the primitive

PrimitiveType getPrimitiveType() const
returns the type of primitive

virtual void draw(Camera2D *cam, DataTypes::RedrawOrigin f )
draws the primitive

virtual double getLength()
returns the length of the primitive

Constructors

Primitive(const PrimitiveType &t, Contour2DInit *p)
create a primitive object
Parameters:
t - the type of primitive
the - Contour2DInit where the primitive belongs

Destructor

virtual ~Primitive()
dummy destructor

class CirclePrimitive: public Primitive
The circle primitive

Vec2 center
the center of the circle

double radius
the radius of the circle

void draw(Camera2D *cam, DataTypes::RedrawOrigin f)
draws the circle primitive

Constructors

CirclePrimitive(const Vec2 &c, const double r, Contour2DInit *p)
create a circle primitive
Parameters:
c - the circle center
r - the circle radius
p - the init contour where the circle belong

Destructor

virtual ~CirclePrimitive()
dummy destructor

double getLength()
returns the length of the circle

void setRadius(const double r)
set the radius of the circle

void setCenter(const Vec2 &c)
set the center of the circle

Vec2 getCenter() const
get the center of the circle

double getRadius() const
get the radius of the circle

class EllipsePrimitive: public Primitive
The ellipse primitive

Vec2 center
the center of the ellipse

double radiusX
the radius of the ellipse in the X direction

double radiusY
the radius of the ellipse in the Y direction

void draw(Camera2D *cam, DataTypes::RedrawOrigin f)
draws the circle primitive

Constructors

EllipsePrimitive(const Vec2 &c, const double rx, const double ry, Contour2DInit *p)
create a ellipse primitive
Parameters:
c - the ellipse center
rx - the ellipse radius in the X direction
ry - the ellipse radius in the Y direction
p - the init contour where the ellipse belong

Destructor

virtual ~EllipsePrimitive()
dummy destructor

double getLength()
returns the length of the ellipse

void setRadiusX(const double rx)
set the X radius of the ellipse

void setRadiusY(const double ry)
set the Y radius of the ellipse

void setCenter(const Vec2 &c)
set the center of the ellipse

Vec2 getCenter() const
get the center of the ellipse

double getRadiusX() const
get the X radius of the ellipse

double getRadiusY() const
get the Y radius of the ellipse

class RectanglePrimitive: public Primitive
The rectangle primitive

Vec2 corner1
the first corner of the rectangle

Vec2 corner2
the second corner of the rectangle

void draw(Camera2D *cam, DataTypes::RedrawOrigin f)
draws the rectangle primitive

Constructors

RectanglePrimitive(const Vec2 &c1, const Vec2 &c2, Contour2DInit *p)
create a ellipse primitive
Parameters:
c1 - the first rectangle corner
c2 - the second rectangle corner
p - the init contour where the ellipse belong

Destructor

virtual ~RectanglePrimitive()
dummy destructor

double getLength()
returns the length of the rectangle

void setFirstCorner(const Vec2 &c1)
set the first corner

void setSecondCorner(const Vec2 &c2)
set the second corner

Vec2 getFirstCorner() const
get the first corner of the rectangle

Vec2 getSecondCorner() const
get the second corner of the rectangle

class PolygonPrimitive: public Primitive
The polygon primitive i.e. a closed or open polygonal line

std::list > vertexList
the list of vertices

bool closed
topology ie if the polygon is closed or opened

void draw(Camera2D *cam, DataTypes::RedrawOrigin f)
draws the circle primitive

Constructors

PolygonPrimitive(const bool isClosed, const Vec2 &c1, Contour2DInit *p)
create a polygon primitive
Parameters:
isClosed - boolean indicating the polygon topology
c1 - the first polygon vertex
p - the init contour where the ellipse belong

Destructor

virtual ~PolygonPrimitive()
dummy destructor

double getLength()
returns the length of the polygon

bool isClosed()
is the polygon closed or opened

void addVertex(const Vec2 &v)
add a vertex to the list

Vec2 & getLastVertex()
gets the last vertex

std::list > ::iterator firstVertex()
get an iterator on the list of vertices from the first vertex

std::list > ::iterator lastVertex()
get an iterator on the list of vertices starting from the last vertex

ObjectsList <Primitive> primitiveList
the list of primitives

static const unsigned int defaultMaxNbVertices
the default maximum number of vertices

unsigned int maxNbVertices
the maximum number of vertices when creating a Contour2D or ActiveContour2D

Constructors

Contour2DInit(Scene2D *scene=NULL)
create an empty Contour2DInit
Parameters:
scene - the 2D scene where the contour should be inserted. If the scene is NULL then the first exisiting scene is chosen

Destructor

virtual ~Contour2DInit()
dummy destructor

ObjectsList <Primitive> ::iterator firstPrimitive()
returns the first item of the primitive list

ObjectsList <Primitive> ::iterator lastPrimitive()
returns the last item of the primitive list

unsigned int getMaxNbVertices() const
get the maximum number of vertices when creating a Contour2D or ActiveContour2D

void setMaxNbVertices(const unsigned int max)
set the maximum number of vertices when creating a Contour2D or ActiveContour2D

TclObject* getTclInterface() const
get the contour Tcl interface

Primitive* selectedPrimitive
the selected primitive

static const float defaultPrimitiveColor[3]
the default primitive color

float primitiveColor[3]
the primitive color

static const float defaultSelectedPrimitiveColor[3]
the default selected primitive color

float selectedPrimitiveColor[3]
the selected primitive color

void getPrimitiveColor(double &r, double &g, double &b)
returns the color of primitives

void getSelectedPrimitiveColor(double &r, double &g, double &b)
returns the color of the selected primitive

Primitive* getSelectedPrimitive() const
gets the selected primitive

void setSelectedPrimitive(Primitive *p)
sets the selected primitive

virtual void redraw(Camera2D *c)
the redraw function

virtual void updateCenter(Vec2 ¢er, unsigned int &n)
Do not modifies the center of the scene

virtual double updateRadius(const Vec2 ¢er)
Do not modifies the radius of the scene

virtual double computeClosestDistance(MouseClick& mc) const
dummy routine for selecting the init contour that should neither be called


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