# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

# vlVG::VectorGraphics Class Reference

The VectorGraphics class is used in conjuction with SceneManagerVectorGraphics to generate and render 2D vector graphics. More...

`#include <VectorGraphics.hpp>`

Inheritance diagram for vlVG::VectorGraphics:

List of all members.

## Classes

class | ImageState
class | State

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| VectorGraphics ()
const vl::ActorCollection * | actors () const
| Returns the list of Actor[s] generated by a VectorGraphics object.
vl::ActorCollection * | actors ()
| Returns the list of Actor[s] generated by a VectorGraphics object.
vl::Actor * | drawLine (double x1, double y1, double x2, double y2)
| Renders a line starting a point <x1,y1> and ending at point <x2,y2>.
vl::Actor * | drawLines (const std::vector< vl::dvec2 > &ln)
| Renders a set of lines. The 'ln' parameter shoud contain N pairs of vl::dvec2. Each pair defines a line segment.
vl::Actor * | drawLineStrip (const std::vector< vl::dvec2 > &ln)
| Renders a line passing through the points defined by 'ln'.
vl::Actor * | drawLineLoop (const std::vector< vl::dvec2 > &ln)
| Renders a closed line passing through the points defined by 'ln'.
vl::Actor * | fillPolygon (const std::vector< vl::dvec2 > &poly)
| Renders a convex polygon whose corners are defined by 'poly'.
vl::Actor * | fillTriangles (const std::vector< vl::dvec2 > &triangles)
| Renders a set of triangles. The 'triangles' parameters must contain N triplets of vl::dvec2. Each triplet defines a triangle.
vl::Actor * | fillTriangleFan (const std::vector< vl::dvec2 > &fan)
| Renders a triangle fan.
vl::Actor * | fillTriangleStrip (const std::vector< vl::dvec2 > &strip)
| Renders a strip of triangles as defined by the OpenGL primitive GL_TRIANGLE_STRIP.
vl::Actor * | fillQuads (const std::vector< vl::dvec2 > &quads)
| Renders a set of rectangles as defined by the OpenGL primitive GL_QUADS.
vl::Actor * | fillQuadStrip (const std::vector< vl::dvec2 > &quad_strip)
| Renders a set of rectangles as defined by the OpenGL primitive GL_QUAD_STRIP.
vl::Actor * | drawPoint (double x, double y)
| Renders a single point. This is only an utility function. If you want to draw many points use drawPoints(const std::vector<vl::dvec2>& pt) instead.
vl::Actor * | drawPoints (const std::vector< vl::dvec2 > &pt)
| Renders a set of points using the currently set pointSize(), color() and image().
vl::Actor * | drawEllipse (double origx, double origy, double xaxis, double yaxis, int segments=64)
| Renders the outline of an ellipse.
vl::Actor * | fillEllipse (double origx, double origy, double xaxis, double yaxis, int segments=64)
| Renders an ellipse.
vl::Actor * | drawQuad (double left, double bottom, double right, double top)
| Utility function that renders the outline of a quad.
vl::Actor * | fillQuad (double left, double bottom, double right, double top)
| Utility function that renders a single quad.
void | startDrawing ()
| Starts the drawing process.
void | continueDrawing ()
| Continues the rendering on a VectorGraphics object.
void | endDrawing (bool release_cache=true)
| Ends the rendering on a VectorGraphics and releases the resources used during the Actor generation process.
void | clear ()
| Resets the VectorGraphics removing all the graphics objects and resetting its internal state.
void | setColor (const vl::fvec4 &color)
| The current color. Note that the current color also modulates the currently active image.
const vl::fvec4 & | color () const
| The current color. Note that the current color also modulates the currently active image.
void | setPointSize (int size)
| The current point size.
int | pointSize () const
| The current point size.
void | setImage (vl::Image *image)
| The current image used to texture the rendered objects. Note that the current color also modulates the currently active image.
const vl::Image * | image () const
| The current image used to texture the rendered objects. Note that the current color also modulates the currently active image.
vl::Image * | image ()
| The current image used to texture the rendered objects. Note that the current color also modulates the currently active image.
void | setPoint (vl::Image *image)
| Utility function equivalent to 'setImage(image); setPointSize(image->width());'.
void | setTextureMode (ETextureMode mode)
| The current texture mode.
ETextureMode | textureMode () const
| The current texture mode.
void | setLogicOp (vl::ELogicOp op)
| The current logic operation, see also http://www.opengl.org/sdk/docs/man/xhtml/glLogicOp.xml for more information.
vl::ELogicOp | logicOp () const
| The current logic operation.
void | setLineWidth (float width)
| The current line width, see also http://www.opengl.org/sdk/docs/man/xhtml/glLineWidth.xml for more information.
float | lineWidth () const
| The current line width.
void | setPointSmoothing (bool smooth)
| The current point smoothing mode.
bool | pointSmoothing () const
| The current point smoothing mode.
void | setLineSmoothing (bool smooth)
| The current line smoothing mode.
bool | lineSmoothing () const
| The current line smoothing mode.
void | setPolygonSmoothing (bool smooth)
| The current polygon smoothing mode.
bool | polygonSmoothing () const
| The current polygon smoothing mode.
void | setLineStipple (ELineStipple stipple)
| The current line stipple, see also http://www.opengl.org/sdk/docs/man/xhtml/glLineStipple.xml for more information.
void | setLineStipple (unsigned short stipple)
| The current line stipple.
unsigned short | lineStipple () const
| The current line stipple.
void | setPolygonStipple (EPolygonStipple stipple)
| The current polygon stipple, see also http://www.opengl.org/sdk/docs/man/xhtml/glPolygonStipple.xml for more information.
void | setPolygonStipple (unsigned char *stipple)
| The current polygon stipple.
const unsigned char * | polygonStipple () const
| The current polygon stipple.
unsigned char * | polygonStipple ()
| The current polygon stipple.
void | setAlphaFunc (vl::EFunction func, float ref_value)
| The current alpha function, see also http://www.opengl.org/sdk/docs/man/xhtml/glAlphaFunc.xml for more information.
void | getAlphaFunc (vl::EFunction &func, float &ref_value) const
| The current alpha function.
const void | setBlendFunc (vl::EBlendFactor src_rgb, vl::EBlendFactor dst_rgb, vl::EBlendFactor src_alpha, vl::EBlendFactor dst_alpha)
| The current blending factor, see also http://www.opengl.org/sdk/docs/man/xhtml/glBlendFunc.xml for more information.
void | getBlendFunc (vl::EBlendFactor &src_rgb, vl::EBlendFactor &dst_rgb, vl::EBlendFactor &src_alpha, vl::EBlendFactor &dst_alpha) const
| The current blending factor.
void | setBlendEquation (vl::EBlendEquation rgb_eq, vl::EBlendEquation alpha_eq)
| The current blend equation, see also http://www.opengl.org/sdk/docs/man/xhtml/glBlendEquation.xml for more information.
void | getBlendEquation (vl::EBlendEquation &rgb_eq, vl::EBlendEquation &alpha_eq) const
| The current blend equation.
void | setColorMask (bool r, bool g, bool b, bool a)
| The current color mask, see also http://www.opengl.org/sdk/docs/man/xhtml/glColorMask.xml for more information.
const vl::ivec4 & | colorMask () const
| The current color mask.
void | setStencilTestEnabled (bool enabled)
| If set to 'true' the stencil test and operations will be enabled.
bool | stencilTestEnabled () const
| If set to 'true' the stencil test and operations will be enabled.
void | setStencilMask (unsigned int mask)
| Current stencil mask, see also http://www.opengl.org/sdk/docs/man/xhtml/glStencilMask.xml for more information.
unsigned int | stencilMask () const
| Current stencil mask.
void | setStencilOp (vl::EStencilOp sfail, vl::EStencilOp dpfail, vl::EStencilOp dppass)
| Current stencil operation, see also http://www.opengl.org/sdk/docs/man/xhtml/glStencilOp.xml for more information.
void | getStencilOp (vl::EStencilOp &sfail, vl::EStencilOp &dpfail, vl::EStencilOp &dppass)
| Current stencil operation.
void | setStencilFunc (vl::EFunction func, int refval, unsigned int mask)
| The current stencil function, see also http://www.opengl.org/sdk/docs/man/xhtml/glStencilFunc.xml for more information.
void | getStencilFunc (vl::EFunction &func, int &refval, unsigned int &mask)
| The current stencil function.
void | setFont (const vl::String &name, int size, bool smooth=false)
| Sets the current Font.
void | setFont (const vl::Font *font)
| Sets the current Font.
void | setDefaultFont ()
| Sets the default Font.
const vl::Font * | font () const
| Returns the current Font.
void | setScissor (int x, int y, int width, int height)
| Defines the scissor box and enables the scissor test.
const vl::Scissor * | scissor () const
| Returns the currently active Scissor.
void | removeScissor ()
| Disables the Scissor test and clipping.
vl::Actor * | clearColor (const vl::fvec4 &color, int x=0, int y=0, int w=-1, int h=-1)
| Clears the specific area of the viewport.
vl::Actor * | clearStencil (int clear_val, int x=0, int y=0, int w=-1, int h=-1)
| Clears the specific area of the viewport.
vl::Actor * | drawText (vl::Text *text)
| Draw the specified Text object.
vl::Actor * | drawText (int x, int y, const vl::String &text, int alignment=vl::AlignBottom|vl::AlignLeft)
| Draws the specified text at the specified position.
vl::Actor * | drawText (const vl::String &text, int alignment=vl::AlignBottom|vl::AlignLeft)
| Draws the specified text.
vl::Actor * | drawActor (vl::Actor *actor, vl::Transform *transform=NULL, bool keep_effect=false)
| Draws the specified Actor with the specified Transform.
vl::Actor * | drawActorCopy (vl::Actor *actor, vl::Transform *transform=NULL, bool keep_effect=false)
| Like drawActor() but instead of drawing the given actor creates a copy of it and draws that.
const vl::dmat4 & | matrix () const
| Returns the current transform matrix.
void | setMatrix (const vl::dmat4 &matrix)
| Sets the current transform matrix.
void | resetMatrix ()
| Resets the current transform matrix.
void | rotate (double deg)
| Performs a rotation of 'deg' degrees around the z axis.
void | translate (double x, double y, double z=0.0)
| Translates the current transform matrix.
void | scale (double x, double y, double z=1.0)
| Scales the current transform matrix.
void | pushMatrix ()
| Pushes the current matrix in the matrix stack in order to restore it later with popMatrix().
void | popMatrix ()
| Pops the top most matrix in the matrix stack and sets it as the current matrix.
const std::vector< vl::dmat4 > & | matrixStack () const
| Returns the matrix stack.
void | pushState ()
| Pushes the current VectorGraphics state (including the matrix state) in the state stack in order to restore it later with popState().
void | popState ()
| Pops the top most state in the state stack and sets it as the current state.
void | pushScissor (int x, int y, int w, int h)
| Pushes the current scissor in the scissor stack in order to restore it later with popScissor() and activates a new one.
void | popScissor ()
| Pops the top most scissor in the scissor stack and sets it as the current scissor.
const std::vector< vl::ref < vl::Scissor > > & | scissorStack () const
| Returns the scissor stack.
void | setTransform (vl::Transform *transform)
| Binds the given Transform to all the Actor[s] that have been generated so far.
vl::Effect * | currentEffect ()
| Returns the Effect representing the current VectorGraphic's state.

