void SSAO::BuildUI() {
	TwInit(TW_DIRECT3D11, _device);
	TwWindowSize(_screenWidth, _screenHeight);
	_bar = TwNewBar("AmbientOcclusion");
	TwDefine(" GLOBAL help='This example shows how to integrate AntTweakBar into a DirectX11 application.' "); // Message added to the help bar.
	int barSize[2] = {300, 375};
	TwSetParam(_bar, NULL, "size", TW_PARAM_INT32, 2, barSize);

	TwAddVarCB(_bar, "Rad", TW_TYPE_FLOAT, SSAO::SetRad, SSAO::GetRad, this, "group=ShaderParams min=0 max=20 step=0.001 keyincr=+ keydecr=-");
	TwAddVarCB(_bar, "TotalStr", TW_TYPE_FLOAT, SSAO::SetTotStr, SSAO::GetTotStr, this, "group=ShaderParams min=0 max=50 step=0.1 keyincr=+ keydecr=-");
	TwAddVarCB(_bar, "Strength", TW_TYPE_FLOAT, SSAO::SetStrength, SSAO::GetStrength, this, "group=ShaderParams min=0.1 max=100 step=0.1 keyincr=+ keydecr=-");
	TwAddVarCB(_bar, "Offset", TW_TYPE_FLOAT, SSAO::SetOffset, SSAO::GetOffset, this, "group=ShaderParams min=0 max=100 step=0.5 keyincr=+ keydecr=-");
	TwAddVarCB(_bar, "Falloff", TW_TYPE_FLOAT, SSAO::SetFalloff, SSAO::GetFalloff, this, "group=ShaderParams min=0 max=0.01 step=0.00001 keyincr=+ keydecr=-");
	TwAddVarCB(_bar, "BlurSize", TW_TYPE_FLOAT, SSAO::SetBlur, SSAO::GetBlur, this, "group=ShaderParams min=1 max=16 step=1 keyincr=+ keydecr=-");
	TwAddButton(_bar, "Reset", SSAO::ResetButton, this, "");
	TwAddButton(_bar, "ShowDebug", SSAO::ShowDebug, this, "");

	TwEnumVal* a = new TwEnumVal[3];
	a[0].Value = 0; a[0].Label = "buddha";
	a[1].Value = 1; a[1].Label = "hairball";
	a[2].Value = 2; a[2].Label = "sib";
	_index = 0;

	TwType actMesh = TwDefineEnum("mesh", a, 3);

	TwAddVarCB(_bar, "ActiveVol", actMesh, SSAO::SetMesh, SSAO::GetMesh, this, 
		" group='Mesh' keyIncr=Backspace keyDecr=SHIFT+Backspace help='Stop or change the rotation mode.' ");

}
Esempio n. 2
0
BezierSceneObject::BezierSceneObject(string name, bool quad, const XMFLOAT3 & pos, ID3D11Device* device,  HWND hwnd)
{
	m_model = new ModelLightingClass(name, quad, pos);
	m_quadInvoker = new QuadInvoker;
	m_dataStruct = new BasePartition::clientDataStruct;

	m_model->BuildQuadPatch( device);
	updateIncrement = 0.0f;
	m_model->SetScale(XMFLOAT3(0.1f, 0.5f, 0.5f));

	m_quadInvoker->InitializeVertexShader(device, hwnd, L"../Engine/BézierVS.hlsl", "BezierVertexShader", false);
	m_quadInvoker->InitializeShaderProgram(device, hwnd, L"../Engine/BézierHS.hlsl", "BezierHullShader","hs_5_0");
	m_quadInvoker->InitializeShaderProgram(device, hwnd, L"../Engine/BézierDS.hlsl", "BezierDomainShader","ds_5_0");
	m_quadInvoker->InitializeShaderProgram(device, hwnd, L"../Engine/BézierPS.hlsl", "BezierPixelShader","ps_5_0");
	m_quadInvoker->InitializeCBuffer(device, "matrixBuffer", sizeof(QuadInvoker::MatrixBufferType));
	m_quadInvoker->InitializeCBuffer(device, "tessBuffer", sizeof(QuadInvoker::TessellationBufferType));
	m_quadInvoker->InitializeCBuffer(device, "LightBuffer", sizeof(QuadInvoker::LightBufferType));
	m_quadInvoker->InitializeSampler(device, "heightSampler");

	m_model->AddModelTweakVar(20.0f , "TessFactor", " step=0.01 group=Bézier");
	m_model->AddModelTweakVar(8.0f , "AmpIncrement", " step=0.01 group=Bézier");
	m_model->AddModelTweakVar(1.0f , "timeMod", " step=0.001 group=Bézier");
	m_model->AddModel3FloatTweakVar(XMFLOAT3(-15.0f, 0.0f, 15.0f), "modifier1", "step=0.01 group=BézierControlGroup1");
	string tempName = name + "/BézierControlGroup1 group=Bézier opened=false";
	TwDefine(tempName.c_str());

	m_dataStruct->m_dev = device;
	m_dataStruct->m_h = hwnd;
	m_dataStruct->m_q = m_quadInvoker;

	TwAddButton(m_model->getBar() ,"FractionalEven", &BezierSceneObject::FractionalEven, m_dataStruct, "" );
	TwAddButton(m_model->getBar() ,"FractionalOdd", &BezierSceneObject::FractionalOdd, m_dataStruct, "" );
	TwAddButton(m_model->getBar() ,"FractionalInt", &BezierSceneObject::Integer, m_dataStruct, "" );

}
SceneDialog::SceneDialog()
{
	// Create a tweak bar
    m_dialog = TwNewBar("Scene");
    TwDefine(" GLOBAL help='This example shows how to integrate AntTweakBar into a DirectX11 application.' "); // Message added to the help bar.
	int barSize[2] = {200, 1060};
    TwSetParam(m_dialog, NULL, "size", TW_PARAM_INT32, 2, barSize);
	TwDefine(" Scene position='10 10' ");

	TwAddButton(m_dialog, "Load Scene", LoadAGL, this, " label='Load Scene' key=c help='Load an Agile file into the editor.' group='I/O'");
	TwAddButton(m_dialog, "Save Scene", SaveAGL, this, " label='Save Scene' key=c help='Save a scene into an Agile file.' group='I/O'");

	TwAddVarRW(m_dialog, "Rotation", TW_TYPE_QUAT4F, Scene::GetInstance()->GetQuaternionRotation(), "opened=true axisz=-z");

	TwStructMember pointMembers[] = { 
        { "X", TW_TYPE_FLOAT, offsetof(AglVector3, x), " Step=0.01 " },
        { "Y", TW_TYPE_FLOAT, offsetof(AglVector3, y), " Step=0.01 " },
		{ "Z", TW_TYPE_FLOAT, offsetof(AglVector3, z), " Step=0.01 " }};
    TwType pointType = TwDefineStruct("POINT", pointMembers, 3, sizeof(AglVector3), NULL, NULL);

	TwAddVarRW(m_dialog, "Position", pointType, Scene::GetInstance()->GetPosition(), "");

	TwAddVarRW(m_dialog, "ShowHideDiffuse", TW_TYPE_BOOLCPP, &DIFFUSEON, "group='Show/Hide'");
	TwAddVarRW(m_dialog, "ShowHideSpec", TW_TYPE_BOOLCPP, &SPECULARON, "group='Show/Hide'");
	TwAddVarRW(m_dialog, "ShowHideGlow", TW_TYPE_BOOLCPP, &GLOWON, "group='Show/Hide'");
	TwAddVarRW(m_dialog, "ShowHideNormal", TW_TYPE_BOOLCPP, &NORMALON, "group='Show/Hide'");

	m_meshDialog = new MeshDialog();
	m_materialDialog = new MaterialDialog();
	m_particleSystemDialog = new ParticleSystemDialog();
	m_mergeDialog = new MergeDialog();
}
  void ParticleEditor::refresh_emitter_ui()
  {
    per_emitter_info_.clear();
    indices_for_tweakbar_.clear();
    TwRemoveAllVars(emitter_window_);
    TwAddVarCB(emitter_window_,
               "Emitter Index",
               TW_TYPE_INT32,
               TweakBarParticleSetEmitter,
               TweakBarParticleGetEmitter,
               nullptr,
               "");
    TwAddButton(emitter_window_,
                "Remove Emitter",
                TweakBarRemoveEmitter,
                &emitter_index_,
                "");
    TwAddButton(emitter_window_,
                "Add State",
                TweakBarAddState,
                nullptr,
                "");
    Reflection::Metadata* emitterMeta = FindType(ParticleEmitter);
    ParticleCallbackInfo emitterInfo;
    emitterInfo.baseData = emitterMeta;
    emitterInfo.type = ParticleUiType::Emitter;
    //first typical bullshit
    for(auto& it : emitterMeta->GetMembers())
    {
      add_members(emitterInfo, &it.second, emitter_window_);
    }
    //so here we have to add controls to toggle interpolation
    //either something interpolates or it doesn't no selective interpolation for certain states
    Reflection::Metadata* stateMeta = FindType(ParticleDescription);
    ParticleCallbackInfo stateInfo;
    stateInfo.baseData = FindType(ParticleDescription);
    stateInfo.type = ParticleUiType::State;
    
    
    per_emitter_info_.push_back(stateInfo);
    void* dataToSend = &per_emitter_info_.back();
    int index = 0;
    for(auto& it : stateMeta->GetMembers())
    {
      indices_for_tweakbar_.push_back(index);
      ++index;
      TwAddVarCB(emitter_window_,
                 it.second.GetName().c_str(),
                 TW_TYPE_STDSTRING,
                 TweakBarParticleSetRegistered,
                 TweakBarParticleGetRegistered,
                 &indices_for_tweakbar_.back(),
                 "group = 'registered vars'");
    }

    refresh_state_ui();
  }
