Visualization Library 2.0.0

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

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Classes | Public Member Functions | List of all members
vl::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 vl::VectorGraphics:

Public Member Functions

 VectorGraphics ()
 
const ActorCollectionactors () const
 Returns the list of Actor[s] generated by a VectorGraphics object. More...
 
ActorCollectionactors ()
 Returns the list of Actor[s] generated by a VectorGraphics object. More...
 
ActordrawLine (double x1, double y1, double x2, double y2)
 Renders a line starting a point <x1,y1> and ending at point <x2,y2> More...
 
ActordrawLines (const std::vector< dvec2 > &ln)
 Renders a set of lines. The 'ln' parameter shoud contain N pairs of dvec2. Each pair defines a line segment. More...
 
ActordrawLineStrip (const std::vector< dvec2 > &ln)
 Renders a line passing through the points defined by 'ln'. More...
 
ActordrawLineLoop (const std::vector< dvec2 > &ln)
 Renders a closed line passing through the points defined by 'ln'. More...
 
ActorfillPolygon (const std::vector< dvec2 > &poly)
 Renders a convex polygon whose corners are defined by 'poly'. More...
 
ActorfillTriangles (const std::vector< dvec2 > &triangles)
 Renders a set of triangles. The 'triangles' parameters must contain N triplets of dvec2. Each triplet defines a triangle. More...
 
ActorfillTriangleFan (const std::vector< dvec2 > &fan)
 Renders a triangle fan. More...
 
ActorfillTriangleStrip (const std::vector< dvec2 > &strip)
 Renders a strip of triangles as defined by the OpenGL primitive GL_TRIANGLE_STRIP. More...
 
ActorfillQuads (const std::vector< dvec2 > &quads)
 Renders a set of rectangles as defined by the OpenGL primitive GL_QUADS. More...
 
ActorfillQuadStrip (const std::vector< dvec2 > &quad_strip)
 Renders a set of rectangles as defined by the OpenGL primitive GL_QUAD_STRIP. More...
 
ActordrawPoint (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<dvec2>& pt) instead. More...
 
ActordrawPoints (const std::vector< dvec2 > &pt)
 Renders a set of points using the currently set pointSize(), color() and image(). More...
 
ActordrawEllipse (double origx, double origy, double xaxis, double yaxis, int segments=64)
 Renders the outline of an ellipse. More...
 
ActorfillEllipse (double origx, double origy, double xaxis, double yaxis, int segments=64)
 Renders an ellipse. More...
 
ActordrawQuad (double left, double bottom, double right, double top)
 Utility function that renders the outline of a quad. More...
 
ActorfillQuad (double left, double bottom, double right, double top)
 Utility function that renders a single quad. More...
 
void startDrawing ()
 Starts the drawing process. More...
 
void continueDrawing ()
 Continues the rendering on a VectorGraphics object. More...
 
void endDrawing (bool release_cache=true)
 Ends the rendering on a VectorGraphics and releases the resources used during the Actor generation process. More...
 
void clear ()
 Resets the VectorGraphics removing all the graphics objects and resetting its internal state. More...
 
void setColor (const fvec4 &color)
 The current color. Note that the current color also modulates the currently active image. More...
 
const fvec4color () const
 The current color. Note that the current color also modulates the currently active image. More...
 
void setPointSize (int size)
 The current point size. More...
 
int pointSize () const
 The current point size. More...
 
void setImage (Image *image)
 The current image used to texture the rendered objects. Note that the current color also modulates the currently active image. More...
 
const Imageimage () const
 The current image used to texture the rendered objects. Note that the current color also modulates the currently active image. More...
 
Imageimage ()
 The current image used to texture the rendered objects. Note that the current color also modulates the currently active image. More...
 
void setPoint (Image *image)
 Utility function equivalent to 'setImage(image); setPointSize(image->width());'. More...
 
void setTextureMode (ETextureMode mode)
 The current texture mode. More...
 
ETextureMode textureMode () const
 The current texture mode. More...
 
void setLogicOp (ELogicOp op)
 The current logic operation, see also http://www.opengl.org/sdk/docs/man/xhtml/glLogicOp.xml for more information. More...
 
ELogicOp logicOp () const
 The current logic operation. More...
 
void setLineWidth (float width)
 The current line width, see also http://www.opengl.org/sdk/docs/man/xhtml/glLineWidth.xml for more information. More...
 
float lineWidth () const
 The current line width. More...
 
void setPointSmoothing (bool smooth)
 The current point smoothing mode. More...
 
bool pointSmoothing () const
 The current point smoothing mode. More...
 
