Added initial shell of PushButton implementation
This commit is contained in:
@@ -36,7 +36,25 @@ Style::Style(const Style& style, const osg::CopyOp& copyop):
|
||||
|
||||
osg::Node* Style::createPanel(const osg::BoundingBox& extents, const osg::Vec4& colour)
|
||||
{
|
||||
return 0;
|
||||
OSG_NOTICE<<"Creating Panel"<<std::endl;
|
||||
osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;
|
||||
|
||||
osg::ref_ptr<osg::Vec3Array> vertices = new osg::Vec3Array;
|
||||
geometry->setVertexArray(vertices.get());
|
||||
|
||||
vertices->push_back( osg::Vec3(extents.xMin(), extents.yMin(), extents.zMin()) );
|
||||
vertices->push_back( osg::Vec3(extents.xMin(), extents.yMax(), extents.zMin()) );
|
||||
vertices->push_back( osg::Vec3(extents.xMax(), extents.yMin(), extents.zMin()) );
|
||||
vertices->push_back( osg::Vec3(extents.xMax(), extents.yMax(), extents.zMin()) );
|
||||
|
||||
osg::ref_ptr<osg::Vec4Array> colours = new osg::Vec4Array;
|
||||
geometry->setColorArray(colours, osg::Array::BIND_OVERALL);
|
||||
|
||||
colours->push_back( colour );
|
||||
|
||||
geometry->addPrimitiveSet( new osg::DrawArrays(GL_TRIANGLE_STRIP, 0, 4) );
|
||||
|
||||
return geometry.release();
|
||||
}
|
||||
|
||||
osg::Node* Style::createFrame(const osg::BoundingBox& extents, const FrameSettings* frameSettings)
|
||||
@@ -46,12 +64,10 @@ osg::Node* Style::createFrame(const osg::BoundingBox& extents, const FrameSettin
|
||||
|
||||
osg::Node* Style::createText(const osg::BoundingBox& extents, const AlignmentSettings* as, const TextSettings* ts, const std::string& text)
|
||||
{
|
||||
osg::ref_ptr<osg::Geode> textGeode = new osg::Geode;
|
||||
osg::ref_ptr<osgText::Text> textDrawable = new osgText::Text;
|
||||
|
||||
textGeode->addDrawable(textDrawable.get());
|
||||
|
||||
textDrawable->setText(text);
|
||||
textDrawable->setPosition( osg::Vec3(extents.xMin(), extents.yMin(), extents.zMin()) );
|
||||
|
||||
if (ts)
|
||||
{
|
||||
@@ -65,7 +81,7 @@ osg::Node* Style::createText(const osg::BoundingBox& extents, const AlignmentSet
|
||||
textDrawable->setAlignment(alignmentType);
|
||||
}
|
||||
|
||||
return textGeode.release();
|
||||
return textDrawable.release();
|
||||
}
|
||||
|
||||
osg::Node* Style::createIcon(const osg::BoundingBox& extents, const std::string& filename)
|
||||
|
||||
Reference in New Issue
Block a user