static void setupAntTweakBar()
{
	g_bar = TwNewBar("TweakBar");
	TwDefine(" TweakBar size='320 640' "); // resize bar
	TwDefine(" GLOBAL help='Simulation control.' "); // Message added to the help bar.
	
	/*TwAddVarRW(g_bar, "TD", TW_TYPE_FLOAT, &var_TIME_DELTA,
		" label='Time delta' precision=5 min=0 max=1 step=0.01 ");*/
	
	TwAddVarRW(g_bar, "FPS", TW_TYPE_DOUBLE, &g_twVar.info_fps,
		" group=INFO label='Frame rate:' precision=1 ");

	TwAddSeparator(g_bar, "SEP0", 0);

	/*TwAddVarRW(g_bar, "ANIMATION_SPEED", TW_TYPE_FLOAT, &var_ANIMATION_SPEED,
	" group=ANIMATION label='Speed' precision=1 min=0 max=10 step=0.1 ");*/

	TwAddVarRW(g_bar, "GRAVITY", TW_TYPE_FLOAT, &g_twVar.sim_gravity,
		" group=SIMULATION label='Gravity' precision=10 min=-1 max=1 step=0.0001 ");
	
	TwAddVarRW(g_bar, "SIMULATE", TW_TYPE_BOOL8, &g_twVar.sim_enable,
		" group=SIMULATION label='Run simulation' ");

	TwAddButton(g_bar, "SIMULATION_STEP", [](void*) { g_twVar.sim_step = true; }, NULL,
		" group=SIMULATION  label='Step simulation' key=N ");

	TwAddButton(g_bar, "SIMULATION_RESET", [](void*) { g_ball->reset(false); s_model->resetAnimation(); }, NULL,
		" group=SIMULATION  label='Reset' ");

	TwAddSeparator(g_bar, "SEP1", 0);

	TwAddVarRW(g_bar, "BLEND_VERT_STIFF", TW_TYPE_BOOL8, &g_twVar.blend_useWeights,
		" group=BLEND label='Use skin weights' ");
	TwAddVarRW(g_bar, "BLEND_STIFF_MULT", TW_TYPE_FLOAT, &g_twVar.blend_multiplier,
		" group=BLEND label='Multiplier' precision=4 min=0 max=1 step=0.0001 ");

	TwAddVarRW(g_bar, "BLEND_CONST_STIFF", TW_TYPE_FLOAT, &g_twVar.constraint_stiffness,
		" group=BLEND label='Stiffness k' precision=4 min=0 max=1 step=0.0001 ");

	TwAddSeparator(g_bar, "SEP2", 0);

	TwAddVarRW(g_bar, "RENDER_FILL", TW_TYPE_BOOL8, &g_twVar.render_fill,
		" group=RENDER label='Fill' ");
	TwAddVarRW(g_bar, "RENDER_WIREFRAME", TW_TYPE_BOOL8, &g_twVar.render_wireframe,
		" group=RENDER label='Wireframe' ");
	TwAddVarRW(g_bar, "RENDER_DISTMAG", TW_TYPE_BOOL8, &g_twVar.render_distMag,
		" group=RENDER label='Distortion magnitude' ");

	TwAddVarRW(g_bar, "rec_record", TW_TYPE_BOOL8, ffmpegRec(),
		" group=RECORD label='Record' ");

	TwAddSeparator(g_bar, "SEP3", 0);

	TwAddButton(g_bar, "BALL_RESET", [](void*) { g_ball->reset(); }, NULL, " label='Throw ball' ");
	
}
Esempio n. 6
0
void Game::Initialise(HINSTANCE hinstance, HWND hwnd, int screenWidth, int screenHeight)
{
	//Initialise Input
	m_Input = new Input;
	m_Input->Initialise(hinstance,hwnd,screenWidth,screenHeight);

	//Initialise Graphics
	m_Graphics = new GameRenderer;
	m_Graphics->Initialise(screenWidth, screenHeight, hwnd);


	//Initialise AntTweakBar
	TwInit(TW_DIRECT3D11, m_Graphics->GetDevice());
	TwWindowSize(screenWidth, screenHeight);

	//Create the camera
	m_Camera = new Camera;
	m_Camera->SetPosition(0, 25, -75);

	m_Camera->SetRotation(10, 0, 0);

	//Create the skybox
	m_sky = new Skybox;
	m_sky->Initialise(m_Graphics->GetDevice(), hwnd);
	m_sky->SetPosition(XMFLOAT3(0, 0, 0));

	//Create the ant tweak bar
	m_gameTweakBar = TwNewBar("Water Wave Simulation");
	int barSize[2] = { 200, 680 };
	TwSetParam(m_gameTweakBar, NULL, "size", TW_PARAM_INT32, 2, barSize);

	//Toggle wireframe on/off
	TwAddButton(m_gameTweakBar, "comment1", Callback, m_Graphics, " label='Toggle Wireframe' ");


	//Create the wave manager
	m_waveManager = new WaveManager;
	TwAddButton(m_gameTweakBar, "comment2", NextPreset, m_waveManager, " label='Next Preset' ");
	m_waveManager->Initialise(m_Graphics->GetDevice(), m_Graphics->GetDeviceContext(), m_gameTweakBar);
	
	m_waveManager->CreateWater(XMFLOAT3(-480, 0, -480), m_Graphics->GetDevice(), m_Graphics->GetDeviceContext(), hwnd);

	m_hwnd = hwnd;

	//Create terrain 
	Mesh* terrainMesh = new Mesh;
	terrainMesh->Initialise(m_Graphics->GetDevice(), m_Graphics->GetDeviceContext(), "terrain.txt", "../WaveSim/Data/Textures/sand.tga");
	//Use same mesh for multiple instances
	CreateGameobject(new GameObject, terrainMesh, XMFLOAT3(1500, -10, 2000));
	CreateGameobject(new GameObject, terrainMesh, XMFLOAT3(10, -10, 1000));
	CreateGameobject(new GameObject, terrainMesh, XMFLOAT3(-1000, -10, 0));
	Console::Log("Terrain Initalised...");
	//Create directional light
	CreateLight();
}
Esempio n. 7
0
void outPut::init_Bars()
{
    b_scene = TwNewBar("Scene");
    _scene3d.distance = _dimensions.x+_dimensions.y;
    _scene3d.zoom = 60;
    _scene3d.focus = coords3d<float>::retournercoords3d(_dimensions.x/2,_dimensions.y/2,0);
    //_scene3d.orientation = {0, 0, 0, 1}; // direction pointing to +x and +y
    _scene3d.orientation[0]=_scene3d.orientation[1]=_scene3d.orientation[2]=0;
    _scene3d.orientation[3]=1;
    TwAddVarRW(b_scene, "Orientation", TW_TYPE_QUAT4F, &(_scene3d.orientation),"axisx=x axisy=y axisz=z");
    TwAddVarRW(b_scene, "Distance", TW_TYPE_DOUBLE, &(_scene3d.distance),"");
    TwAddVarRW(b_scene, "Zoom", TW_TYPE_DOUBLE, &(_scene3d.zoom),"min = 5 max = 200");
    TwAddVarRW(b_scene, "x", TW_TYPE_FLOAT, &(_scene3d.focus.x), "group = 'Focus' ");
    TwAddVarRW(b_scene, "y", TW_TYPE_FLOAT, &(_scene3d.focus.y), "group = 'Focus' ");
    TwAddVarRW(b_scene, "z", TW_TYPE_FLOAT, &(_scene3d.focus.z), "group = 'Focus'");
    TwAddButton(b_scene, "Centrer", cbCenterView, this, " group = 'Focus' ");
    TwAddVarRW(b_scene, "Test de profondeur résultat", TW_TYPE_BOOLCPP,
               &(_reg.ZTEST_RESULT), "label='Z test resultat'");

    TwAddVarRW(b_scene, "Temps de calcul (ms)", TW_TYPE_INT32, &(_status.drawDelay), "min=0 max=1000");

    //_scene3d.lightDir = {1,1,-1};
    _scene3d.lightDir[0]=_scene3d.lightDir[1]=1;
    _scene3d.lightDir[2]=-1;
    //_scene3d.lightPos = {-1,-1,1,0};
    _scene3d.lightPos[0]=_scene3d.lightPos[1]=-1;
    _scene3d.lightPos[2]=1;
    _scene3d.lightPos[3]=0;
    TwAddVarRW(b_scene, "Direction", TW_TYPE_DIR3F, &(_scene3d.lightDir), "group = Lumiere" );
    TwAddVarRW(b_scene, "Directionnelle", TW_TYPE_FLOAT, &(_scene3d.lightPos[3]), "group = Lumiere min=0 max =1" );

    b_reglages = TwNewBar("Reglages");
    TwAddVarRO(b_reglages, "MAX_FPS", TW_TYPE_INT32, &(_reg.MAX_FPS), "group='Window settings'");
    TwAddButton(b_reglages, "Recalculer", recalculate, this, " group = Rendu ");
    TwAddVarRW(b_reglages, "Multiplicateur", TW_TYPE_DOUBLE, &(_reg.MULTIPLIER), "group = 'Rendu' min = 0 max = 100");
    TwType colorsType;
    colorsType = TwDefineEnum("ColorsType", NULL, 0);
    //TwAddVarRW(b_reglages, "Couleurs", colorsType, &(_reg.COLORS), " enum='0 {Réelles}, 1 {Colorisé}, 2 {Uniforme}'");
    TwAddVarRW(b_reglages, "Filaire", TW_TYPE_BOOLCPP, &(_reg.WIREFRAME), " group = Rendu ");
    TwAddVarRW(b_reglages, "Normales", TW_TYPE_BOOLCPP, &(_reg.DRAW_NORMALS), "group = 'Rendu'");
    TwAddVarRW(b_reglages, "Couleur unie", TW_TYPE_COLOR3F, &(_reg.UNIFORM_COLOR), "colormode=hls group = 'Rendu'");
    b_postprocess = TwNewBar("Post-processing");
    _effect = 0;
    TwAddVarRW(b_postprocess, "Effet", TW_TYPE_INT32, &(_effect),"max=20 keyincr = p keydecr = m");

    b_pathfind = TwNewBar("Pathfind");
    TwAddVarRW(b_pathfind, "En cours", TW_TYPE_BOOLCPP, &(_status.running), "help='Fermer le programme' key=ESC");
    TwAddVarRW(b_pathfind, "Pause", TW_TYPE_BOOLCPP, &(_status.pause), "key=t");

    TwSetTopBar(b_scene);
    TwDefine(" Reglages iconified=true ");
    TwDefine(" Pathfind iconified=true ");
    TwDefine(" Post-processing iconified=true ");
}
Esempio n. 8
0
void RiftAppSkeleton::ToggleShaderWorld()
{
    ShaderToy* pST = m_paneScene.GetFocusedShader();

    if (m_shaderToyScene.m_bDraw)
    {
        // Back into gallery
        ResetAllTransformations();
        m_headSize = 1.0f;
        m_shaderToyScene.m_bDraw = false;
        m_shaderToyScene.SetShaderToy(NULL);

#ifdef USE_ANTTWEAKBAR
        TwRemoveVar(m_pTweakbar, "title");
        TwRemoveVar(m_pTweakbar, "author");
        TwRemoveVar(m_pTweakbar, "gotourl");
#endif
    }
    else if (pST != NULL)
    {
        // Transitioning into shader world
        ///@todo Will we drop frames here? Clear to black if so.
        m_shaderToyScene.m_bDraw = true;
        m_shaderToyScene.SetShaderToy(pST);

        const glm::vec3 hp = pST->GetHeadPos();
        m_chassisPos.x = hp.x;
        m_chassisPos.y = hp.y;
        m_chassisPos.z = hp.z;
        m_headSize = pST->GetHeadSize();
        m_chassisYaw = static_cast<float>(M_PI);

#ifdef USE_ANTTWEAKBAR
        const std::string titleStr = "title: " + pST->GetSourceFile();
        const std::string authorStr = "author: " + pST->GetAuthor();

        std::stringstream ss;
        // Assemble a string to pass into help here
        ss << " label='"
           << titleStr
           << "' group=Shader ";
        TwAddButton(m_pTweakbar, "title", NULL, NULL, ss.str().c_str());

        ss.str("");
        ss << " label='"
           << authorStr
           << "' group=Shader ";
        TwAddButton(m_pTweakbar, "author", NULL, NULL, ss.str().c_str());

        TwAddButton(m_pTweakbar, "gotourl", GoToURLCB, this, " label='Go to URL'  group='Shader' ");
#endif
    }
}
Esempio n. 9
0
void IntroOpenGl::CreateGui()
{
    m_bar = TwNewBar("IntroToOpenGL");

    TwDefine(" IntroToOpenGL position='10 10' "); // move bar to position (10, 10)
    TwDefine(" IntroToOpenGL size='430 320' "); // resize bar
    TwDefine(" IntroToOpenGL color='128 128 128' alpha=32 ");   // semi-transparent blue bar
    TwDefine(" IntroToOpenGL resizable=false "); // mybar cannot be resized


    TwAddButton(m_bar, "label_01", NULL, NULL, "label='simply opengl scene, nothing much happening'"); //show as label
    TwAddButton(m_bar, "mainMenu", Callback, this, "label='main menu'"); //show as button
}
Esempio n. 10
0
void APP_SpotRotate::CreateGui()
{
    m_bar = TwNewBar("SpotRotate");

    TwDefine(" SpotRotate position='10 10' "); // move bar to position (10, 10)
    TwDefine(" SpotRotate size='430 320' "); // resize bar
    TwDefine(" SpotRotate color='128 128 128' alpha=32 ");   // semi-transparent blue bar
    TwDefine(" SpotRotate resizable=false "); // mybar cannot be resized


    TwAddButton(m_bar, "label_01", NULL, NULL, "label='proof of concept for bill borded sprites with rotation'"); //show as label
    TwAddButton(m_bar, "mainMenu", Callback, this, "label='main menu'"); //show as button
}
void MaterialDialog::setMaterial(int pIndex)
{
	if (m_dialog)
		TwDeleteBar(m_dialog);
	// Create a tweak bar
	m_dialog = TwNewBar("Material");
	int barSize[2] = {200, 1060};
	TwDefine(" Material position='1710 10'  ");
	TwSetParam(m_dialog, NULL, "size", TW_PARAM_INT32, 2, barSize);

	m_material = Scene::GetInstance()->GetMaterial(pIndex);

	TwAddVarCB(m_dialog, "MaterialName", TW_TYPE_CDSTRING, SetName, GetName, (void*)this, " label='Name: '");
	TwAddVarRW(m_dialog, "Ambient", TW_TYPE_COLOR3F, (void*)&m_material->ambient, " help='Light color.' group='Properties'");
	TwAddVarRW(m_dialog, "Diffuse", TW_TYPE_COLOR3F, (void*)&m_material->diffuse, " help='Light color.' group='Properties'");
	TwAddVarRW(m_dialog, "Specular", TW_TYPE_COLOR3F, (void*)&m_material->specular, " help='Light color.' group='Properties'");
	TwAddVarRW(m_dialog, "Emissive", TW_TYPE_COLOR3F, (void*)&m_material->emissive, " help='Light color.' group='Properties'");

	TwAddVarRW(m_dialog, "Opacity", TW_TYPE_FLOAT, (void*)&m_material->opacity, " help='Light color.' group='Properties' min=0.0 max=1.0 step=0.01");
	TwAddVarRW(m_dialog, "Reflectivity", TW_TYPE_FLOAT, (void*)&m_material->reflectivity, " help='Light color.' group='Properties' min=0.0 max=1.0 step=0.01");
	TwAddVarRW(m_dialog, "Shininess", TW_TYPE_FLOAT, (void*)&m_material->shininess, " help='Light color.' group='Properties' min=0.0 max=100.0 step=1.0");
	TwAddVarRW(m_dialog, "Texture Scale", TW_TYPE_FLOAT, (void*)&m_material->textureScale, " help='Light color.' group='Properties' min=0.0 max=10.0 step=0.01");

	TwAddButton(m_dialog, "Load Diffuse Texture", LoadDiffuse, this, " label='Diffuse Texture' key=c help='Load an Agile file into the editor.' group='Load'");
	TwAddButton(m_dialog, "Load Specular Texture", LoadSpecular, this, " label='Specular Texture' key=c help='Load an Agile file into the editor.' group='Load'");
	TwAddButton(m_dialog, "Load Glow Texture", LoadGlow, this, " label='Glow Texture' key=c help='Load an Agile file into the editor.' group='Load'");
	TwAddButton(m_dialog, "Load Normal Texture", LoadNormal, this, " label='Normal Texture' key=c help='Load an Agile file into the editor.' group='Load'");
	TwAddButton(m_dialog, "Load Displacement Texture", LoadDisplacement, this, " label='Displacement Texture' key=c help='Load an Agile file into the editor.' group='Load'");
	TwAddButton(m_dialog, "Load Gradient Texture", LoadGradient, this, " label='Gradient Texture' key=c help='Load an Agile file into the editor.' group='Load'");

	TwStructMember tessMembers[] = { 
		{ "Edge1", TW_TYPE_FLOAT, offsetof(AglVector4, x), " Step=0.1 min=1.0 max=64.0" },
		{ "Edge2", TW_TYPE_FLOAT, offsetof(AglVector4, y), " Step=0.1 min=1.0 max=64.0" },
		{ "Edge3", TW_TYPE_FLOAT, offsetof(AglVector4, z), " Step=0.1 min=1.0 max=64.0" },
		{ "Internal", TW_TYPE_FLOAT, offsetof(AglVector4, w), " Step=0.1 min=1.0 max=64.0" }};
	TwType tessType = TwDefineStruct("TESSELATIONFACTORS", tessMembers, 4, sizeof(AglVector4), NULL, NULL);

	TwAddVarRW(m_dialog, "Tess", tessType, &m_material->tesselationFactor, " group='Properties' ");
	TwAddVarRW(m_dialog, "Displacement", TW_TYPE_FLOAT, (void*)&m_material->displacement, " group='Properties' min=0.0 max=10.0 step=0.01");

	TwAddButton(m_dialog, "Add Layer", AddLayer, this, " label='Add Layer' key=c help='Load an Agile file into the editor.' group='Gradient Mapping'");

	TwAddButton(m_dialog, "Delete", Delete, this, "");


	if (m_material->gradientDataIndex >= 0)
	{
		AglGradient* g = Scene::GetInstance()->GetGradient(m_material->gradientDataIndex);
		vector<AglGradientMaterial*> layers = g->getLayers();
		for (unsigned int i = 0; i < layers.size(); i++)
		{
			AddLayer(g, layers[i], i);
		}
	}


	show();
}
Esempio n. 12
0
/*
 * Ui_Root
 *
 * Defines the root TwBar.
 */
