cleanup experimental code, improve whitespaces

This commit is contained in:
wmayer
2017-02-11 15:32:25 +01:00
parent 968a597aa7
commit 56ff88ea46
8 changed files with 330 additions and 378 deletions

View File

@@ -55,7 +55,7 @@
<string>Use OpenGL Vertex Buffer Object (experimental)</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>useVBO</cstring>
<cstring>UseVBO</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>

View File

@@ -89,7 +89,7 @@ void AbstractSplitView::setupSettings()
OnChange(*hGrp,"UseBackgroundColorMid");
OnChange(*hGrp,"UseAntialiasing");
OnChange(*hGrp,"ShowFPS");
OnChange(*hGrp,"useVBO");
OnChange(*hGrp,"UseVBO");
OnChange(*hGrp,"Orthographic");
OnChange(*hGrp,"HeadlightColor");
OnChange(*hGrp,"HeadlightDirection");
@@ -227,11 +227,10 @@ void AbstractSplitView::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp
else if (strcmp(Reason,"ShowFPS") == 0) {
for (std::vector<View3DInventorViewer*>::iterator it = _viewer.begin(); it != _viewer.end(); ++it)
(*it)->setEnabledFPSCounter(rGrp.GetBool("ShowFPS",false));
puts("updating FPS 1");
}
else if (strcmp(Reason,"useVBO") == 0) {
else if (strcmp(Reason,"UseVBO") == 0) {
for (std::vector<View3DInventorViewer*>::iterator it = _viewer.begin(); it != _viewer.end(); ++it)
(*it)->setEnableduseVBO(rGrp.GetBool("useVBO",false));
(*it)->setEnabledVBO(rGrp.GetBool("UseVBO",false));
}
else if (strcmp(Reason,"Orthographic") == 0) {

View File

@@ -177,7 +177,7 @@ View3DInventor::View3DInventor(Gui::Document* pcDocument, QWidget* parent,
OnChange(*hGrp,"BackgroundColor4");
OnChange(*hGrp,"UseBackgroundColorMid");
OnChange(*hGrp,"ShowFPS");
OnChange(*hGrp,"useVBO");
OnChange(*hGrp,"UseVBO");
OnChange(*hGrp,"Orthographic");
OnChange(*hGrp,"HeadlightColor");
OnChange(*hGrp,"HeadlightDirection");
@@ -369,8 +369,8 @@ void View3DInventor::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M
else if (strcmp(Reason,"ShowFPS") == 0) {
_viewer->setEnabledFPSCounter(rGrp.GetBool("ShowFPS",false));
}
else if (strcmp(Reason,"useVBO") == 0) {
_viewer->setEnableduseVBO(rGrp.GetBool("useVBO",false));
else if (strcmp(Reason,"UseVBO") == 0) {
_viewer->setEnabledVBO(rGrp.GetBool("UseVBO",false));
}
else if (strcmp(Reason,"Orthographic") == 0) {
// check whether a perspective or orthogrphic camera should be set

View File

@@ -351,6 +351,9 @@ View3DInventorViewer::View3DInventorViewer(const QGLFormat& format, QWidget* par
void View3DInventorViewer::init()
{
fpsEnabled = false;
vboEnabled = false;
Gui::Selection().Attach(this);
// Coin should not clear the pixel-buffer, so the background image
@@ -787,11 +790,16 @@ void View3DInventorViewer::setEnabledFPSCounter(bool on)
fpsEnabled = on;
}
void View3DInventorViewer::setEnableduseVBO(bool on)
void View3DInventorViewer::setEnabledVBO(bool on)
{
vboEnabled = on;
}
bool View3DInventorViewer::isEnabledVBO() const
{
return vboEnabled;
}
void View3DInventorViewer::setAxisCross(bool on)
{
SoNode* scene = getSceneGraph();
@@ -1344,10 +1352,7 @@ void View3DInventorViewer::actualRedraw()
break;
}
}
bool View3DInventorViewer::get_vbo_state()
{
return vboEnabled;
}
void View3DInventorViewer::renderFramebuffer()
{
const SbViewportRegion vp = this->getSoRenderManager()->getViewportRegion();
@@ -1450,7 +1455,6 @@ void View3DInventorViewer::renderScene(void)
SoGLRenderActionElement::set(glra->getState(), glra);
glra->apply(this->backgroundroot);
navigation->updateAnimation();
try {

View File

@@ -93,10 +93,9 @@ public:
ShowCoord=1, /**< Enables the Coordinate system in the corner. */
ShowFPS =2, /**< Enables the Frams per Second counter. */
SimpleBackground=4,/**< switch to a simple background. */
DisallowRotation=8,/**< switch of the rotation. */
DisallowPanning=16,/**< switch of the panning. */
DisallowZooming=32,/**< switch of the zooming. */
useVBO=64,/**< switch of the OpenGL VBO usage. */
DisallowRotation=8,/**< switch off the rotation. */
DisallowPanning=16,/**< switch off the panning. */
DisallowZooming=32,/**< switch off the zooming. */
};
//@}
@@ -340,7 +339,8 @@ public:
bool hasAxisCross(void);
void setEnabledFPSCounter(bool b);
void setEnableduseVBO(bool b);
void setEnabledVBO(bool b);
bool isEnabledVBO() const;
NavigationStyle* navigationStyle() const;
@@ -348,8 +348,6 @@ public:
Gui::Document* getDocument();
virtual PyObject *getPyObject(void);
bool vboEnabled;
bool get_vbo_state();
protected:
void renderScene();
@@ -423,7 +421,7 @@ private:
//stuff needed to draw the fps counter
bool fpsEnabled;
SoSeparator* fpsRoot;
bool vboEnabled;
SbBool editing;
QCursor editCursor, zoomCursor, panCursor, spinCursor;