[osg-users] Cloning text

Robert Osfield robert.osfield at gmail.com
Fri Aug 18 02:38:06 PDT 2017


Hi Andreas,

In my rewrite of osgText my approach was that the internal implementation
details aren't meant to be something that users need to meddle with.

The fact that you are needing to meddle with the internal details to
workaorund performance issues in your usage case suggest an issue with
basic performance/flexibility,  The new implementation might change this
performance/flexibility side so perhaps your local changes might not be
needed.

If the new osgText doesn't provide the performance you need for your usage
case perhaps it could be optimized to handle them.  Creating an example
that illustrates the usage case which highlights the issues would be a good
first step if you feel this approach has promise.

Finally, I'm open to small tweaks to the API allow easier subclassing.
However, this isn't my preferred approach as any changes to the internals
later would then break end user code that relies upon it - exactly the
problem you are facing now...

Robert.

On 18 August 2017 at 09:14, Andreas Ekstrand <andreas.ekstrand at remograph.com
> wrote:

> Hi,
>
> With OSG 3.2.1 I have been able to do fast shallow cloning of
> osgText::Text in my own subclass, copying the _textureGlyphQuadMap instead
> of calling computeGlyphRepresentation, since the latter is a slow operation
> for my thousands of texts.
>
> In OSG 3.5.6 this isn't possible, I guess due to a private
> GlyphQuads::operator=. So I'm looping through _textureGlyphQuadMap in my
> copy constructor and copy its glyphs and primitives separately instead. But
> I can't see my copied text at all! If I save it out to an .osg or .osgt
> file it's visible in osgviewer.
>
> I guess setting GlyphQuads::operator= private was deliberate, so can
> someone explain how I can accomplish fast text cloning in OSG 3.5.6 or
> optimize it somehow?
>
> Regards,
> Andreas
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170818/870d4b1f/attachment.htm>


More information about the osg-users mailing list