本文整理汇总了C++中wt::WContainerWidget::setInline方法的典型用法代码示例。如果您正苦于以下问题:C++ WContainerWidget::setInline方法的具体用法?C++ WContainerWidget::setInline怎么用?C++ WContainerWidget::setInline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wt::WContainerWidget
的用法示例。
在下文中一共展示了WContainerWidget::setInline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: glov
Wt::WApplication *createApplication(const Wt::WEnvironment& env)
{
// uncomment to get error checking (slow)
//Wt::WGLWidget::enableClientErrorChecks();
OSGWTApp * w = new OSGWTApp (env);
w->setTitle("osgGeometry");
Wt::WContainerWidget* glContainer = new Wt::WContainerWidget(w->root());
glContainer->resize(500, 500);
glContainer->setInline(false);
osg::ref_ptr<osg::Group> g = new osg::Group();
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile("glider.osgt");
osg::ref_ptr<osg::Node> rootnode = createRoom(loadedModel);
// use vertex buffer objects only (no client side arrays are supported by webgl)
osgUtil::GLObjectsVisitor glov(osgUtil::GLObjectsVisitor::SWITCH_ON_VERTEX_BUFFER_OBJECTS);
rootnode->accept(glov);
// ReWeb3D: add uniforms for the lights!
// best solution would be that osg::Light provides these
{
osg::Uniform* light0Ambient = new osg::Uniform( "glLightSource0.ambient",Light0->getAmbient() );
osg::Uniform* light0Diffuse = new osg::Uniform( "glLightSource0.diffuse",Light0->getDiffuse());
osg::Uniform* light0Specular = new osg::Uniform( "glLightSource0.specular", Light0->getSpecular());
osg::Uniform* light0SpotExponent = new osg::Uniform( "glLightSource0.spotExponent", Light0->getSpotExponent());
osg::Uniform* light0SpotCutoff = new osg::Uniform( "glLightSource0.spotCutoff", Light0->getSpotCutoff());
osg::Uniform* light0linearAttenuation = new osg::Uniform( "glLightSource0.linearAttenuation",Light0->getLinearAttenuation() );
osg::Uniform* light0constantAttenuation = new osg::Uniform( "glLightSource0.constantAttenuation",Light0->getConstantAttenuation() );
osg::Uniform* light0quadraticAttenuation = new osg::Uniform( "glLightSource0.quadraticAttenuation",Light0->getQuadraticAttenuation() );
osg::Uniform* light0spotDirection = new osg::Uniform( "glLightSource0.spotDirection", Light0->getDirection());
osg::Uniform* light0position = new osg::Uniform( "glLightSource0.position", Light0->getPosition());
osg::Uniform* light1Ambient = new osg::Uniform( "glLightSource1.ambient",Light1->getAmbient() );
osg::Uniform* light1Diffuse = new osg::Uniform( "glLightSource1.diffuse",Light1->getDiffuse());
osg::Uniform* light1Specular = new osg::Uniform( "glLightSource1.specular", Light1->getSpecular());
osg::Uniform* light1SpotExponent = new osg::Uniform( "glLightSource1.spotExponent", Light1->getSpotExponent());
osg::Uniform* light1SpotCutoff = new osg::Uniform( "glLightSource1.spotCutoff", Light1->getSpotCutoff());
osg::Uniform* light1linearAttenuation = new osg::Uniform( "glLightSource1.linearAttenuation",Light1->getLinearAttenuation() );
osg::Uniform* light1constantAttenuation = new osg::Uniform( "glLightSource1.constantAttenuation",Light1->getConstantAttenuation() );
osg::Uniform* light1quadraticAttenuation = new osg::Uniform( "glLightSource1.quadraticAttenuation",Light1->getQuadraticAttenuation() );
osg::Uniform* light1spotDirection = new osg::Uniform( "glLightSource1.spotDirection", Light1->getDirection());
osg::Uniform* light1position = new osg::Uniform( "glLightSource1.position", Light1->getPosition());
osg::Uniform* materialAmbient = new osg::Uniform( "glMaterial.ambient",osg::Vec4(1.0,1.0,1.0,1.0));
osg::Uniform* materialDiffuse = new osg::Uniform( "glMaterial.diffuse",osg::Vec4(1.0,1.0,1.0,1.0));
osg::Uniform* materialSpecular = new osg::Uniform( "glMaterial.specular", osg::Vec4(1.0,1.0,1.0,1.0));
osg::Uniform* materialShiness = new osg::Uniform( "glMaterial.shiness",(float)32.0 );
osg::Uniform* materialEmission = new osg::Uniform( "glMaterial.emission", osg::Vec4(0.0,0.0,0.0,0.0));
osg::StateSet* ss = rootnode->getOrCreateStateSet();
ss->addUniform(light0Ambient);
ss->addUniform(light0Diffuse);
ss->addUniform(light0Specular);
ss->addUniform(light0SpotExponent);
ss->addUniform(light0SpotCutoff);
ss->addUniform(light0linearAttenuation);
ss->addUniform(light0constantAttenuation);
ss->addUniform(light0quadraticAttenuation);
ss->addUniform(light0spotDirection);
ss->addUniform(light0position);
ss->addUniform(light1Ambient);
ss->addUniform(light1Diffuse);
ss->addUniform(light1Specular);
ss->addUniform(light1SpotExponent);
ss->addUniform(light1SpotCutoff);
ss->addUniform(light1linearAttenuation);
ss->addUniform(light1constantAttenuation);
ss->addUniform(light1quadraticAttenuation);
ss->addUniform(light1spotDirection);
ss->addUniform(light1position);
ss->addUniform(materialAmbient);
ss->addUniform(materialDiffuse);
ss->addUniform(materialSpecular);
ss->addUniform(materialShiness);
ss->addUniform(materialEmission);
}
// add shader to OSG scenegraph
{
osg::ref_ptr<osg::Shader> vShader = new osg::Shader(
osg::Shader::VERTEX,
defaultVertexShader);
osg::ref_ptr<osg::Shader> fShader = new osg::Shader(
osg::Shader::FRAGMENT,
defaultFragmentShader);
osg::ref_ptr<osg::Program> program = new osg::Program();
program->addShader(vShader);
program->addShader(fShader);
rootnode->getOrCreateStateSet()->setAttribute(program);
}
//.........这里部分代码省略.........