static TwBar *Ui_Root(void) {
	TwBar *bar = TwNewBar("Quake2World");

	TwAddButton(bar, "Servers", Ui_ToggleBar, "Servers", NULL);
	TwAddButton(bar, "Controls", Ui_ToggleBar, "Controls", NULL);
	TwAddButton(bar, "Player", Ui_ToggleBar, "Player", NULL);
	TwAddButton(bar, "System", Ui_ToggleBar, "System", NULL);

	TwAddSeparator(bar, NULL, NULL);

	TwAddButton(bar, "Quit", Ui_Command, "quit\n", NULL);

	TwDefine("Quake2World size='200 130' alpha=200 iconifiable=false");

	return bar;
}
void initGUI() {
    // Initialize AntTweakBar GUI
    if (!TwInit(TW_OPENGL, NULL))
    {
        assert(0);
    }

    TwWindowSize(g_WindowWidth, g_WindowHeight);
    TwBar *controlBar = TwNewBar("Controls");
    TwDefine(" Controls position='10 10' size='200 320' refresh=0.1 ");

    TwAddVarCB(controlBar, "use_shaders", TW_TYPE_BOOLCPP, cbSetShaderStatus, cbGetShaderStatus, NULL, " label='shaders' key=s help='Turn programmable pipeline on/off.' ");

    // Shader panel setup
    TwAddVarRW(controlBar, "vs", TW_TYPE_BOOLCPP, &g_UseVertexShader, " group='Shaders' label='vertex' key=v help='Toggle vertex shader.' ");
    TwAddVarRW(controlBar, "gs", TW_TYPE_BOOLCPP, &g_UseGeometryShader, " group='Shaders' label='geometry' key=g help='Toggle geometry shader.' ");
    TwAddVarRW(controlBar, "fs", TW_TYPE_BOOLCPP, &g_UseFragmentShader, " group='Shaders' label='fragment' key=f help='Toggle fragment shader.' ");
    TwAddButton(controlBar, "build", cbCompileShaderProgram, NULL, " group='Shaders' label='build' key=b help='Build shader program.' ");
	//TwDefine( " Controls/Shaders readonly=true "); 

    // Render panel setup
    TwAddVarRW(controlBar, "wiremode", TW_TYPE_BOOLCPP, &g_WireMode, " group='Render' label='wire mode' key=w help='Toggle wire mode.' ");
    TwAddVarRW(controlBar, "face_culling", TW_TYPE_BOOLCPP, &g_FaceCulling, " group=Render label='face culling' key=c help='Toggle face culling.' ");

    // Scene panel setup
    TwEnumVal geometry_type[] = { 
        { ELEPHANT_GEOMETRY    , "Elephant"},
        { CUBE_GEOMETRY        , "Cube"    },
    };
    TwType geom_type = TwDefineEnum("Model", geometry_type, NUM_GEOMETRY_TYPES);
    TwAddVarRW(controlBar, "model", geom_type, &g_GeometryType, " group='Scene' keyIncr=Space help='Change model.' ");
    TwAddVarRW(controlBar, "auto-rotation", TW_TYPE_BOOLCPP, &g_SceneRotEnabled, " group='Scene' label='rotation' key=r help='Toggle scene rotation.' ");
    TwAddVarRW(controlBar, "Translate", TW_TYPE_FLOAT, &g_SceneTraZ, " group='Scene' label='translate' min=1 max=1000 step=0.5 keyIncr=t keyDecr=T help='Scene translation.' ");
    TwAddVarRW(controlBar, "SceneRotation", TW_TYPE_QUAT4F, &g_SceneRot, " group='Scene' label='rotation' open help='Toggle scene orientation.' ");
}
Esempio n. 14
0
fractal_t::fractal_t()
    : pos_(0.5, 0), scale_factor_(1)
{
#ifdef USE_CORE_OPENGL
   TwInit(TW_OPENGL_CORE, NULL);
#else
   TwInit(TW_OPENGL, NULL);
#endif
   // Определение "контролов" GUI
   TwBar *bar = TwNewBar("Parameters");
   TwDefine(" Parameters size='300 50' color='70 100 120' valueswidth=220 iconpos=topleft");

   TwAddButton(bar, "Fullscreen toggle", toggle_fullscreen_callback, NULL,
               " label='Toggle fullscreen mode' key=f");

   // Создание шейдеров
   vs_ = create_shader(GL_VERTEX_SHADER  , "shaders//fractal.glslvs");
   fs_ = create_shader(GL_FRAGMENT_SHADER, "shaders//fractal.glslfs");
   // Создание программы путём линковки шейдерова
   program_ = create_program(vs_, fs_);
   // Создание буфера с вершинными данными
   init_buffer();
   // Создание VAO
   init_vertex_array();
}
// Callback function to create a bar with a given title
void TW_CALL CreateBarCB(void *clientData)
{
    const std::string *title = (const std::string *)(clientData);

    // Create a unique bar name
    int barIndex = (int)g_BarTitles.size();
    std::stringstream name;
    name << "bar_" << barIndex;

    g_BarTitles.push_back(*title);

    // Create bar
    TwBar *bar = TwNewBar(name.str().c_str());
    TwAddButton(bar, "Info", NULL, NULL, " label='std::string variable:' ");

    // Set bar label (ie. the title)
    std::stringstream def;
    def << name.str() << " label=`" << *title << "` ";
    TwDefine(def.str().c_str());

    // Cast barNum as void* to use it as clientData 
    // (doing so it could be directly sent through the get/set callbacks)
    void *barIndexAsVoidPtr = *(void **)&barIndex;

    // Add a std::string variable to the bar to edit its title,
    // The variable will be accessed through callbacks
    TwAddVarCB(bar, "EditTitle", TW_TYPE_STDSTRING, SetBarTitleCB, GetBarTitleCB, barIndexAsVoidPtr, 
               " label='Edit bar title' help='Edit this string to change the tweak bar title.' ");
}
  void ParticleEditor::refresh_state_ui()
  {
    per_state_info_.clear();
    TwRemoveAllVars(state_window_);
    TwAddVarCB(state_window_,
               "State Index",
               TW_TYPE_INT32,
               TweakBarParticleSetState,
               TweakBarParticleGetState,
               nullptr,
               "");
    TwAddButton(state_window_, 
                "Remove State", 
                TweakBarRemoveState, 
                &state_index_, 
                "");

    Reflection::Metadata* stateMeta = FindType(ParticleDescription);
    ParticleCallbackInfo stateInfo;
    stateInfo.baseData = FindType(ParticleDescription);
    stateInfo.type = ParticleUiType::State;
    //once for particle

    for(auto& it : stateMeta->GetMembers())
    {
      add_members(stateInfo, &it.second, state_window_, "state");
    }
    //once for variance
    stateInfo.type = ParticleUiType::Variance;
    for(auto& it : stateMeta->GetMembers())
    {
      add_members(stateInfo, &it.second, state_window_, "variance");
    }
  }