void setLineSmoothing (bool smooth)
 The current line smoothing mode. More...
 
bool lineSmoothing () const
 The current line smoothing mode. More...
 
void setPolygonSmoothing (bool smooth)
 The current polygon smoothing mode. More...
 
bool polygonSmoothing () const
 The current polygon smoothing mode. More...
 
void setLineStipple (ELineStipple stipple)
 The current line stipple, see also http://www.opengl.org/sdk/docs/man/xhtml/glLineStipple.xml for more information. More...
 
void setLineStipple (unsigned short stipple)
 The current line stipple. More...
 
unsigned short lineStipple () const
 The current line stipple. More...
 
void setPolygonStipple (EPolygonStipple stipple)
 The current polygon stipple, see also http://www.opengl.org/sdk/docs/man/xhtml/glPolygonStipple.xml for more information. More...
 
void setPolygonStipple (unsigned char *stipple)
 The current polygon stipple. More...
 
const unsigned char * polygonStipple () const
 The current polygon stipple. More...
 
unsigned char * polygonStipple ()
 The current polygon stipple. More...
 
void setAlphaFunc (EFunction func, float ref_value)
 The current alpha function, see also http://www.opengl.org/sdk/docs/man/xhtml/glAlphaFunc.xml for more information. More...
 
void getAlphaFunc (EFunction &func, float &ref_value) const
 The current alpha function. More...
 
void setBlendFunc (EBlendFactor src_rgb, EBlendFactor dst_rgb, EBlendFactor src_alpha, EBlendFactor dst_alpha)
 The current blending factor, see also http://www.opengl.org/sdk/docs/man/xhtml/glBlendFunc.xml for more information. More...
 
void getBlendFunc (EBlendFactor &src_rgb, EBlendFactor &dst_rgb, EBlendFactor &src_alpha, EBlendFactor &dst_alpha) const
 The current blending factor. More...
 
void setBlendEquation (EBlendEquation rgb_eq, EBlendEquation alpha_eq)
 The current blend equation, see also http://www.opengl.org/sdk/docs/man/xhtml/glBlendEquation.xml for more information. More...
 
void getBlendEquation (EBlendEquation &rgb_eq, EBlendEquation &alpha_eq) const
 The current blend equation. More...
 
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. More...
 
const ivec4colorMask () const
 The current color mask. More...
 
void setStencilTestEnabled (bool enabled)
 If set to 'true' the stencil test and operations will be enabled. More...
 
bool stencilTestEnabled () const
 If set to 'true' the stencil test and operations will be enabled. More...
 
void setStencilMask (unsigned int mask)
 Current stencil mask, see also http://www.opengl.org/sdk/docs/man/xhtml/glStencilMask.xml for more information. More...
 
unsigned int stencilMask () const
 Current stencil mask. More...
 
void setStencilOp (EStencilOp sfail, EStencilOp dpfail, EStencilOp dppass)
 Current stencil operation, see also http://www.opengl.org/sdk/docs/man/xhtml/glStencilOp.xml for more information. More...
 
void getStencilOp (EStencilOp &sfail, EStencilOp &dpfail, EStencilOp &dppass)
 Current stencil operation. More...
 
