Free Electron
Public Types | Public Member Functions | List of all members
fe::ext::DrawI Class Referenceabstract

Generalized drawing of points, lines, text, and basic triangles. More...

#include <DrawI.h>

Inheritance diagram for fe::ext::DrawI:
Inheritance graph
[legend]

Public Types

enum  StripMode {
  e_discrete,
  e_strip,
  e_fan,
  e_triple
}
 Format of vertices for tri-stripping. More...
 
enum  MatrixMode {
  e_modelview,
  e_projection,
  e_texture,
  e_color
}
 

Public Member Functions

virtual void setDrawMode (sp< DrawMode > mode)=0
 Set rendering mode. More...
 
virtual sp< DrawModedrawMode (void) const =0
 Get rendering mode. More...
 
virtual void pushDrawMode (sp< DrawMode > mode)=0
 Push rendering mode onto stack. More...
 
virtual sp< DrawModepopDrawMode (void)=0
 Pop rendering mode from stack. More...
 
virtual void pushMatrixState (void)=0
 Push transform matrices. More...
 
virtual void popMatrixState (void)=0
 Pop transform matrices. More...
 
virtual void pushMatrix (MatrixMode a_mode, Real a_values[16])=0
 push a new 4x4 matrix on a particular stack More...
 
virtual void popMatrix (MatrixMode a_mode)=0
 pop the top 4x4 matrix from a particular stack More...
 
virtual void unbindVertexArray (void)=0
 currently, sets vertex array to zero in OpenGL More...
 
virtual void setBrightness (Real a_brightness)=0
 set additive lightening More...
 
virtual Real brightness (void)=0
 get lightening More...
 
virtual void setContrast (Real a_contrast)=0
 set multiplicitive light scaling More...
 
virtual Real contrast (void)=0
 get light scaling More...
 
virtual BWORD isDirect (void) const =0
 Returns TRUE is display is local and rendered directly. More...
 
virtual void setDrawChain (sp< DrawI > a_spDrawI)=0
 Set next DrawI in a chain. More...
 
virtual sp< DrawIdrawChain (void)=0
 
virtual void setTransform (const SpatialTransform &a_rTransform)=0
 Impose a spatial translation. More...
 
virtual void flush (void)=0
 Called once after each frame. More...
 
virtual void flushLive (void)=0
 Pass on current input data as is. More...
 
virtual void clearInput (void)=0
 Reset the current input queue. More...
 
virtual BWORD empty (void) const =0
 Returns TRUE if the current input queue is empty. More...
 
virtual void setView (sp< ViewI > spViewI)=0
 Set current view. More...
 
virtual sp< ViewIview (void) const =0
 Get current view. More...
 
virtual sp< FontIfont (void)=0
 Get current font. More...
 
virtual Real multiplication (void)=0
 Select the GL-specific index/handle. More...
 
virtual void drawPoints (const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, BWORD multicolor, const Color *color)=0
 Draw points vertex[vertices]. More...
 
virtual void drawPoints (const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, BWORD multicolor, const Color *color, sp< DrawBufferI > spDrawBuffer)=0
 
virtual void drawLines (const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)=0
 Draw lines. More...
 
virtual void drawLines (const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, StripMode strip, BWORD multicolor, const Color *color, BWORD multiradius, const Real *radius, const Vector3i *element, U32 elementCount, sp< DrawBufferI > spDrawBuffer)=0
 
virtual void drawCurve (const SpatialVector *vertex, const SpatialVector *normal, const Real *radius, U32 vertices, BWORD multicolor, const Color *color)=0
 Draw one curve. More...
 
virtual void drawTriangles (const SpatialVector *vertex, const SpatialVector *normal, const Vector2 *texture, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)=0
 Draw triangles. More...
 
virtual void drawTriangles (const SpatialVector *vertex, const SpatialVector *normal, const Vector2 *texture, U32 vertices, StripMode strip, BWORD multicolor, const Color *color, const Array< I32 > *vertexMap, const Array< I32 > *hullPointMap, const Array< Vector4i > *hullFacePoint, sp< DrawBufferI > spDrawBuffer)=0
 
virtual void drawRectangles (const SpatialVector *vertex, U32 vertices, BWORD multicolor, const Color *color)=0
 Draw rectangles. More...
 
virtual void draw (cp< DrawableI > cpDrawableI, const Color *color)=0
 Draw DrawableI. More...
 
virtual void draw (cp< DrawableI > cpDrawableI, const Color *color, sp< DrawBufferI > spDrawBuffer)=0
 
