Commit a4b6b73a authored by Max Lyon's avatar Max Lyon

Merge branch 'master' into CMakeSimplification

parents 49679119 05dd27d2
/*! \page changelog Changelog
- <b>OpenFlipper 4.1 ( ?/?/? )</b>
- <b>ACG</b>
- GlutPrimitiveNode: Added cone support
- <b>Python Subsystem</b>
- Exit application on error in scripting with batch mode
- Correctly output logging information
......@@ -10,6 +12,7 @@
- Type Light: Python Interface added
- Primitives Generator: Python Interface added
- Mesh Compare: Python Interface added
- Noise: New plugin to add noise to meshes or splats
- <b>OpenFlipper 4.0 ( 05/03/2019 )</b>
......
......@@ -20,10 +20,10 @@ set( CMAKE_CXX_STANDARD_REQUIRED TRUE )
set( CMAKE_CXX_STANDARD 11 )
# ACG Environment default settings
# This is ugly but currently we need to work around the default installed 5.3 on debian
if ( EXISTS /ACG/acgdev/gcc-x86_64/qt-5.11.2/5.11.2/gcc_64 )
# This is ugly but currently we need to work around the default installed on debian
if ( EXISTS /ACG/acgdev/gcc-x86_64/qt-5.12.2/5.12.2/gcc_64 )
# Default to this install path for QT%_INSTALL_DIR
set (QT5_INSTALL_PATH /ACG/acgdev/gcc-x86_64/qt-5.11.2/5.11.2/gcc_64/ CACHE PATH "Qt5 install path set for ACG environment using QT 5.11.2" )
set (QT5_INSTALL_PATH /ACG/acgdev/gcc-x86_64/qt-5.12.2/5.12.2/gcc_64/ CACHE PATH "Qt5 install path set for ACG environment using QT 5.12.2" )
endif()
if ( WIN32 )
......@@ -128,7 +128,7 @@ if ( WIN32 )
endif()
endif()
set (OF_MAX_QT_VERSION "5.9.0")
set (OF_MAX_QT_VERSION "5.12.2")
if (${Qt5Core_VERSION_STRING} STRGREATER ${OF_MAX_QT_VERSION})
message(WARNING "Detected QT Version higher than ${OF_MAX_QT_VERSION}!\n" "OpenFlipper has not been tested with this QT Version.")
......
......@@ -32,23 +32,27 @@ elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
endif()
if (QT5_FOUND)
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.11.2")
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.11.2")
else()
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.10.1" )
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.10.1")
else()
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.9.0" )
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.9.0")
else()
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.8.0" OR ${Qt5Core_VERSION_STRING} VERSION_GREATER "5.5.1")
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.8.0")
else()
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-4.9-x86_64/qwt-6.1-qt5")
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.12.2")
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.4-qt5.12.2")
else()
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.11.2")
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.11.2")
else()
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.10.1" )
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.10.1")
else()
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.9.0" )
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.9.0")
else()
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.8.0" OR ${Qt5Core_VERSION_STRING} VERSION_GREATER "5.5.1")
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.8.0")
else()
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-4.9-x86_64/qwt-6.1-qt5")
endif()
endif()
endif()
endif()
endif()
endif()
else()
SET(ACG_SEARCH_PATH "/usr/local/qwt/")
endif()
......
......@@ -75,6 +75,7 @@ GlutPrimitiveNode::GlutPrimitiveNode( BaseNode* _parent,
const int stacks = 20;
sphere_ = new ACG::GLSphere(slices,stacks);
cone_ = new ACG::GLCone(slices, stacks, 1.0, 0, true, false);
};
//----------------------------------------------------------------------------
......@@ -93,6 +94,7 @@ GlutPrimitiveNode::GlutPrimitiveNode(GlutPrimitiveType _type,
primitives_.push_back(p);
sphere_ = new ACG::GLSphere(slices, stacks);
cone_ = new ACG::GLCone(slices, stacks, 1.0, 0, true, false);
}
void
......@@ -442,25 +444,49 @@ getRenderObjects(IRenderer* _renderer, GLState& _state , const DrawModes::DrawM
}
ro.setMaterial(&localMaterial);
ro.shaderDesc.shadeMode = SG_SHADE_PHONG;
size_t n_layers = _drawMode.getNumLayers();
for (size_t i = 0; i < n_layers; ++i)
{
const auto layer = _drawMode.getLayer(i);
switch (primitives_[i].type) {
case SPHERE:
switch (layer->lightStage())
{
case DrawModes::LIGHTSTAGE_SMOOTH:
ro.shaderDesc.shadeMode = SG_SHADE_GOURAUD;
break;
case DrawModes::LIGHTSTAGE_PHONG:
ro.shaderDesc.shadeMode = SG_SHADE_PHONG;
break;
case DrawModes::LIGHTSTAGE_UNLIT:
ro.shaderDesc.shadeMode = SG_SHADE_UNLIT;
break;
}
// Sphere
ro.debugName = std::string("glutprimitive.sphere no ") + std::to_string(i) + ": " + name();
switch (primitives_[i].type)
{
case SPHERE:
sphere_->addToRenderer(_renderer, &ro, primitives_[i].size);
// Sphere
ro.debugName = std::string("glutprimitive.sphere no ") + std::to_string(i) + ": " + name();
break;
sphere_->addToRenderer(_renderer, &ro, primitives_[i].size);
break;
default:
// TODO: The other glut primitives are not yet supported by the advanced renderers
std::cerr << "Sorry, but the glut renderer objects are not available for this renderer yet!" << std::endl;
break;
case CONE:
//Cone
ro.debugName = std::string("glutprimitive.cone no ") + std::to_string(i) + ": " + name();
cone_->addToRenderer(_renderer, &ro, primitives_[i].innersize);
break;
default:
// TODO: The other glut primitives are not yet supported by the advanced renderers
std::cerr << "Sorry, but the glut renderer objects are not available for this renderer yet!" << std::endl;
break;
}
}
}
}
......
......@@ -178,7 +178,12 @@ public:
/// destructor
virtual ~GlutPrimitiveNode() {}
virtual ~GlutPrimitiveNode() {
if(sphere_)
delete sphere_;
if(cone_)
delete cone_;
}
/**
* Adds a primitive and returns its index.
......@@ -241,6 +246,7 @@ private:
// Sphere rendering
ACG::GLSphere* sphere_;
ACG::GLCone* cone_;
};
......
......@@ -128,6 +128,7 @@ SET (CTEST_DROP_SITE_CDASH FALSE)
"${CMAKE_SOURCE_DIR}/PluginCollection-*/Plugin-*/CMakeLists.txt"
"${CMAKE_SOURCE_DIR}/Package-*/Plugin-*/CMakeLists.txt"
"${CMAKE_SOURCE_DIR}/Package-*/PluginCollection-*/Plugin-*/CMakeLists.txt"
"${CMAKE_SOURCE_DIR}/Type-*/Plugin-*/CMakeLists.txt"
)
foreach (_plugin ${_plugins_in})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment