Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenMesh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenMesh
OpenMesh
Commits
8dc194e8
Commit
8dc194e8
authored
Sep 16, 2016
by
Alexander Dielen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'BuildPythonWindows'
# Conflicts: # src/Python/Vector.hh
parents
f90c6da1
4f209d9f
Pipeline
#2809
passed with stage
in 21 minutes and 8 seconds
Changes
22
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
372 additions
and
91 deletions
+372
-91
CMakeLists.txt
CMakeLists.txt
+8
-0
Doc/changelog.docu
Doc/changelog.docu
+22
-0
src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh
src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh
+1
-1
src/OpenMesh/Apps/Unsupported/OsgViewer/osgviewer.cc
src/OpenMesh/Apps/Unsupported/OsgViewer/osgviewer.cc
+1
-1
src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc
src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc
+1
-1
src/OpenMesh/Core/CMakeLists.txt
src/OpenMesh/Core/CMakeLists.txt
+0
-1
src/OpenMesh/Core/Geometry/Vector11T.hh
src/OpenMesh/Core/Geometry/Vector11T.hh
+2
-2
src/OpenMesh/Core/Geometry/VectorT.hh
src/OpenMesh/Core/Geometry/VectorT.hh
+1
-1
src/OpenMesh/Core/IO/reader/STLReader.cc
src/OpenMesh/Core/IO/reader/STLReader.cc
+63
-34
src/OpenMesh/Core/Mesh/IteratorsT.hh
src/OpenMesh/Core/Mesh/IteratorsT.hh
+1
-1
src/OpenMesh/Core/System/config.h
src/OpenMesh/Core/System/config.h
+1
-1
src/OpenMesh/Core/System/mostream.hh
src/OpenMesh/Core/System/mostream.hh
+4
-4
src/OpenMesh/Core/Utils/PropertyContainer.hh
src/OpenMesh/Core/Utils/PropertyContainer.hh
+1
-1
src/OpenMesh/Core/Utils/PropertyManager.hh
src/OpenMesh/Core/Utils/PropertyManager.hh
+109
-2
src/OpenMesh/Tools/Decimater/DecimaterT.cc
src/OpenMesh/Tools/Decimater/DecimaterT.cc
+3
-3
src/OpenMesh/Tools/Decimater/DecimaterT.hh
src/OpenMesh/Tools/Decimater/DecimaterT.hh
+1
-1
src/OpenMesh/Tools/Utils/HeapT.hh
src/OpenMesh/Tools/Utils/HeapT.hh
+2
-2
src/OpenMesh/Tools/VDPM/ViewingParameters.cc
src/OpenMesh/Tools/VDPM/ViewingParameters.cc
+1
-1
src/Python/Vector.hh
src/Python/Vector.hh
+1
-1
src/Unittests/unittests_cpp_11_features.cc
src/Unittests/unittests_cpp_11_features.cc
+1
-1
src/Unittests/unittests_propertymanager.cc
src/Unittests/unittests_propertymanager.cc
+71
-31
src/Unittests/unittests_vector_type.cc
src/Unittests/unittests_vector_type.cc
+77
-1
No files found.
CMakeLists.txt
View file @
8dc194e8
...
...
@@ -7,6 +7,14 @@ if("${PROJECT_NAME}" STREQUAL "")
project
(
OpenMesh
)
endif
()
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS
"6.0"
AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER
"4.9"
OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL
"4.9"
)
message
(
WARNING
"Your version of GCC contains an optimizer bug. Please verify that you do not use -O3!"
)
string
(
REPLACE
"-O3"
"-O2"
CMAKE_CXX_FLAGS_RELEASE_NEW
"
${
CMAKE_CXX_FLAGS_RELEASE
}
"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE_NEW
}
"
CACHE STRING
""
FORCE
)
endif
()
endif
()
if
(
WIN32
)
# This is the base directory for windows library search used in the finders we ship.
set
(
CMAKE_WINDOWS_LIBS_DIR
"c:/libs"
CACHE STRING
"Default Library search dir on windows."
)
...
...
Doc/changelog.docu
View file @
8dc194e8
...
...
@@ -9,6 +9,28 @@
<tr valign=top><td><b>6.3</b> (?/?/?)</td><td>
<b>Core</b>
<ul>
<li>Fixed type pun warning with gcc-6</li>
<li>Fixed incorrect type of hash function for boost causing a warning with clang</li>
</ul>
<b>IO</b>
<ul>
<li>STL Reader: Identify stl files containing solid keyword as ASCII type</li>
</ul>
<b>General</b>
<ul>
<li>Fixed undefined MSVC macro warning (Thanks to Xan for the patch)</li>
</ul>
<b>Build System</b>
<ul>
<li>Removed unnecessary include dir from Core Cmakelist (Thanks to Xan for the patch)</li>
</ul>
</tr>
<tr valign=top><td><b>6.2</b> (2016/07/11)</td><td>
...
...
src/OpenMesh/Apps/Decimating/DecimaterViewerWidget.hh
View file @
8dc194e8
...
...
@@ -114,7 +114,7 @@ public:
typedef
Decimater
::
ModNormalFlippingT
<
mesh_t
>::
Handle
mod_nf_t
;
// object types
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
typedef
std
::
unique_ptr
<
decimater_t
>
decimater_o
;
#else
typedef
std
::
auto_ptr
<
decimater_t
>
decimater_o
;
...
...
src/OpenMesh/Apps/Unsupported/OsgViewer/osgviewer.cc
View file @
8dc194e8
...
...
@@ -131,7 +131,7 @@ public:
bool
bind
(
osg
::
GeometryPtr
geo
)
{
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
std
::
unique_ptr
<
mesh_t
>
obj
(
new
mesh_t
);
#else
std
::
auto_ptr
<
mesh_t
>
obj
(
new
mesh_t
);
...
...
src/OpenMesh/Apps/VDProgMesh/Analyzer/vdpmanalyzer.cc
View file @
8dc194e8
...
...
@@ -851,7 +851,7 @@ compute_screen_space_error(VHierarchyNodeHandle node_handle, VHierarchyNodeHandl
Vec3f
residual
;
Vec3f
res
;
Vec3f
lp
;
#if (
_MSC_VER >= 1900
)
#if (
(defined(_MSC_VER) && (_MSC_VER >= 1900))
)
// Workaround for internal compiler error
Vec3f
tri
[
3
]{
{},{},{}
};
#else
...
...
src/OpenMesh/Core/CMakeLists.txt
View file @
8dc194e8
...
...
@@ -3,7 +3,6 @@ include (ACGCommon)
include_directories
(
../..
${
CMAKE_CURRENT_SOURCE_DIR
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
# source code directories
...
...
src/OpenMesh/Core/Geometry/Vector11T.hh
View file @
8dc194e8
...
...
@@ -366,8 +366,8 @@ class VectorT {
template
<
typename
OtherScalar
>
auto
operator
%
(
const
VectorT
<
OtherScalar
,
DIM
>
&
_rhs
)
const
->
typename
std
::
enable_if
<
DIM
==
3
,
VectorT
<
decltype
(
this
->
values_
[
0
]
*
_rhs
[
0
]
-
this
->
values_
[
0
]
*
_rhs
[
0
]),
VectorT
<
decltype
(
(
*
this
)
[
0
]
*
_rhs
[
0
]
-
(
*
this
)
[
0
]
*
_rhs
[
0
]),
DIM
>>::
type
{
return
{
values_
[
1
]
*
_rhs
[
2
]
-
values_
[
2
]
*
_rhs
[
1
],
...
...
src/OpenMesh/Core/Geometry/VectorT.hh
View file @
8dc194e8
...
...
@@ -60,7 +60,7 @@
// macro expansion and preprocessor defines
// don't work properly.
#if (
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
#if (
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
#include "Vector11T.hh"
#else
#ifndef DOXYGEN
...
...
src/OpenMesh/Core/IO/reader/STLReader.cc
View file @
8dc194e8
...
...
@@ -55,12 +55,20 @@
#include <float.h>
#include <fstream>
#include <cstring>
// OpenMesh
#include <OpenMesh/Core/IO/BinaryHelper.hh>
#include <OpenMesh/Core/IO/reader/STLReader.hh>
#include <OpenMesh/Core/IO/IOManager.hh>
//comppare strings crossplatform ignorign case
#ifdef _WIN32
#define strnicmp _strnicmp
#else
#define strnicmp strncasecmp
#endif
//=== NAMESPACES ==============================================================
...
...
@@ -447,41 +455,62 @@ _STLReader_::STL_Type
_STLReader_
::
check_stl_type
(
const
std
::
string
&
_filename
)
const
{
// assume it's binary stl, then file size is known from #triangles
// if size matches, it's really binary
// open file
FILE
*
in
=
fopen
(
_filename
.
c_str
(),
"rb"
);
if
(
!
in
)
return
NONE
;
// determine endian mode
union
{
unsigned
int
i
;
unsigned
char
c
[
4
];
}
endian_test
;
endian_test
.
i
=
1
;
bool
swapFlag
=
(
endian_test
.
c
[
3
]
==
1
);
// read number of triangles
char
dummy
[
100
];
fread
(
dummy
,
1
,
80
,
in
);
size_t
nT
=
read_int
(
in
,
swapFlag
);
// compute file size from nT
size_t
binary_size
=
84
+
nT
*
50
;
// get actual file size
size_t
file_size
(
0
);
rewind
(
in
);
while
(
!
feof
(
in
))
file_size
+=
fread
(
dummy
,
1
,
100
,
in
);
fclose
(
in
);
// if sizes match -> it's STLB
return
(
binary_size
==
file_size
?
STLB
:
STLA
);
// open file
std
::
ifstream
ifs
(
_filename
.
c_str
(),
std
::
ifstream
::
binary
);
if
(
!
ifs
.
good
())
{
omerr
()
<<
"could not open file"
<<
_filename
<<
std
::
endl
;
return
NONE
;
}
//find first non whitespace character
std
::
string
line
=
""
;
std
::
size_t
firstChar
;
while
(
line
.
empty
()
&&
ifs
.
good
())
{
std
::
getline
(
ifs
,
line
);
firstChar
=
line
.
find_first_not_of
(
"
\t
"
);
}
//check for ascii keyword solid
if
(
strnicmp
(
"solid"
,
&
line
[
firstChar
],
5
)
==
0
)
{
return
STLA
;
}
ifs
.
close
();
//if the file does not start with solid it is probably STLB
//check the file size to verify it.
//open the file
FILE
*
in
=
fopen
(
_filename
.
c_str
(),
"rb"
);
if
(
!
in
)
return
NONE
;
// determine endian mode
union
{
unsigned
int
i
;
unsigned
char
c
[
4
];
}
endian_test
;
endian_test
.
i
=
1
;
bool
swapFlag
=
(
endian_test
.
c
[
3
]
==
1
);
// read number of triangles
char
dummy
[
100
];
fread
(
dummy
,
1
,
80
,
in
);
size_t
nT
=
read_int
(
in
,
swapFlag
);
// compute file size from nT
size_t
binary_size
=
84
+
nT
*
50
;
// get actual file size
size_t
file_size
(
0
);
rewind
(
in
);
while
(
!
feof
(
in
))
file_size
+=
fread
(
dummy
,
1
,
100
,
in
);
fclose
(
in
);
// if sizes match -> it's STLB
return
(
binary_size
==
file_size
?
STLB
:
NONE
);
}
...
...
src/OpenMesh/Core/Mesh/IteratorsT.hh
View file @
8dc194e8
...
...
@@ -170,7 +170,7 @@ class GenericIteratorT {
return
cpy
;
}
#if (
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
#if (
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
template
<
class
T
=
value_handle
>
auto
operator
+=
(
int
amount
)
->
typename
std
::
enable_if
<
...
...
src/OpenMesh/Core/System/config.h
View file @
8dc194e8
...
...
@@ -102,7 +102,7 @@
typedef
unsigned
int
uint
;
#if (
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__))
#if (
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__))
#define OM_HAS_HASH
#endif
...
...
src/OpenMesh/Core/System/mostream.hh
View file @
8dc194e8
...
...
@@ -70,7 +70,7 @@
#include <string>
#include <algorithm>
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
#include <mutex>
#endif
...
...
@@ -189,7 +189,7 @@ protected:
virtual
int
sync
()
{
// If working on multiple threads, we need to serialize the output correctly (requires c++11 headers)
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
std
::
lock_guard
<
std
::
mutex
>
lck
(
serializer_
);
#endif
...
...
@@ -214,7 +214,7 @@ protected:
char
c
=
traits_type
::
to_char_type
(
_c
);
// If working on multiple threads, we need to serialize the output correctly (requires c++11 headers)
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
{
std
::
lock_guard
<
std
::
mutex
>
lck
(
serializer_
);
buffer_
.
push_back
(
c
);
...
...
@@ -264,7 +264,7 @@ private:
bool
enabled_
;
// If working on multiple threads, we need to serialize the output correctly (requires c++11 headers)
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
std
::
mutex
serializer_
;
#endif
...
...
src/OpenMesh/Core/Utils/PropertyContainer.hh
View file @
8dc194e8
...
...
@@ -204,7 +204,7 @@ public:
* In C++11 an beyond we can introduce more efficient and more legible
* implementations of the following methods.
*/
#if (
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
#if (
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && !defined(OPENMESH_VECTOR_LEGACY)
/**
* Reserves space for \p _n elements in all property vectors.
*/
...
...
src/OpenMesh/Core/Utils/PropertyManager.hh
View file @
8dc194e8
...
...
@@ -92,7 +92,7 @@ namespace OpenMesh {
*/
template
<
typename
PROPTYPE
,
typename
MeshT
>
class
PropertyManager
{
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
public:
PropertyManager
(
const
PropertyManager
&
)
=
delete
;
PropertyManager
&
operator
=
(
const
PropertyManager
&
)
=
delete
;
...
...
@@ -167,7 +167,7 @@ class PropertyManager {
MeshT
&
getMesh
()
const
{
return
*
mesh_
;
}
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
/// Only for pre C++11 compatibility.
typedef
PropertyManager
<
PROPTYPE
,
MeshT
>
Proxy
;
...
...
@@ -208,6 +208,42 @@ class PropertyManager {
return
std
::
move
(
pm
);
}
/**
* Like createIfNotExists() with two parameters except, if the property
* doesn't exist, it is initialized with the supplied value over
* the supplied range after creation. If the property already exists,
* this method has the exact same effect as the two parameter version.
* Lifecycle management is disabled in any case.
*
* @see makePropertyManagerFromExistingOrNew
*/
template
<
typename
PROP_VALUE
,
typename
ITERATOR_TYPE
>
static
PropertyManager
createIfNotExists
(
MeshT
&
mesh
,
const
char
*
propname
,
const
ITERATOR_TYPE
&
begin
,
const
ITERATOR_TYPE
&
end
,
const
PROP_VALUE
&
init_value
)
{
const
bool
exists
=
propertyExists
(
mesh
,
propname
);
PropertyManager
pm
(
mesh
,
propname
,
exists
);
pm
.
retain
();
if
(
!
exists
)
pm
.
set_range
(
begin
,
end
,
init_value
);
return
std
::
move
(
pm
);
}
/**
* Like createIfNotExists() with two parameters except, if the property
* doesn't exist, it is initialized with the supplied value over
* the supplied range after creation. If the property already exists,
* this method has the exact same effect as the two parameter version.
* Lifecycle management is disabled in any case.
*
* @see makePropertyManagerFromExistingOrNew
*/
template
<
typename
PROP_VALUE
,
typename
ITERATOR_RANGE
>
static
PropertyManager
createIfNotExists
(
MeshT
&
mesh
,
const
char
*
propname
,
const
ITERATOR_RANGE
&
range
,
const
PROP_VALUE
&
init_value
)
{
return
createIfNotExists
(
mesh
,
propname
,
range
.
begin
(),
range
.
end
(),
init_value
);
}
PropertyManager
duplicate
(
const
char
*
clone_name
)
{
PropertyManager
pm
(
*
mesh_
,
clone_name
,
false
);
...
...
@@ -267,6 +303,27 @@ class PropertyManager {
return
(
Proxy
)
pm
;
}
/**
* Like createIfNotExists() with two parameters except, if the property
* doesn't exist, it is initialized with the supplied value over
* the supplied range after creation. If the property already exists,
* this method has the exact same effect as the two parameter version.
* Lifecycle management is disabled in any case.
*
* @see makePropertyManagerFromExistingOrNew
*/
template
<
typename
PROP_VALUE
,
typename
ITERATOR_TYPE
>
static
Proxy
createIfNotExists
(
MeshT
&
mesh
,
const
char
*
propname
,
const
ITERATOR_TYPE
&
begin
,
const
ITERATOR_TYPE
&
end
,
const
PROP_VALUE
&
init_value
)
{
const
bool
exists
=
propertyExists
(
mesh
,
propname
);
PropertyManager
pm
(
mesh
,
propname
,
exists
);
pm
.
retain
();
if
(
!
exists
)
pm
.
set_range
(
begin
,
end
,
init_value
);
return
(
Proxy
)
pm
;
}
Proxy
duplicate
(
const
char
*
clone_name
)
{
PropertyManager
pm
(
*
mesh_
,
clone_name
,
false
);
pm
.
mesh_
->
property
(
pm
.
prop_
)
=
mesh_
->
property
(
prop_
);
...
...
@@ -353,6 +410,14 @@ class PropertyManager {
(
*
this
)[
*
begin
]
=
value
;
}
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
template
<
typename
HandleTypeIteratorRange
,
typename
PROP_VALUE
>
void
set_range
(
const
HandleTypeIteratorRange
&
range
,
const
PROP_VALUE
&
value
)
{
set_range
(
range
.
begin
(),
range
.
end
(),
value
);
}
#endif
/**
* Conveniently transfer the values managed by one property manager
* onto the values managed by a different property manager.
...
...
@@ -466,5 +531,47 @@ PropertyManager<PROPTYPE, MeshT> makePropertyManagerFromExistingOrNew(MeshT &mes
return
PropertyManager
<
PROPTYPE
,
MeshT
>::
createIfNotExists
(
mesh
,
propname
);
}
/** \relates PropertyManager
* Like the two parameter version of makePropertyManagerFromExistingOrNew()
* except it initializes the property with the specified value over the
* specified range if it needs to be created. If the property already exists,
* this function has the exact same effect as the two parameter version.
*
* Creates a non-owning wrapper for a mesh property (no lifecycle management).
* If the given property does not exist, it is created.
*
* Intended for creating or accessing persistent properties.
*/
template
<
typename
PROPTYPE
,
typename
MeshT
,
typename
ITERATOR_TYPE
,
typename
PROP_VALUE
>
PropertyManager
<
PROPTYPE
,
MeshT
>
makePropertyManagerFromExistingOrNew
(
MeshT
&
mesh
,
const
char
*
propname
,
const
ITERATOR_TYPE
&
begin
,
const
ITERATOR_TYPE
&
end
,
const
PROP_VALUE
&
init_value
)
{
return
PropertyManager
<
PROPTYPE
,
MeshT
>::
createIfNotExists
(
mesh
,
propname
,
begin
,
end
,
init_value
);
}
/** \relates PropertyManager
* Like the two parameter version of makePropertyManagerFromExistingOrNew()
* except it initializes the property with the specified value over the
* specified range if it needs to be created. If the property already exists,
* this function has the exact same effect as the two parameter version.
*
* Creates a non-owning wrapper for a mesh property (no lifecycle management).
* If the given property does not exist, it is created.
*
* Intended for creating or accessing persistent properties.
*/
template
<
typename
PROPTYPE
,
typename
MeshT
,
typename
ITERATOR_RANGE
,
typename
PROP_VALUE
>
PropertyManager
<
PROPTYPE
,
MeshT
>
makePropertyManagerFromExistingOrNew
(
MeshT
&
mesh
,
const
char
*
propname
,
const
ITERATOR_RANGE
&
range
,
const
PROP_VALUE
&
init_value
)
{
return
makePropertyManagerFromExistingOrNew
<
PROPTYPE
,
MeshT
>
(
mesh
,
propname
,
range
.
begin
(),
range
.
end
(),
init_value
);
}
}
/* namespace OpenMesh */
#endif
/* PROPERTYMANAGER_HH_ */
src/OpenMesh/Tools/Decimater/DecimaterT.cc
View file @
8dc194e8
...
...
@@ -78,7 +78,7 @@ template<class Mesh>
DecimaterT
<
Mesh
>::
DecimaterT
(
Mesh
&
_mesh
)
:
BaseDecimaterT
<
Mesh
>
(
_mesh
),
mesh_
(
_mesh
),
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
heap_
(
nullptr
)
#else
heap_
(
NULL
)
...
...
@@ -178,7 +178,7 @@ size_t DecimaterT<Mesh>::decimate(size_t _n_collapses) {
// initialize heap
HeapInterface
HI
(
mesh_
,
priority_
,
heap_position_
);
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
heap_
=
std
::
unique_ptr
<
DeciHeap
>
(
new
DeciHeap
(
HI
));
#else
heap_
=
std
::
auto_ptr
<
DeciHeap
>
(
new
DeciHeap
(
HI
));
...
...
@@ -282,7 +282,7 @@ size_t DecimaterT<Mesh>::decimate_to_faces(size_t _nv, size_t _nf) {
// initialize heap
HeapInterface
HI
(
mesh_
,
priority_
,
heap_position_
);
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
heap_
=
std
::
unique_ptr
<
DeciHeap
>
(
new
DeciHeap
(
HI
));
#else
heap_
=
std
::
auto_ptr
<
DeciHeap
>
(
new
DeciHeap
(
HI
));
...
...
src/OpenMesh/Tools/Decimater/DecimaterT.hh
View file @
8dc194e8
...
...
@@ -195,7 +195,7 @@ private: //------------------------------------------------------- private data
Mesh
&
mesh_
;
// heap
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined( __GXX_EXPERIMENTAL_CXX0X__ )
std
::
unique_ptr
<
DeciHeap
>
heap_
;
#else
std
::
auto_ptr
<
DeciHeap
>
heap_
;
...
...
src/OpenMesh/Tools/Utils/HeapT.hh
View file @
8dc194e8
...
...
@@ -79,7 +79,7 @@
#include "Config.hh"
#include <vector>
#include <OpenMesh/Core/System/omstream.hh>
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
#include <utility>
#endif
...
...
@@ -150,7 +150,7 @@ public:
/// Constructor
HeapT
()
:
HeapVector
()
{}
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
/// Construct with a given \c HeapIterface.
HeapT
(
HeapInterface
_interface
)
:
HeapVector
(),
interface_
(
std
::
move
(
_interface
))
...
...
src/OpenMesh/Tools/VDPM/ViewingParameters.cc
View file @
8dc194e8
...
...
@@ -92,7 +92,7 @@ update_viewing_configurations()
Vec3f
trans
;
// Workaround for internal compiler error on Visual Studio 2015 Update 1
#if (
_MSC_VER >= 1900
)
#if (
(defined(_MSC_VER) && (_MSC_VER >= 1900))
)
Vec3f
inv_rot
[
3
]{
{},{},{}
};
Vec3f
normal
[
4
]{
{},{},{},{}
};
#else
...
...
src/Python/Vector.hh
View file @
8dc194e8
...
...
@@ -190,4 +190,4 @@ void expose_vec(const char *_name) {
}
// namespace OpenMesh
}
// namespace Python
#endif
#endif
\ No newline at end of file
src/Unittests/unittests_cpp_11_features.cc
View file @
8dc194e8
...
...
@@ -53,7 +53,7 @@ class OpenMesh_Triangle : public OpenMeshBase {
* ====================================================================
*/
#if
_MSC_VER >= 1900
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
#if
(defined(_MSC_VER) && (_MSC_VER >= 1900))
|| __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
/*
*/
...
...
src/Unittests/unittests_propertymanager.cc
View file @
8dc194e8
...
...
@@ -60,36 +60,76 @@ TEST_F(OpenMeshPropertyManager, set_range_bool) {
face_vhandles
.
push_back
(
vhandle
[
3
]);
mesh_
.
add_face
(
face_vhandles
);
OpenMesh
::
PropertyManager
<
OpenMesh
::
VPropHandleT
<
bool
>
,
Mesh
>
pm_v_bool
(
mesh_
,
"pm_v_bool"
);
pm_v_bool
.
set_range
(
mesh_
.
vertices_begin
(),
mesh_
.
vertices_end
(),
false
);
for
(
int
i
=
0
;
i
<
4
;
++
i
)
ASSERT_FALSE
(
pm_v_bool
[
vhandle
[
i
]]);
pm_v_bool
.
set_range
(
mesh_
.
vertices_begin
(),
mesh_
.
vertices_end
(),
true
);
for
(
int
i
=
0
;
i
<
4
;
++
i
)
ASSERT_TRUE
(
pm_v_bool
[
vhandle
[
i
]]);
OpenMesh
::
PropertyManager
<
OpenMesh
::
EPropHandleT
<
bool
>
,
Mesh
>
pm_e_bool
(
mesh_
,
"pm_e_bool"
);
pm_e_bool
.
set_range
(
mesh_
.
edges_begin
(),
mesh_
.
edges_end
(),
false
);
for
(
Mesh
::
EdgeIter
e_it
=
mesh_
.
edges_begin
(),
f_end
=
mesh_
.
edges_end
();
e_it
!=
f_end
;
++
e_it
)
ASSERT_FALSE
(
pm_e_bool
[
*
e_it
]);
pm_e_bool
.
set_range
(
mesh_
.
edges_begin
(),
mesh_
.
edges_end
(),
true
);
for
(
Mesh
::
EdgeIter
e_it
=
mesh_
.
edges_begin
(),
f_end
=
mesh_
.
edges_end
();
e_it
!=
f_end
;
++
e_it
)
ASSERT_TRUE
(
pm_e_bool
[
*
e_it
]);
OpenMesh
::
PropertyManager
<
OpenMesh
::
FPropHandleT
<
bool
>
,
Mesh
>
pm_f_bool
(
mesh_
,
"pm_f_bool"
);
pm_f_bool
.
set_range
(
mesh_
.
faces_begin
(),
mesh_
.
faces_end
(),
false
);
for
(
Mesh
::
FaceIter
f_it
=
mesh_
.
faces_begin
(),
f_end
=
mesh_
.
faces_end
();
f_it
!=
f_end
;
++
f_it
)
ASSERT_FALSE
(
pm_f_bool
[
*
f_it
]);
pm_f_bool
.
set_range
(
mesh_
.
faces_begin
(),
mesh_
.
faces_end
(),
true
);
for
(
Mesh
::
FaceIter
f_it
=
mesh_
.
faces_begin
(),
f_end
=
mesh_
.
faces_end
();
f_it
!=
f_end
;
++
f_it
)
ASSERT_TRUE
(
pm_f_bool
[
*
f_it
]);
{
OpenMesh
::
PropertyManager
<
OpenMesh
::
VPropHandleT
<
bool
>
,
Mesh
>
pm_v_bool
(
mesh_
,
"pm_v_bool"
);
pm_v_bool
.
set_range
(
mesh_
.
vertices_begin
(),
mesh_
.
vertices_end
(),
false
);
for
(
int
i
=
0
;
i
<
4
;
++
i
)
ASSERT_FALSE
(
pm_v_bool
[
vhandle
[
i
]]);
pm_v_bool
.
set_range
(
mesh_
.
vertices_begin
(),
mesh_
.
vertices_end
(),
true
);
for
(
int
i
=
0
;
i
<
4
;
++
i
)
ASSERT_TRUE
(
pm_v_bool
[
vhandle
[
i
]]);
OpenMesh
::
PropertyManager
<
OpenMesh
::
EPropHandleT
<
bool
>
,
Mesh
>
pm_e_bool
(
mesh_
,
"pm_e_bool"
);
pm_e_bool
.
set_range
(
mesh_
.
edges_begin
(),
mesh_
.
edges_end
(),
false
);
for
(
Mesh
::
EdgeIter
e_it
=
mesh_
.
edges_begin
(),
f_end
=
mesh_
.
edges_end
();
e_it
!=
f_end
;
++
e_it
)
ASSERT_FALSE
(
pm_e_bool
[
*
e_it
]);
pm_e_bool
.
set_range
(
mesh_
.
edges_begin
(),
mesh_
.
edges_end
(),
true
);
for
(
Mesh
::
EdgeIter
e_it
=
mesh_
.
edges_begin
(),
f_end
=
mesh_
.
edges_end
();
e_it
!=
f_end
;
++
e_it
)
ASSERT_TRUE
(
pm_e_bool
[
*
e_it
]);
OpenMesh
::
PropertyManager
<
OpenMesh
::
FPropHandleT
<
bool
>
,
Mesh
>
pm_f_bool
(
mesh_
,
"pm_f_bool"
);
pm_f_bool
.
set_range
(
mesh_
.
faces_begin
(),
mesh_
.
faces_end
(),
false
);
for
(
Mesh
::
FaceIter
f_it
=
mesh_
.
faces_begin
(),
f_end
=
mesh_
.
faces_end
();
f_it
!=
f_end
;
++
f_it
)
ASSERT_FALSE
(
pm_f_bool
[
*
f_it
]);
pm_f_bool
.
set_range
(
mesh_
.
faces_begin
(),
mesh_
.
faces_end
(),
true
);
for
(
Mesh
::
FaceIter
f_it
=
mesh_
.
faces_begin
(),
f_end
=
mesh_
.
faces_end
();
f_it
!=
f_end
;
++
f_it
)
ASSERT_TRUE
(
pm_f_bool
[
*
f_it
]);
}
#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
/*
* Same thing again, this time with C++11 ranges.
*/
{
OpenMesh
::
PropertyManager
<
OpenMesh
::
VPropHandleT
<
bool
>
,
Mesh
>
pm_v_bool
(
mesh_
,
"pm_v_bool2"
);
pm_v_bool
.
set_range
(
mesh_
.
vertices
(),
false
);
for
(
int
i
=
0
;
i
<
4
;
++
i
)
ASSERT_FALSE
(
pm_v_bool
[
vhandle
[
i
]]);
pm_v_bool
.
set_range
(
mesh_
.
vertices
(),
true
);
for
(
int
i
=
0
;
i
<
4
;
++
i
)
ASSERT_TRUE
(
pm_v_bool
[
vhandle
[
i
]]);
OpenMesh
::
PropertyManager
<
OpenMesh
::
EPropHandleT
<
bool
>
,
Mesh
>
pm_e_bool
(
mesh_
,
"pm_e_bool2"
);
pm_e_bool
.
set_range
(
mesh_
.
edges
(),
false
);
for
(
Mesh
::
EdgeIter
e_it
=
mesh_
.
edges_begin
(),
f_end
=
mesh_
.
edges_end
();
e_it
!=
f_end
;
++
e_it
)
ASSERT_FALSE
(
pm_e_bool
[
*
e_it
]);
pm_e_bool
.
set_range
(
mesh_
.
edges
(),
true
);
for
(
Mesh
::
EdgeIter
e_it
=
mesh_
.
edges_begin
(),
f_end
=
mesh_
.
edges_end
();
e_it
!=
f_end
;
++
e_it
)
ASSERT_TRUE
(
pm_e_bool
[
*
e_it
]);
OpenMesh
::
PropertyManager
<
OpenMesh
::
FPropHandleT
<
bool
>
,
Mesh
>
pm_f_bool
(
mesh_
,
"pm_f_bool2"
);
pm_f_bool
.
set_range
(
mesh_
.
faces
(),
false
);
for
(
Mesh
::
FaceIter
f_it
=
mesh_
.
faces_begin
(),
f_end
=
mesh_
.
faces_end
();
f_it
!=
f_end
;
++
f_it
)
ASSERT_FALSE
(
pm_f_bool
[
*
f_it
]);
pm_f_bool
.
set_range
(
mesh_
.
faces
(),
true
);