## Detailed Description

The VectorGraphics class is used in conjuction with SceneManagerVectorGraphics to generate and render 2D vector graphics.

The VectorGraphics object is basically nothing more than an container of Actor[s] generated by functions like drawLines(), fillTriangles() etc. The Actor[s] are rendered in the order in which they are generated.

The VectorGraphics class features a set of advanced capabilites:

- Matrix transformations and matrix stack
- State stack
- All the blending operations supported by OpenGL
- All the stencil operations supported by OpenGL
- Texture mapping on all the primitives with automatic texture coordinate generation
- Several primitives like lines, points, quads, triangles, line strips, triangle strips, ellipses etc.
- Polygon and line stipple
- Text rendering
- Scissor test to clip the objects against a rectangular region
- Line and point smoothing
- Color logic operations

For more information please refer to the 2D Vector Graphics page.

## Constructor & Destructor Documentation

vlVG::VectorGraphics::VectorGraphics | ( |  | ) | `[inline]`

## Member Function Documentation

virtual const char* vlVG::VectorGraphics::className | ( |  | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Object.

const vl::ActorCollection* vlVG::VectorGraphics::actors | ( |  | ) | const`[inline]`

Returns the list of Actor[s] generated by a VectorGraphics object.

vl::ActorCollection* vlVG::VectorGraphics::actors | ( |  | ) | `[inline]`

Returns the list of Actor[s] generated by a VectorGraphics object.

vl::Actor* vlVG::VectorGraphics::drawLine | ( | double | x1,
|  | double | y1,
|  | double | x2,
|  | double | y2 |
| ) |  |  | `[inline]`

Renders a line starting a point <x1,y1> and ending at point <x2,y2>.

vl::Actor* vlVG::VectorGraphics::drawLines | ( | const std::vector< vl::dvec2 > & | ln | ) | `[inline]`

Renders a set of lines. The 'ln' parameter shoud contain N pairs of vl::dvec2. Each pair defines a line segment.

vl::Actor* vlVG::VectorGraphics::drawLineStrip | ( | const std::vector< vl::dvec2 > & | ln | ) | `[inline]`

Renders a line passing through the points defined by 'ln'.

vl::Actor* vlVG::VectorGraphics::drawLineLoop | ( | const std::vector< vl::dvec2 > & | ln | ) | `[inline]`

Renders a closed line passing through the points defined by 'ln'.

vl::Actor* vlVG::VectorGraphics::fillPolygon | ( | const std::vector< vl::dvec2 > & | poly | ) | `[inline]`

Renders a convex polygon whose corners are defined by 'poly'.

vl::Actor* vlVG::VectorGraphics::fillTriangles | ( | const std::vector< vl::dvec2 > & | triangles | ) | `[inline]`

Renders a set of triangles. The 'triangles' parameters must contain N triplets of vl::dvec2. Each triplet defines a triangle.

vl::Actor* vlVG::VectorGraphics::fillTriangleFan | ( | const std::vector< vl::dvec2 > & | fan | ) | `[inline]`

Renders a triangle fan.

vl::Actor* vlVG::VectorGraphics::fillTriangleStrip | ( | const std::vector< vl::dvec2 > & | strip | ) | `[inline]`

Renders a strip of triangles as defined by the OpenGL primitive GL_TRIANGLE_STRIP.

vl::Actor* vlVG::VectorGraphics::fillQuads | ( | const std::vector< vl::dvec2 > & | quads | ) | `[inline]`

Renders a set of rectangles as defined by the OpenGL primitive GL_QUADS.

vl::Actor* vlVG::VectorGraphics::fillQuadStrip | ( | const std::vector< vl::dvec2 > & | quad_strip | ) | `[inline]`

Renders a set of rectangles as defined by the OpenGL primitive GL_QUAD_STRIP.

vl::Actor* vlVG::VectorGraphics::drawPoint | ( | double | x,
|  | double | y |
| ) |  |  | `[inline]`

Renders a single point. This is only an utility function. If you want to draw many points use drawPoints(const std::vector<vl::dvec2>& pt) instead.

vl::Actor* vlVG::VectorGraphics::drawPoints | ( | const std::vector< vl::dvec2 > & | pt | ) | `[inline]`

Renders a set of points using the currently set pointSize(), color() and image().

vl::Actor* vlVG::VectorGraphics::drawEllipse | ( | double | origx,
|  | double | origy,
|  | double | xaxis,
|  | double | yaxis,
|  | int | segments = `64` |
| ) |  |  | `[inline]`

Renders the outline of an ellipse.

vl::Actor* vlVG::VectorGraphics::fillEllipse | ( | double | origx,
|  | double | origy,
|  | double | xaxis,
|  | double | yaxis,
|  | int | segments = `64` |
| ) |  |  | `[inline]`

Renders an ellipse.

vl::Actor* vlVG::VectorGraphics::drawQuad | ( | double | left,
|  | double | bottom,
|  | double | right,
|  | double | top |
| ) |  |  | `[inline]`

Utility function that renders the outline of a quad.

vl::Actor* vlVG::VectorGraphics::fillQuad | ( | double | left,
|  | double | bottom,
|  | double | right,
|  | double | top |
| ) |  |  | `[inline]`

Utility function that renders a single quad.

void vlVG::VectorGraphics::startDrawing | ( |  | ) | `[inline]`

Starts the drawing process.

You have to call this function before calling any of the fill* and draw* functions. This function will erase all the previously generated content of the VectorGraphics.

void vlVG::VectorGraphics::continueDrawing | ( |  | ) | `[inline]`

Continues the rendering on a VectorGraphics object.

This function will reset the VectorGraphics state and matrix but will not erase the previously generated graphics.

void vlVG::VectorGraphics::endDrawing | ( | bool | release_cache = `true` | ) | `[inline]`

Ends the rendering on a VectorGraphics and releases the resources used during the Actor generation process.

If you intend to continue the rendering or to add new graphics objects later set 'release_cache' to false.

void vlVG::VectorGraphics::clear | ( |  | ) | `[inline]`

Resets the VectorGraphics removing all the graphics objects and resetting its internal state.

void vlVG::VectorGraphics::setColor | ( | const vl::fvec4 & | color | ) | `[inline]`

The current color. Note that the current color also modulates the currently active image.

const vl::fvec4& vlVG::VectorGraphics::color | ( |  | ) | const`[inline]`

The current color. Note that the current color also modulates the currently active image.

void vlVG::VectorGraphics::setPointSize | ( | int | size | ) | `[inline]`

The current point size.

int vlVG::VectorGraphics::pointSize | ( |  | ) | const`[inline]`

The current point size.

void vlVG::VectorGraphics::setImage | ( | vl::Image * | image | ) | `[inline]`

The current image used to texture the rendered objects. Note that the current color also modulates the currently active image.

const vl::Image* vlVG::VectorGraphics::image | ( |  | ) | const`[inline]`

The current image used to texture the rendered objects. Note that the current color also modulates the currently active image.

vl::Image* vlVG::VectorGraphics::image | ( |  | ) | `[inline]`

The current image used to texture the rendered objects. Note that the current color also modulates the currently active image.

void vlVG::VectorGraphics::setPoint | ( | vl::Image * | image | ) | `[inline]`

Utility function equivalent to 'setImage(image); setPointSize(image->width());'.

void vlVG::VectorGraphics::setTextureMode | ( | ETextureMode | mode | ) | `[inline]`

The current texture mode.

ETextureMode vlVG::VectorGraphics::textureMode | ( |  | ) | const`[inline]`

The current texture mode.

void vlVG::VectorGraphics::setLogicOp | ( | vl::ELogicOp | op | ) | `[inline]`

The current logic operation, see also http://www.opengl.org/sdk/docs/man/xhtml/glLogicOp.xml for more information.

vl::ELogicOp vlVG::VectorGraphics::logicOp | ( |  | ) | const`[inline]`

The current logic operation.

void vlVG::VectorGraphics::setLineWidth | ( | float | width | ) | `[inline]`

The current line width, see also http://www.opengl.org/sdk/docs/man/xhtml/glLineWidth.xml for more information.

float vlVG::VectorGraphics::lineWidth | ( |  | ) | const`[inline]`

The current line width.

void vlVG::VectorGraphics::setPointSmoothing | ( | bool | smooth | ) | `[inline]`

The current point smoothing mode.

bool vlVG::VectorGraphics::pointSmoothing | ( |  | ) | const`[inline]`

The current point smoothing mode.

void vlVG::VectorGraphics::setLineSmoothing | ( | bool | smooth | ) | `[inline]`

The current line smoothing mode.

bool vlVG::VectorGraphics::lineSmoothing | ( |  | ) | const`[inline]`

The current line smoothing mode.

void vlVG::VectorGraphics::setPolygonSmoothing | ( | bool | smooth | ) | `[inline]`

The current polygon smoothing mode.

bool vlVG::VectorGraphics::polygonSmoothing | ( |  | ) | const`[inline]`

The current polygon smoothing mode.

void vlVG::VectorGraphics::setLineStipple | ( | ELineStipple | stipple | ) | `[inline]`

The current line stipple, see also http://www.opengl.org/sdk/docs/man/xhtml/glLineStipple.xml for more information.

void vlVG::VectorGraphics::setLineStipple | ( | unsigned short | stipple | ) | `[inline]`

The current line stipple.

unsigned short vlVG::VectorGraphics::lineStipple | ( |  | ) | const`[inline]`

The current line stipple.

void vlVG::VectorGraphics::setPolygonStipple | ( | EPolygonStipple | stipple | ) | `[inline]`

The current polygon stipple, see also http://www.opengl.org/sdk/docs/man/xhtml/glPolygonStipple.xml for more information.

void vlVG::VectorGraphics::setPolygonStipple | ( | unsigned char * | stipple | ) | `[inline]`

The current polygon stipple.

const unsigned char* vlVG::VectorGraphics::polygonStipple | ( |  | ) | const`[inline]`

The current polygon stipple.

unsigned char* vlVG::VectorGraphics::polygonStipple | ( |  | ) | `[inline]`

The current polygon stipple.

void vlVG::VectorGraphics::setAlphaFunc | ( | vl::EFunction | func,
|  | float | ref_value |
| ) |  |  | `[inline]`

The current alpha function, see also http://www.opengl.org/sdk/docs/man/xhtml/glAlphaFunc.xml for more information.

void vlVG::VectorGraphics::getAlphaFunc | ( | vl::EFunction & | func,
|  | float & | ref_value |
| ) |  |  | const`[inline]`

The current alpha function.

const void vlVG::VectorGraphics::setBlendFunc | ( | vl::EBlendFactor | src_rgb,
|  | vl::EBlendFactor | dst_rgb,
|  | vl::EBlendFactor | src_alpha,
|  | vl::EBlendFactor | dst_alpha |
| ) |  |  | `[inline]`

The current blending factor, see also http://www.opengl.org/sdk/docs/man/xhtml/glBlendFunc.xml for more information.

void vlVG::VectorGraphics::getBlendFunc | ( | vl::EBlendFactor & | src_rgb,
|  | vl::EBlendFactor & | dst_rgb,
|  | vl::EBlendFactor & | src_alpha,
|  | vl::EBlendFactor & | dst_alpha |
| ) |  |  | const`[inline]`

The current blending factor.

void vlVG::VectorGraphics::setBlendEquation | ( | vl::EBlendEquation | rgb_eq,
|  | vl::EBlendEquation | alpha_eq |
| ) |  |  | `[inline]`

The current blend equation, see also http://www.opengl.org/sdk/docs/man/xhtml/glBlendEquation.xml for more information.

void vlVG::VectorGraphics::getBlendEquation | ( | vl::EBlendEquation & | rgb_eq,
|  | vl::EBlendEquation & | alpha_eq |
| ) |  |  | const`[inline]`

The current blend equation.

void vlVG::VectorGraphics::setColorMask | ( | bool | r,
|  | bool | g,
|  | bool | b,
|  | bool | a |
| ) |  |  | `[inline]`

The current color mask, see also http://www.opengl.org/sdk/docs/man/xhtml/glColorMask.xml for more information.

const vl::ivec4& vlVG::VectorGraphics::colorMask | ( |  | ) | const`[inline]`

The current color mask.

void vlVG::VectorGraphics::setStencilTestEnabled | ( | bool | enabled | ) | `[inline]`

If set to 'true' the stencil test and operations will be enabled.

bool vlVG::VectorGraphics::stencilTestEnabled | ( |  | ) | const`[inline]`

If set to 'true' the stencil test and operations will be enabled.

void vlVG::VectorGraphics::setStencilMask | ( | unsigned int | mask | ) | `[inline]`

Current stencil mask, see also http://www.opengl.org/sdk/docs/man/xhtml/glStencilMask.xml for more information.

unsigned int vlVG::VectorGraphics::stencilMask | ( |  | ) | const`[inline]`

Current stencil mask.

void vlVG::VectorGraphics::setStencilOp | ( | vl::EStencilOp | sfail,
|  | vl::EStencilOp | dpfail,
|  | vl::EStencilOp | dppass |
| ) |  |  | `[inline]`

Current stencil operation, see also http://www.opengl.org/sdk/docs/man/xhtml/glStencilOp.xml for more information.

void vlVG::VectorGraphics::getStencilOp | ( | vl::EStencilOp & | sfail,
|  | vl::EStencilOp & | dpfail,
|  | vl::EStencilOp & | dppass |
| ) |  |  | `[inline]`

Current stencil operation.

void vlVG::VectorGraphics::setStencilFunc | ( | vl::EFunction | func,
|  | int | refval,
|  | unsigned int | mask |
| ) |  |  | `[inline]`

The current stencil function, see also http://www.opengl.org/sdk/docs/man/xhtml/glStencilFunc.xml for more information.

void vlVG::VectorGraphics::getStencilFunc | ( | vl::EFunction & | func,
|  | int & | refval,
|  | unsigned int & | mask |
| ) |  |  | `[inline]`

The current stencil function.

void vlVG::VectorGraphics::setFont | ( | const vl::String & | name,
|  | int | size,
|  | bool | smooth = `false` |
| ) |  |  | `[inline]`

Sets the current Font.

void vlVG::VectorGraphics::setFont | ( | const vl::Font * | font | ) | `[inline]`

Sets the current Font.

void vlVG::VectorGraphics::setDefaultFont | ( |  | ) | `[inline]`

Sets the default Font.

const vl::Font* vlVG::VectorGraphics::font | ( |  | ) | const`[inline]`

Returns the current Font.

void vlVG::VectorGraphics::setScissor | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height |
| ) |  |  | `[inline]`

