From Tree, added support for accept(PrimitiveFunctor) into osg::Text. Currently
implemention is overly simple, but will do until rewrite.
This commit is contained in:
@@ -111,6 +111,9 @@ class OSGTEXT_EXPORT Text : public osg::Drawable
|
||||
void setText(const std::string& text) { _text=text; _initAlignment=false; }
|
||||
const std::string& getText() const { return _text; }
|
||||
|
||||
virtual bool supports(PrimitiveFunctor& pf) const;
|
||||
virtual void accept(PrimitiveFunctor& pf) const;
|
||||
|
||||
virtual void drawImplementation(osg::State& state) const;
|
||||
virtual void drawBoundingBox(void) const;
|
||||
virtual void drawAlignment(void) const;
|
||||
|
||||
@@ -172,6 +172,25 @@ bool Text::computeBound() const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Text::supports(PrimitiveFunctor&) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Text::accept(PrimitiveFunctor& functor) const
|
||||
{
|
||||
Vec3 boundingVertices[4];
|
||||
boundingVertices[0].set(_bbox._min._v[0],_bbox._max._v[1],_bbox._min._v[2]);
|
||||
boundingVertices[1] = _bbox._min;
|
||||
boundingVertices[2].set(_bbox._max._v[0],_bbox._min._v[1],_bbox._max._v[2]);
|
||||
boundingVertices[3] = _bbox._max;
|
||||
|
||||
functor.setVertexArray(4,boundingVertices);
|
||||
functor.drawArrays( GL_QUADS, 0, 4);
|
||||
|
||||
cout << "done draw arrays"<<endl;
|
||||
}
|
||||
|
||||
void Text::drawImplementation(State& state) const
|
||||
{
|
||||
if(!_init)
|
||||
|
||||
Reference in New Issue
Block a user