Commit 114e7737 authored by Martin Schultz's avatar Martin Schultz

Merge branch 'master' into unstable

parents ef101799 47eb9b08
...@@ -9,11 +9,27 @@ ...@@ -9,11 +9,27 @@
- Queued cross plugin interconnection feature - Queued cross plugin interconnection feature
- Use QOpenGLWidget - Use QOpenGLWidget
- Switched to Qt command line parsing and removed SimpleOpt - Switched to Qt command line parsing and removed SimpleOpt
- <b>ACG</b>
- Clamp shininess in Materialnode (caused GL Errors)
- Better Material support in Materialnode (emissive and refractive materials)
- <b>Plugins</b> - <b>Plugins</b>
- File-OBJ
- Read emissive and refractive materials
- File-STL
- Binary STL support for scripting
- HoleFiller
- Bounding box diagonal and boundary length where exchanged in the toolbox table
- Primitives - Primitives
- Added Torus - Added Torus
- Added Hexahedral cube
- PropertyViz
- Support Build without OVM (Thanks to Matthias Moeller for the patch)
- Added normalized checkbox to vizualize vectors as colors
- Fixed a typo
- SelectionBase - SelectionBase
- added signal and slot to add widgets for selectionParameters to the selectioninterface - added signal and slot to add widgets for selectionParameters to the selectioninterface
- Type OpenVolumemesh
- added drawmode faces_colored_flat_shaded
- VSI - VSI
- Fixed picking in Object selection - Fixed picking in Object selection
- Moved Icon into Plugin - Moved Icon into Plugin
...@@ -28,6 +44,8 @@ ...@@ -28,6 +44,8 @@
- Make sure that resource filenames are unique - Make sure that resource filenames are unique
- Split Type plugins into separate builds and remove types from pluginlib - Split Type plugins into separate builds and remove types from pluginlib
- Make all plugins submodules and therefore standalone git repositories - Make all plugins submodules and therefore standalone git repositories
- don't recognize type dependency as fulfilled when type plugin is in source tree but not built (e.g. type plugin misses dependencies) (Thanks to Matthias Moeller for the patch)
- Reduced number of includes to speedup comilation
- <b>OpenFlipper 3.1 ( 2016/10/12 )</b> - <b>OpenFlipper 3.1 ( 2016/10/12 )</b>
- <b>General</b> - <b>General</b>
......
...@@ -47,7 +47,7 @@ macro (acg_qt5) ...@@ -47,7 +47,7 @@ macro (acg_qt5)
endif(Qt5Core_VERSION) endif(Qt5Core_VERSION)
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${Qt5Core_VERSION_STRING}") string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${Qt5Core_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${Qt5Core_VERSION_STRING}") string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${Qt5Core_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${Qt5Core_VERSION_STRING}") string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${Qt5Core_VERSION_STRING}")
find_package (Qt5Widgets QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS}) find_package (Qt5Widgets QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
......
# http://www.andres.sc/graph.html
# We call it andresgraph to avoid ambiguity
# - Try to find ANDRESGRAPH
# Once done this will define
# ANDRESGRAPH_FOUND - System has ANDRESGRAPH
# ANDRESGRAPH_INCLUDE_DIRS - The ANDRESGRAPH include directories
if (ANDRESGRAPH_INCLUDE_DIR)
# in cache already
set(ANDRESGRAPH_FOUND TRUE)
set(ANDRESGRAPH_INCLUDE_DIRS "${ANDRESGRAPH_INCLUDE_DIR}" )
else (ANDRESGRAPH_INCLUDE_DIR)
find_path( ANDRESGRAPH_INCLUDE_DIR
NAMES andres/graph/multicut-lifted/kernighan-lin.hxx
PATHS $ENV{ANDRESGRAPH_DIR}
/usr/include/
/usr/local/include/
/opt/local/include/
)
set(ANDRESGRAPH_INCLUDE_DIRS "${ANDRESGRAPH_INCLUDE_DIR}" )
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBCPLEX_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(ANDRESGRAPH DEFAULT_MSG
ANDRESGRAPH_INCLUDE_DIR)
mark_as_advanced(ANDRESGRAPH_INCLUDE_DIR)
endif(ANDRESGRAPH_INCLUDE_DIR)
...@@ -27,6 +27,7 @@ find_path(GUROBI_INCLUDE_DIR ...@@ -27,6 +27,7 @@ find_path(GUROBI_INCLUDE_DIR
"/Library/gurobi502/mac64/include" "/Library/gurobi502/mac64/include"
"/Library/gurobi562/mac64/include" "/Library/gurobi562/mac64/include"
"/Library/gurobi650/mac64/include" "/Library/gurobi650/mac64/include"
"/Library/gurobi751/mac64/include"
"C:\\libs\\gurobi502\\include" "C:\\libs\\gurobi502\\include"
"C:\\libs\\gurobi562\\include" "C:\\libs\\gurobi562\\include"
"${GUROBI_BASE}/include" "${GUROBI_BASE}/include"
...@@ -34,6 +35,7 @@ find_path(GUROBI_INCLUDE_DIR ...@@ -34,6 +35,7 @@ find_path(GUROBI_INCLUDE_DIR
find_library( GUROBI_LIBRARY find_library( GUROBI_LIBRARY
NAMES gurobi NAMES gurobi
gurobi75
gurobi70 gurobi70
gurobi65 gurobi65
gurobi60 gurobi60
...@@ -45,9 +47,10 @@ find_library( GUROBI_LIBRARY ...@@ -45,9 +47,10 @@ find_library( GUROBI_LIBRARY
gurobi45 gurobi45
PATHS "$ENV{GUROBI_HOME}/lib" PATHS "$ENV{GUROBI_HOME}/lib"
"/Library/gurobi562/mac64/lib"
"/Library/gurobi502/mac64/lib" "/Library/gurobi502/mac64/lib"
"/Library/gurobi562/mac64/lib"
"/Library/gurobi650/mac64/lib" "/Library/gurobi650/mac64/lib"
"/Library/gurobi751/mac64/lib"
"C:\\libs\\gurobi562\\lib" "C:\\libs\\gurobi562\\lib"
"C:\\libs\\gurobi502\\lib" "C:\\libs\\gurobi502\\lib"
"${GUROBI_BASE}/lib" "${GUROBI_BASE}/lib"
...@@ -63,6 +66,7 @@ find_library( GUROBI_CXX_LIBRARY ...@@ -63,6 +66,7 @@ find_library( GUROBI_CXX_LIBRARY
PATHS "$ENV{GUROBI_HOME}/lib" PATHS "$ENV{GUROBI_HOME}/lib"
"/Library/gurobi562/mac64/lib" "/Library/gurobi562/mac64/lib"
"/Library/gurobi502/mac64/lib" "/Library/gurobi502/mac64/lib"
"/Library/gurobi751/mac64/lib"
"C:\\libs\\gurobi562\\lib" "C:\\libs\\gurobi562\\lib"
"C:\\libs\\gurobi502\\lib" "C:\\libs\\gurobi502\\lib"
"${GUROBI_BASE}/lib" "${GUROBI_BASE}/lib"
......
...@@ -61,6 +61,7 @@ find_path(QWT6_INCLUDE_DIR qwt.h ...@@ -61,6 +61,7 @@ find_path(QWT6_INCLUDE_DIR qwt.h
c:\\libs\\qwt-6.1.0 c:\\libs\\qwt-6.1.0
c:\\libs\\qwt-6.0.2 c:\\libs\\qwt-6.0.2
c:\\libs\\qwt-6.0.1 c:\\libs\\qwt-6.0.1
/opt/local/libexec/qt5/lib/qwt.framework/Versions/6/Headers/
#PATH_SUFFIXES qwt qwt6 qwt-6.1.0 qwt-6.0.2 qwt-6.0.1 include qwt/include qwt6/include #deactivated for acg dir #PATH_SUFFIXES qwt qwt6 qwt-6.1.0 qwt-6.0.2 qwt-6.0.1 include qwt/include qwt6/include #deactivated for acg dir
ENV PATH ENV PATH
) )
...@@ -123,8 +124,9 @@ if (QWT6_VERSION_FOUND) ...@@ -123,8 +124,9 @@ if (QWT6_VERSION_FOUND)
) )
if (NOT QWT6_LIBRARY) # if not the specific acg qwt installation was found, try system wide if (NOT QWT6_LIBRARY) # if not the specific acg qwt installation was found, try system wide
find_library(QWT6_LIBRARY NAMES qwt find_library(QWT6_LIBRARY NAMES qwt qwt-qt5
PATHS PATHS
/opt/local/libexec/qt5/lib
/usr/local/qwt/lib /usr/local/qwt/lib
/opt/local/lib /opt/local/lib
/usr/local/lib /usr/local/lib
......
...@@ -329,7 +329,7 @@ macro (_check_plugin_deps _prefix _optional ) ...@@ -329,7 +329,7 @@ macro (_check_plugin_deps _prefix _optional )
if ( DEFINED ${_prefix}_TYPES ) if ( DEFINED ${_prefix}_TYPES )
foreach (_TYPE ${${_prefix}_TYPES}) foreach (_TYPE ${${_prefix}_TYPES})
if ( DEFINED ${_TYPE}_INCLUDE ) if ( TARGET ${_TYPE} )
list(APPEND ${_prefix}_TYPE_INCLUDES "${${_TYPE}_INCLUDE}") list(APPEND ${_prefix}_TYPE_INCLUDES "${${_TYPE}_INCLUDE}")
list(APPEND ${_prefix}_TYPE_DEPENDENCIES "${_TYPE}") list(APPEND ${_prefix}_TYPE_DEPENDENCIES "${_TYPE}")
list(APPEND ${_prefix}_TYPE_DEFINITIONS "-DENABLE_${_TYPE}_SUPPORT") list(APPEND ${_prefix}_TYPE_DEFINITIONS "-DENABLE_${_TYPE}_SUPPORT")
...@@ -348,12 +348,12 @@ macro (_check_plugin_deps _prefix _optional ) ...@@ -348,12 +348,12 @@ macro (_check_plugin_deps _prefix _optional )
foreach (_TYPE ${${_prefix}_OPT_TYPES}) foreach (_TYPE ${${_prefix}_OPT_TYPES})
if ( DEFINED ${_TYPE}_INCLUDE ) if ( TARGET ${_TYPE} )
list(APPEND ${_prefix}_TYPE_INCLUDES "${${_TYPE}_INCLUDE}") list(APPEND ${_prefix}_TYPE_INCLUDES "${${_TYPE}_INCLUDE}")
list(APPEND ${_prefix}_TYPE_DEPENDENCIES "${_TYPE}") list(APPEND ${_prefix}_TYPE_DEPENDENCIES "${_TYPE}")
list(APPEND ${_prefix}_TYPE_DEFINITIONS "-DENABLE_${_TYPE}_SUPPORT") list(APPEND ${_prefix}_TYPE_DEFINITIONS "-DENABLE_${_TYPE}_SUPPORT")
else() else()
message(warning "Optional Datatype ${_TYPE} not available, proceeding without it") message("Optional Datatype ${_TYPE} not available, proceeding without it")
endif() endif()
endforeach() endforeach()
......
...@@ -270,6 +270,10 @@ MaterialNode* BaseObjectData::materialNode() { ...@@ -270,6 +270,10 @@ MaterialNode* BaseObjectData::materialNode() {
return materialNode_; return materialNode_;
} }
const MaterialNode* BaseObjectData::materialNode() const {
return materialNode_;
}
BoundingBoxNode* BaseObjectData::boundingBoxNode() { BoundingBoxNode* BaseObjectData::boundingBoxNode() {
return boundingBoxNode_; return boundingBoxNode_;
} }
......
...@@ -193,7 +193,10 @@ class DLLEXPORT BaseObjectData : public BaseObject ...@@ -193,7 +193,10 @@ class DLLEXPORT BaseObjectData : public BaseObject
/// get a pointer to the materialnode /// get a pointer to the materialnode
MaterialNode* materialNode(); MaterialNode* materialNode();
/// get a const pointer to the materialnode
const MaterialNode* materialNode() const;
/// get a pointer to the bounding box node /// get a pointer to the bounding box node
BoundingBoxNode* boundingBoxNode(); BoundingBoxNode* boundingBoxNode();
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
#include <vector> #include <vector>
#include <list> #include <list>
#include <OpenMesh/Core/Utils/Property.hh> #include <OpenMesh/Core/Utils/Property.hh>
#include <OpenMesh/Core/IO/MeshIO.hh> #include <OpenMesh/Core/Utils/color_cast.hh>
#include <ACG/GL/globjects.hh> #include <ACG/GL/globjects.hh>
#include <ACG/GL/GLState.hh> #include <ACG/GL/GLState.hh>
......
...@@ -134,7 +134,7 @@ GLState::GLState(bool _updateGL, bool _compatibilityProfile) ...@@ -134,7 +134,7 @@ GLState::GLState(bool _updateGL, bool _compatibilityProfile)
glheight_(2), glheight_(2),
near_plane_(1.0), near_plane_(1.0),
far_plane_(100.0), far_plane_(100.0),
multisampling_(false), multisampling_(false),
allow_multisampling_(true), allow_multisampling_(true),
mipmapping_(true), mipmapping_(true),
updateGL_(_updateGL), updateGL_(_updateGL),
...@@ -198,9 +198,9 @@ void GLState::initialize() ...@@ -198,9 +198,9 @@ void GLState::initialize()
// Get max number of texture units // Get max number of texture units
GLint value; GLint value;
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &value); glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &value);
num_texture_units_ = value; num_texture_units_ = value;
// lighting // lighting
set_twosided_lighting(true); set_twosided_lighting(true);
} }
...@@ -399,8 +399,8 @@ void GLState::set_modelview(const GLMatrixd& _m, const GLMatrixd& _inv_m) ...@@ -399,8 +399,8 @@ void GLState::set_modelview(const GLMatrixd& _m, const GLMatrixd& _inv_m)
void GLState::ortho( double _left, double _right, void GLState::ortho( double _left, double _right,
double _bottom, double _top, double _bottom, double _top,
double _n, double _f ) double _n, double _f )
{ {
near_plane_ = _n; near_plane_ = _n;
far_plane_ = _f; far_plane_ = _f;
...@@ -422,8 +422,8 @@ void GLState::ortho( double _left, double _right, ...@@ -422,8 +422,8 @@ void GLState::ortho( double _left, double _right,
void GLState::frustum( double _left, double _right, void GLState::frustum( double _left, double _right,
double _bottom, double _top, double _bottom, double _top,
double _n, double _f ) double _n, double _f )
{ {
near_plane_ = _n; near_plane_ = _n;
far_plane_ = _f; far_plane_ = _f;
...@@ -445,7 +445,7 @@ void GLState::frustum( double _left, double _right, ...@@ -445,7 +445,7 @@ void GLState::frustum( double _left, double _right,
void GLState::perspective( double _fovY, double _aspect, void GLState::perspective( double _fovY, double _aspect,
double _n, double _f ) double _n, double _f )
{ {
near_plane_ = _n; near_plane_ = _n;
far_plane_ = _f; far_plane_ = _f;
...@@ -467,8 +467,8 @@ void GLState::perspective( double _fovY, double _aspect, ...@@ -467,8 +467,8 @@ void GLState::perspective( double _fovY, double _aspect,
void GLState::viewport( int _left, int _bottom, void GLState::viewport( int _left, int _bottom,
int _width, int _height, int _width, int _height,
int _glwidth, int _glheight) int _glwidth, int _glheight)
{ {
left_ = _left; left_ = _left;
bottom_ = _bottom; bottom_ = _bottom;
...@@ -512,8 +512,8 @@ void GLState::viewport( int _left, int _bottom, ...@@ -512,8 +512,8 @@ void GLState::viewport( int _left, int _bottom,
void GLState::lookAt( const Vec3d& _eye, void GLState::lookAt( const Vec3d& _eye,
const Vec3d& _center, const Vec3d& _center,
const Vec3d& _up ) const Vec3d& _up )
{ {
modelview_.lookAt(_eye, _center, _up); modelview_.lookAt(_eye, _center, _up);
inverse_modelview_.inverse_lookAt(_eye, _center, _up); inverse_modelview_.inverse_lookAt(_eye, _center, _up);
...@@ -530,7 +530,7 @@ void GLState::lookAt( const Vec3d& _eye, ...@@ -530,7 +530,7 @@ void GLState::lookAt( const Vec3d& _eye,
void GLState::translate( double _x, double _y, double _z, void GLState::translate( double _x, double _y, double _z,
MultiplyFrom _mult_from ) MultiplyFrom _mult_from )
{ {
if (_mult_from == MULT_FROM_RIGHT) if (_mult_from == MULT_FROM_RIGHT)
{ {
...@@ -561,7 +561,7 @@ void GLState::translate( Vec3d _vector, ...@@ -561,7 +561,7 @@ void GLState::translate( Vec3d _vector,
void GLState::rotate( double _angle, double _x, double _y, double _z, void GLState::rotate( double _angle, double _x, double _y, double _z,
MultiplyFrom _mult_from ) MultiplyFrom _mult_from )
{ {
if (_mult_from == MULT_FROM_RIGHT) if (_mult_from == MULT_FROM_RIGHT)
{ {
...@@ -586,7 +586,7 @@ void GLState::rotate( double _angle, double _x, double _y, double _z, ...@@ -586,7 +586,7 @@ void GLState::rotate( double _angle, double _x, double _y, double _z,
void GLState::scale( double _sx, double _sy, double _sz, void GLState::scale( double _sx, double _sy, double _sz,
MultiplyFrom _mult_from ) MultiplyFrom _mult_from )
{ {
if (_mult_from == MULT_FROM_RIGHT) if (_mult_from == MULT_FROM_RIGHT)
{ {
...@@ -611,7 +611,7 @@ void GLState::scale( double _sx, double _sy, double _sz, ...@@ -611,7 +611,7 @@ void GLState::scale( double _sx, double _sy, double _sz,
void GLState::mult_matrix( const GLMatrixd& _m, const GLMatrixd& _inv_m, void GLState::mult_matrix( const GLMatrixd& _m, const GLMatrixd& _inv_m,
MultiplyFrom _mult_from ) MultiplyFrom _mult_from )
{ {
if (_mult_from == MULT_FROM_RIGHT) if (_mult_from == MULT_FROM_RIGHT)
{ {
...@@ -758,13 +758,13 @@ void GLState::set_overlay_color(const Vec4f& _col) ...@@ -758,13 +758,13 @@ void GLState::set_overlay_color(const Vec4f& _col)
void GLState::set_shininess(float _shininess) void GLState::set_shininess(float _shininess)
{ {
shininess_ = _shininess; shininess_ = _shininess;
if (updateGL_ && compatibilityProfile_) if (updateGL_ && compatibilityProfile_)
{ {
makeCurrent(); makeCurrent();
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, _shininess); glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, std::min(128.f, _shininess));
} }
} }
...@@ -891,7 +891,7 @@ Vec3d GLState::eye() const ...@@ -891,7 +891,7 @@ Vec3d GLState::eye() const
Vec3d GLState::viewing_direction(int _x, int _y) const Vec3d GLState::viewing_direction(int _x, int _y) const
{ {
Vec3d dir = ( unproject(Vec3d(_x, _y, 1.0)) - Vec3d dir = ( unproject(Vec3d(_x, _y, 1.0)) -
unproject(Vec3d(_x, _y, 0.0)) ); unproject(Vec3d(_x, _y, 0.0)) );
dir.normalize(); dir.normalize();
return dir; return dir;
} }
...@@ -903,7 +903,7 @@ Vec3d GLState::viewing_direction(int _x, int _y) const ...@@ -903,7 +903,7 @@ Vec3d GLState::viewing_direction(int _x, int _y) const
Vec3d GLState::up() const Vec3d GLState::up() const
{ {
Vec3d dir( unproject(Vec3d(0.5*width_, height_-1, 0.0)) - Vec3d dir( unproject(Vec3d(0.5*width_, height_-1, 0.0)) -
unproject(Vec3d(0.5*width_, 0.5*height_, 0.0)) ); unproject(Vec3d(0.5*width_, 0.5*height_, 0.0)) );
dir.normalize(); dir.normalize();
return dir; return dir;
} }
...@@ -915,7 +915,7 @@ Vec3d GLState::up() const ...@@ -915,7 +915,7 @@ Vec3d GLState::up() const
Vec3d GLState::right() const Vec3d GLState::right() const
{ {
Vec3d dir( unproject(Vec3d(width_-1, 0.5*height_, 0.0)) - Vec3d dir( unproject(Vec3d(width_-1, 0.5*height_, 0.0)) -
unproject(Vec3d(0.5*width_, 0.5*height_, 0.0)) ); unproject(Vec3d(0.5*width_, 0.5*height_, 0.0)) );
dir.normalize(); dir.normalize();
return dir; return dir;
} }
...@@ -925,7 +925,7 @@ Vec3d GLState::right() const ...@@ -925,7 +925,7 @@ Vec3d GLState::right() const
void GLState::viewing_ray( int _x, int _y, void GLState::viewing_ray( int _x, int _y,
Vec3d& _origin, Vec3d& _direction) const Vec3d& _origin, Vec3d& _direction) const
{ {
_origin = unproject(Vec3d(_x, _y, 0.0)); _origin = unproject(Vec3d(_x, _y, 0.0));
_direction = unproject(Vec3d(_x, _y, 1.0)) - _origin; _direction = unproject(Vec3d(_x, _y, 1.0)) - _origin;
...@@ -1338,7 +1338,7 @@ void GLState::syncFromGL() ...@@ -1338,7 +1338,7 @@ void GLState::syncFromGL()
if (glIsEnabled(caps[i])) stateStack_.back().glStateEnabled_.set(caps[i]); if (glIsEnabled(caps[i])) stateStack_.back().glStateEnabled_.set(caps[i]);
else stateStack_.back().glStateEnabled_.reset(caps[i]); else stateStack_.back().glStateEnabled_.reset(caps[i]);
} }
GLint getparam; GLint getparam;
#ifdef GL_VERSION_1_4 #ifdef GL_VERSION_1_4
...@@ -1364,9 +1364,9 @@ void GLState::syncFromGL() ...@@ -1364,9 +1364,9 @@ void GLState::syncFromGL()
glGetIntegerv(GL_BLEND_EQUATION_RGB, &getparam); glGetIntegerv(GL_BLEND_EQUATION_RGB, &getparam);
stateStack_.back().blendEquationState_ = getparam; stateStack_.back().blendEquationState_ = getparam;
glGetFloatv(GL_BLEND_COLOR, stateStack_.back().blendColorState_); glGetFloatv(GL_BLEND_COLOR, stateStack_.back().blendColorState_);
glGetIntegerv(GL_ALPHA_TEST_FUNC, &getparam); glGetIntegerv(GL_ALPHA_TEST_FUNC, &getparam);
stateStack_.back().alphaFuncState_ = getparam; stateStack_.back().alphaFuncState_ = getparam;
...@@ -1381,7 +1381,7 @@ void GLState::syncFromGL() ...@@ -1381,7 +1381,7 @@ void GLState::syncFromGL()
GLenum bufGets[8] = { GLenum bufGets[8] = {
GL_ARRAY_BUFFER_BINDING, GL_ARRAY_BUFFER, GL_ARRAY_BUFFER_BINDING, GL_ARRAY_BUFFER,
GL_ELEMENT_ARRAY_BUFFER_BINDING, GL_ELEMENT_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER_BINDING, GL_ELEMENT_ARRAY_BUFFER,
GL_PIXEL_PACK_BUFFER_BINDING, GL_PIXEL_PACK_BUFFER, GL_PIXEL_PACK_BUFFER_BINDING, GL_PIXEL_PACK_BUFFER,
GL_PIXEL_UNPACK_BUFFER_BINDING, GL_PIXEL_UNPACK_BUFFER}; GL_PIXEL_UNPACK_BUFFER_BINDING, GL_PIXEL_UNPACK_BUFFER};
...@@ -1452,7 +1452,7 @@ void GLState::syncFromGL() ...@@ -1452,7 +1452,7 @@ void GLState::syncFromGL()
GL_TEXTURE_COORD_ARRAY_SIZE, GL_TEXTURE_COORD_ARRAY_TYPE, GL_TEXTURE_COORD_ARRAY_SIZE, GL_TEXTURE_COORD_ARRAY_TYPE,
GL_TEXTURE_COORD_ARRAY_STRIDE, GL_TEXTURE_COORD_ARRAY_POINTER}; GL_TEXTURE_COORD_ARRAY_STRIDE, GL_TEXTURE_COORD_ARRAY_POINTER};
GLStateContext::GLVertexPointer* ptrs[] = {&stateStack_.back().vertexPointer_, GLStateContext::GLVertexPointer* ptrs[] = {&stateStack_.back().vertexPointer_,
&stateStack_.back().colorPointer_, &stateStack_.back().texcoordPointer_}; &stateStack_.back().colorPointer_, &stateStack_.back().texcoordPointer_};
for (int i = 0; i < 3 ; ++i) for (int i = 0; i < 3 ; ++i)
...@@ -1743,7 +1743,7 @@ void GLState::depthRange(GLclampd _zNear, GLclampd _zFar) ...@@ -1743,7 +1743,7 @@ void GLState::depthRange(GLclampd _zNear, GLclampd _zFar)
{ {
if (!depthRangeLock_) if (!depthRangeLock_)
{ {
#ifdef GLSTATE_AVOID_REDUNDANT_GLCALLS #ifdef GLSTATE_AVOID_REDUNDANT_GLCALLS
if (abs(_zNear - stateStack_.back().depthRange_[0]) > 1e-6 || if (abs(_zNear - stateStack_.back().depthRange_[0]) > 1e-6 ||
abs(_zFar - stateStack_.back().depthRange_[1]) > 1e-6) abs(_zFar - stateStack_.back().depthRange_[1]) > 1e-6)
#endif #endif
......
...@@ -142,6 +142,8 @@ QString Material::serializeToJson() const { ...@@ -142,6 +142,8 @@ QString Material::serializeToJson() const {
matMap["overlayColor"] = col2vl(overlayColor_); matMap["overlayColor"] = col2vl(overlayColor_);
matMap["shininess"] = shininess_; matMap["shininess"] = shininess_;
matMap["reflectance"] = reflectance_; matMap["reflectance"] = reflectance_;
matMap["indexOfRefraction"] = indexOfRefraction_;
matMap["isRefractive"] = isRefractive_;
matMap["pointSize"] = pointSize_; matMap["pointSize"] = pointSize_;
matMap["lineWidth"] = lineWidth_; matMap["lineWidth"] = lineWidth_;
matMap["roundPoints"] = roundPoints_; matMap["roundPoints"] = roundPoints_;
...@@ -178,6 +180,8 @@ void Material::deserializeFromVariantMap(const QVariantMap &matMap) { ...@@ -178,6 +180,8 @@ void Material::deserializeFromVariantMap(const QVariantMap &matMap) {
if (matMap.contains("overlayColor")) overlayColor_ = vl2col(matMap["overlayColor"].toList()); if (matMap.contains("overlayColor")) overlayColor_ = vl2col(matMap["overlayColor"].toList());
if (matMap.contains("shininess")) shininess_ = matMap["shininess"].toFloat(); if (matMap.contains("shininess")) shininess_ = matMap["shininess"].toFloat();
if (matMap.contains("reflectance")) reflectance_ = matMap["reflectance"].toDouble(); if (matMap.contains("reflectance")) reflectance_ = matMap["reflectance"].toDouble();
if (matMap.contains("indexOfRefraction")) indexOfRefraction_ = matMap["indexOfRefraction"].toDouble();
if (matMap.contains("isRefractive")) isRefractive_ = matMap["isRefractive"].toBool();
if (matMap.contains("pointSize")) pointSize_ = matMap["pointSize"].toFloat(); if (matMap.contains("pointSize")) pointSize_ = matMap["pointSize"].toFloat();
if (matMap.contains("lineWidth")) lineWidth_ = matMap["lineWidth"].toFloat(); if (matMap.contains("lineWidth")) lineWidth_ = matMap["lineWidth"].toFloat();
if (matMap.contains("roundPoints")) roundPoints_ = matMap["roundPoints"].toBool(); if (matMap.contains("roundPoints")) roundPoints_ = matMap["roundPoints"].toBool();
...@@ -217,11 +221,11 @@ void MaterialNode::enter(GLState& _state, const DrawModes::DrawMode& _drawmode ...@@ -217,11 +221,11 @@ void MaterialNode::enter(GLState& _state, const DrawModes::DrawMode& _drawmode
if (applyProperties_ & Material) if (applyProperties_ & Material)
{ {
materialBackup_.ambientColor_ = _state.ambient_color(); materialBackup_.ambientColor_ = _state.ambient_color();
materialBackup_.diffuseColor_ = _state.diffuse_color(); materialBackup_.diffuseColor_ = _state.diffuse_color();
materialBackup_.specularColor_ = _state.specular_color(); materialBackup_.specularColor_ = _state.specular_color();
materialBackup_