virtual void drawTransformed (const SpatialTransform &transform, cp< DrawableI > cpDrawableI, const Color *color)=0
 
virtual void drawTransformed (const SpatialTransform &transform, cp< DrawableI > cpDrawableI, const Color *color, sp< DrawBufferI > spDrawBuffer)=0
 
virtual void drawBox (const Box2 &box, const Color &color)=0
 Draw 2D box. More...
 
virtual void drawBox (const Box2i &box, const Color &color)=0
 Draw 2D box with pixel adjustments. More...
 
virtual void drawBox (const Box3 &box, const Color &color)=0
 Draw 3D box. More...
 
virtual void drawAlignedText (const SpatialVector &location, const String text, const Color &color)=0
 Draw screen-aligned single color text. More...
 
virtual void drawCircle (const SpatialTransform &transform, const SpatialVector *scale, const Color &color)=0
 
virtual void drawSphere (const SpatialTransform &transform, const SpatialVector *scale, const Color &color)=0
 
virtual void drawCylinder (const SpatialTransform &transform, const SpatialVector *scale, Real baseScale, const Color &color, U32 slices)=0
 Draw a transformed cylinder or cone. More...
 
virtual void drawCylinder (const SpatialVector &location1, const SpatialVector &location2, Real radius1, Real radius2, const Color &color, U32 slices)=0
 
virtual void drawCylinders (const SpatialTransform *transform, const SpatialVector *scale, const Real *baseScale, const U32 *slices, U32 cylinders, BWORD multicolor, const Color *color)=0
 
virtual void drawTransformedCylinders (const SpatialTransform &pretransform, const SpatialTransform *transform, const SpatialVector *scale, const Real *baseScale, const U32 *slices, U32 cylinders, BWORD multicolor, const Color *color)=0
 
virtual void drawArc (const SpatialTransform &transform, const SpatialVector *scale, Real startangle, Real endangle, const Color &color)=0
 
virtual void drawTransformedPoints (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, BWORD multicolor, const Color *color)=0
 
virtual void drawTransformedPoints (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, BWORD multicolor, const Color *color, sp< DrawBufferI > spDrawBuffer)=0
 
virtual void drawTransformedLines (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)=0
 
virtual void drawTransformedLines (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, StripMode strip, BWORD multicolor, const Color *color, BWORD multiradius, const Real *radius, const Vector3i *element, U32 elementCount, sp< DrawBufferI > spDrawBuffer)=0
 
virtual void drawTransformedCurve (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, const Real *radius, U32 vertices, BWORD multicolor, const Color *color)=0
 
virtual void drawTransformedTriangles (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, const Vector2 *texture, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)=0
 
virtual void drawTransformedTriangles (const SpatialTransform &transform, const SpatialVector *scale, const SpatialVector *vertex, const SpatialVector *normal, const Vector2 *texture, U32 vertices, StripMode strip, BWORD multicolor, const Color *color, const Array< I32 > *vertexMap, const Array< I32 > *hullPointMap, const Array< Vector4i > *hullFacePoint, sp< DrawBufferI > spDrawBuffer)=0
 
virtual void drawTransformedBox (const SpatialTransform &transform, const Box3 &box, const Color &color)=0
 
virtual void drawTransformedBoxes (const SpatialTransform *transform, const SpatialVector *scale, U32 boxes, BWORD multicolor, const Color *color)=0
 
virtual void drawAxes (Real scale)=0
 
virtual void drawTransformedAxes (const SpatialTransform &transform, Real scale)=0
 
virtual void drawMarker (Real radius, const Color &color)=0
 
virtual void drawTransformedMarker (const SpatialTransform &transform, Real radius, const Color &color)=0
 
virtual void drawRaster (sp< ImageI > spImageI, const SpatialVector &location)=0
 
virtual sp< DrawBufferIcreateBuffer (void)=0
 
- Public Member Functions inherited from fe::Component
const Stringname (void) const
 Return the components chosen name. More...
 
const String verboseName (void) const
 Return the annotated chosen name. More...
 
void setName (const String &name)
 Rename the component to anything you want. More...
 
hp< Registryregistry (void) const
 Get the Registry that created this component. More...
 
void adjoin (sp< Component > spComponent)
 Tie this component's lifetime to another. More...
 
sp< Componentcreate (const String &implementation, BWORD quiet=FALSE) const
 Convienience function to registry()->create() More...
 
void disjoin (void)
 Untie component from Hub, if connected. More...
 
String factoryName (void)
 
void setLibrary (sp< Library > spLibrary)
 Store a reference to the library used to instantiate this component. More...
 
