本文整理汇总了C++中ci::params::InterfaceGlRef类的典型用法代码示例。如果您正苦于以下问题:C++ InterfaceGlRef类的具体用法?C++ InterfaceGlRef怎么用?C++ InterfaceGlRef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InterfaceGlRef类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: loadGUI
void CameraComponent::loadGUI(const ci::params::InterfaceGlRef &gui)
{
gui->addSeparator();
gui->addText( mContext->getName() +" : "+ getName());
auto updateFn = std::bind(&CameraComponent::updateCameraParams, this);
gui->addParam( mContext->getName() +" : FOV", &mFov).updateFn(updateFn);
gui->addParam( mContext->getName() +" : Far", &mFar).updateFn(updateFn);
gui->addParam( mContext->getName() +" : Near", &mNear).updateFn(updateFn);
gui->addParam( mContext->getName() +" : Interest Point", &mInterestPoint);
}
开发者ID:m1keall1son,项目名称:Ecstatic_Computation,代码行数:11,代码来源:CameraComponent.cpp
示例2: loadGUI
void OSCComponent::loadGUI(const ci::params::InterfaceGlRef &gui)
{
gui->addSeparator();
gui->addText( mContext->getName() +" : "+ getName());
auto updateFn = [&]{ mListener.setup(mListenPort); };
gui->addParam("listen port", &mListenPort).updateFn(updateFn);
///TODO:: change osc sender gui update
// auto loadFn = [&]{
// auto tree = ec::ConfigManager::get()->retreiveComponent(ec::Controller::get()->scene().lock()->getName(), mContext->getName(), getName() );
// auto ip = tree["send_ip"].getValue();
// auto port = tree["send_port"].getValue<int>();
// mSendPort = port;
// mSendIp = ip;
// mSender.setup(mSendIp, mSendPort);
// };
// gui->addButton("reload osc sender", loadFn );
}
开发者ID:m1keall1son,项目名称:Ecstatic_Computation,代码行数:20,代码来源:OSCComponent.cpp
示例3: loadGUI
void ComponentTemplate::loadGUI(const ci::params::InterfaceGlRef &gui)
{
gui->addSeparator();
gui->addText(getName());
}
开发者ID:m1keall1son,项目名称:Ecstatic_Computation,代码行数:5,代码来源:ComponentTemplate.cpp
示例4: AddParams
void SpherePrimitive::AddParams(ci::params::InterfaceGlRef _params) {
Primitive::AddParams(_params);
_params->addParam(GetName() + "::Center", &mCenter, "group=" + GetName() + " label='Center'");
_params->addParam(GetName() + "::Radius", &mRadius, "group=" + GetName() + " label='Radius'");
}
开发者ID:akshayloke,项目名称:RayTracer,代码行数:5,代码来源:SpherePrimitive.cpp
示例5: setup
void FaceApp::setup()
{
gl::enableAlphaBlending();
mEnabledFace2d = true;
mEnabledFace3d = true;
mFrameRate = 0.0f;
mFullScreen = false;
mDevice = Kinect2::Device::create();
mDevice->start();
mDevice->enableFaceMesh();
mDevice->connectBodyEventHandler( [ & ]( const Kinect2::BodyFrame frame )
{
} );
mDevice->connectColorEventHandler( [ & ]( const Kinect2::ColorFrame frame )
{
mSurface = frame.getSurface();
} );
mParams = params::InterfaceGl::create( "Params", Vec2i( 230, 130 ) );
mParams->addParam( "Frame rate", &mFrameRate, "", true );
mParams->addParam( "Full screen", &mFullScreen ).key( "f" );
mParams->addParam( "2d face tracking", &mEnabledFace2d ).key( "2" );
mParams->addParam( "3d face tracking", &mEnabledFace3d ).key( "3" );
mParams->addButton( "Quit", [ & ]() { quit(); } , "key=q" );
}
开发者ID:blelem,项目名称:Cinder-KCB2,代码行数:27,代码来源:FaceApp.cpp
示例6: setup
void BasicApp::setup()
{
gl::enable( GL_TEXTURE_2D );
mFrameRate = 0.0f;
mFullScreen = false;
mDevice = Kinect2::Device::create();
mDevice->start();
mDevice->connectBodyIndexEventHandler( [ & ]( const Kinect2::BodyIndexFrame& frame )
{
mChannelBodyIndex = frame.getChannel();
} );
mDevice->connectColorEventHandler( [ & ]( const Kinect2::ColorFrame& frame )
{
mSurfaceColor = frame.getSurface();
} );
mDevice->connectDepthEventHandler( [ & ]( const Kinect2::DepthFrame& frame )
{
mChannelDepth = frame.getChannel();
} );
mDevice->connectInfraredEventHandler( [ & ]( const Kinect2::InfraredFrame& frame )
{
mChannelInfrared = frame.getChannel();
} );
mParams = params::InterfaceGl::create( "Params", ivec2( 200, 100 ) );
mParams->addParam( "Frame rate", &mFrameRate, "", true );
mParams->addParam( "Full screen", &mFullScreen ).key( "f" );
mParams->addButton( "Quit", [ & ]() { quit(); } , "key=q" );
}
开发者ID:RandomStudio,项目名称:Cinder-KCB2,代码行数:31,代码来源:BasicApp.cpp
示例7: setup
void UdpServerApp::setup()
{
gl::enableAlphaBlending();
gl::enable( GL_TEXTURE_2D );
mFont = Font( "Georgia", 24 );
mFrameRate = 0.0f;
mFullScreen = false;
mPort = 2000;
mPortPrev = mPort;
mParams = params::InterfaceGl::create( "Params", ivec2( 200, 110 ) );
mParams->addParam( "Frame rate", &mFrameRate, "", true );
mParams->addParam( "Full screen", &mFullScreen, "key=f" );
mParams->addParam( "Port", &mPort,
"min=0 max=65535 step=1 keyDecr=p keyIncr=P" );
mParams->addButton( "Quit", bind( &UdpServerApp::quit, this ), "key=q" );
// Initialize a server by passing a boost::asio::io_service to it.
// ci::App already has one that it polls on update, so we'll use that.
// You can use your own io_service, but you will have to manage it
// manually (i.e., call poll(), poll_one(), run(), etc).
mServer = UdpServer::create( io_service() );
// Add callbacks to work with the server asynchronously.
mServer->connectAcceptEventHandler( &UdpServerApp::onAccept, this );
mServer->connectErrorEventHandler( &UdpServerApp::onError, this );
// Start listening.
accept();
}
开发者ID:BanTheRewind,项目名称:Cinder-Asio,代码行数:31,代码来源:UdpServerApp.cpp
示例8: setup
void ServerApp::setup()
{
mFrameRate = 0.0f;
mFullScreen = false;
mMessage = "Hello, client!";
gl::enable( GL_TEXTURE_2D );
mFont = Font( "Georgia", 80 );
mSize = Vec2f( getWindowSize() );
mText = "Listening...";
mTextPrev = "";
mServer.addConnectCallback( &ServerApp::onConnect, this );
mServer.addDisconnectCallback( &ServerApp::onDisconnect, this );
mServer.addErrorCallback( &ServerApp::onError, this );
mServer.addInterruptCallback( &ServerApp::onInterrupt, this );
mServer.addPingCallback( &ServerApp::onPing, this );
mServer.addReadCallback( &ServerApp::onRead, this );
mParams = params::InterfaceGl::create( "SERVER", Vec2i( 200, 100 ) );
mParams->addParam( "Frame rate", &mFrameRate, "", true );
mParams->addParam( "Fullscreen", &mFullScreen, "key=f" );
mParams->addParam( "Message", &mMessage );
mParams->addButton( "Write", bind( &ServerApp::write, this ), "key=w" );
mParams->addButton( "Quit", bind( &ServerApp::quit, this ), "key=q" );
mServer.listen( 9002 );
}
开发者ID:araid,项目名称:Cinder-WebSocketPP,代码行数:28,代码来源:ServerApp.cpp
示例9: draw
void BasicApp::draw()
{
gl::viewport( getWindowSize() );
gl::clear();
gl::setMatricesWindow( getWindowSize() );
gl::enableAlphaBlending();
if ( mSurfaceColor ) {
gl::TextureRef tex = gl::Texture::create( *mSurfaceColor );
gl::draw( tex, tex->getBounds(), Rectf( vec2( 0.0f ), getWindowCenter() ) );
}
if ( mChannelDepth ) {
gl::TextureRef tex = gl::Texture::create( *Kinect2::channel16To8( mChannelDepth ) );
gl::draw( tex, tex->getBounds(), Rectf( getWindowCenter().x, 0.0f, (float)getWindowWidth(), getWindowCenter().y ) );
}
if ( mChannelInfrared ) {
gl::TextureRef tex = gl::Texture::create( *mChannelInfrared );
gl::draw( tex, tex->getBounds(), Rectf( 0.0f, getWindowCenter().y, getWindowCenter().x, (float)getWindowHeight() ) );
}
if ( mChannelBodyIndex ) {
gl::TextureRef tex = gl::Texture::create( *Kinect2::colorizeBodyIndex( mChannelBodyIndex ) );
gl::draw( tex, tex->getBounds(), Rectf( getWindowCenter(), vec2( getWindowSize() ) ) );
}
mParams->draw();
}
开发者ID:RandomStudio,项目名称:Cinder-KCB2,代码行数:26,代码来源:BasicApp.cpp
示例10: setup
void SegmentationApp::setup()
{
#ifdef _WIN32
showWin32Console();
#endif
guiMode = GUI_MODE::LOAD_IMAGE;
drawMode = DRAW_MODE::INPUT_GROUNDTRUTH;
this->setWindowSize(WINDOW_WIDTH, WINDOW_HEIGHT);
this->setWindowPos(20, 20);
interface = params::InterfaceGl::create(this->getWindow(),
"Segmentation",
ci::app::toPixels(ci::Vec2i(WINDOW_WIDTH/6,GUI_HEIGHT)));
interface->setPosition(ci::Vec2i(25,50));
firstImageRect = Rectf(WINDOW_WIDTH/6.f+50, 50, 3.5f*WINDOW_WIDTH/6.f, GUI_HEIGHT);
secondImageRect = Rectf(3.5f*WINDOW_WIDTH/6.f+10, 50, 3.5f*WINDOW_WIDTH/6.f+10+firstImageRect.x2-firstImageRect.x1, GUI_HEIGHT);
colorThreshold = 120;
mahalonobisThreshold = 50;
greenWeight = 1.2f;
blueWeight = 2.9f;
filterRadius = 2;
hueThreshold = 0.075f;
hueAngle = -0.046f;
otsusIterations = 2;
diceCoefficientResult = 0;
mouse = new MouseUI(this->getWindow());
initInterface();
}
开发者ID:cmorace,项目名称:nckuGraphicsLib,代码行数:31,代码来源:SegmentationApp.cpp
示例11: setup
void FtpClientApp::setup()
{
gl::enable( GL_TEXTURE_2D );
mFont = Font( "Georgia", 24 );
mFrameRate = 0.0f;
mFullScreen = false;
mParams = params::InterfaceGl::create( "Params", ivec2( 200, 120 ) );
mParams->addParam( "Frame rate", &mFrameRate, "", true );
mParams->addParam( "Full screen", &mFullScreen, "key=f" );
mParams->addButton( "Quit", [ & ]() { quit(); }, "key=q" );
mConnectionControl = TcpClientConnection::create( io_service() );
mConnectionControl->connect( "www.bantherewind.com", 21 );
}
开发者ID:marcuspingel,项目名称:Cinder-Protocol,代码行数:17,代码来源:FtpClientApp.cpp
示例12: setup
void ClientApp::setup()
{
gl::enable( GL_TEXTURE_2D );
mFont = Font( "Georgia", 80 );
mSize = Vec2f( getWindowSize() );
mText = "";
mTextPrev = mText;
mClient.addConnectCallback( &ClientApp::onConnect, this );
mClient.addDisconnectCallback( &ClientApp::onDisconnect, this );
mClient.addErrorCallback( &ClientApp::onError, this );
mClient.addInterruptCallback( &ClientApp::onInterrupt, this );
mClient.addPingCallback( &ClientApp::onPing, this );
mClient.addReadCallback( &ClientApp::onRead, this );
mFrameRate = 0.0f;
mFullScreen = false;
mMessage = "Hello, server!";
mPing = false;
mPingTime = getElapsedSeconds();
mParams = params::InterfaceGl::create( "CLIENT", Vec2i( 200, 160 ) );
mParams->addParam( "Frame rate", &mFrameRate, "", true );
mParams->addParam( "Fullscreen", &mFullScreen, "key=f" );
mParams->addParam( "Ping enabled", &mPing, "key=p" );
mParams->addParam( "Message", &mMessage );
mParams->addButton( "Connect", bind( &ClientApp::connect, this ), "key=c" );
mParams->addButton( "Disconnect", bind( &ClientApp::disconnect, this ), "key=d" );
mParams->addButton( "Write", bind( &ClientApp::write, this ), "key=w" );
mParams->addButton( "Quit", bind( &ClientApp::quit, this ), "key=q" );
connect();
}
开发者ID:araid,项目名称:Cinder-WebSocketPP,代码行数:33,代码来源:ClientApp.cpp
示例13: setup
void MultiUdpClientApp::setup()
{
gl::enableAlphaBlending();
gl::enable( GL_TEXTURE_2D );
mFont = Font( "Georgia", 24 );
mFrameRate = 0.0f;
mFullScreen = false;
mHost = "127.0.0.1";
mPortLocal = 0;
mPortRemote = 2000;
mRequest = "Hello, server!";
mParams = params::InterfaceGl::create( "Params", ivec2( 200, 150 ) );
mParams->addParam( "Frame rate", &mFrameRate, "", true );
mParams->addParam( "Full screen", &mFullScreen, "key=f" );
mParams->addParam( "Host", &mHost );
mParams->addParam( "Port", &mPortRemote,
"min=0 max=65535 step=1 keyDecr=p keyIncr=P" );
mParams->addParam( "Request", &mRequest );
mParams->addButton( "Write", bind( &MultiUdpClientApp::write, this ), "key=w" );
mParams->addButton( "Quit", bind( &MultiUdpClientApp::quit, this ), "key=q" );
mClient = UdpClient::create( io_service() );
mServer = UdpServer::create( io_service() );
mClient->connectConnectEventHandler( &MultiUdpClientApp::onConnect, this );
mClient->connectErrorEventHandler( &MultiUdpClientApp::onError, this );
mClient->connectResolveEventHandler( &MultiUdpClientApp::onResolve, this );
mServer->connectAcceptEventHandler( &MultiUdpClientApp::onAccept, this );
mServer->connectErrorEventHandler( &MultiUdpClientApp::onError, this );
}
开发者ID:BanTheRewind,项目名称:Cinder-Asio,代码行数:33,代码来源:MultiUdpClientApp.cpp
示例14: setup
void ImageApp::setup()
{
gl::enable( GL_TEXTURE_2D );
mDevice = Device::create();
mDevice->connectEventHandler( [ & ]( Leap::Frame frame )
{
mFrame = frame;
} );
mFrameRate = 0.0f;
mFullScreen = false;
mParams = params::InterfaceGl::create( "Params", Vec2i( 200, 105 ) );
mParams->addParam( "Frame rate", &mFrameRate, "", true );
mParams->addParam( "Full screen", &mFullScreen ).key( "f" );
mParams->addButton( "Screen shot", [ & ]() { screenShot(); }, "key=space" );
mParams->addButton( "Quit", [ & ]() { quit(); }, "key=q" );
}
开发者ID:jhurlbut,项目名称:Cinder-LeapMotion,代码行数:18,代码来源:ImageApp.cpp
示例15: draw
void WebClientApp::draw()
{
gl::clear( Colorf::black() );
gl::setMatricesWindow( getWindowSize() );
if ( mTexture ) {
gl::draw( mTexture, ivec2( 250, 20 ) );
}
mParams->draw();
}
开发者ID:BanTheRewind,项目名称:Cinder-Protocol,代码行数:11,代码来源:WebClientApp.cpp
示例16: draw
void ImageFileBasicApp::draw()
{
gl::clear( Color( 0.5f, 0.5f, 0.5f ) );
gl::enableAlphaBlending();
if( mTexture ) {
Rectf destRect = Rectf( mTexture->getBounds() ).getCenteredFit( getWindowBounds(), true ).scaledCentered( 0.85f );
gl::draw(mTexture, getWindowBounds());
}
m_params->draw();
}
开发者ID:2666hz,项目名称:Cinder,代码行数:11,代码来源:ImageFileBasicApp.cpp
示例17: setup
void LeapApp::setup()
{
gl::enable( GL_LINE_SMOOTH );
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
gl::enable( GL_POLYGON_SMOOTH );
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
mCamera = CameraPersp( getWindowWidth(), getWindowHeight(), 60.0f, 1.0f, 1000.0f );
mCamera.lookAt( Vec3f( 0.0f, 250.0f, 500.0f ), Vec3f( 0.0f, 250.0f, 0.0f ) );
mDevice = Device::create();
mDevice->connectEventHandler( &LeapApp::onFrame, this );
mFrameRate = 0.0f;
mFullScreen = false;
mParams = params::InterfaceGl::create( "Params", Vec2i( 200, 105 ) );
mParams->addParam( "Frame rate", &mFrameRate, "", true );
mParams->addParam( "Full screen", &mFullScreen ).key( "f" );
mParams->addButton( "Screen shot", bind( &LeapApp::screenShot, this ), "key=space" );
mParams->addButton( "Quit", bind( &LeapApp::quit, this ), "key=q" );
}
开发者ID:num3ric,项目名称:Cinder-LeapMotion,代码行数:21,代码来源:LeapApp.cpp
示例18: draw
void TcpClientApp::draw()
{
gl::setViewport( getWindowBounds() );
gl::clear( Colorf::black() );
gl::setMatricesWindow( getWindowSize() );
if ( mTexture ) {
gl::draw( mTexture, Vec2i( 250, 20 ) );
}
mParams->draw();
}
开发者ID:GreenKittyGames,项目名称:Cinder-Asio,代码行数:12,代码来源:TcpClientApp.cpp
示例19: draw
void FaceApp::draw()
{
gl::setViewport( getWindowBounds() );
gl::clear();
gl::setMatricesWindow( getWindowSize() );
if ( mSurface ) {
gl::color( Colorf::white() );
gl::enable( GL_TEXTURE_2D );
gl::TextureRef tex = gl::Texture::create( mSurface );
gl::draw( tex, tex->getBounds(), Rectf( getWindowBounds() ) );
gl::disable( GL_TEXTURE_2D );
gl::pushMatrices();
gl::scale( Vec2f( getWindowSize() ) / Vec2f( mSurface.getSize() ) );
for ( const Kinect2::Face3d& face : mFaces3d ) {
const TriMesh& mesh = face.getMesh();
if ( mesh.getNumIndices() > 0 ) {
vector<Vec2f> verts;
for ( const Vec3f& i : mesh.getVertices() ) {
Vec2f v = mDevice->mapCameraToColor( i );
verts.push_back( v );
}
gl::lineWidth( 0.5f );
gl::enableWireframe();
TriMesh2d mesh2d;
mesh2d.appendIndices( &mesh.getIndices()[ 0 ], mesh.getNumIndices() );
mesh2d.appendVertices( &verts[ 0 ], mesh.getNumVertices() );
gl::draw( mesh2d );
gl::disableWireframe();
}
}
if ( mEnabledFace3d ) {
gl::color( Colorf( 1.0f, 0.0f, 0.0f ) );
} else {
gl::lineWidth( 2.0f );
}
for ( const Kinect2::Face2d& face : mFaces2d ) {
if ( face.isTracked() ) {
gl::drawStrokedRect( face.getBoundsColor() );
for ( const Vec2f& i : face.getPointsColor() ) {
gl::drawSolidCircle( i, 3.0f, 16 );
}
}
}
gl::popMatrices();
}
mParams->draw();
}
开发者ID:blelem,项目名称:Cinder-KCB2,代码行数:53,代码来源:FaceApp.cpp
示例20: setup
void HttpClientApp::setup()
{
gl::enable( GL_TEXTURE_2D );
mBytesRead = 0;
mContentLength = 0;
mFont = Font( "Georgia", 24 );
mFrameRate = 0.0f;
mFullScreen = false;
mHost = "127.0.0.1";
mIndex = 0;
mHttpRequest = HttpRequest( "GET", "/", HttpVersion::HTTP_1_1 );
mHttpRequest.setHeader( "Host", mHost );
mHttpRequest.setHeader( "Accept", "*/*" );
mParams = params::InterfaceGl::create( "Params", ivec2( 200, 150 ) );
mParams->addParam( "Frame rate", &mFrameRate, "", true );
mParams->addParam( "Full screen", &mFullScreen ).key( "f" );
mParams->addParam( "Image index", &mIndex, "min=0 max=3 step=1 keyDecr=i keyIncr=I" );
mParams->addParam( "Host", &mHost );
mParams->addButton( "Write", [ & ]() { write(); }, "key=w" );
mParams->addButton( "Quit", [ & ]() { quit(); }, "key=q" );
mClient = TcpClient::create( io_service() );
mClient->connectConnectEventHandler( &HttpClientApp::onConnect, this );
mClient->connectErrorEventHandler( &HttpClientApp::onError, this );
mClient->connectResolveEventHandler( &HttpClientApp::onResolve, this );
}
开发者ID:BanTheRewind,项目名称:Cinder-Protocol,代码行数:29,代码来源:HttpClientApp.cpp
注:本文中的ci::params::InterfaceGlRef类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论