本文整理汇总了C++中params::InterfaceGlRef::setOptions方法的典型用法代码示例。如果您正苦于以下问题:C++ InterfaceGlRef::setOptions方法的具体用法?C++ InterfaceGlRef::setOptions怎么用?C++ InterfaceGlRef::setOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类params::InterfaceGlRef
的用法示例。
在下文中一共展示了InterfaceGlRef::setOptions方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void WaterSimulationApp::update(){
////change status
float dt = 1.f/60.0f;
if(mAnimate){
if(randomForce.lengthSquared()>0 && mAddNewForce) addForce(dt);
fluidsys->step(dt);
mParams->setOptions("status","label=`In animation:`");
}else{
mParams->setOptions("status","label=`Idle:`");
}
}
示例2: createParams
void GeometryApp::createParams()
{
#if ! defined( CINDER_GL_ES )
vector<string> primitives = { "Capsule", "Cone", "Cube", "Cylinder", "Helix", "Icosahedron", "Icosphere", "Sphere", "Teapot", "Torus", "Plane" };
vector<string> qualities = { "Low", "Default", "High" };
vector<string> viewModes = { "Shaded", "Wireframe" };
vector<string> texturingModes = { "None", "Procedural", "Sampler" };
mParams = params::InterfaceGl::create( getWindow(), "Geometry Demo", toPixels( ivec2( 300, 200 ) ) );
mParams->setOptions( "", "valueswidth=160 refresh=0.1" );
mParams->addParam( "Primitive", primitives, (int*) &mPrimitiveSelected );
mParams->addParam( "Quality", qualities, (int*) &mQualitySelected );
mParams->addParam( "Viewing Mode", viewModes, (int*) &mViewMode );
mParams->addParam( "Texturing Mode", texturingModes, (int*) &mTexturingMode );
mParams->addSeparator();
mParams->addParam( "Subdivision", &mSubdivision ).min( 1 ).max( 5 ).updateFn( [this] { createGeometry(); } );
mParams->addSeparator();
mParams->addParam( "Show Grid", &mShowGrid );
mParams->addParam( "Show Normals", &mShowNormals );
mParams->addParam( "Show Colors", &mShowColors ).updateFn( [this] { createGeometry(); } );
mParams->addParam( "Face Culling", &mEnableFaceFulling ).updateFn( [this] { gl::enableFaceCulling( mEnableFaceFulling ); } );
#endif
}
示例3: button
void TweakBarApp::button()
{
app::console() << "Clicked!" << std::endl;
mParams->setOptions( "text", "label=`Clicked!`" );
}
示例4: makeGui
void cApp::makeGui(){
gui = params::InterfaceGl::create( getWindow(), "Ramses", vec2(300, getWindowHeight()) );
gui->setOptions( "", "position=`0 0` valueswidth=100" );
function<void(void)> update = [&](){
for( int i=0; i<rms.size(); i++){
rms[i].updateVbo(eye);
}
};
function<void(void)> sx = [this](){
saveXml();
};
function<void(void)> ld = [this](){
loadXml();
for( int i=0; i<rms.size(); i++){
rms[i].eSimType = simType;
rms[i].loadSimData(frame);
rms[i].updateVbo(eye);
}
};
function<void(void)> ren = [this](){
bStart = true;
mExp.startRender();
};
gui->addText( "main" );
gui->addParam("start", &bStart );
gui->addParam("frame", &frame ).updateFn(update);
gui->addParam("ortho", &bOrtho );
gui->addParam("xyz global scale", &Ramses::globalScale ).step(0.01).updateFn(update);
//gui->addParam("r(x) resolution", &Ramses::boxelx, true );
//gui->addParam("theta(y) resolution", &Ramses::boxely, true );
gui->addButton("save XML", sx );
gui->addButton("load XML", ld );
gui->addButton("start Render", ren );
gui->addSeparator();
for( int i=0; i<6; i++){
string p = to_string(simType) + "_"+ Ramses::prm[i];
function<void(void)> up = [i, this](){
rms[i].updateVbo(eye);
};
function<void(void)> up2 = [i, this](){
rms[i].loadSimData(this->frame);
rms[i].updateVbo(eye);
};
gui->addParam(p+" show", &rms[i].bShow ).group(p).updateFn(up2);
//gui->addParam(p+" polar coordinate", &rms[i].bPolar ).group(p).updateFn(up2);
gui->addParam(p+" Auto Min Max", &rms[i].bAutoMinMax ).group(p).updateFn(up);
gui->addParam(p+" in min", &rms[i].in_min).step(0.05f).group(p).updateFn(up);
gui->addParam(p+" in max", &rms[i].in_max).step(0.05f).group(p).updateFn(up);
gui->addParam(p+" z extrude", &rms[i].extrude).step(1.0f).group(p).updateFn(up);
//gui->addParam(p+" x offset", &rms[i].xoffset).step(1.0f).group(p).updateFn(up);
//gui->addParam(p+" y offset", &rms[i].yoffset).step(1.0f).group(p).updateFn(up);
//gui->addParam(p+" z offset", &rms[i].zoffset).step(1.0f).group(p).updateFn(up);
gui->addParam(p+" xy scale", &rms[i].scale).step(1.0f).group(p).updateFn(up);
//gui->addParam(p+" visible thresh", &rms[i].visible_thresh).step(0.005f).min(0.0f).max(1.0f).group(p).updateFn(up);
gui->addParam(p+" log", &rms[i].eStretch).step(1).min(0).max(1).group(p).updateFn(up2);
// read only
//gui->addParam(p+" r(x) resolution", &rms[eSimType][i].boxelx, true );
//gui->addParam(p+" theta(y) resolution", &rms[eSimType][i].boxely, true );
//gui->addParam(p+" visible rate(%)", &rms[i].visible_rate, true ).group(p);
//gui->addParam(p+" num particle", &rms[i].nParticle, true).group(p);
gui->addSeparator();
}
}
示例5: createParams
void GeometryApp::createParams()
{
#if ! defined( CINDER_GL_ES )
vector<string> primitives = { "Capsule", "Cone", "Cube", "Cylinder", "Helix", "Icosahedron", "Icosphere", "Sphere", "Teapot", "Torus", "Torus Knot", "Plane", "Rectangle", "Rounded Rectangle", "Circle", "Ring" };
vector<string> qualities = { "Low", "Default", "High" };
vector<string> viewModes = { "Shaded", "Wireframe" };
vector<string> texturingModes = { "None", "Procedural", "Sampler" };
mParams = params::InterfaceGl::create( getWindow(), "Geometry Demo", toPixels( ivec2( 300, 400 ) ) );
mParams->setOptions( "", "valueswidth=100 refresh=0.1" );
mParams->addParam( "Primitive", primitives, (int*)&mPrimitiveSelected ).updateFn( std::bind( &GeometryApp::updateParams, this ) );
mParams->addParam( "Quality", qualities, (int*)&mQualitySelected );
mParams->addParam( "Viewing Mode", viewModes, (int*)&mViewMode );
mParams->addParam( "Texturing Mode", texturingModes, (int*)&mTexturingMode );
mParams->addSeparator();
mParams->addParam( "Show Grid", &mShowGrid );
mParams->addParam( "Show Normals", &mShowNormals );
mParams->addParam( "Show Tangents", &mShowTangents );
mParams->addParam( "Show Colors", &mShowColors ).updateFn( [this] { createGeometry(); } );
mParams->addParam( "Face Culling", &mEnableFaceFulling ).updateFn( [this] { gl::enableFaceCulling( mEnableFaceFulling ); } );
mParams->addSeparator();
mParams->addParam( "Show Wire Primitive", &mShowWirePrimitive );
mParams->addParam( "Show Solid Primitive", &mShowSolidPrimitive );
mParams->addSeparator();
//
mPrimitiveParams.resize( PRIMITIVE_COUNT );
// Capsule
mPrimitiveParams[CAPSULE].push_back( mParams->addParam( "Capsule: Radius", &mCapsuleRadius ).step( 0.01f ).updateFn( [this] { createGeometry(); } ) );
mPrimitiveParams[CAPSULE].push_back( mParams->addParam( "Capsule: Length", &mCapsuleLength ).step( 0.05f ).updateFn( [this] { createGeometry(); } ) );
// Cone
mPrimitiveParams[CONE].push_back( mParams->addParam( "Cone: Ratio", &mConeRatio ).step( 0.01f ).updateFn( [this] { createGeometry(); } ) );
// Helix
mPrimitiveParams[HELIX].push_back( mParams->addParam( "Helix: Ratio", &mHelixRatio ).step( 0.01f ).updateFn( [this] { createGeometry(); } ) );
mPrimitiveParams[HELIX].push_back( mParams->addParam( "Helix: Coils", &mHelixCoils ).step( 0.1f ).updateFn( [this] { createGeometry(); } ) );
mPrimitiveParams[HELIX].push_back( mParams->addParam( "Helix: Twist", &mHelixTwist ).updateFn( [this] { createGeometry(); } ) );
mPrimitiveParams[HELIX].push_back( mParams->addParam( "Helix: Twist Offset", &mHelixOffset ).step( 0.05f ).updateFn( [this] { createGeometry(); } ) );
// Ring
mPrimitiveParams[RING].push_back( mParams->addParam( "Ring: Width", &mRingWidth ).step( 0.01f ).updateFn( [this] { createGeometry(); } ) );
// Rounded Rect
mPrimitiveParams[ROUNDEDRECT].push_back( mParams->addParam( "Corner Radius", &mRoundedRectRadius ).step( 0.01f ).updateFn( [this] { createGeometry(); } ) );
// Torus
mPrimitiveParams[TORUS].push_back( mParams->addParam( "Torus: Ratio", &mTorusRatio ).step( 0.01f ).updateFn( [this] { createGeometry(); } ) );
mPrimitiveParams[TORUS].push_back( mParams->addParam( "Torus: Twist", &mTorusTwist ).updateFn( [this] { createGeometry(); } ) );
mPrimitiveParams[TORUS].push_back( mParams->addParam( "Torus: Twist Offset", &mTorusOffset ).step( 0.05f ).updateFn( [this] { createGeometry(); } ) );
// Torus Knot
mPrimitiveParams[TORUSKNOT].push_back( mParams->addParam( "Torus Knot: Parameter P", &mTorusKnotP ).updateFn( [this] { createGeometry(); } ) );
mPrimitiveParams[TORUSKNOT].push_back( mParams->addParam( "Torus Knot: Parameter Q", &mTorusKnotQ ).updateFn( [this] { createGeometry(); } ) );
mPrimitiveParams[TORUSKNOT].push_back( mParams->addParam( "Torus Knot: Scale X", &mTorusKnotScale.x ).step( 0.1f ).updateFn( [this] { createGeometry(); } ) );
mPrimitiveParams[TORUSKNOT].push_back( mParams->addParam( "Torus Knot: Scale Y", &mTorusKnotScale.y ).step( 0.1f ).updateFn( [this] { createGeometry(); } ) );
mPrimitiveParams[TORUSKNOT].push_back( mParams->addParam( "Torus Knot: Scale Z", &mTorusKnotScale.z ).step( 0.1f ).updateFn( [this] { createGeometry(); } ) );
mPrimitiveParams[TORUSKNOT].push_back( mParams->addParam( "Torus Knot: Radius", &mTorusKnotRadius ).step( 0.05f ).updateFn( [this] { createGeometry(); } ) );
updateParams();
#endif
}