sp< Librarylibrary (void)
 Get the library that created the component. More...
 
void setFactoryIndex (I32 a_factoryIndex)
 Set the library's factory index. More...
 
I32 factoryIndex (void)
 Get the library's factory index. More...
 
void setSingleton (BWORD set)
 Specify whether component is a singleton. More...
 
BWORD isSingleton (void)
 Return whether component is a singleton. More...
 
virtual void acquire (void)
 Specialized reference increment. More...
 
virtual void release (void)
 Specialized reference decrement. More...
 
- Public Member Functions inherited from fe::Handled< Component >
const hp< Component > & getHandle (void) const
 Get a safe handle to this object. More...
 
- Public Member Functions inherited from fe::Protectable
virtual I32 protection (void) const
 
virtual void protect (void)
 
virtual void unprotect (void)
 
virtual Protectableclone (Protectable *pInstance=NULL)
 
- Public Member Functions inherited from fe::Counted
virtual void acquire (int &rCount)
 Increment the reference count (and get the count) More...
 
virtual void abandon (void)
 Decrement the reference count. More...
 
int count (void) const
 Return the count of references. More...
 
void setName (const String &)
 
void trackReference (void *pReference, String what)
 
void untrackReference (void *pReference)
 
void registerRegion (void *pT, U32 bytes)
 
- Public Member Functions inherited from fe::Initialized
void initializeAll (void)
 
void setActive (bool a_active)
 

Additional Inherited Members

- Static Public Member Functions inherited from fe::Counted
static String reportTracker (void)
 
static U32 trackerCount (void)
 
- Protected Types inherited from fe::Initialized
typedef void(* InitializeFunction) (Initialized *)
 
- Protected Member Functions inherited from fe::Handled< Component >
void abandonHandle (void)
 
- Protected Member Functions inherited from fe::Counted
int releaseInternal (void)
 Decrement the reference count. More...
 
void suppressReport (void)
 
- Protected Member Functions inherited from fe::Initialized
void addInitializer (InitializeFunction function)
 

Detailed Description

Generalized drawing of points, lines, text, and basic triangles.

Member Enumeration Documentation

◆ StripMode

Format of vertices for tri-stripping.

Member Function Documentation

◆ brightness()

virtual Real fe::ext::DrawI::brightness ( void  )
pure virtual

get lightening

Implemented in fe::ext::DrawCommon, and fe::ext::DrawNull.

◆ clearInput()

virtual void fe::ext::DrawI::clearInput ( void  )
pure virtual

Reset the current input queue.

Implemented in fe::ext::DrawCommon, fe::ext::DrawCached, fe::ext::DrawRayTrace, and fe::ext::DrawNull.

◆ contrast()

virtual Real fe::ext::DrawI::contrast ( void  )
pure virtual

get light scaling

Implemented in fe::ext::DrawCommon, and fe::ext::DrawNull.

◆ draw()

virtual void fe::ext::DrawI::draw ( cp< DrawableI cpDrawableI,
const Color color 
)
pure virtual

Draw DrawableI.

If color is NULL, the surface is expected to use its own color data.

Implemented in fe::ext::DrawRayTrace, fe::ext::DrawNull, and fe::ext::DrawCommon.

◆ drawAlignedText()

virtual void fe::ext::DrawI::drawAlignedText ( const SpatialVector location,
const String  text,
const Color color 
)
pure virtual

Draw screen-aligned single color text.

Text is drawn at the given location, transformed and projected by the current state of the underlying graphics system.

Implemented in fe::ext::DrawCommon, fe::ext::DrawCached, fe::ext::DrawRayTrace, fe::ext::DrawNull, fe::ext::DrawOpenGL, fe::ext::DrawMaya, and fe::ext::DrawConsole.

◆ drawBox() [1/3]

virtual void fe::ext::DrawI::drawBox ( const Box2 box,
const Color color 
)
pure virtual

Draw 2D box.

Implemented in fe::ext::DrawNull, and fe::ext::DrawCommon.

◆ drawBox() [2/3]

virtual void fe::ext::DrawI::drawBox ( const Box2i box,
const Color color 
)
pure virtual

Draw 2D box with pixel adjustments.

Implemented in fe::ext::DrawNull, and fe::ext::DrawCommon.

◆ drawBox() [3/3]

virtual void fe::ext::DrawI::drawBox ( const Box3 box,
const Color color 
)
pure virtual

Draw 3D box.

Implemented in fe::ext::DrawNull, and fe::ext::DrawCommon.

◆ drawCurve()

