Commit b323c97c authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Merge branch 'master' of roosevelt.informatik.rwth-aachen.de:OpenFlipper-Free/OpenFlipper-Free

parents d52945f6 efd6e2ac
......@@ -1632,6 +1632,9 @@ MeshNodeT<Mesh>::
update_textures() {
drawMesh_->updateTextures();
updateVertexPicking_ = true;
updateFacePicking_ = true;
updateAnyPicking_ = true;
}
......
......@@ -1256,4 +1256,12 @@ void invalidatePickCaches() {
}
}
ObjectRange objects(IteratorRestriction _restriction, DataType _dataType) {
return ObjectRange(_restriction, _dataType);
}
ObjectReferenceRange objectReferences(IteratorRestriction _restriction, DataType _dataType) {
return ObjectReferenceRange(_restriction, _dataType);
}
} // End namespace PluginFunctions
......@@ -518,9 +518,164 @@ class DLLEXPORT ObjectIterator {
* It stops at the root node.
*/
inline void proceedToNextBaseObjectData(BaseObject*& _object);
};
/**
* \brief Helper class that wraps an ObjectIterator to return a reference
* instead of a pointer
*/
class DLLEXPORT ObjectReferenceIterator : public std::iterator<std::forward_iterator_tag, BaseObjectData>
{
public:
explicit ObjectReferenceIterator(IteratorRestriction _restriction = ALL_OBJECTS, DataType _dataType = DATA_ALL) :
it_(_restriction, _dataType)
{
}
explicit ObjectReferenceIterator(BaseObjectData* _pos, IteratorRestriction _restriction = ALL_OBJECTS, DataType _dataType = DATA_ALL) :
it_(_pos, _restriction, _dataType)
{
}
ObjectReferenceIterator(const ObjectReferenceIterator& _rhs) :
it_(_rhs.it_)
{
}
ObjectReferenceIterator& operator=(const ObjectReferenceIterator& _rhs)
{
if (this != &_rhs) {
it_ = _rhs.it_;
}
return *this;
}
ObjectReferenceIterator& operator++() {
++it_;
return *this;
}
ObjectReferenceIterator operator++(int) {
ObjectReferenceIterator copy(*this);
operator++();
return copy;
}
bool operator==(const ObjectReferenceIterator& _rhs) const {
return it_ == _rhs.it_;
}
bool operator!=(const ObjectReferenceIterator& _rhs) const {
return it_ != _rhs.it_;
}
BaseObjectData& operator*() {
return **it_;
}
BaseObjectData* operator->() {
return *it_;
}
private:
ObjectIterator it_;
};
/** \brief Range adapter for ObjectIterator
*
* An iterator range suitable for iterating over objects using a C++11
* range-based for loop.
*
* \note Use the PluginFunction::objects factory function as a shorthand for
* creating object ranges.
**/
class DLLEXPORT ObjectRange {
public:
explicit ObjectRange(IteratorRestriction _restriction = ALL_OBJECTS , DataType _dataType = DATA_ALL) :
restriction_(_restriction),
dataType_(_dataType)
{
}
ObjectIterator begin() const {
return ObjectIterator(restriction_, dataType_);
}
ObjectIterator end() const {
return ObjectIterator(0);
}
private:
IteratorRestriction restriction_;
DataType dataType_;
};
/** \brief Range adapter for ObjectIterator
*
* An iterator range suitable for iterating over objects using a C++11
* range-based for loop.
*
* \note Use the PluginFunction::objectReferences factory function as a shorthand for
* creating object ranges.
**/
class DLLEXPORT ObjectReferenceRange {
public:
explicit ObjectReferenceRange(IteratorRestriction _restriction = ALL_OBJECTS , DataType _dataType = DATA_ALL) :
restriction_(_restriction),
dataType_(_dataType)
{
}
ObjectReferenceIterator begin() const {
return ObjectReferenceIterator(restriction_, dataType_);
}
ObjectReferenceIterator end() const {
return ObjectReferenceIterator(0);
}
private:
IteratorRestriction restriction_;
DataType dataType_;
};
/** \brief Iterable object range
*
* Creates an iterator range suitable for iterating over objects using a C++11
* range-based for loop.
*
* \note Usage:
* \code
* for (auto& object : PluginFunctions::objectReferences(..., ...)) {
* ...
* }
* \endcode
**/
DLLEXPORT
ObjectReferenceRange objectReferences(IteratorRestriction _restriction = ALL_OBJECTS , DataType _dataType = DATA_ALL);
/** \brief Iterable object range
*
* Creates an iterator range suitable for iterating over objects using a C++11
* range-based for loop.
*
* \note Iterated elements are *pointers* to objects, not object references.
* Hence, the loop header should be declared as
* \code
* for (auto* object : PluginFunctions::objects(..., ...)) {
* ...
* }
* \endcode
**/
DLLEXPORT
ObjectRange objects(IteratorRestriction _restriction = ALL_OBJECTS , DataType _dataType = DATA_ALL);
/** \brief Core Data Iterator used to iterate over all objects (Including groups)
*
* This iterator is a more low level one not only returning really visible objects but also
......
......@@ -20,7 +20,7 @@ if ( BLOCK_IN_SOURCE_BUILD )
endif()
# allow only Debug and Release builds
set (CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo" CACHE STRING "" FORCE)
set (CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo" CACHE STRING "")
mark_as_advanced (CMAKE_CONFIGURATION_TYPES)
# set Debus as default build target
......
......@@ -37,6 +37,7 @@ find_path( EIGEN3_INCLUDE_DIR
/usr/local/include
/usr/local/include/eigen3/
/opt/local/include/eigen3/
"${CMAKE_WINDOWS_LIBS_DIR}/general/Eigen-3.2.8"
"${CMAKE_WINDOWS_LIBS_DIR}/general/Eigen-3.2.6"
"${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2.6"
"${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2.6/include"
......
......@@ -27,6 +27,7 @@ find_path( GMM_INCLUDE_DIR
"c:\\libs\\gmm-4.2\\include"
"c:\\libs\\gmm-4.1\\include"
"c:\\libs\\gmm-3.0\\include"
"${CMAKE_WINDOWS_LIBS_DIR}/general/gmm-5.0/include"
"${CMAKE_WINDOWS_LIBS_DIR}/general/gmm-4.2/include"
${PROJECT_SOURCE_DIR}/MacOS/Libs/gmm-3.1/include
../../External/include
......
Subproject commit c4e2d27d3359a618bbb8a0277596109279259a58
Subproject commit 8b71dd6702ee6f8ffb9bfb5060496fa0115e538d
Subproject commit b5b9aad9f03fce1d2c8538f3259e4634dc182da6
Subproject commit 15ebfd74be468cd8fcf072b765d28c195431158f
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