Window::Sizes Window::_getHeightImplementation() const {
    osg::BoundingBox bb = getGeode()->getBoundingBox();

    point_type h = osg::round(bb.yMax() - bb.yMin());

    return Sizes(h, 0.0f);
}
Window::Sizes Window::_getWidthImplementation() const {
    osg::BoundingBox bb = getGeode()->getBoundingBox();
    
    point_type w = osg::round(bb.xMax() - bb.xMin());

    return Sizes(w, 0.0f);
}
	ListBoxBase(const std::string& name):
	osgWidget::Frame(name),
	_lineColor (0.0f, 0.0f, 0.1f),
	_fillColor (0.7f, 0.8f, 0.8f),
	_lineWidth (1.0f),
	_fontSize  (10) {
		std::ostringstream font;

		font << "Bitstream Vera Sans " << _fontSize;

		_font = new osgPairo::Font(font.str().c_str());

		ButtonTheme* bt = new ButtonTheme();

		bt->renderTheme(
			8.0f,
			_lineWidth,
			osgWidget::Color(_lineColor, 1.0f),
			osgWidget::Color(_fillColor, 1.0f)
		);

		createSimpleFrameWithSingleTexture(bt, 200.0f, 15.0f);
		setFlags(osgWidget::Frame::FRAME_TEXTURE);
		getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.0f);

		getGeode()->getOrCreateStateSet()->setAttributeAndModes(
			new osg::BlendFunc(osg::BlendFunc::ONE, osg::BlendFunc::ONE_MINUS_SRC_ALPHA)
		);
	}
示例#4
0
Bouton::Bouton(std::string texture, std::string texture2)
{
	textureNameFile = texture;
	textureNameFile2 = texture2;
	geode = 0;
	pat = 0;
	// Instancie un noeud de geometrie pour accueillir le carre 
	pat = this->getPat();
	switchBox = new Switch();
	switchBox->addChild(getGeode(),false); // geode active par défaut
	switchBox->addChild(getGeode2(),true); // geode inactive par défaut
	pat->addChild(switchBox);
	
}