virtual void fe::ext::DrawI::drawCurve ( const SpatialVector vertex,
const SpatialVector normal,
const Real *  radius,
U32  vertices,
BWORD  multicolor,
const Color color 
)
pure virtual

Draw one curve.

Uses vertices and colors as explained in drawPoints.

This is similar to drawLines in strip mode and with a radius property.

Implemented in fe::ext::DrawCommon, fe::ext::DrawNull, fe::ext::TerminalDraw, and fe::ext::GodotDraw.

◆ drawCylinder()

virtual void fe::ext::DrawI::drawCylinder ( const SpatialTransform transform,
const SpatialVector scale,
Real  baseScale,
const Color color,
U32  slices 
)
pure virtual

Draw a transformed cylinder or cone.

The baseScale is a additional scale at the base of the cylinder. For a cone, specify a baseScale of 0.

Implemented in fe::ext::DrawCached, fe::ext::DrawRayTrace, fe::ext::DrawNull, fe::ext::DrawCommon, and fe::ext::DrawConsole.

◆ drawLines()

virtual void fe::ext::DrawI::drawLines ( const SpatialVector vertex,
const SpatialVector normal,
U32  vertices,
StripMode  strip,
BWORD  multicolor,
const Color color 
)
pure virtual

Draw lines.

Uses vertices and colors as explained in drawPoints.

If strip is DrawI::e_strip, vertices are contiguous with vertices-1 segments, else vertices are independent pairs with vertices/2 segments.

Implemented in fe::ext::DrawCommon, and fe::ext::DrawNull.

◆ drawMode()

virtual sp<DrawMode> fe::ext::DrawI::drawMode ( void  ) const
pure virtual

Get rendering mode.

Implemented in fe::ext::DrawCommon, and fe::ext::DrawNull.

◆ drawPoints()

virtual void fe::ext::DrawI::drawPoints ( const SpatialVector vertex,
const SpatialVector normal,
U32  vertices,
BWORD  multicolor,
const Color color 
)
pure virtual

Draw points vertex[vertices].

The array vertex is assumed to contain vertices elements. If multicolor, points are independently colored with color[vertices], else only color[0] is used. If color is NULL, no colors are specified, so the current color state is left in effect.

Implemented in fe::ext::DrawCommon, and fe::ext::DrawNull.

◆ drawRectangles()

virtual void fe::ext::DrawI::drawRectangles ( const SpatialVector vertex,
U32  vertices,
BWORD  multicolor,
const Color color 
)
pure virtual

Draw rectangles.

Uses vertices and colors as explained in drawPoints.

Rectangles are never stripped.

Implemented in fe::ext::DrawCommon, fe::ext::DrawCached, fe::ext::DrawNull, fe::ext::DrawOpenGL, and fe::ext::DrawMaya.

◆ drawTriangles()

virtual void fe::ext::DrawI::drawTriangles ( const SpatialVector vertex,
const SpatialVector normal,
const Vector2 texture,
U32  vertices,
StripMode  strip,
BWORD  multicolor,
const Color color 
)
pure virtual

Draw triangles.

Uses vertices and colors as explained in drawPoints.

Normals are treated the same as vertices. If strip is DrawI::e_strip, vertices are tri-striped with vertices-2 triangles, else vertices are independent triplets with vertices/3 triangles.

Implemented in fe::ext::DrawCommon, and fe::ext::DrawNull.

◆ empty()

virtual BWORD fe::ext::DrawI::empty ( void  ) const
pure virtual

Returns TRUE if the current input queue is empty.

Implemented in fe::ext::DrawCommon, fe::ext::DrawCached, and fe::ext::DrawNull.

◆ flush()

virtual void fe::ext::DrawI::flush ( void  )
pure virtual

Called once after each frame.

This shifts data access to freeze the current input buffer and prepare a new empty input buffer.

The resulting output buffer is sent on to the next DrawI interface.

Implemented in fe::ext::DrawCommon, fe::ext::DrawCached, fe::ext::DrawRayTrace, fe::ext::DrawNull, fe::ext::DrawOpenGL, fe::ext::DrawHydra, fe::ext::DrawThreaded, and fe::ext::DrawConsole.

◆ flushLive()

virtual void fe::ext::DrawI::flushLive ( void  )
pure virtual

Pass on current input data as is.

This sends the current input to the next DrawI interface without shifting buffers. The same input can still be written to afterwards.

Implemented in fe::ext::DrawCommon, fe::ext::DrawCached, fe::ext::DrawRayTrace, and fe::ext::DrawNull.

◆ font()

virtual sp<FontI> fe::ext::DrawI::font ( void  )
pure virtual

◆ isDirect()

