Skip to content

Commit

Permalink
Added "invalidate autoProxy models" feature.
Browse files Browse the repository at this point in the history
There should be a new button for this in both the
"Debug" GUI and the "KISS" GUI.
To use without the button, simply set exposedModel
"ap_invalidateAllModels" to "true".
For testing; see e.g., examples/jpg_proxy_test.
  • Loading branch information
Jens Olav Nygaard authored and Jens Olav Nygaard committed Mar 20, 2015
1 parent 4a2b1a2 commit 27cb972
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
9 changes: 9 additions & 0 deletions examples/jpg_proxy_test/JPCJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ bool JPCJob::init()
rootLayout->addChild(compact_grid);
m_model->setGUILayout(rootLayout, tinia::model::gui::DESKTOP);

// 150320: Debugging/testing of new feature; "invalidate"
m_model->updateElement<int>("ap_splats", 20);
m_model->updateElement<int>("ap_overlap", 51);
m_model->updateElement<bool>( "ap_debugSplatCol", true );
m_model->updateElement<bool>( "ap_autoProxyDebugging", true );
m_model->updateElement<bool>( "ap_screenSpaceSized", false );
m_model->updateElement<bool>( "ap_splatOutline", true );
m_model->updateElement<bool>( "ap_useAutoProxy", true );

return true;
}

Expand Down
4 changes: 2 additions & 2 deletions js/gui/Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ dojo.declare("gui.Canvas", [dijit._Widget], {
this._boundingboxKey = params.boundingboxKey;
this._resetViewKey = params.resetViewKey;
this._renderListURL = params.renderListURL;
this._width = 512;
this._height = 512;
this._width = 1024;
this._height = 1024;
this._modelLib = params.modelLib;
// The modification of fields of 'params' in this constructor is probably not necessary, because the call (there seems to be
// only one) to the constructor uses a very short-lived automatic variable that is not used again before going out of scope.
Expand Down
7 changes: 7 additions & 0 deletions js/gui/ProxyRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,13 @@ dojo.declare("gui.ProxyRenderer", null, {
this._lock = true;
this._lock2 = false;
}
if ( (this.exposedModel.hasKey("ap_invalidateAllModels")) && (this.exposedModel.getElementValue("ap_invalidateAllModels")) ) {
// Clearing out all stored proxy models that should be invalidated, and resetting the flag to false.
this.exposedModel.updateElement("ap_invalidateAllModels", false);
for (var i=0; i<this._proxyModelCoverage.bufferRingSize; i++) {
this._proxyModelCoverage.proxyModelRing[i] = new gui.ProxyModel(this.gl);
}
}
this._setUniform1f(this._splatProgram, "splats_x", this._splats_x);
this._setUniform1f(this._splatProgram, "splats_y", this._splats_y);
this._setUniform1f(this._splatProgram, "splatOverlap", this._splatOverlap);
Expand Down
6 changes: 6 additions & 0 deletions src/utils/ProxyDebugGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ ProxyDebugGUI::ProxyDebugGUI( boost::shared_ptr<model::ExposedModel> model,
model->addAnnotation("ap_splats", "Number of splats)");
model->addElement<bool>( "ap_resetAllModels", false );
model->addAnnotation("ap_resetAllModels", "Reset and fix proxy");
model->addElement<bool>( "ap_invalidateAllModels", false );
model->addAnnotation("ap_invalidateAllModels", "Invalidate all AP-models");
model->addElement<bool>( "ap_useISTC", true );
model->addAnnotation("ap_useISTC", "Use intra-splat texcoo");
model->addElement<bool>( "ap_splatOutline", true );
Expand Down Expand Up @@ -269,6 +271,7 @@ void ProxyDebugGUI::resetSettingsClient()
m_model->updateElement<int>( "ap_overlap", 200);
m_model->updateElement<bool>( "ap_alwaysShowMostRecent", true );
m_model->updateElement<bool>( "ap_resetAllModels", false );
m_model->updateElement<bool>( "ap_invalidateAllModels", false );
m_model->updateElement<bool>( "ap_useISTC", true );
m_model->updateElement<bool>( "ap_splatOutline", false );
m_model->updateElement<bool>( "ap_reloadShader", false );
Expand Down Expand Up @@ -449,6 +452,8 @@ tinia::model::gui::Grid *ProxyDebugGUI::getGrid()
mainGrid->setChild(row, 0, new tinia::model::gui::Label("ap_consoleLog", false));
mainGrid->setChild(row, 1, new tinia::model::gui::Label("ap_consoleLog", true));
row++;
mainGrid->setChild(row, 0, new tinia::model::gui::Button("ap_invalidateAllModels"));
row++;
mainGrid->setChild(row, 0, new tinia::model::gui::VerticalExpandingSpace());
}

Expand Down Expand Up @@ -511,6 +516,7 @@ tinia::model::gui::Grid *ProxyDebugGUI::getCompactGrid()
mainGrid->setChild(0, 1, new tinia::model::gui::RadioButtons("ap_compactConnectionChoices"));
mainGrid->setChild(1, 0, new tinia::model::gui::Label("ap_compactClientChoices"));
mainGrid->setChild(1, 1, new tinia::model::gui::RadioButtons("ap_compactClientChoices"));
mainGrid->setChild(2, 0, new tinia::model::gui::Button("ap_invalidateAllModels"));

// Medium choices for defaults
mediumBandwidthMediumLatency();
Expand Down

0 comments on commit 27cb972

Please sign in to comment.