Defines the scissor box and enables the scissor test.

The parameters are considered in windows coordinates. The Scissor is used to clip the rendering against a specific rectangular area. See also http://www.opengl.org/sdk/docs/man/xhtml/glScissor.xml for more information.

const vl::Scissor* vlVG::VectorGraphics::scissor | ( |  | ) | const`[inline]`

Returns the currently active Scissor.

void vlVG::VectorGraphics::removeScissor | ( |  | ) | `[inline]`

Disables the Scissor test and clipping.

vl::Actor* vlVG::VectorGraphics::clearColor | ( | const vl::fvec4 & | color,
|  | int | x = `0`,
|  | int | y = `0`,
|  | int | w = `-1`,
|  | int | h = `-1` |
| ) |  |  | `[inline]`

Clears the specific area of the viewport.

The parameters x y w h define a rectangular area in viewport coordinates that is clipped against the viewport itself.

Note:
  The specified rectangular area is not affected by the current matrix transform.

vl::Actor* vlVG::VectorGraphics::clearStencil | ( | int | clear_val,
|  | int | x = `0`,
|  | int | y = `0`,
|  | int | w = `-1`,
|  | int | h = `-1` |
| ) |  |  | `[inline]`

Clears the specific area of the viewport.

The parameters x y w h define a rectangular area in viewport coordinates that is clipped against the viewport itself.

