libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo es el conjunto de objetos y funciones, que permiten ejecutar las operaciones básicas de la plataforma Moldeo, y que compone su núcleo.
Referencia de la Clase OGLFT::Solid

Render text as solid letters. Más...

#include <moOGLFT.h>

Diagrama de herencias de OGLFT::Solid
Inheritance graph
Diagrama de colaboración para OGLFT::Solid:
Collaboration graph

Clases

struct  glePoint2D
 Data for the gleExtrusion routine. Más...
 

Métodos públicos

 Solid (const char *filename, float point_size=12, FT_UInt resolution=100)
 
 Solid (FT_Face face, float point_size=12, FT_UInt resolution=100)
 
 ~Solid (void)
 
void setDepth (double depth)
 
double depth (void) const
 
- Métodos públicos heredados desde OGLFT::Filled
 Filled (const char *filename, float point_size=12, FT_UInt resolution=100)
 
 Filled (FT_Face face, float point_size=12, FT_UInt resolution=100)
 
virtual ~ Filled (void)
 
VertexInfoListextraVertices (void)
 
- Métodos públicos heredados desde OGLFT::Polygonal
 Polygonal (const char *filename, float point_size=12, FT_UInt resolution=100)
 
 Polygonal (FT_Face face, float point_size=12, FT_UInt resolution=100)
 
virtual ~ Polygonal (void)
 
void setTessellationSteps (unsigned int tessellation_steps)
 
unsigned int tessellationSteps (void) const
 
void setCharacterRotationX (GLfloat character_rotation_x)
 
void setCharacterRotationY (GLfloat character_rotation_y)
 
void setCharacterRotationZ (GLfloat character_rotation_z)
 
GLfloat characterRotationX (void) const
 
GLfloat characterRotationY (void) const
 
GLfloat characterRotationZ (void) const
 
void setColorTess (ColorTess *color_tess)
 
ColorTesscolorTess (void) const
 
void setTextureTess (TextureTess *texture_tess)
 
TextureTesstextureTess (void) const
 
double height (void) const
 
BBox measure (unsigned char c)
 
BBox measure (const char *s)
 
- Métodos públicos heredados desde OGLFT::Face
 Face (const char *filename, float point_size=12, FT_UInt resolution=100)
 
 Face (FT_Face face, float point_size=12, FT_UInt resolution=100)
 
virtual ~ Face (void)
 
bool isValid (void) const
 
bool addAuxiliaryFace (const char *filename)
 
bool addAuxiliaryFace (FT_Face face)
 
void setCompileMode (enum GlyphCompileMode compile_mode)
 
enum GlyphCompileMode compileMode (void) const
 
void setPointSize (float point_size)
 
float pointSize (void)
 
void setResolution (FT_UInt resolution)
 
FT_UInt resolution (void)
 
void setAdvance (bool advance)
 
bool advance (void) const
 
void setForegroundColor (GLfloat red=0.0, GLfloat green=0.0, GLfloat blue=0.0, GLfloat alpha=1.0)
 
void setForegroundColor (const GLfloat foreground_color[4])
 
GLfloat foregroundRed (void) const
 
GLfloat foregroundGreen (void) const
 
GLfloat foregroundBlue (void) const
 
GLfloat foregroundAlpha (void) const
 
void setBackgroundColor (GLfloat red=1.0, GLfloat green=1.0, GLfloat blue=1.0, GLfloat alpha=0.0)
 
void setBackgroundColor (const GLfloat background_color[4])
 
GLfloat backgroundRed (void) const
 
GLfloat backgroundGreen (void) const
 
GLfloat backgroundBlue (void) const
 
GLfloat backgroundAlpha (void) const
 
void setCharacterRotationReference (unsigned char c)
 
void setStringRotation (GLfloat string_rotation)
 
GLfloat stringRotation (void) const
 
void setHorizontalJustification (enum HorizontalJustification horizontal_justification)
 
enum HorizontalJustification horizontalJustification (void) const
 
void setVerticalJustification (enum VerticalJustification vertical_justification)
 
enum VerticalJustification verticaljustification (void) const
 
