[osg-users] OsgText compile issue with the newer versions of OSG

Robert Osfield robert.osfield at gmail.com
Thu Nov 16 09:03:07 PST 2017


Hi Nick,

Thanks for the links and explanation.

The new implementation is completely different, it simply not an issue
of making an old API public again, there is no way you can map the old
to the new implementation for backwards compatibility as they are so
different.  The new implementation shares a single vertex array for
the whole osgText::Text object, the old implementation uses mutliple
vertex arrays for different texture atlas and view combinations.

Getting the coords of glyphs is something we'd need to add to
osgText::Text, such as Text::getGlyphCorners(int characterPosition,
osg::Vec3& bottomLeft,   osg::Vec3& bottomRight etc.).

Robert.

On 16 November 2017 at 16:54, Trajce Nikolov NICK
<trajce.nikolov.nick at gmail.com> wrote:
> Hi Robert,
>
> that is part of a code I wrote that has history :-) and now is part of the
> OpenIG project. Originally this was written like 6-7 (???) years ago and was
> part of the osgWidget::Input too ( I had submission then for this ). The
> purpose was to have a Line Edit as is known in any UI. OpenIG is using it
> for typing commands as from terminal and here is the whole code
> https://github.com/CCSI-CSSI/MuseOpenIG/blob/master/Core-OpenIG/Terminal.cpp
> ....
>
> This particular snippet Curtis is mentioning was changed over time (simple
> changes that are handled with #ifdefs) and now we have the same case - I am
> aware of the recent osgText refactors but don't know the details. The
> purpose of this snippet is to get the glyphs coords of the edited text in
> order to set the cursor position. That simple :-).
>
> The mentioned snippet is using the API for a decade that now become broken,
> so I will vote to make it back compatible again - if it will be a simple
> addition what I believe it is the case
>
> Please let me know your thoughts and what will be the best effort to fix
> this issue
>
> Thanks a bunch as always!
>
> Cheers,
> NIck
>
> On Wed, Nov 15, 2017 at 10:35 PM, Robert Osfield <robert.osfield at gmail.com>
> wrote:
>>
>> Hi Curtis,
>>
>> It might be that we need to add some extra API to osgText to help you
>> do what you want to do.  As a general trend I would much rather have
>> users no need to grapple with the internal implementation details of
>> classes to do their work, if this requires some amendments to the
>> public interface or just providing some advice to solve it another way
>> then this will be preferable.
>>
>> At this point I can't really provide any specific advice as to what
>> would be appropriate in hour case as the small code snippet really
>> doesn't tell me anything about the what you are and why.  Could you
>> provide a small compilable code example that illustrates what you were
>> doing with older versions of the OSG.  From this I should be able to
>> work out what you were doing and why, and then work out what would be
>> appropriate to do next.
>>
>> Robert.
>>
>> On 15 November 2017 at 19:29, Curtis Rubel <crubel at compro.net> wrote:
>> > Hello community,
>> >
>> >    I was attempting to test the latest release of OSG 3.5.8 and am now
>> > getting
>> > some compiler errors.
>> >
>> > error: ‘const struct osgText::Text::GlyphQuads’ has no member named
>> > ‘getCoords’
>> >
>> > coords.insert(coords.end(),gq.getCoords()->begin(),gq.getCoords()->end());
>> >
>> > Snippet of the code in question:
>> >
>> > Code:
>> >
>> >
>> > std::vector<osg::Vec2>                          coords;
>> >
>> > osgText::Text::TextureGlyphQuadMap& tgqm =
>> > const_cast<osgText::Text::TextureGlyphQuadMap&>(_text->getTextureGlyphQuadMap());
>> >
>> > const osgText::Text::GlyphQuads& gq = tgqmi->second;
>> >
>> >
>> > coords.insert(coords.end(),gq.getCoords()->begin(),gq.getCoords()->end());
>> >
>> >
>> >
>> >
>> >
>> > We are using this code to control onscreen text command line input.
>> > What would be the proper way to fix this code under the newer versions
>> > of OSG to
>> > accomplish the same, if it is still possible in some way?
>> >
>> > Any hints would be appreciated.
>> >
>> > Thank you all as always...
>> >
>> > Cheers,
>> > Curtis[/code]
>> >
>> > ------------------
>> > Read this topic online here:
>> > http://forum.openscenegraph.org/viewtopic.php?p=72393#72393
>> >
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > osg-users mailing list
>> > osg-users at lists.openscenegraph.org
>> >
>> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
>
> --
> trajce nikolov nick
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


More information about the osg-users mailing list