Note:
  The specified rectangular area is not affected by the current matrix transform.

vl::Actor* vlVG::VectorGraphics::drawText | ( | vl::Text * | text | ) | `[inline]`

Draw the specified Text object.

vl::Actor* vlVG::VectorGraphics::drawText | ( | int | x,
|  | int | y,
|  | const vl::String & | text,
|  | int | alignment = `vl::AlignBottom|vl::AlignLeft` |
| ) |  |  | `[inline]`

Draws the specified text at the specified position.

Note that the current matrix transform affect the final position, rotation and scaling of the text.

vl::Actor* vlVG::VectorGraphics::drawText | ( | const vl::String & | text,
|  | int | alignment = `vl::AlignBottom|vl::AlignLeft` |
| ) |  |  | `[inline]`

Draws the specified text.

vl::Actor* vlVG::VectorGraphics::drawActor | ( | vl::Actor * | actor,
|  | vl::Transform * | transform = `NULL`,
|  | bool | keep_effect = `false` |
| ) |  |  | `[inline]`

Draws the specified Actor with the specified Transform.

If keep_effect is set to 'false' or the Actor's Effect is NULL a default Effect is automatically generated. If 'transform' is non NULL it is bound to the Actor.

vl::Actor* vlVG::VectorGraphics::drawActorCopy | ( | vl::Actor * | actor,
|  | vl::Transform * | transform = `NULL`,
|  | bool | keep_effect = `false` |
| ) |  |  | `[inline]`

