Ran script to remove trailing spaces and tabs
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
# endif
|
||||
#else
|
||||
# define OSGTEXT_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -43,17 +43,17 @@ protected:
|
||||
virtual ~FadeText() {}
|
||||
|
||||
void init();
|
||||
|
||||
|
||||
struct FadeTextUpdateCallback;
|
||||
friend struct FadeTextUpdateCallback;
|
||||
|
||||
typedef std::map<osg::View*, osg::Vec4 > ViewBlendColourMap;
|
||||
|
||||
|
||||
ViewBlendColourMap& getViewBlendColourMap() { return _viewBlendColourMap; }
|
||||
const ViewBlendColourMap& getViewBlendColourMap() const { return _viewBlendColourMap; }
|
||||
|
||||
float _fadeSpeed;
|
||||
|
||||
|
||||
mutable ViewBlendColourMap _viewBlendColourMap;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace osgText {
|
||||
class Font;
|
||||
|
||||
/** Read a font from specified file. The filename may contain a path.
|
||||
* It will search for the font file in the following places in this order:
|
||||
* It will search for the font file in the following places in this order:
|
||||
* - In the current directory
|
||||
* - All paths defined in OSG_FILE_PATH or OSGFILEPATH environment variable
|
||||
* - Filename with path stripped: In the current directory
|
||||
@@ -43,7 +43,7 @@ class Font;
|
||||
* - Other OS: In /usr/share/fonts/ttf
|
||||
* - Other OS: In /usr/share/fonts/ttf/western
|
||||
* - Other OS: In /usr/share/fonts/ttf/decoratives
|
||||
*
|
||||
*
|
||||
* If the given file could not be found, the path part will be stripped and
|
||||
* the file will be searched again in the OS specific directories.
|
||||
*/
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
osg::StateSet* getStateSet() { return _stateset.get(); }
|
||||
const osg::StateSet* getStateSet() const { return _stateset.get(); }
|
||||
|
||||
|
||||
|
||||
/** Get a kerning (adjustment of spacing of two adjacent character) for specified charcodes, w.r.t the current font size hint.*/
|
||||
virtual osg::Vec2 getKerning(unsigned int leftcharcode,unsigned int rightcharcode, KerningType kerningType);
|
||||
|
||||
@@ -110,13 +110,13 @@ public:
|
||||
|
||||
/** Set the margin around each glyph,
|
||||
* to ensure that texture filtering doesn't bleed adjacent glyph's into each other.
|
||||
* Default margin is 1 texels.*/
|
||||
* Default margin is 1 texels.*/
|
||||
void setGlyphImageMargin(unsigned int margin);
|
||||
unsigned int getGlyphImageMargin() const;
|
||||
|
||||
/** Set the margin ratio around each glyph, relative to the glyph's size.
|
||||
* to ensure that texture filtering doesn't bleed adjacent glyph's into each other.
|
||||
* Default margin is 0.05.*/
|
||||
* Default margin is 0.05.*/
|
||||
void setGlyphImageMarginRatio(float margin);
|
||||
float getGlyphImageMarginRatio() const;
|
||||
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
/** Set the size of texture to create to store the glyph images when rendering.
|
||||
* Note, this doesn't affect already created Texture Glhph's.*/
|
||||
void setTextureSizeHint(unsigned int width,unsigned int height);
|
||||
|
||||
|
||||
unsigned int getTextureWidthHint() const;
|
||||
unsigned int getTextureHeightHint() const;
|
||||
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
* Note, this doesn't affect already created Texture Glhph's.*/
|
||||
void setMinFilterHint(osg::Texture::FilterMode mode);
|
||||
osg::Texture::FilterMode getMinFilterHint() const;
|
||||
|
||||
|
||||
/** Set the magnification texture filter to use when creating the texture to store the glyph images when rendering.
|
||||
* Note, this doesn't affect already created Texture Glhph's.*/
|
||||
void setMagFilterHint(osg::Texture::FilterMode mode);
|
||||
@@ -164,10 +164,10 @@ public:
|
||||
virtual void releaseGLObjects(osg::State* state=0) const;
|
||||
|
||||
typedef OpenThreads::Mutex FontMutex;
|
||||
|
||||
|
||||
typedef std::vector< osg::ref_ptr<GlyphTexture> > GlyphTextureList;
|
||||
GlyphTextureList& getGlyphTextureList() { return _glyphTextureList; }
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~Font();
|
||||
@@ -196,28 +196,28 @@ protected:
|
||||
float _marginRatio;
|
||||
|
||||
unsigned int _textureWidthHint;
|
||||
unsigned int _textureHeightHint;
|
||||
unsigned int _textureHeightHint;
|
||||
osg::Texture::FilterMode _minFilterHint;
|
||||
osg::Texture::FilterMode _magFilterHint;
|
||||
|
||||
unsigned int _depth;
|
||||
unsigned int _numCurveSamples;
|
||||
|
||||
|
||||
|
||||
osg::ref_ptr<FontImplementation> _implementation;
|
||||
|
||||
|
||||
|
||||
// declare the nested classes.
|
||||
public:
|
||||
|
||||
class FontImplementation : public osg::Referenced
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
FontImplementation():
|
||||
osg::Referenced(true),
|
||||
_facade(0) {}
|
||||
|
||||
|
||||
virtual std::string getFileName() const = 0;
|
||||
|
||||
virtual bool supportsMultipleFontResolutions() const = 0;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -265,7 +265,7 @@ public:
|
||||
|
||||
/** create an image that maps all the associated Glyph's onto a single image, that is equivilant to what will be downloaded to the texture.*/
|
||||
osg::Image* createImage();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~GlyphTexture();
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -74,7 +74,7 @@ class OSGTEXT_EXPORT String : public VectorUInt
|
||||
|
||||
void set(const std::string& str);
|
||||
|
||||
/** Set the text using a wchar_t string,
|
||||
/** Set the text using a wchar_t string,
|
||||
* which is converted to an internal TextString.*/
|
||||
void set(const wchar_t* text);
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -73,20 +73,20 @@ public:
|
||||
|
||||
enum BackdropImplementation
|
||||
{
|
||||
/* POLYGON_OFFSET:
|
||||
* This uses glPolygonOffset to draw the text multiple times to
|
||||
* create the drop-shadow and outline effects. glPolygonOffset
|
||||
/* POLYGON_OFFSET:
|
||||
* This uses glPolygonOffset to draw the text multiple times to
|
||||
* create the drop-shadow and outline effects. glPolygonOffset
|
||||
* is used to prevent z-fighting of the overlapping text.
|
||||
* This probably should have been the best option, but all the ATI
|
||||
* cards we have encountered so far have serious problems with this.
|
||||
* We see little white holes/artifacts in the rendered glyph textures
|
||||
* which move around depending on the viewing angle. For moving text,
|
||||
* the moving holes give an extremely unpleasant flickering effect.
|
||||
* Pumping up the "units" parameter in glPolygonOffset can minimize
|
||||
* Pumping up the "units" parameter in glPolygonOffset can minimize
|
||||
* this problem, but two other bad side-effects occur if you do this.
|
||||
* First, high values will cause problems with clipping, particularly
|
||||
* when there are objects behind the text. The drop-shadows or outline
|
||||
* may be culled because their computed offset is behind the object or
|
||||
* may be culled because their computed offset is behind the object or
|
||||
* z-far plane. Second, there is an additional problem associated with
|
||||
* the Z-slope. High values can make large chunks of the backdrop
|
||||
* suddenly disappear. This can be reduced by the "factor" parameter.
|
||||
@@ -95,24 +95,24 @@ public:
|
||||
* So there is no perfect solution. With units, you trade off the 'holes'
|
||||
* for the large-section clipping.
|
||||
* Experimentally, we have found units values from 150-512 to be tolerable
|
||||
* to acceptable with respect to the 'holes'. A factor of .1 seems to
|
||||
* to acceptable with respect to the 'holes'. A factor of .1 seems to
|
||||
* bring down the large clipping problem without creating a new z-fighting
|
||||
* problem.
|
||||
* (You can experiment with these numbers by playing with the
|
||||
* (You can experiment with these numbers by playing with the
|
||||
* osg:PolygonOffset multipliers which this backend tries to respect.)
|
||||
*
|
||||
* If ATI ever fixes their cards/drivers, then this might become the
|
||||
* If ATI ever fixes their cards/drivers, then this might become the
|
||||
* best option.*/
|
||||
POLYGON_OFFSET = 0,
|
||||
|
||||
|
||||
/* NO_DEPTH_BUFFER
|
||||
* Instead of using glPolygonOffset to prevent z-fighting, this mode
|
||||
* just disables the depth buffer when rendering the text. This allows
|
||||
* the text to be rendered without any z-fighting. The downside to this
|
||||
* mode is that render order begins to matter and the text will not
|
||||
* necessarily correctly appear above or behind other objects in the
|
||||
* the text to be rendered without any z-fighting. The downside to this
|
||||
* mode is that render order begins to matter and the text will not
|
||||
* necessarily correctly appear above or behind other objects in the
|
||||
* scene based on depth values.
|
||||
* This mode is best for text that only needs to be ontop and
|
||||
* This mode is best for text that only needs to be ontop and
|
||||
* not obscured by any objects.*/
|
||||
NO_DEPTH_BUFFER,
|
||||
|
||||
@@ -120,26 +120,26 @@ public:
|
||||
* This mode is inspired by Paul Martz's OpenGL FAQ, item 13.050.
|
||||
* This uses glDepthRange as a substitute for glPolygonOffset.
|
||||
* Strangely, experiments on ATI cards seem to produce cleaner results
|
||||
* than when using glPolygonOffset. The trade-off for this is that the
|
||||
* than when using glPolygonOffset. The trade-off for this is that the
|
||||
* backdrop still may be placed too far back and might be culled by objects
|
||||
* directly behind the object or by the far z-plane. If ATI ever fixes
|
||||
* the glPolygonOffset problem, polygon offset is probably a slightly
|
||||
* better solution because you can use smaller offsets. But with the
|
||||
* the glPolygonOffset problem, polygon offset is probably a slightly
|
||||
* better solution because you can use smaller offsets. But with the
|
||||
* current ATI problem, this option may be preferable.*/
|
||||
DEPTH_RANGE,
|
||||
/* STENCIL_BUFFER
|
||||
* (Assuming the backend is written correctly,) the Stencil Buffer is
|
||||
* the most "correct" and reliable way of producing backdrop text.
|
||||
* The stencil buffer is a multipass system that allows writing to the
|
||||
* The stencil buffer is a multipass system that allows writing to the
|
||||
* same z-values without needing to resort to offsets. This implementation
|
||||
* should not have any of the problems associated with the 3 previous
|
||||
* implementations. But the trade-off for this mode is that without
|
||||
* hardware acceleration for the stencil buffer, rendering will be
|
||||
* extremely slow. (There is also potentially more overhead for this
|
||||
* algorithm so it could be slower than the other implementations.
|
||||
* implementations. But the trade-off for this mode is that without
|
||||
* hardware acceleration for the stencil buffer, rendering will be
|
||||
* extremely slow. (There is also potentially more overhead for this
|
||||
* algorithm so it could be slower than the other implementations.
|
||||
* Benchmarking would be required to determine if the speed differences
|
||||
* are significant on your particular hardware.) This mode is best for
|
||||
* when quality is important and stencil buffer hardware acceleration
|
||||
* are significant on your particular hardware.) This mode is best for
|
||||
* when quality is important and stencil buffer hardware acceleration
|
||||
* is available.*/
|
||||
STENCIL_BUFFER,
|
||||
|
||||
@@ -155,17 +155,17 @@ public:
|
||||
};
|
||||
|
||||
/**
|
||||
* BackdropType gives you a background shadow text behind your regular
|
||||
* text. This helps give text extra contrast which can be useful when
|
||||
* placing text against noisy backgrounds.
|
||||
* BackdropType gives you a background shadow text behind your regular
|
||||
* text. This helps give text extra contrast which can be useful when
|
||||
* placing text against noisy backgrounds.
|
||||
* The color of the background shadow text is specified by setBackdropColor().
|
||||
* DROP_SHADOW_BOTTOM_RIGHT will draw backdrop text to the right and down of
|
||||
* DROP_SHADOW_BOTTOM_RIGHT will draw backdrop text to the right and down of
|
||||
* the normal text. Other DROW_SHADOW_* modes do the same for their repective directions.
|
||||
* OUTLINE will draw backdrop text so that it appears the text has an outline
|
||||
* or border around the normal text. This mode is particularly useful against
|
||||
* really noisy backgrounds that may put text on top of things that have
|
||||
* all types of colors which you don't have control over.
|
||||
* Some real world examples of this general technique in use that I know of
|
||||
* really noisy backgrounds that may put text on top of things that have
|
||||
* all types of colors which you don't have control over.
|
||||
* Some real world examples of this general technique in use that I know of
|
||||
* are Google Earth, Sid Meier's Pirates (2004 Remake), and Star Control 2 (PC 1993).
|
||||
* The default is NONE.
|
||||
*/
|
||||
@@ -173,8 +173,8 @@ public:
|
||||
|
||||
BackdropType getBackdropType() const { return _backdropType; }
|
||||
|
||||
/**
|
||||
* Sets the amount text is offset to create the backdrop/shadow effect.
|
||||
/**
|
||||
* Sets the amount text is offset to create the backdrop/shadow effect.
|
||||
* Set the value too high and for example, in OUTLINE mode you will get a "Brady Bunch"
|
||||
* effect where you see duplicates of the text in a 3x3 grid.
|
||||
* Set the value too small and you won't see anything.
|
||||
@@ -185,7 +185,7 @@ public:
|
||||
* to your specific font and display characteristics).
|
||||
* Note that the text bounding boxes are updated to include backdrop offsets.
|
||||
* However, other metric information such as getCharacterHeight() are unaffected
|
||||
* by this. This means that individual glyph spacing (kerning?) are unchanged
|
||||
* by this. This means that individual glyph spacing (kerning?) are unchanged
|
||||
* even when this mode is used.
|
||||
* The default is 0.07 (7% offset).
|
||||
*/
|
||||
@@ -213,7 +213,7 @@ public:
|
||||
* Unfortunately, at this time, there is no "perfect" rendering solution
|
||||
* so this function is provided to let you 'pick your poison'. Each
|
||||
* implementation has trade-offs. See BackdropImplementation enum
|
||||
* docs for details.*/
|
||||
* docs for details.*/
|
||||
void setBackdropImplementation(BackdropImplementation implementation);
|
||||
|
||||
BackdropImplementation getBackdropImplementation() const { return _backdropImplementation; }
|
||||
@@ -229,17 +229,17 @@ public:
|
||||
|
||||
/**
|
||||
* This sets different types of text coloring modes.
|
||||
* When the coloring mode is not set to SOLID, the
|
||||
* When the coloring mode is not set to SOLID, the
|
||||
* colors specified in setColorGradientCorners() determine
|
||||
* the colors for the text.
|
||||
* When the gradient mode is OVERALL, the coloring scheme
|
||||
* attempts to approximate the effect as if the entire text box/region
|
||||
* were a single polygon and you had applied colors to each of the four
|
||||
* corners with GL_SMOOTH enabled. In this mode, OpenGL interpolates
|
||||
* the colors across the polygon, and this is what OVERALL tries to
|
||||
* emulate. This can be used to give nice embellishments on things
|
||||
* the colors across the polygon, and this is what OVERALL tries to
|
||||
* emulate. This can be used to give nice embellishments on things
|
||||
* like logos and names.
|
||||
* PER_CHARACTER is similar to OVERALL except that it applies the
|
||||
* PER_CHARACTER is similar to OVERALL except that it applies the
|
||||
* color interpolation to the four corners of each character instead
|
||||
* of across the overall text box.
|
||||
* The default is SOLID (a.k.a. off).
|
||||
@@ -250,7 +250,7 @@ public:
|
||||
|
||||
/**
|
||||
* Used only for gradient mode, let's you specify the colors of the 4 corners.
|
||||
* If ColorGradients are off, these values are ignored (and the value from setColor()
|
||||
* If ColorGradients are off, these values are ignored (and the value from setColor()
|
||||
* is the only one that is relevant.
|
||||
*/
|
||||
void setColorGradientCorners(const osg::Vec4& topLeft, const osg::Vec4& bottomLeft, const osg::Vec4& bottomRight, const osg::Vec4& topRight);
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
const osg::Vec4& getColorGradientTopRight() const { return _colorGradientTopRight; }
|
||||
|
||||
|
||||
|
||||
|
||||
/** Draw the text.*/
|
||||
virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
|
||||
|
||||
@@ -340,7 +340,7 @@ public:
|
||||
return &itGlyphQuad->second;
|
||||
}
|
||||
|
||||
const TextureGlyphQuadMap& getTextureGlyphQuadMap() const
|
||||
const TextureGlyphQuadMap& getTextureGlyphQuadMap() const
|
||||
{
|
||||
return _textureGlyphQuadMap;
|
||||
}
|
||||
@@ -354,20 +354,20 @@ protected:
|
||||
const Font* getActiveFont() const;
|
||||
|
||||
String::iterator computeLastCharacterOnLine(osg::Vec2& cursor, String::iterator first,String::iterator last);
|
||||
|
||||
|
||||
// members which have public access.
|
||||
|
||||
// iternal map used for rendering. Set up by the computeGlyphRepresentation() method.
|
||||
mutable TextureGlyphQuadMap _textureGlyphQuadMap;
|
||||
|
||||
|
||||
void computeGlyphRepresentation();
|
||||
|
||||
// internal caches of the positioning of the text.
|
||||
|
||||
|
||||
bool computeAverageGlyphWidthAndHeight(float& avg_width, float& avg_height) const;
|
||||
|
||||
|
||||
virtual void computePositions(unsigned int contextID) const;
|
||||
|
||||
|
||||
void computeBackdropPositions(unsigned int contextID) const;
|
||||
void computeBackdropBoundingBox() const;
|
||||
void computeBoundingBoxMargin() const;
|
||||
@@ -385,7 +385,7 @@ protected:
|
||||
void renderWithDepthRange(osg::State& state, const osg::Vec4& colorMultiplier) const;
|
||||
void renderWithStencilBuffer(osg::State& state, const osg::Vec4& colorMultiplier) const;
|
||||
void renderWithDelayedDepthWrites(osg::State& state, const osg::Vec4& colorMultiplier) const;
|
||||
|
||||
|
||||
bool _enableDepthWrites;
|
||||
|
||||
BackdropType _backdropType;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -66,18 +66,18 @@ public:
|
||||
Style* getOrCreateStyle() { if (!_style) _style = new Style; return _style.get(); }
|
||||
|
||||
/** Set the Font reference width and height resolution in texels.
|
||||
* Note, the size may not be supported by current font,
|
||||
* Note, the size may not be supported by current font,
|
||||
* the closest supported font size will be selected.*/
|
||||
void setFontResolution(unsigned int width, unsigned int height);
|
||||
|
||||
unsigned int getFontWidth() const { return _fontSize.first; }
|
||||
unsigned int getFontHeight() const { return _fontSize.second; }
|
||||
|
||||
|
||||
|
||||
|
||||
/** Set the text using a osgText::String.*/
|
||||
void setText(const String& text);
|
||||
|
||||
/** Set the text using a std::string,
|
||||
/** Set the text using a std::string,
|
||||
* which is converted to an internal TextString.*/
|
||||
void setText(const std::string& text);
|
||||
|
||||
@@ -85,19 +85,19 @@ public:
|
||||
* The encoding parameter specificies which Unicode encodeding is used in the std::string. */
|
||||
void setText(const std::string& text,String::Encoding encoding);
|
||||
|
||||
/** Set the text using a wchar_t string,
|
||||
/** Set the text using a wchar_t string,
|
||||
* which is converted to an internal TextString.*/
|
||||
void setText(const wchar_t* text);
|
||||
|
||||
/** Get the text string.
|
||||
|
||||
/** Get the text string.
|
||||
* Note, if you modify the string you must call Text::update() for
|
||||
* the internal glyph reprentation to be updated.*/
|
||||
String& getText() { return _text; }
|
||||
|
||||
/** Get the const text string.*/
|
||||
const String& getText() const { return _text; }
|
||||
|
||||
/** update internal glyph respresentation used for rendering,
|
||||
|
||||
/** update internal glyph respresentation used for rendering,
|
||||
* and bounding volume.*/
|
||||
void update() { computeGlyphRepresentation(); }
|
||||
|
||||
@@ -120,32 +120,32 @@ public:
|
||||
|
||||
/** Set how the CharacterSize value relates to the final rendered character.*/
|
||||
void setCharacterSizeMode(CharacterSizeMode mode) { _characterSizeMode = mode; }
|
||||
|
||||
|
||||
/** Get the CharacterSizeMode.*/
|
||||
CharacterSizeMode getCharacterSizeMode() const { return _characterSizeMode; }
|
||||
|
||||
|
||||
/** Set the maximum width of the text box.
|
||||
* With horizontal layouts any characters which do not fit are wrapped around.
|
||||
* 0 or negative values indicate that no maximum width is set, lines can be as long as
|
||||
* 0 or negative values indicate that no maximum width is set, lines can be as long as
|
||||
* they need be to fit thre required text*/
|
||||
void setMaximumWidth(float maximumWidth);
|
||||
|
||||
|
||||
/** Get the maximim width of the text box.*/
|
||||
float getMaximumWidth() const { return _maximumWidth; }
|
||||
|
||||
/** Set the maximum height of the text box.
|
||||
* With horizontal layouts any characters which do not fit are wrapped around.
|
||||
* 0 or negative values indicate that no maximum height is set, lines can be as long as
|
||||
* 0 or negative values indicate that no maximum height is set, lines can be as long as
|
||||
* they need be to fit the required text*/
|
||||
void setMaximumHeight(float maximumHeight);
|
||||
|
||||
|
||||
/** Get the maximum height of the text box.*/
|
||||
float getMaximumHeight() const { return _maximumHeight; }
|
||||
|
||||
/** Set the line spacing of the text box, given as a percentage of
|
||||
* the character height. The default value is 0 for backward
|
||||
* compatibility. For longer paragraphs of text, a value of at
|
||||
* the character height. The default value is 0 for backward
|
||||
* compatibility. For longer paragraphs of text, a value of at
|
||||
* least 25% (i.e. set line spacing to 0.25) is recommended. */
|
||||
void setLineSpacing(float lineSpacing);
|
||||
|
||||
@@ -156,10 +156,10 @@ public:
|
||||
|
||||
/** Set the position of text.*/
|
||||
void setPosition(const osg::Vec3& pos);
|
||||
|
||||
|
||||
/** Get the position of text.*/
|
||||
const osg::Vec3& getPosition() const { return _position; }
|
||||
|
||||
|
||||
|
||||
enum AlignmentType
|
||||
{
|
||||
@@ -174,19 +174,19 @@ public:
|
||||
RIGHT_TOP,
|
||||
RIGHT_CENTER,
|
||||
RIGHT_BOTTOM,
|
||||
|
||||
|
||||
LEFT_BASE_LINE,
|
||||
CENTER_BASE_LINE,
|
||||
RIGHT_BASE_LINE,
|
||||
|
||||
|
||||
LEFT_BOTTOM_BASE_LINE,
|
||||
CENTER_BOTTOM_BASE_LINE,
|
||||
RIGHT_BOTTOM_BASE_LINE,
|
||||
|
||||
|
||||
BASE_LINE = LEFT_BASE_LINE /// default.
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
void setAlignment(AlignmentType alignment);
|
||||
AlignmentType getAlignment() const { return _alignment; }
|
||||
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
|
||||
void setAxisAlignment(AxisAlignment axis);
|
||||
AxisAlignment getAxisAlignment() const { return _axisAlignment; }
|
||||
|
||||
|
||||
void setRotation(const osg::Quat& quat);
|
||||
const osg::Quat& getRotation() const { return _rotation; }
|
||||
|
||||
@@ -218,9 +218,9 @@ public:
|
||||
RIGHT_TO_LEFT,
|
||||
VERTICAL
|
||||
};
|
||||
|
||||
|
||||
void setLayout(Layout layout);
|
||||
|
||||
|
||||
Layout getLayout() const { return _layout; }
|
||||
|
||||
|
||||
@@ -233,18 +233,18 @@ public:
|
||||
};
|
||||
|
||||
void setDrawMode(unsigned int mode);
|
||||
|
||||
|
||||
unsigned int getDrawMode() const { return _drawMode; }
|
||||
|
||||
void setBoundingBoxMargin(float margin);
|
||||
|
||||
|
||||
float getBoundingBoxMargin() const { return _textBBMargin; }
|
||||
|
||||
void setBoundingBoxColor(const osg::Vec4& color){ _textBBColor = color; }
|
||||
|
||||
|
||||
const osg::Vec4& getBoundingBoxColor() const { return _textBBColor; }
|
||||
|
||||
|
||||
|
||||
void setKerningType(KerningType kerningType) { _kerningType = kerningType; }
|
||||
|
||||
KerningType getKerningType() const { return _kerningType; }
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* state=0) const;
|
||||
|
||||
|
||||
|
||||
virtual osg::BoundingBox computeBound() const;
|
||||
|
||||
protected:
|
||||
@@ -277,8 +277,8 @@ protected:
|
||||
|
||||
virtual void computePositions(unsigned int contextID) const = 0;
|
||||
virtual void computeGlyphRepresentation() = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
// members which have public access.
|
||||
osg::Vec4 _color;
|
||||
osg::ref_ptr<Font> _font;
|
||||
@@ -303,17 +303,17 @@ protected:
|
||||
KerningType _kerningType;
|
||||
unsigned int _lineCount;
|
||||
|
||||
|
||||
|
||||
|
||||
// internal caches of the positioning of the text.
|
||||
|
||||
|
||||
struct AutoTransformCache
|
||||
{
|
||||
{
|
||||
AutoTransformCache():
|
||||
_traversalNumber(-1),
|
||||
_width(0),
|
||||
_height(0) {}
|
||||
|
||||
|
||||
int _traversalNumber;
|
||||
int _width;
|
||||
int _height;
|
||||
@@ -322,7 +322,7 @@ protected:
|
||||
osg::Matrix _projection;
|
||||
osg::Matrix _matrix;
|
||||
};
|
||||
|
||||
|
||||
mutable osg::buffered_object<AutoTransformCache> _autoTransformCache;
|
||||
mutable osg::Vec3 _offset;
|
||||
mutable osg::Vec3 _normal;
|
||||
@@ -333,4 +333,4 @@ protected:
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user