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

Merge branch 'master' into unstable

parents ef101799 47eb9b08
......@@ -9,11 +9,27 @@
- Queued cross plugin interconnection feature
- Use QOpenGLWidget
- 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>
- 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
- 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
- added signal and slot to add widgets for selectionParameters to the selectioninterface
- Type OpenVolumemesh
- added drawmode faces_colored_flat_shaded
- VSI
- Fixed picking in Object selection
- Moved Icon into Plugin
......@@ -28,6 +44,8 @@
- Make sure that resource filenames are unique
- Split Type plugins into separate builds and remove types from pluginlib
- 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>General</b>
......
......@@ -47,7 +47,7 @@ macro (acg_qt5)
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_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}")
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
"/Library/gurobi502/mac64/include"
"/Library/gurobi562/mac64/include"
"/Library/gurobi650/mac64/include"
"/Library/gurobi751/mac64/include"
"C:\\libs\\gurobi502\\include"
"C:\\libs\\gurobi562\\include"
"${GUROBI_BASE}/include"
......@@ -34,6 +35,7 @@ find_path(GUROBI_INCLUDE_DIR
find_library( GUROBI_LIBRARY
NAMES gurobi
gurobi75
gurobi70
gurobi65
gurobi60
......@@ -45,9 +47,10 @@ find_library( GUROBI_LIBRARY
gurobi45
PATHS "$ENV{GUROBI_HOME}/lib"
"/Library/gurobi562/mac64/lib"
"/Library/gurobi502/mac64/lib"
"/Library/gurobi562/mac64/lib"
"/Library/gurobi650/mac64/lib"
"/Library/gurobi751/mac64/lib"
"C:\\libs\\gurobi562\\lib"
"C:\\libs\\gurobi502\\lib"
"${GUROBI_BASE}/lib"
......@@ -63,6 +66,7 @@ find_library( GUROBI_CXX_LIBRARY
PATHS "$ENV{GUROBI_HOME}/lib"
"/Library/gurobi562/mac64/lib"
"/Library/gurobi502/mac64/lib"
"/Library/gurobi751/mac64/lib"
"C:\\libs\\gurobi562\\lib"
"C:\\libs\\gurobi502\\lib"
"${GUROBI_BASE}/lib"
......
......@@ -61,6 +61,7 @@ find_path(QWT6_INCLUDE_DIR qwt.h
c:\\libs\\qwt-6.1.0
c:\\libs\\qwt-6.0.2
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
ENV PATH
)
......@@ -123,8 +124,9 @@ if (QWT6_VERSION_FOUND)
)
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
/opt/local/libexec/qt5/lib
/usr/local/qwt/lib
/opt/local/lib
/usr/local/lib
......
......@@ -329,7 +329,7 @@ macro (_check_plugin_deps _prefix _optional )
if ( DEFINED ${_prefix}_TYPES )
foreach (_TYPE ${${_prefix}_TYPES})
if ( DEFINED ${_TYPE}_INCLUDE )
if ( TARGET ${_TYPE} )
list(APPEND ${_prefix}_TYPE_INCLUDES "${${_TYPE}_INCLUDE}")
list(APPEND ${_prefix}_TYPE_DEPENDENCIES "${_TYPE}")
list(APPEND ${_prefix}_TYPE_DEFINITIONS "-DENABLE_${_TYPE}_SUPPORT")
......@@ -348,12 +348,12 @@ macro (_check_plugin_deps _prefix _optional )
foreach (_TYPE ${${_prefix}_OPT_TYPES})
if ( DEFINED ${_TYPE}_INCLUDE )
if ( TARGET ${_TYPE} )
list(APPEND ${_prefix}_TYPE_INCLUDES "${${_TYPE}_INCLUDE}")
list(APPEND ${_prefix}_TYPE_DEPENDENCIES "${_TYPE}")
list(APPEND ${_prefix}_TYPE_DEFINITIONS "-DENABLE_${_TYPE}_SUPPORT")
else()
message(warning "Optional Datatype ${_TYPE} not available, proceeding without it")
message("Optional Datatype ${_TYPE} not available, proceeding without it")
endif()
endforeach()
......
......@@ -270,6 +270,10 @@ MaterialNode* BaseObjectData::materialNode() {
return materialNode_;
}
const MaterialNode* BaseObjectData::materialNode() const {
return materialNode_;
}
BoundingBoxNode* BaseObjectData::boundingBoxNode() {
return boundingBoxNode_;
}
......
......@@ -194,6 +194,9 @@ class DLLEXPORT BaseObjectData : public BaseObject
/// get a pointer to the materialnode
MaterialNode* materialNode();
/// get a const pointer to the materialnode
const MaterialNode* materialNode() const;
/// get a pointer to the bounding box node
BoundingBoxNode* boundingBoxNode();
......
......@@ -65,7 +65,7 @@
#include <vector>
#include <list>
#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/GLState.hh>
......
......@@ -764,7 +764,7 @@ void GLState::set_shininess(float _shininess)
if (updateGL_ && compatibilityProfile_)
{
makeCurrent();
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, _shininess);
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, std::min(128.f, _shininess));
}
}
......
......@@ -142,6 +142,8 @@ QString Material::serializeToJson() const {
matMap["overlayColor"] = col2vl(overlayColor_);
matMap["shininess"] = shininess_;
matMap["reflectance"] = reflectance_;
matMap["indexOfRefraction"] = indexOfRefraction_;
matMap["isRefractive"] = isRefractive_;
matMap["pointSize"] = pointSize_;
matMap["lineWidth"] = lineWidth_;
matMap["roundPoints"] = roundPoints_;
......@@ -178,6 +180,8 @@ void Material::deserializeFromVariantMap(const QVariantMap &matMap) {
if (matMap.contains("overlayColor")) overlayColor_ = vl2col(matMap["overlayColor"].toList());
if (matMap.contains("shininess")) shininess_ = matMap["shininess"].toFloat();
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("lineWidth")) lineWidth_ = matMap["lineWidth"].toFloat();
if (matMap.contains("roundPoints")) roundPoints_ = matMap["roundPoints"].toBool();
......@@ -480,6 +484,7 @@ MaterialNode::read(std::istream& _is)
char s[200];
float x, y, z, u;
bool b;
while (_is && (!_is.eof()) && _is.getline(s,200) ) {
std::istringstream buffer(s);
......@@ -541,6 +546,22 @@ MaterialNode::read(std::istream& _is)
material_.shininess(x);
}
}
// Refractive
else if (specifier == "isRefractive") {
buffer >> b;
if (buffer.good()) {
material_.setRefractive(b);
}
}
// Refraction Index
else if (specifier == "indexOfRefraction") {
buffer >> x;
if (buffer.good()) {
material_.indexOfRefraction(x);
}
}
// PointSize
else if (specifier == "PointSize") {
buffer >> x;
......
......@@ -96,6 +96,8 @@ public:
overlayColor_(GLState::default_overlay_color),
shininess_(GLState::default_shininess),
reflectance_(0.0),
indexOfRefraction_(1.0),
isRefractive_(false),
pointSize_(1.0),
lineWidth_(1.0),
roundPoints_(false),
......@@ -121,6 +123,8 @@ public:
overlayColor_(_m.overlayColor_),
shininess_(_m.shininess_),
reflectance_(_m.reflectance_),
indexOfRefraction_(_m.indexOfRefraction_),
isRefractive_(_m.isRefractive_),
pointSize_(_m.pointSize_),
lineWidth_(_m.lineWidth_),
roundPoints_(_m.roundPoints_),
......@@ -163,11 +167,16 @@ public:
1.0));
}
/// set the base color
/// set the base color (Sets the baseColor which is the same as the emission(const Vec4f& _c) )
void baseColor(const Vec4f& _c) { baseColor_ = _c;}
/// get the base color
/// get the base color ( Same as emission() )
const Vec4f& baseColor() const { return baseColor_; }
/// set emission ( Same as baseColor( const Vec4f& _c )) )
void emissionColor(const Vec4f& _c) { baseColor_ = _c;}
/// get emission ( Same as baseColor() )
const Vec4f& emissionColor() const { return baseColor_; }
/// set the ambient color.
void ambientColor(const Vec4f& _a) { ambientColor_ = _a; }
/// get the ambient color.
......@@ -207,6 +216,16 @@ public:
/// get reflectance ( not used in OpenGL Rendering)
double reflectance() const { return reflectance_; }
/// set index of refraction
void indexOfRefraction(double _m) { indexOfRefraction_ = _m; }
/// get index of refraction ( not used in OpenGL Rendering)
double indexOfRefraction() const { return indexOfRefraction_; }
/// set refractive flag
void setRefractive(bool _r) { isRefractive_ = _r; }
/// get refractive flag
bool isRefractive() const {return isRefractive_;}
/// set point size (default: 1.0)
void pointSize(float _sz) { pointSize_ = _sz; }
/// get point size
......@@ -280,6 +299,8 @@ public:
/// disable backface culling (not active by default, see applyProperties)
void disableBackfaceCulling() { backfaceCulling_ = false; }
bool isEmissive() const { return (baseColor_[0] > 0.f || baseColor_[1] > 0.f || baseColor_[2] > 0.f); }
protected:
Vec4f baseColor_;
......@@ -290,6 +311,8 @@ protected:
float shininess_;
double reflectance_;
double indexOfRefraction_;
bool isRefractive_;
float pointSize_;
float lineWidth_;
......@@ -400,11 +423,16 @@ public:
material_.generateRandomColor();
}
/// set the base color
/// set the base color ( Same as set_emission(const Vec4f& _c) )
void set_base_color(const Vec4f& _c) { material_.baseColor(_c); }
/// get the base color
/// get the base color ( same as emission() )
const Vec4f& base_color() const { return material_.baseColor(); }
/// set emission ( same as set_base_color(const Vec4f& _c) )
void set_emission(const Vec4f& _c) { material_.baseColor(_c); }
/// get emission ( same as base_color() )
const Vec4f& emission() const { return material_.baseColor(); }
/// set the ambient color.
void set_ambient_color(const Vec4f& _a) { material_.ambientColor(_a); }
/// get the ambient color.
......@@ -444,6 +472,16 @@ public:
/// get reflectance
double reflectance() const { return material_.reflectance(); }
/// set index of refraction
void set_indexOfRefraction(double _m) { material_.indexOfRefraction(_m); }
/// get index of refraction
double indexOfRefraction() const { return material_.indexOfRefraction(); }
/// set refractive flag
void set_refractive(bool _r) { material_.isRefractive_ = _r; }
/// get refractive flag
bool isRefractive() const {return material_.isRefractive_;}
/** @} */
//===========================================================================
......
Subproject commit c48e95785d9c16f00799726204f488c9170b7f63
Subproject commit 7856a4371b5f3607942cb9e0587f4596a3c5ef60
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