Esempio n. 17
0
void CGUI::Initialize()
{
	TwInit(TW_DIRECT3D9, g_Device);

	m_pGUI = TwNewBar("SA::Render");

	TwAddButton(m_pGUI, "ReloadShaders", ReloadShaders, NULL, "group=Global");
}
void ExtrapolationSystem::initialize()
{
	AntTweakBarWrapper::getInstance()->addReadOnlyVariable(
		AntTweakBarWrapper::NETWORK, "Corrected delta",
		TwType::TW_TYPE_FLOAT, &m_correctedDeltaTime, "" );

	TwAddButton(AntTweakBarWrapper::getInstance()->getAntBar(AntTweakBarWrapper::NETWORK),
		"Toggle pos extrapolation", togglePositionalExtrapolation, (void*)NULL, "");
}
Esempio n. 19
0
void twGUI(TwBar *bar){
    
    TwAddVarRW(bar, "Model path", TW_TYPE_CSSTRING(255), &filename, " group='Model' ");
    TwAddButton(bar, "Load", loadModel, NULL, " group='Model' ");
    
    TwAddVarRW(bar, "Radius", TW_TYPE_FLOAT, &mesh.radius, " group='Surfels' min=0 max=1 step = 0.002 ");
    TwAddVarRW(bar, "Normal Size", TW_TYPE_FLOAT, &mesh.normalSize, " group='Surfels' min=0 max=1 step = 0.02 ");

}
Esempio n. 20
0
bool UiButton::AddToPanel( const UiPanel& panel )
{
	return TwAddButton(
		panel.GetPanel(), 
		GetName().c_str(), 
		ButtonCallback,
		this,
		GetParameters().c_str()) != 0;
}
void RTweakBar::AddButton(const char * table, const char * name, std::function<void(void*)> onButtonPressed, void* userdata)
{
	if(!GetBarByName(table))
		return;

	// Place the std::function into the map so we can call lambdas later
	ButtonCallbackMap[std::string(table) + "|" + std::string(name)] = cbStruct(userdata, onButtonPressed);

	TwAddButton(GetBarByName(table), name, OnButtonPressedHelper, &ButtonCallbackMap[std::string(table) + "|" + std::string(name)], "");
}
Esempio n. 22
0
void SceneDialog::AddMaterial(AglMaterial* pMaterial)
{
	if (pMaterial->id == -1)
		Scene::GetInstance()->AddMaterial(pMaterial, false, false);
	if (pMaterial->nameID == -1)
		pMaterial->nameID = Scene::GetInstance()->AddName("Material" + toString(pMaterial->id));
	string s = Scene::GetInstance()->GetName(pMaterial->nameID);
	string info = " label='" + s + "' group='Materials'";
	TwAddButton(m_dialog, ("Material" + toString(pMaterial->id)).c_str(), OpenMaterialDialog, (void*)pMaterial->id, info.c_str());
}
Esempio n. 23
0
void SceneDialog::ClonePE(AglParticleSystemHeader pHeader)
{
	AglParticleSystem* ps = new AglParticleSystem(pHeader);
	Scene::GetInstance()->AddParticleSystem(ps);
	string s = "NoName";
	string info = " label='" + s + "' help='Load an Agile file into the editor.' group='Particle Effects'";
	int zero = Scene::GetInstance()->GetParticleSystems().size()-1;

	TwAddButton(this->m_dialog, ("Particle Effect" + toString(zero)).c_str(), OpenParticleSystemDialog, (void*)zero, info.c_str());
}
Esempio n. 24
0
GLWidget::GLWidget(QWidget *parent)
    : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
{
  filename=0;
  hasToPick=false;
  setWindowTitle(tr("Hello GL"));
  bar = TwNewBar("TweakBar");
  TwCopyCDStringToClientFunc (CopyCDStringToClient);

  TwAddVarRW(bar,"Input",TW_TYPE_CDSTRING, &filename," label='Filepath' group=SetMesh help=` Name of the file to load` ");
  TwAddButton(bar,"Load from file",loadMesh,0,	" label='Load Mesh' group=SetMesh help=`load the mesh` ");
  TwAddButton(bar,"Use tetrahedron",loadTetrahedron,0,	" label='Make Tetrahedron' group=SetMesh help=`use tetrahedron.` ");

  // ShapeEV associates Shape enum values with labels that will be displayed instead of enum values
  TwEnumVal drawmodes[6] = { {GLW::DMSmooth, "Smooth"}, {GLW::DMPoints, "Per Points"}, {GLW::DMWire, "Wire"}, {GLW::DMFlatWire, "FlatWire"},{GLW::DMHidden, "Hidden"},{GLW::DMFlat, "Flat"}};
  // Create a type for the enum shapeEV
  TwType drawMode = TwDefineEnum("DrawMode", drawmodes, 6);
  // add 'g_CurrentShape' to 'bar': this is a variable of type ShapeType. Its key shortcuts are [<] and [>].
  TwAddVarRW(bar, "Draw Mode", drawMode, &drawmode, " keyIncr='<' keyDecr='>' help='Change draw mode.' ");
}
Esempio n. 25
0
ofxTweakbarButton* ofxTweakbar::addButton(
		const char* pName
		,TwButtonCallback fCallback
		,void* pClientData 
		,const char* pDef 
)
{
	ofxTweakbarButton* type = new ofxTweakbarButton(this, pName);
	TwAddButton(bar, type->getName(), fCallback, pClientData, pDef);
	variables[type->getName()] = type;
	return type;
}
Esempio n. 26
0
 void initializeTwGUI()
 {
     TwDefine(" OSGDemo size='240 400' color='96 216 224' ");
     
     TwAddVarRW( g_twBar, "ModelName", TW_TYPE_CSSTRING(sizeof(g_fileName)), g_fileName, " label='Model name' " );
     TwAddButton( g_twBar, "LoadButton", TwGUIManager::loadModelFunc, this, " label='Load model from file' " );
     TwAddSeparator( g_twBar, NULL, NULL );
     TwAddVarRW( g_twBar, "PosX", TW_TYPE_FLOAT, &(position[0]), " step=0.1 " );
     TwAddVarRW( g_twBar, "PosY", TW_TYPE_FLOAT, &(position[1]), " step=0.1 " );
     TwAddVarRW( g_twBar, "PosZ", TW_TYPE_FLOAT, &(position[2]), " step=0.1 " );
     TwAddVarRW( g_twBar, "Rotation", TW_TYPE_QUAT4F, &(rotation[0]), NULL );
 }
