Archon::X3D::Text Struct Reference

Server side representation of the equally named X3D node type. More...

#include <archon/x3d/server/text.H>

Inheritance diagram for Archon::X3D::Text:

Inheritance graph
[legend]
Collaboration diagram for Archon::X3D::Text:

Collaboration graph
[legend]
List of all members.

Public Member Functions

const NodeTypegetType () const
 Text (BackRef< ExecutionContext > c)
vector< string > getString () const
Ref< const FontStyleNodegetFontStyle () const
vector< double > getLength () const
double getMaxExtent () const
bool getSolid () const
int intersect (const Math::Ray3 &, double &dist) const
void getNormalAndTexCoord (Vector3 hitPoint, int where, const Shape *, Vector3 *hitNormal, Vector2 *hitTexCoord) const
void render (bool texture, const Shape *shape, const RenderConfig *)
 The meaning of a line spacing of 1 (as specified by the FontStyle node) is taken to be relativly equal to the nominal line spacing explicitly specified by the font.

Static Public Member Functions

static Ref< NodeBaseinstantiate (BackRef< ExecutionContext > c)

Static Public Attributes

static const NodeTypetype = 0

Friends

void initializeTextComponent ()

Detailed Description

Server side representation of the equally named X3D node type.

Definition at line 108 of file text.H.


Member Function Documentation

int Archon::X3D::Text::intersect const Math::Ray3 ,
double &  dist
const [virtual]
 

Todo:
The X3D specification says that "The Text node does not participate in collision detection", but does this mean that one cannot activate a pointing device sensor via the text node, or does it only refer to the fact that the text node will not interfear with your avatar when walking? (In fact, the latest version of the specification does not mention anything about collision detection or sensor interaction)

Implements Archon::X3D::GeometryNode.

Definition at line 132 of file text.C.

void Archon::X3D::Text::render bool  texture,
const Shape shape,
const RenderConfig renderConfig
[virtual]
 

The meaning of a line spacing of 1 (as specified by the FontStyle node) is taken to be relativly equal to the nominal line spacing explicitly specified by the font.

Todo:
We can improve performance by doing nothing when the text will be back-face-culled.

Todo:
Support vertical layout.

Todo:
Support texturing through TextureNodes on text by utilizing OpenGLs multi texture support.
But this will probably come easier after implementing the general MultiTexture facility of X3D.

Todo:
Support more than the ISO Latin-1 subset of the Unicode character set.
This will require some sort of paging, ie. a table of font pages that are currently available. A page could obviously have size "256 glyphs", but smaller sizes may lead to better memory utilization (less waste).

Todo:
We must recognize the standard font family names "SERIF", "SANS" and "TYPEWRITER" and be able to map them to specific font faces that conform with the X3D specification.
Currently we just check for one alternative name before giving up. the alternative name for "SERIF" is "Times New Roman", for "SANS" it is "Arial" and for "TYPEWRITER" it is "Courier New". This works fine if you have access to the fonts from a Microsoft Windows installation. But a better alternative should be strived for.

Todo:
Font glyphs could be packed much better in the texture than they are right now.
Currently we waste a lot of precious texture memory, and it quickly ruins performance.

Todo:
Apply kerning information.
See the FreeType separate glyph documentation if you feel clueless.

Todo:
Because the text rendering utilizes transparency for anti-aliasing purposes, the order of rendering starts to get important.
Currently there is no control of rendering order, that is, nodes are rendered in the order they occur in the source file. One possible way to deal with this problem would be to detect polygons with transparent features, and instead of rendering them rigt away they should be saved with global coordinates and all OpenGL properties into a BSP tree. Then when all the opaque polygons are rendered the polygons from the BSP tree are rendered in depth order with 'write to depthbuffer' disabled. A drawback is that these polygons cannot be compiled into a calllist as usual. Proberbly a better alternative to storing individual polygons in a BSP tree would be to postpone rendering of the individual text nodes. This should be done by somehow saving the local coordinate system and information about which directional light sources that are active. Then the text nodes can be sorted in order of distance to the local origin and rendered in that order after the normal rendering. This will not produce an optimal result with respect to quality when text nodes are intersecting each other or just too close together, but it might be good enough. Another way to deal with the problem might be to utilize the alpha buffer. Yet another way would be to abandon the anti-aliasing feature and then use alpha-testing to achive on/off-transparency. This can be done without regard to rendering order. Finally we should considder these problems togeter with the more general challenge in getting transparent textures to work on any kind of geometry.

Todo:
It might be a bad idea to delay rendering just because we need to load fonts.
Maybe we should just bail out if the font is not imediately available, and then either initiate font loading or rely on some external entity to initiate font loading. This would also fit perfectly for the situation where the FreeType simple is unavailable.

Todo:
Currently blending is enabled and then desabled here, but never touched elsewhere.Instead a decision must be made on how to handle transparency in general.

Implements Archon::X3D::GeometryNode.

Definition at line 716 of file text.C.

References Archon::Utilities::Ref< T >::get(), Archon::X3D::FontStyle::getFamily(), Archon::X3D::FontStyle::getHorizontal(), Archon::X3D::FontStyle::getJustify(), Archon::X3D::FontStyle::getLeftToRight(), Archon::X3D::FontStyle::getSize(), Archon::X3D::FontStyle::getSpacing(), Archon::X3D::FontStyle::getStyle(), Archon::X3D::FontStyle::getTopToBottom(), size, Archon::X3D::RenderConfig::textAsQuadsMode, and Archon::X3D::RenderConfig::wireframeMode.


The documentation for this struct was generated from the following files:
Generated on Sun Jul 30 23:01:05 2006 for Archon by  doxygen 1.4.4