Commit Graph

153 Commits

Author SHA1 Message Date
Robert Osfield
8f6db66e59 Added setting of the charcode during construction of osgText::Font::Glyph() 2010-01-14 15:15:42 +00:00
Robert Osfield
6d3e7f83e2 From Terry Welsh, "As I mentioned here
http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg33967.html
, interpolating through HSV space gives a rainbow color effect which
does not mimic the simple RGB color interpolation that OpenGL does.
It's overkill and causes unexpected visual artifacts.  In the attached
files I've removed the conversion to HSV so that interpolation happens
in RGB space."
2009-11-24 14:12:54 +00:00
Robert Osfield
d17d7159a1 Ported osgUtil, osgDB, osgGA, NodeKits and plugins to compile against OpenGL ES 1.1 and OpenGL ES 2.0. 2009-10-28 20:31:57 +00:00
Robert Osfield
31a947fda6 From Terry Welsh, "Okay, here are the mods I wrote for drawing a filled bounding box
behind osgText::Text.  I made it so the box would get drawn using
whichever BackdropImplementation was selected.  However, I did not
implement STENCIL_BUFFER.  In that case it defaults to drawing the
bounding box using POLYGON_OFFSET instead.

Also made it so the BOUNDINGBOX and FILLEDBOUNDINGBOX are drawn with a
settable color and margin size.

While I was at it I tightened up the values applied with DEPTH_RANGE
and POLYGON_OFFSET, not just for drawing the bounding box but also for
drawing backdrop text (these values must be coupled since the bounding
box has to be drawn deeper in Z than the backdrop text).  The values
in use before seemed like overkill and I was seeing some z-clipping
with my background scenery in the case of DEPTH_RANGE.  If there was a
good reason for the large values please let me know...."
2009-07-24 14:59:51 +00:00
Robert Osfield
9643c15346 From David Callu, "Problem:
osgText::Text and osgText::Text3D use the same font file.
     The first really load the file and obtain an osgText::Font object,
     the second use the cache created during the first load of the
     font file, and so obtain an osgText::Font object instead of
     osgText::Font3D object. To obtain an osgText::Font3D object,
     osgText::Text3D call osgDB::readObjectFile(...) with an option
     to specify the plugin we want an osgText::Font3D instead of
     osgText::Font.

Generalised Problem:
    In osgDB::Registry, loaded file cache is referenced by the name
    of this file, so if I load a file with some options, and the cache
    already contain object for this filename, I obtain an object
    potentially not loaded with my options.