Esempio n. 27
0
void APP_OBJLoader::CreateGui()
{
	m_bar = TwNewBar("ObjLoader");

	TwDefine(" ObjLoader position='10 10' "); // move bar to position (10, 10)
	TwDefine(" ObjLoader size='430 320' "); // resize bar	
	TwDefine(" ObjLoader color='128 128 128' alpha=32 ");   // semi-transparent blue bar
	TwDefine(" ObjLoader resizable=false "); // mybar cannot be resized


	TwAddButton(m_bar, "label_01", NULL, NULL, "label='loads obj and shows normals'"); //show as label		
	TwAddButton(m_bar, "mainMenu", Callback, this, "label='main menu'"); //show as button	

	//resets the camera when app re-opens
	GameCam->SetPosition(vec3(-9.8, 3.65, 13.46));
	GameCam->SetFront(vec3(.483, .0558, -.87));
	GameCam->SetPitchYaw(3.2, -61);

	GameCam->SetMouseSnapToCurrent();
	GameCam->ManualSnap();
}
Esempio n. 28
0
void SceneDialog::AddPE(AglParticleSystem* pParticleSystem, int p_index)
{
	int index = p_index;
	if (Scene::GetInstance()->GetIndex(pParticleSystem) < 0)
	{
		Scene::GetInstance()->AddParticleSystem(pParticleSystem);
		index = Scene::GetInstance()->GetIndex(pParticleSystem);
	}
	string s = "NoName";
	string info = " label='" + s + "' group='Particle Effects'";
	TwAddButton(m_dialog, ("Particle Effect" + toString(index)).c_str(), OpenParticleSystemDialog, (void*)index, info.c_str());
}
Esempio n. 29
0
	void TweakBar::Create()
	{
		TwAddVarRO(m_act, "Active ID", TW_TYPE_INT32, &m_groupId, "");
		TwAddButton(m_bar, "Press1",	NULL, NULL, " label='| [1]Select Group 1 | [2]Select Group 2 | [WASD]Camera Movement |'");
		TwAddButton(m_bar, "Press2",	NULL, NULL, " label='-----------------------------------------------------------------'");
		TwAddButton(m_bar, "click",	NULL, NULL, " label='Select a group to select a mode'");
		TwAddButton(m_bar, "Press3",	NULL, NULL, " label='-----------------------------------------------------------------'");
		TwAddButton(m_bar, "cameramove",	NULL, NULL, " label='[Left Mouse]Click anywhere on the ground for Patrol Mode'");
		TwAddButton(m_bar, "Press4",	NULL, NULL, " label='-----------------------------------------------------------------'");
		TwAddButton(m_bar, "Press5",	NULL, NULL, " label='MODES | [I]dle | [P]atrol | Attac[K] |'");
	}