virtual BWORD fe::ext::DrawI::isDirect ( void  ) const
pure virtual

Returns TRUE is display is local and rendered directly.

Implemented in fe::ext::DrawCommon, fe::ext::DrawCached, fe::ext::DrawOpenGL, and fe::ext::DrawNull.

◆ multiplication()

virtual Real fe::ext::DrawI::multiplication ( void  )
pure virtual

Select the GL-specific index/handle.

An index of 0 indicates no font. upscaling preference, such as for high DPI

Implemented in fe::ext::DrawCommon, fe::ext::DrawCached, fe::ext::DrawNull, fe::ext::DrawOpenGL, and fe::ext::DrawMaya.

◆ popDrawMode()

virtual sp<DrawMode> fe::ext::DrawI::popDrawMode ( void  )
pure virtual

Pop rendering mode from stack.

Implemented in fe::ext::DrawCommon, and fe::ext::DrawNull.

◆ popMatrix()

virtual void fe::ext::DrawI::popMatrix ( MatrixMode  a_mode)
pure virtual

pop the top 4x4 matrix from a particular stack

Implemented in fe::ext::DrawCommon, fe::ext::DrawOpenGL, and fe::ext::DrawNull.

◆ popMatrixState()

virtual void fe::ext::DrawI::popMatrixState ( void  )
pure virtual

Pop transform matrices.

Implemented in fe::ext::DrawCommon, fe::ext::DrawOpenGL, and fe::ext::DrawNull.

◆ pushDrawMode()

virtual void fe::ext::DrawI::pushDrawMode ( sp< DrawMode mode)
pure virtual

Push rendering mode onto stack.

Implemented in fe::ext::DrawCommon, and fe::ext::DrawNull.

◆ pushMatrix()

virtual void fe::ext::DrawI::pushMatrix ( MatrixMode  a_mode,
Real  a_values[16] 
)
pure virtual

push a new 4x4 matrix on a particular stack

Implemented in fe::ext::DrawCommon, fe::ext::DrawOpenGL, and fe::ext::DrawNull.

◆ pushMatrixState()

virtual void fe::ext::DrawI::pushMatrixState ( void  )
pure virtual

Push transform matrices.

Implemented in fe::ext::DrawCommon, fe::ext::DrawOpenGL, and fe::ext::DrawNull.

◆ setBrightness()

virtual void fe::ext::DrawI::setBrightness ( Real  a_brightness)
pure virtual

set additive lightening

Implemented in fe::ext::DrawCommon, fe::ext::DrawOpenGL, and fe::ext::DrawNull.

◆ setContrast()

virtual void fe::ext::DrawI::setContrast ( Real  a_contrast)
pure virtual

set multiplicitive light scaling

Implemented in fe::ext::DrawCommon, fe::ext::DrawOpenGL, and fe::ext::DrawNull.

◆ setDrawChain()

virtual void fe::ext::DrawI::setDrawChain ( sp< DrawI a_spDrawI)
pure virtual

Set next DrawI in a chain.

If this DrawI is designed to pass drawing commands to another DrawI, such as for conversion or caching, this commands specifies that next component.

Any implementation may ignore this request.

Implemented in fe::ext::DrawCached, fe::ext::DrawCommon, fe::ext::DrawRayTrace, and fe::ext::DrawNull.

◆ setDrawMode()

virtual void fe::ext::DrawI::setDrawMode ( sp< DrawMode mode)
pure virtual

Set rendering mode.

Implemented in fe::ext::DrawOpenGL, fe::ext::DrawCommon, and fe::ext::DrawNull.

◆ setTransform()

virtual void fe::ext::DrawI::setTransform ( const SpatialTransform a_rTransform)
pure virtual

Impose a spatial translation.

If supported, this adjusts the output in an implementation-specific manner.

Any implementation may ignore this request or just use part of the transform, such as translation only.

Implemented in fe::ext::DrawCommon, fe::ext::DrawRayTrace, and fe::ext::DrawNull.

◆ setView()

virtual void fe::ext::DrawI::setView ( sp< ViewI spViewI)
pure virtual

Set current view.

Implemented in fe::ext::DrawCommon, and fe::ext::DrawNull.

◆ unbindVertexArray()

virtual void fe::ext::DrawI::unbindVertexArray ( void  )
pure virtual

currently, sets vertex array to zero in OpenGL

Implemented in fe::ext::DrawCommon, fe::ext::DrawOpenGL, and fe::ext::DrawNull.

◆ view()

virtual sp<ViewI> fe::ext::DrawI::view ( void  ) const
pure virtual

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