Behaviours:
    Cache management is delegate to osgDB::Registry, but cache
    coherence (load a file with option then reuse it, deactivate the
    cache when load a specific file or don't cached the loaded file)
    is user's responsibility.

Text3D solution:
    Postfix the font file name by .text3d or something similar and then have the freetype plugin return
    osgText::Font3D when it detects this.
    This operation is done by osgText::readFont3DFile() which unsure the filename have .text3d as extension.
    This is totaly transparent for user, and backward compatible.


BTW, I fix the bug about the Normal of 3D text. Currently, the front and wall face have
the same normal (0,0,1) in the Text3D object coordinate. Now the wall face have its own
normal array computed by the plugin.

BTW 2, I implement
- void Text3D::accept(osg::Drawable::ConstAttributeFunctor& af) const
- void Text3D::accept(osg::PrimitiveFunctor& pf) const
so now statistics are well reported.
"
2009-03-10 10:56:00 +00:00
Robert Osfield
6f6f56c795 Improved the doxygen docs over the various namespaces 2008-08-05 19:17:09 +00:00
Robert Osfield
7dc3ad4b5e From David Callu, "fixed bounding box bug" 2008-06-18 10:46:05 +00:00
Robert Osfield
01c284429b From Paul Melis, "Here's an updated include/osgText/Text3D that forces recomputation of the glyph repr when the character depth is updated, also when the rendering mode is set.
This caused a Text3D object read from a .osg file to not have the correct depth."
2008-06-06 16:25:14 +00:00
Robert Osfield
e869200b3d Refactored the mutex usage in osgText and freetype plugin to prevent multi-thread crash 2008-02-25 12:54:54 +00:00
Robert Osfield
ce5388a8bc Convert osgText and freetype plugin across to keeping the font size as state that
is passed into the getGlyph and getKerning methods rather than a current state of the font itself.
2007-12-23 18:15:54 +00:00
Robert Osfield
f290b75bc9 Moved Font code across to using FontSizePair internally and on Font methods, but
still using original implemetations.
2007-12-23 13:45:37 +00:00
Robert Osfield
dea067050c Renamed osgText::Font::SizePair to osgText::FontSizePair in prep for use this more
widely within osgText/freetype plugin.

Added support for inserting loading models into --mt multithreaded implementation.
2007-12-23 13:18:40 +00:00
Robert Osfield
0cdc3e9506 Added intializers. 2007-12-16 17:01:40 +00:00
Robert Osfield
213a370c25 Added new setFont(ref_ptr<>) variants to Text and Text3D 2007-12-12 17:48:20 +00:00
Robert Osfield
256391c3b4 From Serge Lages, introduce readRef*File() methods which pass back ref_ptr<> rather than C pointers. 2007-12-12 17:04:48 +00:00
Robert Osfield
eef88e7e83 From David Callu, Text3D 2007-12-10 19:49:17 +00:00
Robert Osfield
f4afa427a7 From Roland Smeenk, "Attached you will find a large set of small typo fixes (mainly in the comments)." 2007-12-10 17:30:18 +00:00
Robert Osfield
f69a48e552 From David Callu, added support of 3D text to osgText and associated plugins. 2007-12-10 15:15:56 +00:00
Robert Osfield
40ded29902 From Dan Minor, "osgText::Text does not currently have a getAxisAlignment method. The
attached code adds this, along with a member variable to keep track of
the setting.  It is based on the latest subversion version, and was
tested by creating a new text object with the same axis alignment as an
existing one (e.g.
new_text->setAxisAlignment(old_text->getAxisAlignment()); )."

From Robert Osfield, " I originally didn't add a getAxisAlignment()
as all setAxisAlignment does is set the Rotation member variable, and
potentially one could apply user defined Rotation setting after the
setAxisAlignment() which would bring it out of sync with the
setAxisAlignment.

Rather than reject your submission on the ground of potentially
getting out of sync and therefore misleading users I've added a
USED_DEFINED_ROTATION to AxisAlignment enum, and set this in the
serRotation and then override this setting of _axisAlignment in the
setAxisAlingment method.  I've also removed the lazy updating
optimization you've added to the top of setAxisAlignment to avoid
potential problems as well."
2007-09-30 15:06:59 +00:00
Robert Osfield
b20d542317 From David Callu, improved consistency of Version strings and add version support
for osgIntrospection and osgManipulator.
2007-09-05 17:12:24 +00:00
Robert Osfield
c9f6a3f7ca Added mutex into osgText::Font::GlphTexture to marshel adding to and reading
from glyph list
2007-09-04 12:32:47 +00:00
Robert Osfield
3304646c4c Changed Font's mutex to become a static mutex shared between all instances of Font.
This ensures single threaded access of the freetype plugin.
2007-09-01 15:24:22 +00:00
Robert Osfield
13faad13e8 Changed mutex reference to a mutex pointer to avoid problems with wrappers 2007-08-31 20:30:45 +00:00
Robert Osfield
5ae1eb711a To solve creations with multi-threaded creation of text, added mutex to Font, and use of this mutex in Text, and added mutex to the reading
of fonts.
2007-08-31 20:16:02 +00:00
Robert Osfield
4f97cdca96 Added thread safe ref/unref by default. 2007-08-22 12:14:15 +00:00
Robert Osfield
19d1a563fe From Csaba Halasz and Robert Osfield, support for passing in ReaderWriter::Options object into readFontFile 2007-07-02 12:30:14 +00:00
Robert Osfield
eac3dc1963 From Paul Melis, "Here is a list of fixes to misspelled APIs. Unfortunately, more than one
of these are public APIs and therefore will break linkage to existing
shared libraries."

Note from Robert Osfield, updated wrappers.
2007-06-27 20:36:16 +00:00
Robert Osfield
dadb92ea64 Reorganised the managment of margins around glyphs so that is done entirely
with src/osgText/Font.cpp rather than the font plugins or Text.cpp
2007-05-04 12:05:29 +00:00
Robert Osfield
272ab99767 Reorganised the text comments so that they are shorter length, and hopefully will
avoid VS2003's silly text string limits when compiling osgIntrospection wrappers
2007-02-15 14:53:54 +00:00
Robert Osfield
77b9a7ae19 From Eric Sokolwsky, "osgText is a useful node kit, but when longer paragraphs are displayed
on the screen, it looks more aesthetically pleasing to have a larger
gap between lines than is given by default. I added a new parameter,
lineSpacing, in the Text class to allow the line spacing to be adjustable
by the application. The default value is 0 meaning there is no extra
spacing given. The value should be given as a percentage of the character
height. A good value for longer paragraphs is 0.25 (25%) or more."
2007-01-30 14:32:12 +00:00
Robert Osfield
9168d1130e From Mike Wittman, "This file removes the virtual destructor of osgText::String. It seemed wrong that osgText::String should have a vtable since it is treated like a value type, and any subclasses containing additional data would effectively be subject to slicing during standard usage. This stuck out as an anomaly when classifying the OSG types for C# bindings." 2007-01-28 09:17:10 +00:00
Robert Osfield
7f5aaa8424 Improved resizeGLObjectBuffers support 2007-01-08 20:46:56 +00:00
Robert Osfield
709d2fa435 Improved the handling a releaseGLObjects() and add setThreadSafeRefUnref and resizeGLObjectsBuffers methods 2007-01-08 20:40:29 +00:00
Robert Osfield
d23c04018b Updated wrappers 2006-11-08 11:49:35 +00:00
Robert Osfield
85dc696c09 Added FadeText::setFadeSpeed and made internal data structures protected. 2006-10-24 09:06:28 +00:00
Robert Osfield
def74d3471 Introduced new osg::View, and osg::RenderInfo classes into the core OSG to help
handle scenes with multiple views with elements that need coordinating on a per view basis.

Added beginings of new osgText::FadeText class (not functionality yet).
2006-09-18 20:54:48 +00:00
Robert Osfield
96e1630cc7 Removed the String inhertiance from osg::Referenced. 2006-09-01 12:46:45 +00:00
Robert Osfield
6be6bc2eaa Added TexEnv object into Font and apply this in Text::drawImplementation to make
sure that a valid TexEnv is applied
2006-08-28 19:37:40 +00:00
Robert Osfield
98cdf9b3c7 From Eric Wing, fix for compute of the bounding box when handling outline/backdrop text. 2006-08-22 10:23:58 +00:00
Robert Osfield
9e7b07fbcf Reworked the state management within osgText::Text and osgText::Font so that it
only applies textures locally rather than whole StateSet.
2006-08-02 21:05:56 +00:00
Robert Osfield
f1c2694c17 Updated copyright years. 2006-07-18 15:21:48 +00:00
Robert Osfield
419e185895 From Eric Wing, add alternate backdrop implementations.
From Robert Osfield, updated naming  and copy constructor methods.
2006-07-18 12:24:04 +00:00
Robert Osfield
3ad5140942 Change osgText so that the Text drawable now can have its own StateSet
that users can assign to it without it being overriden.  If none is
assigned externally it now uses a StateSet associated wit the Font assigned
to the Text.
2006-07-04 13:56:29 +00:00
Robert Osfield
710adfd698 From Eric Wing, added support for outline/shadow and colour gradient effects. 2006-06-27 13:09:00 +00:00
Robert Osfield
a1cfdca94d From Eric Wing, made getLineCount() const. 2005-12-19 11:18:26 +00:00
Robert Osfield
7d4acba022 Changed constructors to use unsigned int to get round VS6.0 + wrapper problems. 2005-12-09 16:00:01 +00:00
Robert Osfield
479af6e825 Build fix for VS6.0 in the template constructors 2005-12-09 14:52:19 +00:00
Robert Osfield
49301347e8 From Eric Wing, fix to comment. 2005-12-08 08:57:16 +00:00
Robert Osfield
8d8229cc05 From Marco Jez, hack/fix for VS compile/link problems related to STL containers. 2005-12-02 00:25:40 +00:00
Robert Osfield
8289eecb7e From Roger James, reworked the export of std::vector<> on standard types to prevent
problems with .lib being built for all targets under VS7.x
2005-11-21 13:51:24 +00:00