Merge branch 'CustomProperties' of https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh into CustomProperties

This commit is contained in:
Alexandra Heuschling
2021-02-26 19:19:37 +01:00
33 changed files with 855 additions and 246 deletions

View File

@@ -25,7 +25,7 @@ vci_append_files (headers "*.hh" ${directories})
vci_append_files (sources "*.cc" ${directories})
# Disable Library installation when not building OpenMesh on its own but as part of another project!
if ( NOT ${PROJECT_NAME} MATCHES "OpenMesh")
if ( NOT ${CMAKE_PROJECT_NAME} MATCHES "OpenMesh")
set(VCI_NO_LIBRARY_INSTALL true)
endif()
@@ -42,8 +42,8 @@ if (WIN32)
else ()
vci_add_library (OpenMeshCore SHAREDANDSTATIC ${sources} ${headers})
set_target_properties (OpenMeshCore PROPERTIES VERSION ${OPENMESH_VERSION_MAJOR}.${OPENMESH_VERSION_MINOR}
SOVERSION ${OPENMESH_VERSION_MAJOR}.${OPENMESH_VERSION_MINOR} )
set_target_properties (OpenMeshCore PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} )
endif ()
if (MSVC)
@@ -51,7 +51,7 @@ if (MSVC)
endif ()
# Add core as dependency before fixbundle
if ( (${PROJECT_NAME} MATCHES "OpenMesh") AND BUILD_APPS )
if ( (${CMAKE_PROJECT_NAME} MATCHES "OpenMesh") AND BUILD_APPS )
if ( WIN32 )
if ( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" )
@@ -68,7 +68,7 @@ if ( (${PROJECT_NAME} MATCHES "OpenMesh") AND BUILD_APPS )
endif()
# if we build debug and release in the same dir, we want to install both!
if ( ${PROJECT_NAME} MATCHES "OpenMesh")
if ( ${CMAKE_PROJECT_NAME} MATCHES "OpenMesh")
if ( WIN32 )
FILE(GLOB files_install_libs "${CMAKE_BINARY_DIR}/Build/lib/*.lib" )
FILE(GLOB files_install_dlls "${CMAKE_BINARY_DIR}/Build/*.dll" )
@@ -104,7 +104,13 @@ endif()
# Only install if the project name matches OpenMesh.
if (NOT APPLE AND ${PROJECT_NAME} MATCHES "OpenMesh")
if (${CMAKE_PROJECT_NAME} MATCHES "OpenMesh")
set (OPENMESH_NO_INSTALL_HEADERS FALSE CACHE BOOL "Should OpenMesh skip installing headers?")
else()
set (OPENMESH_NO_INSTALL_HEADERS TRUE CACHE BOOL "Should OpenMesh skip installing headers?")
endif()
if (NOT APPLE AND NOT ${OPENMESH_NO_INSTALL_HEADERS})
# Install Header Files)
install(DIRECTORY .

View File

@@ -304,6 +304,14 @@ PolyConnectivity::add_face(const VertexHandle* _vertex_handles, size_t _vhs_size
SmartFaceHandle PolyConnectivity::add_face(VertexHandle _vh0, VertexHandle _vh1, VertexHandle _vh2, VertexHandle _vh3)
{
// Check if we have been given a degenerate configuration (2 vertices are identical)
assert(_vh0!=_vh1);
assert(_vh0!=_vh2);
assert(_vh1!=_vh2);
assert(_vh0!=_vh3);
assert(_vh1!=_vh3);
assert(_vh2!=_vh3);
VertexHandle vhs[4] = { _vh0, _vh1, _vh2, _vh3 };
return add_face(vhs, 4);
}
@@ -312,6 +320,11 @@ SmartFaceHandle PolyConnectivity::add_face(VertexHandle _vh0, VertexHandle _vh1,
SmartFaceHandle PolyConnectivity::add_face(VertexHandle _vh0, VertexHandle _vh1, VertexHandle _vh2)
{
// Check if we have been given a degenerate configuration (2 vertices are identical)
assert(_vh0!=_vh1);
assert(_vh0!=_vh2);
assert(_vh1!=_vh2);
VertexHandle vhs[3] = { _vh0, _vh1, _vh2 };
return add_face(vhs, 3);
}

View File

@@ -205,6 +205,10 @@ public:
* \brief Adds a new vertex initialized to a custom position.
*
* \sa new_vertex(), new_vertex_dirty()
*
* \attention Be careful to not use a reference to a point in the mesh itself here.
* as a resize of the underlying vector might invalidate this reference
* and cause a segfault.
*/
inline SmartVertexHandle new_vertex(const Point& _p)
{
@@ -231,7 +235,13 @@ public:
return make_smart(vh, this);
}
/// Alias for new_vertex(const Point&).
/** Alias for new_vertex(const Point&).
*
* \attention Be careful to not use a reference to a point in the mesh itself here.
* as a resize of the underlying vector might invalidate this reference
* and cause a segfault.
*
*/
inline SmartVertexHandle add_vertex(const Point& _p)
{ return new_vertex(_p); }