void setCharacterDisplayLists (const DisplayLists &character_display_lists)
 
DisplayListscharacterDisplayLists (void)
 
virtual BBox measureRaw (const char *s)
 
GLuint compile (const char *s)
 
GLuint compile (unsigned char c)
 
void draw (const char *s)
 
void draw (unsigned char c)
 
void draw (GLfloat x, GLfloat y, unsigned char c)
 
void draw (GLfloat x, GLfloat y, GLfloat z, unsigned char c)
 
void draw (GLfloat x, GLfloat y, const char *s)
 
void draw (GLfloat x, GLfloat y, GLfloat z, const char *s)
 
int ascender (void)
 
int descender (void)
 

Métodos privados

void assign (gleDouble a[3], double x, double y, double z)
 
void init (void)
 
void renderGlyph (FT_Face face, FT_UInt glyph_index)
 

Métodos privados estáticos

static int moveToCallback (FT_Vector *to, Solid *solid)
 
static int lineToCallback (FT_Vector *to, Solid *solid)
 
static int conicToCallback (FT_Vector *control, FT_Vector *to, Solid *solid)
 
static int cubicToCallback (FT_Vector *control1, FT_Vector *control2, FT_Vector *to, Solid *solid)
 

Atributos privados

FT_Outline_Funcs interface_
 
struct {
   double   depth_
 
   struct {
      int   x_
 
      int   y_
 
   }   normal_sign_
 
   std::vector< glePoint2D >   contour_
 
   std::vector< glePoint2D >   contour_normals_
 
   gleDouble   up_ [3]
 
   int   n_polyline_pts_
 
   gleDouble   point_array_ [N_POLYLINE_PTS][3]
 
extrusion_
 Collect all the output from GLE in one of these structures. Más...
 

Atributos privados estáticos

static const unsigned int N_POLYLINE_PTS = 4
 For now, you can only get block extruded solids. Más...
 

Otros miembros heredados

- Tipos públicos heredados desde OGLFT::Face
enum  HorizontalJustification { LEFT, ORIGIN, CENTER, RIGHT }
 
enum  VerticalJustification { BOTTOM, BASELINE, MIDDLE, TOP }
 
enum  GlyphCompileMode { COMPILE, IMMEDIATE }
 
- Tipos protegidos heredados desde OGLFT::Polygonal
typedef std::list< VertexInfo *> VertexInfoList
 Normally, we will consider a list of vertices. Más...
 
typedef VertexInfoList::const_iterator VILCI
 A convenience definition of the iterator over the list of vertices. Más...
 
typedef VertexInfoList::iterator VILI
 A convenience definition of the iterator over the list of vertices. Más...
 
- Tipos protegidos heredados desde OGLFT::Face
typedef std::map< FT_UInt, GLuint > GlyphDLists
 Type of the cache of defined glyph to display list mapping. Más...
 
typedef GlyphDLists::const_iterator GDLCI
 
typedef GlyphDLists::iterator GDLI
 
- Métodos protegidos heredados desde OGLFT::Polygonal
void clearCaches (void)
 
- Atributos protegidos heredados desde OGLFT::Filled
GLfloat depth_offset_
 
- Atributos protegidos heredados desde OGLFT::Polygonal
struct {
   bool   active_
 
   GLfloat   x_
 
   GLfloat   y_
 
