本文整理汇总了C++中params::InterfaceGl::addSeparator方法的典型用法代码示例。如果您正苦于以下问题:C++ InterfaceGl::addSeparator方法的具体用法?C++ InterfaceGl::addSeparator怎么用?C++ InterfaceGl::addSeparator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类params::InterfaceGl
的用法示例。
在下文中一共展示了InterfaceGl::addSeparator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
void BasicApp::setup()
{
setWindowSize(800, 600);
configFilename = "config.xml";
bgColor = Color::black();
showRect = true;
rectRot = 0.f;
rectColor = ColorA::gray(0.5f);
rectPosition = Vec3f::zero();
showCircle = true;
circleRadius = 70.f;
circleColor = ColorA::gray(0.7f);
circlePosition = Vec3f::zero();
text = "Config Block for Cinder";
doubleParam = 0.0; intParam = 0; quatfParam = Quatf();
enumNames.push_back( "Orange" );
enumNames.push_back( "Apple" );
enumNames.push_back( "Banana" );
enumValue = 0;
//-----------------------------------------------------------------------------
mParams = params::InterfaceGl( "Settings", Vec2i( 400, 550 ) );
mConfig = new config::Config(&mParams);
mParams.addParam("Configuration file name", &configFilename);
mParams.addButton("Save config", bind(&BasicApp::saveConfig, this));
mParams.addButton("Load config", bind(&BasicApp::loadConfig, this));
mParams.addSeparator();
mConfig->addParam("Background color", &bgColor);
mConfig->addParam("Text", &text);
mParams.addSeparator();
mConfig->newNode("Rectangle");
mConfig->addParam("Show rectangle", &showRect);
mConfig->addParam("Rectangle rotation", &rectRot);
mConfig->addParam("Rectangle color", &rectColor);
mConfig->addParam("Rectangle position", &rectPosition);
mParams.addSeparator();
mConfig->newNode("Circle");
mConfig->addParam("Show circle", &showCircle);
mConfig->addParam("Circle radius", &circleRadius);
mConfig->addParam("Circle color", &circleColor);
mConfig->addParam("Circle position", &circlePosition);
mConfig->newNode("Other");
mConfig->addParam("Double type parameter", &doubleParam);
mConfig->addParam("Int type parameter", &intParam);
mConfig->addParam("Quatf type parameter", &quatfParam);
mConfig->addParam("Enum type parameter", enumNames, &enumValue);
}
示例2: setup
void LookAroundYouApp::setup()
{
Rand::randomize();
mVolume = 1.0;
// Setup GUI
getWindow()->setTitle("MPCDigital App");
mParams = params::InterfaceGl( "Settings", Vec2i( 300, 200 ) );
mParams.addParam( "Framerate", &mFrameRate, "", true );
mParams.addSeparator();
mParams.addParam("Speed", &Boid::speedMultiplier, "min=0.5 max=5.0 step=0.01");
mParams.addParam("Radius", &Boid::radiusMultiplier, "min=0.5 max=5.0 step=0.01");
mParams.addParam("Range", &Boid::range, "min=10.0 max=100 step=0.1");
mParams.addSeparator();
mParams.addParam("Master Volume", &mVolume, "min=0 max=1.0 step=0.01");
// Setup Audio
AudioDevice::printDeviceMap();
mAudioDevice = make_shared<AudioDevice>();
mAudioDevice->setup(0);
mAudioDevice->setAmbientReverb(FMOD_PRESET_UNDERWATER);
console() << "Channels Available: " << mAudioDevice->getNumRemainingChannels() << endl;
DataSourceRef data = loadAsset("music/Music For Airports - 1 1.mp3");
string musicName = mAudioDevice->registerSound(data, true, false, true);
music = mAudioDevice->getSoundInstance(musicName, 1.0);
music->pause();
fxnames.push_back(mAudioDevice->registerSound(loadAsset("fx/blue.aif"), true, true));
fxnames.push_back(mAudioDevice->registerSound(loadAsset("fx/fliup.aif"), true, true));
fxnames.push_back(mAudioDevice->registerSound(loadAsset("fx/green.aif"), true, true));
fxnames.push_back(mAudioDevice->registerSound(loadAsset("fx/howl.wav"), true, true));
fxnames.push_back(mAudioDevice->registerSound(loadAsset("fx/orange.aif"), true, true));
fxnames.push_back(mAudioDevice->registerSound(loadAsset("fx/red.aif"), true, true));
fxnames.push_back(mAudioDevice->registerSound(loadAsset("fx/white.aif"), true, true));
fxnames.push_back(mAudioDevice->registerSound(loadAsset("fx/yellow.aif"), true, true));
// Setup noise generator to drive Boid motion
mPerlin = new Perlin();
mPerlin->setSeed(clock());
mPerlin->setOctaves(1);
// Construct Boids
for(int i=0; i<10; i++) {
int n = Rand::randInt(0, fxnames.size());
SoundInstanceRef fx = mAudioDevice->getSoundInstance(fxnames[n], 1.0);
BoidRef boid = make_shared<Boid>(mPerlin, fx);
mBoids.push_back(boid);
}
// enable the depth buffer (for 3D)
gl::enableDepthRead();
gl::enableDepthWrite();
gl::enableAlphaBlending();
}
示例3: setup
void TestbedApp::setup()
{
std::vector<std::string> testNames;
testCount = 0;
while( nullptr != g_testEntries[testCount].createFcn ) {
testNames.push_back( g_testEntries[testCount].name );
++testCount;
}
testIndex = b2Clamp(testIndex, 0, testCount-1);
testSelection = testIndex;
entry = g_testEntries + testIndex;
if (entry && entry->createFcn) {
test = entry->createFcn();
testSelection = testIndex;
testIndex = -1;
}
#if ! defined( CINDER_GL_ES )
mParams = params::InterfaceGl( "Params", ivec2( 250, 400 ) );
mParams.addParam( "Tests", testNames, &testSelection );
mParams.addSeparator();
mParams.addParam( "Vel Iters", &settings.velocityIterations, "min=1 max=500 step=1" );
mParams.addParam( "Pos Iters", &settings.positionIterations, "min=0 max=100 step=1" );
mParams.addParam( "Pcl Iters", &settings.particleIterations, "min=1 max=100 step=1" );
mParams.addParam( "Hertz", &settingsHz, "min=1 max=100 step=1" );
mParams.addSeparator();
mParams.addParam( "Sleep", &settings.enableSleep );
mParams.addParam( "Warm Starting", &settings.enableWarmStarting );
mParams.addParam( "Time of Impact", &settings.enableContinuous );
mParams.addParam( "Sub-Stepping", &settings.enableSubStepping );
mParams.addParam( "Strict Particle/Body Contacts", &settings.strictContacts );
mParams.addSeparator( "Draw" );
mParams.addParam( "Shapes", &settings.drawShapes );
mParams.addParam( "Particles", &settings.drawParticles );
mParams.addParam( "Joints", &settings.drawJoints );
mParams.addParam( "AABBs", &settings.drawAABBs) ;
mParams.addParam( "Contact Points", &settings.drawContactPoints );
mParams.addParam( "Contact Normals", &settings.drawContactNormals );
mParams.addParam( "Contact Impulses", &settings.drawContactImpulse );
mParams.addParam( "Friction Impulses", &settings.drawFrictionImpulse );
mParams.addParam( "Center of Masses", &settings.drawCOMs );
mParams.addParam( "Statistics", &settings.drawStats );
mParams.addParam( "Profile", &settings.drawProfile );
#else
float s = 1080.0f/480.0f;
Rectf r = Rectf( 0, 0, 50*s, 50*s );
mLeftButton = r + vec2( 0, getWindowHeight() - r.getHeight() );
mRightButton = r + vec2( getWindowWidth() - r.getWidth(), getWindowHeight() - r.getHeight() );
#endif
}
示例4: setup
void DelaunayMeshMaker::setup()
{
mSurface = loadImage( app::loadAsset( "texture0.jpg" ) );
int width = mSurface.getWidth();
int height = mSurface.getHeight();
app::setWindowSize( width, height );
mFbo = gl::Fbo( width, height, false );
mBorderPoints.push_back( Vec2f::zero() );
mBorderPoints.push_back( Vec2f( (float)width, 0 ) );
mBorderPoints.push_back( Vec2f( (float)width ,(float)height ) );
mBorderPoints.push_back( Vec2f( 0 ,(float)height ) );
mMesh.clear();
mParams = params::InterfaceGl( "Parameters", Vec2i( 300, 250 ) );
mParams.addParam( "Alpha", &mAlpha, "max=1.0 min=0.0 step=0.005" );
mParams.addParam( "Blend", &mBlend );
mParams.addParam( "Phong Shading", &mApplyPhongShading );
mParams.addParam( "Depth Offset", &mDepthOffset, "step=0.1" );
mParams.addParam( "Draw wireframe", &mDrawWireframe );
mParams.addSeparator();
mParams.addText("Edge detection");
mParams.addParam( "Edge detection scale down", &mScaleDown, "min=1" );
mParams.addParam( "Minimum threshold", &mCannyMinThreshold, "min=0.0f" );
mParams.addParam( "Maximum threshold", &mCannyMaxThreshold, "min=0.0f" );
mParams.addSeparator();
mParams.addButton( "Tesselate", std::bind( &DelaunayMeshMaker::tesselate, this ) );
mScaleDown = 8;
mScaleDownPrev = mScaleDown;
mCannyMinThreshold = 60.0;
mCannyMaxThreshold = 70.0;
mAlpha = 0.0f;
mBlend = false;
mApplyPhongShading = false;
mDrawWireframe = false;
mDepthOffset = 0.0f;
mPrevDepthOffset = mDepthOffset;
mPrevBlend = mBlend;
mPhongShader = gl::GlslProg( loadAsset("phong_vert.glsl"), loadAsset("phong_frag.glsl") );
mEdgeDetectSurface = edgeDetect( Surface8u( mSurface ), mCannyMinThreshold, mCannyMaxThreshold, mScaleDownPrev );
mTesselator = Tesselator::makeTesselator();
mTesselator->sDone.connect( boost::bind( &DelaunayMeshMaker::onTesselationDone, this ) );
}
示例5: setupParams
void FxApp::setupParams()
{
mParams.clear();
mParams.addParam( "Effect", mEffectNames, &mCurrentEffect );
mParams.addSeparator();
mParams.addText( mEffects[ mCurrentEffect ]->getName() );
mEffects[ mCurrentEffect ]->addToParams( mParams );
mParams.addSeparator();
mParams.addParam( "Fps", &mFps, "", true );
}
示例6: setup
void bordaiApp::setup() {
mParams = params::InterfaceGl("bordai", Vec2i(300, 175));
mParams.addParam("Screen width", &mWindowSize.x, "", true);
mParams.addParam("Screen height", &mWindowSize.y, "", true);
mParams.addParam("Camera width", &mCameraLensSize.x, "min=128 max=1024 step=64 keyIncr=W keyDecr=w");
mParams.addParam("Camera height", &mCameraLensSize.y, "min=128 max=1024 step=64 keyIncr=H keyDecr=h");
mParams.addSeparator();
mParams.addText("Press space to apply new camera resolution");
mParams.addText("Press 'p' to pause/play camera");
mParams.addSeparator();
mParams.addParam("Framerate", &mFrameRate, "min=5.0 max=70.0 step=5.0 keyIncr=+ keyDecr=-");
mHaarDetector = HaarDetector( getResourcePath( "haarcascade_frontalface_alt2.xml" ) );
mCamera.startCapturing(mCameraLensSize.x, mCameraLensSize.y);
}
示例7: setup
void SmilesApp::setup()
{
mSmileLimit = 4.0f;
mSmileAverageNumOfFrames = 10;
mCamIndex = 0;
mFps = getAverageFps();
try {
mCapture = Capture( CAMWIDTH, CAMHEIGHT );
mCapture.start();
}
catch( ... ) {
console() << "Failed to initialize capture" << std::endl;
}
mSmileRect = Rectf(300,100,600,400);
setupSmileDetector(mSmileRect.getInteriorArea().getWidth(), mSmileRect.getInteriorArea().getHeight());
console()<< mSmileRect.getInteriorArea().getWidth() << mSmileRect.getInteriorArea().getHeight() << endl;
mSmileThreshold = 0;
mSmileAverageIndex = 0;
mParams = params::InterfaceGl( "Parameters", Vec2i( 220, 170 ) );
mParams.addParam( "FPS", &mFps,"", true );
mParams.addSeparator();
mParams.addParam( "SmileResponse", &mSmileResponse, "", true );
mParams.addParam( "SmileThreshold", &mSmileThreshold, "", true );
mParams.addParam( "mSmileLimit", &mSmileLimit );
mParams.addParam( "mSmileAverageNumOfFrames", &mSmileAverageNumOfFrames );
}
示例8:
void f6_structure::setup()
{
// SET WINDOW
setWindowSize(1920, 1080);
setFrameRate(30.f);
gl::color(Color::black());
// SETUP PARTICLE SYSTEMS
ParticleSystem ps1;
ps1.setup();
pss.push_back(ps1);
// SETUP LISTENER
Listener& listener = Listener::getInstance();
listener.setup();
// SETUP TRACKER
//t.setup();
// SETUP PARAMS
mParams = params::InterfaceGl("Parameters", Vec2i(200, 150));
mParams.addParam("Particle ID", &pf.d_particleToCreate, "keyIncr=+ keyDecr=-");
mParams.addSeparator();
mParams.addParam("Total particles", &mTotalParticles, "readonly=1");
mParams.addParam("Volume", &mVolume, "readonly=1");
mParams.addParam("Scale", &listener.mScale, "min=0.1 max=40.0 step=0.1");
}
示例9: setup
void KaleidoscopeApp::setup()
{
mParams = params::InterfaceGl( "Parameters", Vec2i( 200, 300 ) );
mParams.addParam( "Fps", &mFps, "", true );
mParams.addParam( "Vertical sync", &mVerticalSyncEnabled );
mParams.addSeparator();
mNumReflectionLines = 3;
mParams.addParam( "Reflection lines", &mNumReflectionLines, "min=0, max=32" );
mRotation = 0.f;
mParams.addParam( "Rotation", &mRotation, "step=.01" );
mCenter = Vec2f( .5f, .5f );
mParams.addParam( "Center X", &mCenter.x, "min=0 max=1 step=.005 group='Center'" );
mParams.addParam( "Center Y", &mCenter.y, "min=0 max=1 step=.005 group='Center'" );
mTexture = loadImage( loadAsset( "tx.jpg" ) );
mTexture.setWrap( true, true );
try
{
mShader = gl::GlslProg( loadAsset( "Kaleidoscope.vert" ),
loadAsset( "Kaleidoscope.frag" ) );
}
catch ( gl::GlslProgCompileExc &exc )
{
console() << exc.what() << endl;
}
}
示例10: setup
void SpirographApp::setup()
{
mLoc = Vec2f(getWindowWidth()/2, getWindowHeight()/2);
mSpirograph = new SpirographPoint();
// Base Spirograph parameters
mAngle = 0.0f;
mRadius = 65.0f;
mIncAngle = 0.02f;
// Setup the parameters
mParams = params::InterfaceGl("Spirograph Parameters", Vec2i(100, 200));
mParams.addParam("Angle", &mAngle);
mParams.addParam("Increment Angle", &mIncAngle);
mParams.addParam("Radius", &mRadius);
mParams.addSeparator();
mParams.addParam("Spirograph Angle", &mSpirograph->mAngle);
mParams.addParam("Spirograph Radius", &mSpirograph->mRadius);
mSaveFrames = false;
// Opengl blending
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_POLYGON_SMOOTH);
glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST); // GL_FASTEST
}
示例11: setup
void AssimpApp::setup()
{
mAssimpLoader = assimp::AssimpLoader( getAssetPath( "astroboy_walk.dae" ) );
mAssimpLoader.setAnimation( 0 );
CameraPersp cam;
cam.setPerspective( 60, getWindowAspectRatio(), 0.1f, 1000.0f );
cam.setEyePoint( Vec3f( 0, 7, 20 ) );
cam.setCenterOfInterestPoint( Vec3f( 0, 7, 0 ) );
mMayaCam.setCurrentCam( cam );
mParams = params::InterfaceGl( "Parameters", Vec2i( 200, 300 ) );
mEnableWireframe = false;
mParams.addParam( "Wireframe", &mEnableWireframe );
mEnableTextures = true;
mParams.addParam( "Textures", &mEnableTextures );
mEnableSkinning = true;
mParams.addParam( "Skinning", &mEnableSkinning );
mEnableAnimation = false;
mParams.addParam( "Animation", &mEnableAnimation );
mDrawBBox = false;
mParams.addParam( "Bounding box", &mDrawBBox );
mParams.addSeparator();
mParams.addParam( "Fps", &mFps, "", true );
}
示例12: setup
void ArmyDemoApp::setup()
{
mSender.bind();
#if ! USE_UDP
mSender.connect();
#endif
model::Skeleton::sRenderMode = model::Skeleton::RenderMode::CLEANED;
mLightPos = vec3(10.0f, 20.0f, 20.0f);
mMouseHorizontalPos = 0;
mMeshIndex = 0;
mParams = params::InterfaceGl( "Parameters", ivec2( 200, 250 ) );
mParams.addParam( "Fps", &mFps, "", true );
mParams.addSeparator();
mDrawMesh = true;
mParams.addParam( "Draw Mesh", &mDrawMesh );
mDrawSkeleton = false;
mParams.addParam( "Draw Skeleton", &mDrawSkeleton );
mDrawAbsolute = true;
mParams.addParam( "Relative/Abolute skeleton", &mDrawAbsolute );
mEnableWireframe = false;
mParams.addParam( "Wireframe", &mEnableWireframe );
gl::enableDepthWrite();
gl::enableDepthRead();
gl::enableAlphaBlending();
mSkeletalMesh = model::SkeletalMesh::create( model::AssimpLoader( loadAsset( "maggot3.md5mesh" ) ) );
}
示例13: setup
void CinderProjectionTestApp::setup()
{
mLookEye = Vec3f( 5.0f, 10.0f, 30.0f );
mSweetEye = Vec3f( 0.0f, 0.0f, 4.0f );
mProjEye = Vec3f( 2.0f, 3.0f, 3.0f );
mLookCenter = mSweetCenter = mProjCenter = Vec3f::zero();
mLookUp = mSweetUp = mProjUp = Vec3f::yAxis();
mLookDistance = 30.0f;
// setPerspective of cams moved to ::resize()
mActiveCam = CAM_LOOK;
mCubeSize = 1.0f;
mTexture = gl::Texture( loadImage( loadResource( RES_IMAGE ) ) );
mProjShader = gl::GlslProg( loadResource( RES_TEXTUREPROJECTION_VERT ), loadResource( RES_TEXTUREPROJECTION_FRAG ) );
mTextureScaling = 1.0f;
vector<string> camEnum;
camEnum.push_back("Look around (free)");
camEnum.push_back("'Sweet spot' (fixed)");
camEnum.push_back("Projector (fixed)");
mParams = params::InterfaceGl( "Texture Projection", Vec2i( 160, 100 ) );
//mParams.addParam( "Active Cam", camEnum, &mActiveCam ); // ::addParam(..enum..) is not available in Cinder 0.8.2
//mParams.setOptions("", "iconified=true" ); // ::setOptions is not available in Cinder 0.8.2
//mParams.setOptions("", "help='Keys [1], [2] and [3] can be used to switch camrea positions'" );
mParams.addParam( "Avg. FPS", &mFPS, "precision=1", true );
mParams.addParam( "Tex Scale", &mTextureScaling, "step=0.1" );
mParams.addParam( "Cube Rot.", &mCubeRotation );
mParams.addParam( "Cube Size", &mCubeSize, "keyincr=+ keydecr=-" );
mParams.addSeparator();
mParams.addParam( "Sweet Eye", &mSweetEye );
}
示例14: setup
void FlockingApp::setup()
{
Rand::randomize();
mCenter = Vec3f( getWindowWidth() * 0.5f, getWindowHeight() * 0.5f, 0.0f );
mCentralGravity = true;
mFlatten = false;
mSaveFrames = false;
mIsRenderingPrint = false;
mZoneRadius = 80.0f;
mLowerThresh = 0.5f;
mHigherThresh = 0.8f;
mAttractStrength = 0.004f;
mRepelStrength = 0.01f;
mOrientStrength = 0.01f;
// SETUP CAMERA
mCameraDistance = 350.0f;
mEye = Vec3f( 0.0f, 0.0f, mCameraDistance );
mCenter = Vec3f::zero();
mUp = Vec3f::yAxis();
mCam.setPerspective( 75.0f, getWindowAspectRatio(), 5.0f, 5000.0f );
// SETUP PARAMS
mParams = params::InterfaceGl( "Flocking", Vec2i( 200, 310 ) );
mParams.addParam( "Scene Rotation", &mSceneRotation, "opened=1" );
mParams.addSeparator();
mParams.addParam( "Eye Distance", &mCameraDistance, "min=100.0 max=2000.0 step=50.0 keyIncr=s keyDecr=w" );
mParams.addParam( "Center Gravity", &mCentralGravity, "keyIncr=g" );
mParams.addParam( "Flatten", &mFlatten, "keyIncr=f" );
mParams.addSeparator();
mParams.addParam( "Zone Radius", &mZoneRadius, "min=10.0 max=100.0 step=1.0 keyIncr=z keyDecr=Z" );
mParams.addParam( "Lower Thresh", &mLowerThresh, "min=0.025 max=1.0 step=0.025 keyIncr=l keyDecr=L" );
mParams.addParam( "Higher Thresh", &mHigherThresh, "min=0.025 max=1.0 step=0.025 keyIncr=h keyDecr=H" );
mParams.addSeparator();
mParams.addParam( "Attract Strength", &mAttractStrength, "min=0.001 max=0.1 step=0.001 keyIncr=a keyDecr=A" );
mParams.addParam( "Repel Strength", &mRepelStrength, "min=0.001 max=0.1 step=0.001 keyIncr=r keyDecr=R" );
mParams.addParam( "Orient Strength", &mOrientStrength, "min=0.001 max=0.1 step=0.001 keyIncr=o keyDecr=O" );
// CREATE PARTICLE CONTROLLER
mParticleController.addParticles( NUM_INITIAL_PARTICLES );
mParticleController.addPredators( NUM_INITIAL_PREDATORS );
}
示例15: setup
void TutorialApp::setup()
{
mCentralGravity = true;
mFlatten = true; //makes it easy to see the effects in 2D...while we are experimenting
mZoneRadius = 65.0f;
mThresh = 0.65f;
//define the camera
mCameraDistance = 500.0f;
mEye = Vec3f( 0.0f, 0.0f, mCameraDistance ); //position of the camera
mCenter = Vec3f::zero(); //the location in 3D space that the camera points at
mUp = Vec3f::yAxis(); //the camera's up direction
// Takes four parameters:
// (1) foV : the smaller the number the tighter the fustrum (usually between 60.0 and 90.0)
// (2) aspect ratio of the application window
// (3) near clipping plane
// (4) far clipping plane
mCam.setPerspective( 75.0f, getWindowAspectRatio(), 50.0f, 2000.0f );
// Initialize the Params object
mParams = params::InterfaceGl( "Flocking", Vec2i( 200, 240 ) );
// We tell Params that we want it control the mSceneRotation variable...during runtime!
// It expects the addr in memory of the variable...that's what & is.
// So, it will include an arc-ball in the scene.
mParams.addParam( "Scene Rotation", &mSceneRotation, "opened=1" );
mParams.addSeparator();
mParams.addParam( "Eye Distance", &mCameraDistance, "min=50.0 max=1500.0 step=50.0 keyIncr=s keyDecr=w" );
mParams.addParam( "Center Gravity", &mCentralGravity, "keyIncr=g" );
mParams.addParam( "Flatten", &mFlatten, "keyIncr=f" );
mParams.addSeparator();
mParams.addParam( "Zone Radius", &mZoneRadius, "min=10.0 max=100.0 step=1.0 keyIncr=z keyDecr=Z" );
mParams.addParam( "Thresh", &mThresh, "min=0.025 max=1.0 step=0.025 keyIncr=t keyDecr=T" );
// CREATE PARTICLE CONTROLLER
mParticleController.addParticles( NUM_INITIAL_PARTICLES );
}