Like drawActor() but instead of drawing the given actor creates a copy of it and draws that.

This function is useful when you want to crate multiple instances of the same geometry.

const vl::dmat4& vlVG::VectorGraphics::matrix | ( |  | ) | const`[inline]`

Returns the current transform matrix.

void vlVG::VectorGraphics::setMatrix | ( | const vl::dmat4 & | matrix | ) | `[inline]`

Sets the current transform matrix.

void vlVG::VectorGraphics::resetMatrix | ( |  | ) | `[inline]`

Resets the current transform matrix.

void vlVG::VectorGraphics::rotate | ( | double | deg | ) | `[inline]`

Performs a rotation of 'deg' degrees around the z axis.

void vlVG::VectorGraphics::translate | ( | double | x,
|  | double | y,
|  | double | z = `0.0` |
| ) |  |  | `[inline]`

Translates the current transform matrix.

void vlVG::VectorGraphics::scale | ( | double | x,
|  | double | y,
|  | double | z = `1.0` |
| ) |  |  | `[inline]`

Scales the current transform matrix.

void vlVG::VectorGraphics::pushMatrix | ( |  | ) | `[inline]`

Pushes the current matrix in the matrix stack in order to restore it later with popMatrix().

void vlVG::VectorGraphics::popMatrix | ( |  | ) | `[inline]`

