当前位置: 首页>>代码示例>>C++>>正文


C++ InterfaceGl::addButton方法代码示例

本文整理汇总了C++中params::InterfaceGl::addButton方法的典型用法代码示例。如果您正苦于以下问题:C++ InterfaceGl::addButton方法的具体用法?C++ InterfaceGl::addButton怎么用?C++ InterfaceGl::addButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在params::InterfaceGl的用法示例。


在下文中一共展示了InterfaceGl::addButton方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setup

void reflection_animationApp::setup()
{
    
	// STRUCTURE
	
	m_shapeDims = Vec3f(50, 75, 50);
	m_numlevels = 12;
    m_incr = 2;
	
    m_shapeType = PYRAMID;
    
    initShape();
	cout << m_structure.m_shapes.size() << endl;
    
    // DISPLAY
    
    m_showInterface = true;
    m_recording = false;
    
    m_path = getHomeDirectory() / "Desktop/"; 
    
	m_showColour = true;
    m_renderMode = ALPHA;
    
    m_contrast = 4.0f;
    m_alpha = .45f;
    
    m_face1Display = ACTIVE;
    m_face2Display = DICHROIC1;
    m_face3Display = GLASS;
    m_face4Display = NONE;
    
    m_dichroic1Colour = Color(0.3f, 0.8f, 1.0f);
    m_dichroic2Colour = Color(1.0f, 0.8f, 0.3f);
	
    // ANIMATION
    
    m_aniMode = VIDEO;
    
    // radar
    m_interval = 360;
    m_frontarea = 1.5f;
    m_backarea  = 6.0f;
    
	// GUI
    
	m_params = params::InterfaceGl( "Geometry/Animation Parameters [press TAB to hide]", Vec2i( 400, 600 ) );
	
    // render
    m_params.addText( "render", "label=`Render`" );
	m_params.addSeparator();
    vector<string> rstrs; rstrs.push_back("ALPHA"); rstrs.push_back("ADDITIVE"); rstrs.push_back("MULTIPLY");
    m_params.addParam( "Render Mode", rstrs, (int*)&m_renderMode );
    m_params.addParam( "Use Colour", &m_showColour );
    m_params.addParam( "Alpha", &m_alpha, "min=0.001 max=2.0 step=0.1" );
	m_params.addParam( "Contrast", &m_contrast, "min=0.001 max=5.0 step=0.1" );
	m_params.addParam( "Dichroic Colour 1", &m_dichroic1Colour );
	m_params.addParam( "Dichroic Colour 2", &m_dichroic2Colour );
    m_params.addText( "emptyline1", "label=` `" );
    
    // structure
	m_params.addText( "structure", "label=`Structure`" );
	m_params.addSeparator();
    vector<string> dstrs; dstrs.push_back("ACTIVE"); dstrs.push_back("DICHROIC1"); dstrs.push_back("DICHROIC2"); dstrs.push_back("GLASS"); dstrs.push_back("NONE");
	m_params.addParam( "Face 1 Display mode", dstrs, (int*)&m_face1Display );
    m_params.addParam( "Face 2 Display mode", dstrs, (int*)&m_face2Display );
    m_params.addParam( "Face 3 Display mode", dstrs, (int*)&m_face3Display );
    m_params.addParam( "Face 4 Display mode", dstrs, (int*)&m_face4Display );
    m_params.addText( "emptyline2", "label=` `" );
    
    // generate shape
    m_params.addText( "generate", "label=`Generate`" );
	m_params.addSeparator();
    vector<string> sstrs; sstrs.push_back("PYRAMID"); sstrs.push_back("TETRAHEDRON"); sstrs.push_back("HOLLOW PYRAMID");
	m_params.addParam( "Shape", sstrs, (int*)&m_shapeType );
    m_params.addParam( "Number Of Levels", &m_numlevels );
    m_params.addParam( "Vertical Interval", &m_incr );
    m_params.addParam( "Shape Dimensions", &m_shapeDims );
    m_params.addButton( "Recreate Shape", std::bind( &reflection_animationApp::initShape, this ) );
    m_params.addText( "emptyline3", "label=` `" );
    
    // animation
    m_params.addText( "animation", "label=`Animation`" );
	m_params.addSeparator();
    vector<string> astrs; astrs.push_back("STATIC"); astrs.push_back("RADAR"); astrs.push_back("VIDEO"); astrs.push_back("VIDEO_RADAR");
	m_params.addParam( "Animation Mode", astrs, (int*)&m_aniMode );
    m_params.addParam( "Interval", &m_interval );
    m_params.addParam( "Size (front)", &m_frontarea );
    m_params.addParam( "Size (tail)", &m_backarea );
    
    m_params.addButton( "Recreate Shape", std::bind( &reflection_animationApp::initShape, this ) );
    
	
	// CAMERA/PERSPECTIVE (not updated anymore -> mayacam)

	m_cameraDistance = 800.0f;
    
    m_eye        = Vec3f( 0.0f, 0.0f, m_cameraDistance );
	m_center     = Vec3f::zero();
	m_up         = Vec3f::yAxis();
//.........这里部分代码省略.........
开发者ID:rapatski,项目名称:321,代码行数:101,代码来源:reflection_animationApp.cpp


注:本文中的params::InterfaceGl::addButton方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。