void setStencilFunc (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. More...
 
void getStencilFunc (EFunction &func, int &refval, unsigned int &mask)
 The current stencil function. More...
 
void setFont (const String &name, int size, bool smooth=false)
 Sets the current Font. More...
 
void setFont (const Font *font)
 Sets the current Font. More...
 
void setDefaultFont ()
 Sets the default Font. More...
 
const Fontfont () const
 Returns the current Font. More...
 
void setScissor (int x, int y, int width, int height)
 Defines the scissor box and enables the scissor test. More...
 
const Scissorscissor () const
 Returns the currently active Scissor. More...
 
void removeScissor ()
 Disables the Scissor test and clipping. More...
 
ActorclearColor (const fvec4 &color, int x=0, int y=0, int w=-1, int h=-1)
 Clears the specific area of the viewport. More...
 
ActorclearStencil (int clear_val, int x=0, int y=0, int w=-1, int h=-1)
 Clears the specific area of the viewport. More...
 
ActordrawText (Text *text)
 Draw the specified Text object. More...
 
ActordrawText (int x, int y, const String &text, int alignment=AlignBottom|AlignLeft)
 Draws the specified text at the specified position. More...
 
ActordrawText (const String &text, int alignment=AlignBottom|AlignLeft)
 Draws the specified text. More...
 
ActordrawActor (Actor *actor, Transform *transform=NULL, bool keep_effect=false)
 Draws the specified Actor with the specified Transform. More...
 
ActordrawActorCopy (Actor *actor, Transform *transform=NULL)
 Like drawActor() but instead of drawing the given actor creates a copy of it and draws that. More...
 
const dmat4matrix () const
 Returns the current transform matrix. More...
 
void setMatrix (const dmat4 &matrix)
 Sets the current transform matrix. More...
 
void resetMatrix ()
 Resets the current transform matrix. More...
 
void rotate (double deg)
 Performs a rotation of 'deg' degrees around the z axis. More...
 
void translate (double x, double y, double z=0.0)
 Translates the current transform matrix. More...
 
void scale (double x, double y, double z=1.0)
 Scales the current transform matrix. More...
 
void pushMatrix ()
 Pushes the current matrix in the matrix stack in order to restore it later with popMatrix(). More...
 
void popMatrix ()
 Pops the top most matrix in the matrix stack and sets it as the current matrix. More...
 
const std::vector< dmat4 > & matrixStack () const
 Returns the matrix stack. More...
 
void pushState ()
 Pushes the current VectorGraphics state (including the matrix state) in the state stack in order to restore it later with popState(). More...
 
void popState ()
 Pops the top most state in the state stack and sets it as the current state. More...
 
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. More...
 
void popScissor ()
 Pops the top most scissor in the scissor stack and sets it as the current scissor. More...
 
const std::vector< ref< Scissor > > & scissorStack () const
 Returns the scissor stack. More...
 
void setTransform (Transform *transform)
 Binds the given Transform to all the Actor[s] that have been generated so far. More...
 
EffectcurrentEffect ()
 Returns the Effect representing the current VectorGraphic's state. More...
 
- Public Member Functions inherited from vl::Object
 Object ()
 Constructor. More...
 
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data. More...
 
Objectoperator= (const Object &other)
 Copy operator: copies the object's name, ref count mutex and user data. More...
 
const std::string & objectName () const
 The name of the object, by default set to the object's class name. More...
 
void setObjectName (const char *name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setObjectName (const std::string &name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setRefCountMutex (IMutex *mutex)
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () const
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
int referenceCount () const
 Returns the number of references of an object. More...
 
void incReference () const
 Increments the reference count of an object. More...
 
void decReference ()
 Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More...
 
void setAutomaticDelete (bool autodel_on)
 If set to true the Object is deleted when its reference count reaches 0. More...
 
bool automaticDelete () const
 If set to true the Object is deleted when its reference count reaches 0. More...
 
template<class T >
T * as ()
 Casts an Object to the specified class. More...
 
template<class T >
const T * as () const
 Casts an Object to the specified class. More...
 

Additional Inherited Members

- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

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:

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

Definition at line 106 of file VectorGraphics.hpp.

Constructor & Destructor Documentation

◆ VectorGraphics()

VectorGraphics::VectorGraphics ( )

Definition at line 37 of file VectorGraphics.cpp.

References vl::EN_BLEND, and vl::Object::setAutomaticDelete().

Member Function Documentation

◆ actors() [1/2]

const ActorCollection* vl::VectorGraphics::actors ( ) const
inline

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

Definition at line 330 of file VectorGraphics.hpp.

◆ actors() [2/2]

ActorCollection* vl::VectorGraphics::actors ( )
inline

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

Definition at line 333 of file VectorGraphics.hpp.

◆ clear()

void VectorGraphics::clear ( )

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

Definition at line 284 of file VectorGraphics.cpp.

References vl::Collection< T >::clear().

Referenced by clearColor(), and clearStencil().

◆ clearColor()

Actor * VectorGraphics::clearColor ( const fvec4 color,
int  x = 0,
int  y = 0,
int  w = -1,
int  h = -1 
)

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.

Definition at line 428 of file VectorGraphics.cpp.

References clear(), currentEffect(), vl::ref< T >::get(), NULL, vl::Clear::setClearColorBuffer(), vl::Clear::setClearColorValue(), and vl::Clear::setScissorBox().

◆ clearStencil()

Actor * VectorGraphics::clearStencil ( int  clear_val,
int  x = 0,
int  y = 0,
int  w = -1,
int  h = -1 
)

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.

Definition at line 437 of file VectorGraphics.cpp.

References clear(), currentEffect(), vl::ref< T >::get(), NULL, vl::Clear::setClearStencilBuffer(), vl::Clear::setClearStencilValue(), and vl::Clear::setScissorBox().

◆ color()

const fvec4& vl::VectorGraphics::color ( ) const
inline

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

Definition at line 402 of file VectorGraphics.hpp.

◆ colorMask()

const ivec4& vl::VectorGraphics::colorMask ( ) const
inline

The current color mask.

Definition at line 501 of file VectorGraphics.hpp.

◆ continueDrawing()

void VectorGraphics::continueDrawing ( )

Continues the rendering on a VectorGraphics object.

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

Definition at line 255 of file VectorGraphics.cpp.

◆ currentEffect()

Effect* vl::VectorGraphics::currentEffect ( )
inline

◆ drawActor()

Actor * VectorGraphics::drawActor ( Actor actor,
Transform transform = NULL,
bool  keep_effect = false 
)

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.

Definition at line 473 of file VectorGraphics.cpp.

References currentEffect(), vl::Actor::effect(), NULL, vl::Actor::setEffect(), vl::Actor::setTransform(), and VL_CHECK.

Referenced by drawActorCopy().

◆ drawActorCopy()

Actor * VectorGraphics::drawActorCopy ( Actor actor,
Transform transform = NULL 
)

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.

Definition at line 483 of file VectorGraphics.cpp.

References drawActor(), vl::ref< T >::get(), and vl::Actor::setTransform().

◆ drawEllipse()

Actor * VectorGraphics::drawEllipse ( double  origx,
double  origy,
double  xaxis,
double  yaxis,
int  segments = 64 
)

Renders the outline of an ellipse.

Definition at line 204 of file VectorGraphics.cpp.

References vl::cos(), vl::dPi, drawLineStrip(), and vl::sin().

◆ drawLine()

Actor * VectorGraphics::drawLine ( double  x1,
double  y1,
double  x2,
double  y2 
)

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

Definition at line 44 of file VectorGraphics.cpp.

References drawLines().

◆ drawLineLoop()

Actor * VectorGraphics::drawLineLoop ( const std::vector< dvec2 > &  ln)

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

Definition at line 89 of file VectorGraphics.cpp.

References currentEffect(), vl::Geometry::drawCalls(), vl::ref< T >::get(), NULL, and vl::PT_LINE_LOOP.

Referenced by drawQuad().

◆ drawLines()

Actor * VectorGraphics::drawLines ( const std::vector< dvec2 > &  ln)

◆ drawLineStrip()

Actor * VectorGraphics::drawLineStrip ( const std::vector< dvec2 > &  ln)

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

Definition at line 77 of file VectorGraphics.cpp.

References currentEffect(), vl::Geometry::drawCalls(), vl::ref< T >::get(), NULL, and vl::PT_LINE_STRIP.

Referenced by drawEllipse().

◆ drawPoint()

Actor * VectorGraphics::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<dvec2>& pt) instead.

Definition at line 173 of file VectorGraphics.cpp.

References drawPoints().

◆ drawPoints()

Actor * VectorGraphics::drawPoints ( const std::vector< dvec2 > &  pt)

◆ drawQuad()

Actor * VectorGraphics::drawQuad ( double  left,
double  bottom,
double  right,
double  top 
)

Utility function that renders the outline of a quad.

Definition at line 228 of file VectorGraphics.cpp.

References drawLineLoop().

◆ drawText() [1/3]

Actor * VectorGraphics::drawText ( Text text)

Draw the specified Text object.

Definition at line 446 of file VectorGraphics.cpp.

References currentEffect(), vl::Text::font(), NULL, and vl::Text::setFont().

Referenced by drawText().

◆ drawText() [2/3]

Actor * VectorGraphics::drawText ( int  x,
int  y,
const String text,
int  alignment = AlignBottom|AlignLeft 
)

Draws the specified text at the specified position.

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

Definition at line 453 of file VectorGraphics.cpp.

References drawText(), vl::Matrix4< double >::getTranslation(), popMatrix(), and pushMatrix().

◆ drawText() [3/3]

Actor * VectorGraphics::drawText ( const String text,
int  alignment = AlignBottom|AlignLeft 
)

◆ endDrawing()

void VectorGraphics::endDrawing ( bool  release_cache = true)

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.

Definition at line 270 of file VectorGraphics.cpp.

◆ fillEllipse()

Actor * VectorGraphics::fillEllipse ( double  origx,
double  origy,
double  xaxis,
double  yaxis,
int  segments = 64 
)

Renders an ellipse.

Definition at line 216 of file VectorGraphics.cpp.

References vl::cos(), vl::dPi, fillPolygon(), and vl::sin().

◆ fillPolygon()

Actor * VectorGraphics::fillPolygon ( const std::vector< dvec2 > &  poly)

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

Definition at line 101 of file VectorGraphics.cpp.

References currentEffect(), vl::Geometry::drawCalls(), vl::ref< T >::get(), NULL, vl::PT_TRIANGLES, vl::ArrayAbstract::size(), and vl::Geometry::vertexArray().

Referenced by fillEllipse().

◆ fillQuad()

Actor * VectorGraphics::fillQuad ( double  left,
double  bottom,
double  right,
double  top 
)

Utility function that renders a single quad.

Definition at line 238 of file VectorGraphics.cpp.

References currentEffect(), vl::Geometry::drawCalls(), vl::ref< T >::get(), NULL, and vl::PT_TRIANGLE_FAN.

◆ fillQuads()

Actor * VectorGraphics::fillQuads ( const std::vector< dvec2 > &  quads)

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

Definition at line 149 of file VectorGraphics.cpp.

References currentEffect(), vl::Geometry::drawCalls(), vl::ref< T >::get(), NULL, and vl::PT_QUADS.

◆ fillQuadStrip()

Actor * VectorGraphics::fillQuadStrip ( const std::vector< dvec2 > &  quad_strip)

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

Definition at line 161 of file VectorGraphics.cpp.

References currentEffect(), vl::Geometry::drawCalls(), vl::ref< T >::get(), NULL, and vl::PT_QUAD_STRIP.

◆ fillTriangleFan()

Actor * VectorGraphics::fillTriangleFan ( const std::vector< dvec2 > &  fan)

Renders a triangle fan.

Definition at line 125 of file VectorGraphics.cpp.

References currentEffect(), vl::Geometry::drawCalls(), vl::ref< T >::get(), NULL, and vl::PT_TRIANGLE_FAN.

◆ fillTriangles()

Actor * VectorGraphics::fillTriangles ( const std::vector< dvec2 > &  triangles)

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

Definition at line 113 of file VectorGraphics.cpp.

References currentEffect(), vl::Geometry::drawCalls(), vl::ref< T >::get(), NULL, and vl::PT_TRIANGLES.

◆ fillTriangleStrip()

Actor * VectorGraphics::fillTriangleStrip ( const std::vector< dvec2 > &  strip)

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

Definition at line 137 of file VectorGraphics.cpp.

References currentEffect(), vl::Geometry::drawCalls(), vl::ref< T >::get(), NULL, and vl::PT_TRIANGLE_STRIP.

◆ font()

const Font* vl::VectorGraphics::font ( ) const
inline

Returns the current Font.

Definition at line 540 of file VectorGraphics.hpp.

◆ getAlphaFunc()

void vl::VectorGraphics::getAlphaFunc ( EFunction func,
float &  ref_value 
) const
inline

The current alpha function.

Definition at line 483 of file VectorGraphics.hpp.

◆ getBlendEquation()

void VectorGraphics::getBlendEquation ( EBlendEquation rgb_eq,
EBlendEquation alpha_eq 
) const

The current blend equation.

Definition at line 394 of file VectorGraphics.cpp.

◆ getBlendFunc()

void VectorGraphics::getBlendFunc ( EBlendFactor src_rgb,
EBlendFactor dst_rgb,
EBlendFactor src_alpha,
EBlendFactor dst_alpha 
) const

The current blending factor.

Definition at line 380 of file VectorGraphics.cpp.

◆ getStencilFunc()

void VectorGraphics::getStencilFunc ( EFunction func,
int &  refval,
unsigned int &  mask 
)

The current stencil function.

Definition at line 421 of file VectorGraphics.cpp.

◆ getStencilOp()

void VectorGraphics::getStencilOp ( EStencilOp sfail,
EStencilOp dpfail,
EStencilOp dppass 
)

Current stencil operation.

Definition at line 407 of file VectorGraphics.cpp.

◆ image() [1/2]

const Image* vl::VectorGraphics::image ( ) const
inline

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

Definition at line 414 of file VectorGraphics.hpp.

Referenced by popScissor().

◆ image() [2/2]

Image* vl::VectorGraphics::image ( )
inline

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

Definition at line 417 of file VectorGraphics.hpp.

◆ lineSmoothing()

bool vl::VectorGraphics::lineSmoothing ( ) const
inline

The current line smoothing mode.

Definition at line 450 of file VectorGraphics.hpp.

◆ lineStipple()

unsigned short vl::VectorGraphics::lineStipple ( ) const
inline

The current line stipple.

Definition at line 465 of file VectorGraphics.hpp.

◆ lineWidth()

float vl::VectorGraphics::lineWidth ( ) const
inline

The current line width.

Definition at line 438 of file VectorGraphics.hpp.

◆ logicOp()

ELogicOp vl::VectorGraphics::logicOp ( ) const
inline

The current logic operation.

Definition at line 432 of file VectorGraphics.hpp.

◆ matrix()

const dmat4& vl::VectorGraphics::matrix ( ) const
inline

Returns the current transform matrix.

Definition at line 592 of file VectorGraphics.hpp.

Referenced by drawPoints(), drawText(), and popScissor().

◆ matrixStack()

const std::vector<dmat4>& vl::VectorGraphics::matrixStack ( ) const
inline

Returns the matrix stack.

Definition at line 616 of file VectorGraphics.hpp.

◆ pointSize()

int vl::VectorGraphics::pointSize ( ) const
inline

The current point size.

Definition at line 408 of file VectorGraphics.hpp.

◆ pointSmoothing()

bool vl::VectorGraphics::pointSmoothing ( ) const
inline

The current point smoothing mode.

Definition at line 444 of file VectorGraphics.hpp.

◆ polygonSmoothing()

bool vl::VectorGraphics::polygonSmoothing ( ) const
inline

The current polygon smoothing mode.

Definition at line 456 of file VectorGraphics.hpp.

◆ polygonStipple() [1/2]

const unsigned char* vl::VectorGraphics::polygonStipple ( ) const
inline

The current polygon stipple.

Definition at line 474 of file VectorGraphics.hpp.

◆ polygonStipple() [2/2]

unsigned char* vl::VectorGraphics::polygonStipple ( )
inline

The current polygon stipple.

Definition at line 477 of file VectorGraphics.hpp.

◆ popMatrix()

void VectorGraphics::popMatrix ( )

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

Definition at line 506 of file VectorGraphics.cpp.

References vl::Log::error(), and setMatrix().

Referenced by drawText(), and popState().

◆ popScissor()

void VectorGraphics::popScissor ( )

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

Definition at line 542 of file VectorGraphics.cpp.

References vl::AABB::addPoint(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at(), currentEffect(), vl::EN_ALPHA_TEST, vl::EN_BLEND, vl::EN_COLOR_LOGIC_OP, vl::EN_LIGHTING, vl::EN_LINE_SMOOTH, vl::EN_LINE_STIPPLE, vl::EN_POINT_SMOOTH, vl::EN_POINT_SPRITE, vl::EN_POLYGON_SMOOTH, vl::EN_POLYGON_STIPPLE, vl::EN_STENCIL_TEST, vl::Shader::enable(), vl::Log::error(), vl::FU_ALWAYS, vl::ref< T >::get(), vl::ArrayAbstract::getAsVec3(), vl::ArrayAbstract::getAsVec4(), vl::Texture::getTexParameter(), vl::Shader::gocAlphaFunc(), vl::Shader::gocBlendEquation(), vl::Shader::gocBlendFunc(), vl::Shader::gocColorMask(), vl::Shader::gocHint(), vl::Shader::gocLineStipple(), vl::Shader::gocLineWidth(), vl::Shader::gocLogicOp(), vl::Shader::gocMaterial(), vl::Shader::gocPointSize(), vl::Shader::gocPolygonStipple(), vl::Shader::gocStencilFunc(), vl::Shader::gocStencilMask(), vl::Shader::gocStencilOp(), vl::Shader::gocTexEnv(), vl::Shader::gocTextureSampler(), vl::Has_Point_Sprite, vl::AABB::height(), vl::HM_NICEST, image(), vl::LO_COPY, matrix(), vl::AABB::minCorner(), vl::PF_FRONT_AND_BACK, vl::Collection< T >::push_back(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::resize(), vl::Vector3< T_Scalar >::s(), vl::Vector4< T_Scalar >::s(), vl::Vector2< T_Scalar >::s(), scissor(), vl::BlendFunc::set(), vl::BlendEquation::set(), vl::AlphaFunc::set(), vl::LogicOp::set(), vl::LineWidth::set(), vl::PointSize::set(), vl::PolygonStipple::set(), vl::LineStipple::set(), vl::StencilFunc::set(), vl::StencilOp::set(), vl::StencilMask::set(), vl::ColorMask::set(), vl::TexParameter::setBorderColor(), vl::Material::setFlatColor(), vl::Hint::setLineSmoothHint(), vl::TexParameter::setMagFilter(), vl::TexParameter::setMinFilter(), vl::Hint::setPointSmoothHint(), vl::TexEnv::setPointSpriteCoordReplace(), vl::Hint::setPolygonSmoohtHint(), vl::Actor::setScissor(), vl::Geometry::setTexCoordArray(), vl::TextureSampler::setTexture(), vl::Geometry::setVertexArray(), vl::TexParameter::setWrapS(), vl::TexParameter::setWrapT(), vl::Effect::shader(), vl::ArrayAbstract::size(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size(), vl::Vector3< T_Scalar >::t(), vl::Vector4< T_Scalar >::t(), vl::Vector2< T_Scalar >::t(), vl::TextureMode_Clamp, vl::TextureMode_Repeat, vl::TF_RGBA, vl::TPF_LINEAR, vl::TPF_LINEAR_MIPMAP_LINEAR, vl::TPW_CLAMP, vl::TPW_REPEAT, vl::Geometry::vertexArray(), vl::AABB::width(), vl::Vector3< T_Scalar >::x(), and vl::Vector3< T_Scalar >::y().

◆ popState()

void VectorGraphics::popState ( )

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

Definition at line 523 of file VectorGraphics.cpp.

References vl::Log::error(), and popMatrix().

◆ pushMatrix()

void vl::VectorGraphics::pushMatrix ( )
inline

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

Definition at line 610 of file VectorGraphics.hpp.

Referenced by drawText(), and pushState().

◆ pushScissor()

void VectorGraphics::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.

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

Definition at line 535 of file VectorGraphics.cpp.

References vl::Rect< T >::height(), setScissor(), vl::Rect< T >::width(), vl::Rect< T >::x(), and vl::Rect< T >::y().

◆ pushState()

void VectorGraphics::pushState ( )

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

Definition at line 517 of file VectorGraphics.cpp.

References pushMatrix().

◆ removeScissor()

void vl::VectorGraphics::removeScissor ( )
inline

Disables the Scissor test and clipping.

Definition at line 555 of file VectorGraphics.hpp.

References vl::AlignBottom, vl::AlignLeft, and NULL.

◆ resetMatrix()

void vl::VectorGraphics::resetMatrix ( )
inline

Resets the current transform matrix.

Definition at line 598 of file VectorGraphics.hpp.

◆ rotate()

void VectorGraphics::rotate ( double  deg)

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

Definition at line 491 of file VectorGraphics.cpp.

References vl::Matrix4< double >::getRotation().

◆ scale()

void VectorGraphics::scale ( double  x,
double  y,
double  z = 1.0 
)

Scales the current transform matrix.

Definition at line 501 of file VectorGraphics.cpp.

References vl::Matrix4< double >::getScaling().

◆ scissor()

const Scissor* vl::VectorGraphics::scissor ( ) const
inline

Returns the currently active Scissor.

Definition at line 552 of file VectorGraphics.hpp.

Referenced by popScissor().

◆ scissorStack()

const std::vector< ref<Scissor> >& vl::VectorGraphics::scissorStack ( ) const
inline

Returns the scissor stack.

Definition at line 635 of file VectorGraphics.hpp.

◆ setAlphaFunc()

void vl::VectorGraphics::setAlphaFunc ( 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.

Definition at line 480 of file VectorGraphics.hpp.

◆ setBlendEquation()

void VectorGraphics::setBlendEquation ( EBlendEquation  rgb_eq,
EBlendEquation  alpha_eq 
)

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

Definition at line 388 of file VectorGraphics.cpp.

◆ setBlendFunc()

void VectorGraphics::setBlendFunc ( EBlendFactor  src_rgb,
EBlendFactor  dst_rgb,
EBlendFactor  src_alpha,
EBlendFactor  dst_alpha 
)

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

Definition at line 372 of file VectorGraphics.cpp.

◆ setColor()

void vl::VectorGraphics::setColor ( const fvec4 color)
inline

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

Definition at line 399 of file VectorGraphics.hpp.

◆ setColorMask()

void vl::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.

Definition at line 498 of file VectorGraphics.hpp.

◆ setDefaultFont()

void vl::VectorGraphics::setDefaultFont ( )
inline

Sets the default Font.

Definition at line 537 of file VectorGraphics.hpp.

References vl::defFontManager().

◆ setFont() [1/2]

void vl::VectorGraphics::setFont ( const String name,
int  size,
bool  smooth = false 
)
inline

Sets the current Font.

Definition at line 531 of file VectorGraphics.hpp.

References vl::FontManager::acquireFont(), and vl::defFontManager().

◆ setFont() [2/2]

void vl::VectorGraphics::setFont ( const Font font)
inline

Sets the current Font.

Definition at line 534 of file VectorGraphics.hpp.

References vl::Font::filePath(), setFont(), vl::Font::size(), and vl::Font::smooth().

Referenced by setFont().

◆ setImage()

void vl::VectorGraphics::setImage ( Image image)
inline

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

Definition at line 411 of file VectorGraphics.hpp.

◆ setLineSmoothing()

void vl::VectorGraphics::setLineSmoothing ( bool  smooth)
inline

The current line smoothing mode.

Definition at line 447 of file VectorGraphics.hpp.

◆ setLineStipple() [1/2]

void VectorGraphics::setLineStipple ( ELineStipple  stipple)

◆ setLineStipple() [2/2]

void vl::VectorGraphics::setLineStipple ( unsigned short  stipple)
inline

The current line stipple.

Definition at line 462 of file VectorGraphics.hpp.

◆ setLineWidth()

void vl::VectorGraphics::setLineWidth ( float  width)
inline

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

Definition at line 435 of file VectorGraphics.hpp.

◆ setLogicOp()

void vl::VectorGraphics::setLogicOp ( ELogicOp  op)
inline

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

Definition at line 429 of file VectorGraphics.hpp.

◆ setMatrix()

void vl::VectorGraphics::setMatrix ( const dmat4 matrix)
inline

Sets the current transform matrix.

Definition at line 595 of file VectorGraphics.hpp.

Referenced by popMatrix().

◆ setPoint()

void vl::VectorGraphics::setPoint ( Image image)
inline

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

Definition at line 420 of file VectorGraphics.hpp.

References vl::Image::width().

◆ setPointSize()

void vl::VectorGraphics::setPointSize ( int  size)
inline

The current point size.

Definition at line 405 of file VectorGraphics.hpp.

◆ setPointSmoothing()

void vl::VectorGraphics::setPointSmoothing ( bool  smooth)
inline

The current point smoothing mode.

Definition at line 441 of file VectorGraphics.hpp.

◆ setPolygonSmoothing()

void vl::VectorGraphics::setPolygonSmoothing ( bool  smooth)
inline

The current polygon smoothing mode.

Definition at line 453 of file VectorGraphics.hpp.

◆ setPolygonStipple() [1/2]

void VectorGraphics::setPolygonStipple ( EPolygonStipple  stipple)

◆ setPolygonStipple() [2/2]

void vl::VectorGraphics::setPolygonStipple ( unsigned char *  stipple)
inline

The current polygon stipple.

Definition at line 471 of file VectorGraphics.hpp.

◆ setScissor()

void vl::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.

Definition at line 546 of file VectorGraphics.hpp.

Referenced by pushScissor().

◆ setStencilFunc()

void VectorGraphics::setStencilFunc ( 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.

Definition at line 414 of file VectorGraphics.cpp.

◆ setStencilMask()

void vl::VectorGraphics::setStencilMask ( unsigned int  mask)
inline

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

Definition at line 513 of file VectorGraphics.hpp.

◆ setStencilOp()

void VectorGraphics::setStencilOp ( EStencilOp  sfail,
EStencilOp  dpfail,
EStencilOp  dppass 
)

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

Definition at line 400 of file VectorGraphics.cpp.

◆ setStencilTestEnabled()

void vl::VectorGraphics::setStencilTestEnabled ( bool  enabled)
inline

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

Definition at line 507 of file VectorGraphics.hpp.

◆ setTextureMode()

void vl::VectorGraphics::setTextureMode ( ETextureMode  mode)
inline

The current texture mode.

Definition at line 423 of file VectorGraphics.hpp.

◆ setTransform()

void vl::VectorGraphics::setTransform ( Transform transform)
inline

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

Definition at line 638 of file VectorGraphics.hpp.

◆ startDrawing()

void vl::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.

Definition at line 385 of file VectorGraphics.hpp.

◆ stencilMask()

unsigned int vl::VectorGraphics::stencilMask ( ) const
inline

Current stencil mask.

Definition at line 516 of file VectorGraphics.hpp.

◆ stencilTestEnabled()

bool vl::VectorGraphics::stencilTestEnabled ( ) const
inline

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

Definition at line 510 of file VectorGraphics.hpp.

◆ textureMode()

ETextureMode vl::VectorGraphics::textureMode ( ) const
inline

The current texture mode.

Definition at line 426 of file VectorGraphics.hpp.

◆ translate()

void VectorGraphics::translate ( double  x,
double  y,
double  z = 0.0 
)

Translates the current transform matrix.

Definition at line 496 of file VectorGraphics.cpp.

References vl::Matrix4< double >::getTranslation().


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