Pops the top most matrix in the matrix stack and sets it as the current matrix.

const std::vector<vl::dmat4>& vlVG::VectorGraphics::matrixStack | ( |  | ) | const`[inline]`

Returns the matrix stack.

void vlVG::VectorGraphics::pushState | ( |  | ) | `[inline]`

Pushes the current VectorGraphics state (including the matrix state) in the state stack in order to restore it later with popState().

void vlVG::VectorGraphics::popState | ( |  | ) | `[inline]`

Pops the top most state in the state stack and sets it as the current state.

void vlVG::VectorGraphics::pushScissor | ( | int | x,
|  | int | y,
|  | int | w,
|  | int | h |
| ) |  |  | `[inline]`

Pushes the current scissor in the scissor stack in order to restore it later with popScissor() and activates a new one.

The 'x', 'y', 'w' and 'h' parameters define the new scissor rectangle. Note that such rectangle is clipped against the currently active one.

void vlVG::VectorGraphics::popScissor | ( |  | ) | `[inline]`

Pops the top most scissor in the scissor stack and sets it as the current scissor.

const std::vector< vl::ref<vl::Scissor> >& vlVG::VectorGraphics::scissorStack | ( |  | ) | const`[inline]`

Returns the scissor stack.

void vlVG::VectorGraphics::setTransform | ( | vl::Transform * | transform | ) | `[inline]`

Binds the given Transform to all the Actor[s] that have been generated so far.

vl::Effect* vlVG::VectorGraphics::currentEffect | ( |  | ) | `[inline]`

Returns the Effect representing the current VectorGraphic's state.

The documentation for this class was generated from the following file:

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlVG/VectorGraphics.hpp

Visualization Library v2009.07 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Mon Aug 10 21:41:51 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.