本文整理汇总了C++中params::InterfaceGl类的典型用法代码示例。如果您正苦于以下问题:C++ InterfaceGl类的具体用法?C++ InterfaceGl怎么用?C++ InterfaceGl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InterfaceGl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: console
void kinectSkelApp::setup()
{
console() << "There are " << Kinect::getNumDevices() << " Kinects connected." << std::endl;
mKinect = Kinect( Kinect::Device() ); // the default Device implies the first Kinect connected
mParams = params::InterfaceGl( "KinectSkel", Vec2i( 200, 180 ) );
mParams.addParam( "Kinect Tilt", &mKinectTilt, "min=-31 max=31 keyIncr=T keyDecr=t" );
mParams.addParam( "lo thresh", &mLo, "min=.0 max=1.0 step=.025 keyIncr=L keyDecr=l" );
mParams.addParam( "hi thresh", &mHi, "min=.0 max=1.0 step=.025 keyIncr=H keyDecr=h" );
mParams.addParam( "dilate size", &mDilateSize, "min=3 max=20 step=1 keyIncr=D keyDecr=d" );
mParams.addParam( "dilate iter", &mDilateIter, "min=1 max=10 step=1 keyIncr=F keyDecr=f" );
mParams.addParam( "skel thresh", &mSkelThresh, "min=0 max=255 step=1 keyIncr=S keyDecr=s" );
mLo = 0.5;
mHi = 1.0;
mDilateSize = 8;
mDilateIter = 1;
mKinectTilt = .0f;
mSkelThresh = 0;
mFboThresh = gl::Fbo(640, 480);
mShader = gl::GlslProg( loadResource( RES_VERT_ID ), loadResource( RES_FRAG_ID ) );
mDepthTexture = gl::Texture( 640, 480 );
mColorTexture = gl::Texture( 640, 480 );
depthSurf = Surface8u(640, 480, true);
kern00 = cv::Mat(5, 5, CV_32FC1, L0);
kern45 = cv::Mat(5, 5, CV_32FC1, L45);
kern90 = cv::Mat(5, 5, CV_32FC1, L90);
kern135 = cv::Mat(5, 5, CV_32FC1, L135);
}
示例2: setWindowSize
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);
}
示例3: Vec2i
void kinectPointCloudApp::setup()
{
// SETUP PARAMS
mParams = params::InterfaceGl( "KinectPointCloud", Vec2i( 200, 180 ) );
mParams.addParam( "Scene Rotation", &mSceneRotation, "opened=1" );
mParams.addParam( "Cam Distance", &mCameraDistance, "min=100.0 max=5000.0 step=100.0 keyIncr=s keyDecr=w" );
mParams.addParam( "Kinect Tilt", &mKinectTilt, "min=-31 max=31 keyIncr=T keyDecr=t" );
// SETUP CAMERA
mCameraDistance = 1000.0f;
mEye = Vec3f( 0.0f, 0.0f, mCameraDistance );
mCenter = Vec3f::zero();
mUp = Vec3f::yAxis();
mCam.setPerspective( 75.0f, getWindowAspectRatio(), 1.0f, 8000.0f );
// SETUP KINECT AND TEXTURES
console() << "There are " << Kinect::getNumDevices() << " Kinects connected." << std::endl;
mKinect = Kinect( Kinect::Device() ); // use the default Kinect
mDepthTexture = gl::Texture( 640, 480 );
// SETUP VBO AND SHADER
createVbo();
mShader = gl::GlslProg( loadResource( RES_VERT_ID ), loadResource( RES_FRAG_ID ) );
// SETUP GL
gl::enableDepthWrite();
gl::enableDepthRead();
}
示例4: KinectDepthSource
KinectDepthSource(params::InterfaceGl& params)
: mTilt(0)
, mEnableIR(false)
{
params.addParam( "Tilt", &mTilt, "min=-31 max=32");
params.addParam( "Toggle IR", &mEnableIR);
}
示例5: Vec3f
void FractalStudyApp::setup()
{
// SETUP CAMERA
mCameraDistance = 1200.0f;
mEye = Vec3f( 0.0f, 0.0f, mCameraDistance );
mCenter = Vec3f( 0.0f, 0.0f, 0.0f );
mUp = Vec3f::yAxis();
mCam.setPerspective( 75.0f, getWindowAspectRatio(), 5.0f, 2000.0f );
//PARAMS
mParams = params::InterfaceGl( "Control Panel", Vec2i( 200, 160 ) );
mParams.addParam( "Scene Rotation", &mSceneRotation );
mParams.addParam( "Eye Distance", &mCameraDistance, "min=50.0 max=1500.0 step=50.0 keyIncr=s keyDecr=w" );
glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
gl::enableDepthWrite();
gl::enableDepthRead();
gl::enableAlphaBlending();
glDisable( GL_TEXTURE_2D );
mDirectional = 1.0f;
camAngle = 0;
mSaveFrame = false;
}
示例6: Vec3f
void ColorTilesApp::setup()
{
app::setWindowSize(1200, 800);
gl::enableAlphaBlending();
// Set up the camera.
cameraDistance_ = 1000.0f;
eye_ = Vec3f(0.0f, 0.0f, cameraDistance_);
center_ = Vec3f::zero();
up_ = Vec3f::yAxis();
camera_.setPerspective(75.0f, getWindowAspectRatio(), 5.0f, 2000.0f);
// Set up camera control.
params_ = params::InterfaceGl("Color Tiles", Vec2i(225, 200));
params_.addParam("Scene Rotation", &sceneRotation_);
params_.addParam("Eye Distance", &cameraDistance_, "min=0.0 max=2000.0 step=50.0 keyIncr=s keyDecr=w");
// Set up the initial set of tiles.
for (int x = -HALF_WIDTH; x <= HALF_WIDTH; ++x) {
for (int y = -HALF_WIDTH; y <= HALF_WIDTH; ++y) {
for (int z = -HALF_WIDTH; z <= HALF_WIDTH; ++z) {
int xpos = x * TILE_WIDTH;
int ypos = y * TILE_HEIGHT;
int zpos = z * TILE_WIDTH;
Tile* tile = new Tile(xpos, ypos, zpos,
TILE_WIDTH, TILE_HEIGHT, TILE_DEPTH);
tiles_.push_back(tile);
}
}
}
}
示例7: catch
void NIUserMaskApp::setup()
{
try
{
mNI = ni::OpenNI( ni::OpenNI::Device() );
}
catch ( ... )
{
console() << "Could not open Kinect" << endl;
quit();
}
mNIUserTracker = mNI.getUserTracker();
mNI.setMirrored();
mNI.start();
mParams = params::InterfaceGl( "Parameters", Vec2i( 200, 100 ) );
mBlurAmt = 15.0;
mParams.addParam( "blur", &mBlurAmt, "min=1 max=15 step=.5" );
mErodeAmt = 3.0;
mParams.addParam( "erode", &mErodeAmt, "min=1 max=15 step=.5" );
mDilateAmt = 7.0;
mParams.addParam( "dilate", &mDilateAmt, "min=1 max=15 step=.5" );
mThres = 128;
mParams.addParam( "threshold", &mThres, "min=1 max=255" );
}
示例8: Vec3f
void SierpinskiTriangleChaos3DApp::setup()
{
// SETUP CAMERA
mCameraDistance = 1000.0f;
mEye = Vec3f( 0.0f, 300.0f, mCameraDistance );
mCenter = Vec3f( 0.0f, 300.0f, 0.0f );
mUp = Vec3f::yAxis();
mCam.setPerspective( 75.0f, getWindowAspectRatio(), 5.0f, 3000.0f );
//PARAMS
mParams = params::InterfaceGl( "Control Panel", Vec2i( 200, 160 ) );
mParams.addParam( "Scene Rotation", &mSceneRotation );
mParams.addParam( "Eye Distance", &mCameraDistance, "min=50.0 max=1300.0 step=20.0 keyIncr=s keyDecr=w" );
glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
gl::enableDepthWrite();
gl::enableDepthRead();
gl::enableAlphaBlending();
glDisable( GL_TEXTURE_2D );
mDirectional = 1.0f;
marker1.set( 0.0f, 0.0f, 400.0f);
marker2.set( -346.5f, 0.0f, -200.0f);
marker3.set( 346.5f, 0.0f, -200.0f);
marker4.set( 0.0f, 600.0f, 0.0f);
thePoint.set( Rand::randFloat(-100.0f, 100.0f), Rand::randFloat(-100.0f, 100.0f), Rand::randFloat(-100.0f, 100.0f) );
mSaveFrame = true;
}
示例9: setWindowSize
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");
}
示例10: Capture
void ___PACKAGENAMEASIDENTIFIER___App::setup()
{
try {
mCapture = Capture( kCaptureWidth, kCaptureHeight );
mCapture.start();
} catch ( ... ) {
console() << "Error with capture device." << std::endl;
exit(1);
}
try {
mShader = gl::GlslProg( loadResource( RES_SHADER_PASSTHRU ), loadResource( RES_SHADER_FRAGMENT ) );
} catch ( gl::GlslProgCompileExc &exc ) {
console() << "Cannot compile shader: " << exc.what() << std::endl;
exit(1);
}catch ( Exception &exc ){
console() << "Cannot load shader: " << exc.what() << std::endl;
exit(1);
}
mFbo = gl::Fbo( kWindowWidth, kWindowHeight );
mMixColorRed = 0.0f;
mMixColorGreen = 0.0f;
mMixColorBlue = 0.0f;
mParams = params::InterfaceGl( "Parameters", Vec2i( kParamsWidth, kParamsHeight ) );
mParams.addParam( "Mix Red", &mMixColorRed, "min=-1.0 max=1.0 step=0.01 keyIncr=r keyDecr=R" );
mParams.addParam( "Mix Green", &mMixColorGreen, "min=-1.0 max=1.0 step=0.01 keyIncr=g keyDecr=G" );
mParams.addParam( "Mix Blue", &mMixColorBlue, "min=-1.0 max=1.0 step=0.01 keyIncr=b keyDecr=B" );
}
示例11: Vec2i
void RDiffusionApp::setup()
{
mReactionU = 0.25f;
mReactionV = 0.04f;
mReactionK = 0.047f;
mReactionF = 0.1f;
mMousePressed = false;
// Setup the parameters
mParams = params::InterfaceGl( "Parameters", Vec2i( 175, 100 ) );
mParams.addParam( "Reaction u", &mReactionU, "min=0.0 max=0.4 step=0.01 keyIncr=u keyDecr=U" );
mParams.addParam( "Reaction v", &mReactionV, "min=0.0 max=0.4 step=0.01 keyIncr=v keyDecr=V" );
mParams.addParam( "Reaction k", &mReactionK, "min=0.0 max=1.0 step=0.001 keyIncr=k keyDecr=K" );
mParams.addParam( "Reaction f", &mReactionF, "min=0.0 max=1.0 step=0.001 keyIncr=f keyDecr=F" );
gl::Fbo::Format format;
format.enableDepthBuffer( false );
mCurrentFBO = 0;
mOtherFBO = 1;
mFBOs[0] = gl::Fbo( FBO_WIDTH, FBO_HEIGHT, format );
mFBOs[1] = gl::Fbo( FBO_WIDTH, FBO_HEIGHT, format );
mShader = gl::GlslProg( loadResource( RES_PASS_THRU_VERT ), loadResource( RES_GSRD_FRAG ) );
mTexture = gl::Texture( loadImage( loadResource( RES_STARTER_IMAGE ) ) );
mTexture.setWrap( GL_REPEAT, GL_REPEAT );
mTexture.setMinFilter( GL_LINEAR );
mTexture.setMagFilter( GL_LINEAR );
mTexture.bind( 1 );
resetFBOs();
}
示例12: Vec2i
void SpriteSheetGeneratorApp::setup()
{
mParams = params::InterfaceGl( "SpriteSheet Generator", Vec2i( 200, 200 ) );
mParams.setOptions( "", "position='50 450'" );
mParams.addParam( "Preview scaling", &mWindowScaling, "min=0.1 max=2.0 step=0.05");
mParams.addParam( "Preview offset", &mPreviewOffset.y );
mParams.addParam( "Output name", &mFilename );
mParams.addButton( "Save sheet", [this](){ saveSpriteSheet(); } );
}
示例13: setup
void setup() { // вызавется при запуске приложения
objectPosition = Vec3f::zero();
cameraDistance = 500; // выставим значение по умолчанию от камеры до цели
camera.setPerspective( 60.0f, getWindowAspectRatio(), 5.0f, 3000.0f ); // настроим преспективу камеры
cameraParams = params::InterfaceGl( "Camera Settings", Vec2i( 225, 200 ) ); // создадим окно интерфейса (название, размер)
cameraParams.addParam( "Scene Rotation", &sceneRotation ); // окно может управлять вращением сцены
cameraParams.addParam( "Eye Distance", &cameraDistance, "min=50.0 max=1000.0 step=50.0 keyIncr=s keyDecr=w" ); // окно может управлять расстоянием от того гда камера до того куда она смотрит (подробнее о параметрах http://anttweakbar.sourceforge.net/doc/tools%3aanttweakbar%3avarparamsyntax)
}
示例14: Kinect
void ContoursApp::setup()
{
mKinect = Kinect( Kinect::Device() );
mKinectReady = false;
mKinectIR = false;
silhouetteDetector = new SilhouetteDetector(640,480);
contours = new vector<vector<cv::Point> >();
mParams = params::InterfaceGl( "Parameters", Vec2i( 200, 100 ) );
mParams.addParam( "Near Threshold", &silhouetteDetector->mNearThreshold, "min=0 max=255 step=1.0 keyIncr=z keyDecr=Z" );
mParams.addParam( "Far Threshold", &silhouetteDetector->mFarThreshold, "min=0 max=255 step=1.0 keyIncr=x keyDecr=X" );
mParams.addParam( "Blur Amount", &silhouetteDetector->mBlurAmt, "min=0 max=20 step=1.0 keyIncr=b keyDecr=B" );
}
示例15: ivec2
void PolygonBooleanApp::setup()
{
mParams = params::InterfaceGl( "App parameters", ivec2( 180, 100 ) );
mParams.addButton( "Union", std::bind( &PolygonBooleanApp::doUnion, this ) );
mParams.addButton( "Intersection", std::bind( &PolygonBooleanApp::doIntersection, this ) );
mParams.addButton( "XOR", std::bind( &PolygonBooleanApp::doXor, this ) );
mParams.addButton( "Difference", std::bind( &PolygonBooleanApp::doDifference, this ) );
mPolyA = makePolyWithHole();
mPolyAMesh = makeMesh( mPolyA );
mPolyB = makeLetterA(); //makeStar();
mPolyBMesh = makeMesh( mPolyB );
}