Esempio n. 30
0
void TweakRivers::updateBar(TwBar *bar)
{
    if (drawer == NULL) {
        return;
    }
    LifeCycleParticleLayer *lifeLayer = drawer->getParticles()->getLayer<LifeCycleParticleLayer>();
    WorldParticleLayer *worldLayer = drawer->getParticles()->getLayer<WorldParticleLayer>();

    TwAddVarCB(bar, "pauseFlow", TW_TYPE_BOOL8, SetPausedCallback, GetPausedCallback, worldLayer, " group=Flow label='Update Particles' help='Activate/Deactivate the flow' false='True' true='False' ");
    TwAddVarCB(bar, "timeStep", TW_TYPE_FLOAT, SetTimeStepCallback, GetTimeStepCallback, drawer.get(), " group=Flow label='Time Step' help='Number of Time Steps between each frame' step=0.01 ");
    TwAddVarCB(bar, "flowSpeed", TW_TYPE_FLOAT, SetFlowSpeedCallback, GetFlowSpeedCallback, worldLayer, " group=Flow label='Flow Speed' help='Flow Speed' step=0.01 ");
    TwAddButton(bar, "Clear", ClearParticlesCallback, drawer->getParticles()->getStorage().get(), "group='Flow'");

    TwType twMeshDisplayType = TwDefineEnum("MeshDisplayType", NULL, 0);
    TwAddVarCB(bar, "displayMesh", twMeshDisplayType, SetMeshDisplayTypeCallback, GetMeshDisplayTypeCallback, drawer.get(), "group=Display label='Display Mode' enum='0 {Hidden}, 1 {Particle Coverage}, 5 {Advected}, 6 {Pre-Advected}, 10 {Non Advected} ' ");
    TwAddVarCB(bar, "displayGrid", TW_TYPE_BOOL8, SetDisplayGridCallback, GetDisplayGridCallback, drawer.get(), "group=Display label='Display Grid' ");
    TwAddVarCB(bar, "displayParticles", TW_TYPE_BOOL8, SetDisplayParticlesCallback, GetdisplayParticlesCallback, drawer.get(), "group=Display label='Display Particles' ");
    TwAddVarCB(bar, "displayVelocities", TW_TYPE_BOOL8, SetDisplayVelocitiesCallback, GetDisplayVelocitiesCallback, drawer.get(), "group=Display label='Display Velocities' ");
    TwAddVarCB(bar, "displaySun", TW_TYPE_BOOL8, SetDisplaySunEffectsCallback, GetDisplaySunEffectsCallback, drawer.get(), "group=Display label='Display Sun Effects' ");
    TwAddVarCB(bar, "waveSlope", TW_TYPE_FLOAT, SetWaveSlopeCallback, GetWaveSlopeCallback, drawer.get(), "group=Display label='Wave slope factor' ");
    TwAddVarCB(bar, "waveLength", TW_TYPE_FLOAT, SetWaveLengthCallback, GetWaveLengthCallback, drawer.get(), "group=Display label='Wave length factor' ");
    TwAddVarCB(bar, "riverDepth", TW_TYPE_FLOAT, SetRiverDepthCallback, GetRiverDepthCallback, drawer.get(), "group=Display label='River Depth' min='1' step='0.1' ");
    TwAddVarCB(bar, "bedLength", TW_TYPE_FLOAT, SetBedLengthCallback, GetBedLengthCallback, drawer.get(), "group=Display label='Bed texture length' min='0.001' step='0.001'");

    TwAddVarCB(bar, "fadeInTime", TW_TYPE_FLOAT, SetFadeInCallback, GetFadeInCallback, lifeLayer, "group=Other label='Fading in Time' step=0.1 ");
    TwAddVarCB(bar, "fadeOutTime", TW_TYPE_FLOAT, SetFadeOutCallback, GetFadeOutCallback, lifeLayer, "group=Other label='Fading Out Time' step=0.1 ");
    TwAddVarCB(bar, "maxAge", TW_TYPE_FLOAT, SetMaxAgeCallback, GetMaxAgeCallback, lifeLayer, "group=Other label='Max Particle Age' step=0.1 ");
    TwAddVarCB(bar, "particleSize", TW_TYPE_FLOAT, SetRadiusCallback, GetRadiusCallback, drawer.get(), "group=Other label='Particle Size' min=0.020 step=0.1 ");
//    TwAddVarCB(bar, "maxParticles", TW_TYPE_INT32, SetMaxPCallback, GetMaxPCallback, drawer.get()->particles, "group=Other label='Max Particles' min=0 ");
    TwAddVarCB(bar, "slipParameter", TW_TYPE_FLOAT, SetSlipCallback, GetSlipCallback, drawer.get(), "group=Other label='Slip Parameter' step='0.05' ");
    TwAddVarCB(bar, "potentialDelta", TW_TYPE_FLOAT, SetPotentialDeltaCallback, GetPotentialDeltaCallback, drawer.get(), "group=Other label='Potential Delta' min=0.01 step='0.01' ");

    // Defining groups
    TwSetParam(bar, "Flow", "readonly", TW_PARAM_CSTRING, 1, "false");
    TwSetParam(bar, "Flow", "opened", TW_PARAM_INT32, 1, &(barStates[0]));
    TwSetParam(bar, "Flow", "group", TW_PARAM_CSTRING, 1, "riverManager");

    TwSetParam(bar, "Display", "readonly", TW_PARAM_CSTRING, 1, "false");
    TwSetParam(bar, "Display", "opened", TW_PARAM_INT32, 1, &(barStates[1]));
    TwSetParam(bar, "Display", "group", TW_PARAM_CSTRING, 1, "riverManager");

    TwSetParam(bar, "Other", "readonly", TW_PARAM_CSTRING, 1, "false");
    TwSetParam(bar, "Other", "opened", TW_PARAM_INT32, 1, &(barStates[2]));
    TwSetParam(bar, "Other", "group", TW_PARAM_CSTRING, 1, "riverManager");

    TwSetParam(bar, "riverManager", "readonly", TW_PARAM_CSTRING, 1, "false");
    TwSetParam(bar, "riverManager", "opened", TW_PARAM_INT32, 1, &(barStates[3]));
    TwSetParam(bar, "riverManager", "label", TW_PARAM_CSTRING, 1, getName());

    currentBar = bar;
}