   GLfloat   z_
 
character_rotation_
 Angle of rotation of characters relative to text orientation. Más...
 
unsigned int tessellation_steps_
 
double delta_
 
double delta2_
 
double delta3_
 
double vector_scale_
 
FT_Outline_Funcs interface_
 Callbacks for FreeType glyph decomposition into outlines. Más...
 
VertexInfo last_vertex_
 
VertexInfoList vertices_
 
bool contour_open_
 
ColorTesscolor_tess_
 
TextureTesstexture_tess_
 
- Atributos protegidos heredados desde OGLFT::Face
std::vector< FaceDatafaces_
 
bool valid_
 Did a font load OK? Más...
 
enum GlyphCompileMode compile_mode_
 Glyph display list creation mode. Más...
 
float point_size_
 Nominal point size. Más...
 
FT_UInt resolution_
 Display resolution in pixels per inch. Más...
 
bool advance_
 Does rendering text affect the MODELVIEW matrix? Más...
 
GLfloat foreground_color_ [4]
 
GLfloat background_color_ [4]
 Background color (what modes would use this?) Más...
 
enum HorizontalJustification horizontal_justification_
 PHIGS-like horizontal positioning of text. Más...
 
enum VerticalJustification vertical_justification_
 PHIGS-like vertical positioning of text. Más...
 
GLfloat string_rotation_
 Rotate an entire string in the Z plane. Más...
 
FT_UInt rotation_reference_glyph_
 
FT_Face rotation_reference_face_
 The rotation reference character could be in any face. Más...
 
GLfloat rotation_offset_y_
 
GlyphDLists glyph_dlists_
 Cache of defined glyph display lists. Más...
 
DisplayLists character_display_lists_
 
- Atributos protegidos estáticos heredados desde OGLFT::Polygonal
static const unsigned int DEFAULT_TESSELLATION_STEPS = 4
 

Descripción detallada

Render text as solid letters.

solid_class.png

Each glyph is drawn as a closed solid. The contours are extracted from the font file through FreeType. FreeType is used to scale the contours to the given size. The contours are passed to the GLE tubing and extrusion library to create the sides of the solid. Then the GLU tessellation routines are used to tessellate the contours into polygons which are used to cap the sides.

Currently, the solids are drawn only in the foreground color. However, proper surface normals are computed so that the solids may be lighted. Eventually, you'll be able to supply a color/texture coordinate function to make glyphs more interesting. Note that you can use the per-glyph display list functionality to alter each glyph individually.

Another TODO item is to improve the interaction with GLE. Currently, you can only create block solids. Eventually, we'll have the capability add bevels and rounds to the edges of the solids and maybe even more general extrusions (like, for example, the swooshing letters in the title sequence of the Salkind's 1978 "Superman" movie).

The only complexity to this style is selecting the point size. Since the glyphs are drawn as a collection of polygons, they are subject to the viewing and modeling transformations. The point size is nominally chosen to be the same as a raster image generated at the given resolution. Some experimentation with point size and resolution may be necessary to achieve the desired results.

Definición en la línea 1587 del archivo moOGLFT.h.

Documentación del constructor y destructor

◆ Solid() [1/2]

OGLFT::Solid::Solid ( const char *  filename,
float  point_size = 12,
FT_UInt  resolution = 100 
)
Parámetros
filenamethe filename which contains the font face.
point_sizethe initial point size of the font to generate. A point is essentially 1/72th of an inch. Defaults to 12.
resolutionthe pixel density of the display in dots per inch (DPI). Defaults to 100 DPI.

Definición en la línea 2837 del archivo moOGLFT.cpp.

Gráfico de llamadas para esta función:

◆ Solid() [2/2]

OGLFT::Solid::Solid ( FT_Face  face,
float  point_size = 12,
FT_UInt  resolution = 100 
)
Parámetros
faceopen FreeType FT_Face.
point_sizethe initial point size of the font to generate. A point is essentially 1/72th of an inch. Defaults to 12.
resolutionthe pixel density of the display in dots per inch (DPI). Defaults to 100 DPI.

Definición en la línea 2845 del archivo moOGLFT.cpp.

Gráfico de llamadas para esta función:

◆ ~Solid()

OGLFT::Solid::~Solid ( void  )

The destructor doesn't do anything in particular.

Definición en la línea 2877 del archivo moOGLFT.cpp.

Documentación de las funciones miembro

◆ assign()

void OGLFT::Solid::assign ( gleDouble  a[3],
double  x,
double  y,
double  z 
)
inlineprivate

Definición en la línea 1676 del archivo moOGLFT.h.

Gráfico de llamadas a esta función:

◆ conicToCallback()

int OGLFT::Solid::conicToCallback ( FT_Vector *  control,
FT_Vector *  to,
Solid solid 
)
staticprivate

Definición en la línea 3062 del archivo moOGLFT.cpp.

Gráfico de llamadas para esta función:
Gráfico de llamadas a esta función:

◆ cubicToCallback()

int OGLFT::Solid::cubicToCallback ( FT_Vector *  control1,
FT_Vector *  control2,
FT_Vector *  to,
Solid solid 
)
staticprivate

Definición en la línea 3129 del archivo moOGLFT.cpp.

Gráfico de llamadas para esta función:
Gráfico de llamadas a esta función:

◆ depth()

double OGLFT::Solid::depth ( void  ) const
inline
Devuelve
the solid extrusion depth.

Definición en la línea 1669 del archivo moOGLFT.h.

Gráfico de llamadas a esta función:

◆ init()

void OGLFT::Solid::init ( void  )
private

Definición en la línea 2851 del archivo moOGLFT.cpp.

Gráfico de llamadas para esta función:
Gráfico de llamadas a esta función:

◆ lineToCallback()

int OGLFT::Solid::lineToCallback ( FT_Vector *  to,
Solid solid 
)
staticprivate

Definición en la línea 3040 del archivo moOGLFT.cpp.

Gráfico de llamadas para esta función:
Gráfico de llamadas a esta función:

◆ moveToCallback()

int OGLFT::Solid::moveToCallback ( FT_Vector *  to,
Solid solid 
)
staticprivate

Definición en la línea 3004 del archivo moOGLFT.cpp.

Gráfico de llamadas para esta función:
Gráfico de llamadas a esta función:

◆ renderGlyph()

void OGLFT::Solid::renderGlyph ( FT_Face  face,
FT_UInt  glyph_index 
)
privatevirtual

Each style implements its own glyph rendering routine.

Parámetros
facethe FT_Face containing the glyph.
glyph_indexthe index of the glyph in face.

Reimplementado de OGLFT::Filled.

Definición en la línea 2894 del archivo moOGLFT.cpp.

Gráfico de llamadas para esta función:

◆ setDepth()

void OGLFT::Solid::setDepth ( double  depth)

Set the thickness of the solid

Parámetros
depththickness of the solid in model units.

Definición en la línea 2882 del archivo moOGLFT.cpp.

Gráfico de llamadas para esta función:

Documentación de los datos miembro

◆ contour_

std::vector< glePoint2D > OGLFT::Solid::contour_

Definición en la línea 1629 del archivo moOGLFT.h.

◆ contour_normals_

std::vector< glePoint2D > OGLFT::Solid::contour_normals_

Definición en la línea 1630 del archivo moOGLFT.h.

◆ depth_

double OGLFT::Solid::depth_

Definición en la línea 1624 del archivo moOGLFT.h.

◆ extrusion_

struct { ... } OGLFT::Solid::extrusion_

Collect all the output from GLE in one of these structures.

◆ interface_

FT_Outline_Funcs OGLFT::Solid::interface_
private

Callbacks for FreeType glyph decomposition into outlines (note: this has the same name as the variable in Polygonal, but it is distinct since the routines for the GLE contouring are different from the Filled GLU tessellation routines. This may be too confusing?)

Definición en la línea 1595 del archivo moOGLFT.h.

◆ N_POLYLINE_PTS

const unsigned int OGLFT::Solid::N_POLYLINE_PTS = 4
staticprivate

For now, you can only get block extruded solids.

Definición en la línea 1598 del archivo moOGLFT.h.

◆ n_polyline_pts_

int OGLFT::Solid::n_polyline_pts_

Definición en la línea 1632 del archivo moOGLFT.h.

◆ normal_sign_

struct { ... } OGLFT::Solid::normal_sign_

◆ point_array_

gleDouble OGLFT::Solid::point_array_[N_POLYLINE_PTS][3]

Definición en la línea 1633 del archivo moOGLFT.h.

◆ up_

gleDouble OGLFT::Solid::up_[3]

Definición en la línea 1631 del archivo moOGLFT.h.

◆ x_

int OGLFT::Solid::x_

Definición en la línea 1627 del archivo moOGLFT.h.

◆ y_

int OGLFT::Solid::y_

Definición en la línea 1627 del archivo moOGLFT.h.


La documentación para esta clase fue generada a partir de los siguientes ficheros: