Commit ea6f2de6 authored by Jan Möbius's avatar Jan Möbius

Moved ACG into subdir

parent 03b2c067
......@@ -3,6 +3,7 @@ include (ACGCommon)
include_directories (
..
${OPENMESH_INCLUDE_DIRS}
${ACG_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
......
......@@ -37,6 +37,7 @@ file (
include_directories (
..
${PACKAGE_DIRS}
${ACG_INCLUDE_DIR}
${OPENMESH_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
......
......@@ -18,6 +18,7 @@ FIND_PATH(ACG_INCLUDE_DIR ACG/QtWidgets/QtBaseViewer.hh
PATHS /usr/local/include
/usr/include
"${CMAKE_SOURCE_DIR}/"
"${CMAKE_SOURCE_DIR}/OpenFlipper/libs_required/"
"${CMAKE_SOURCE_DIR}/../"
/ACG/acgdev/gcc-4.3-x86_64/OM2/ACG-2.0/include
)
......
......@@ -55,6 +55,7 @@ IF (NOT OPENMESH_FOUND)
/usr/
"${CMAKE_SOURCE_DIR}/OpenMesh/src/OpenMesh"
"${CMAKE_SOURCE_DIR}/libs_required/OpenMesh/src/OpenMesh"
"${CMAKE_SOURCE_DIR}/OpenFlipper/libs_required/OpenMesh/src/OpenMesh"
"${CMAKE_SOURCE_DIR}/../OpenMesh/src/OpenMesh"
"C:/Program Files/OpenMesh 3.2"
"C:/Program Files/OpenMesh 3.1"
......
......@@ -480,6 +480,7 @@ function (_build_openflipper_plugin plugin)
.
${PACKAGE_DIRS}
${CMAKE_SOURCE_DIR}
${ACG_INCLUDE_DIR}
${OPENMESH_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
......
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
Library()
glew()
glut()
openmesh()
contains( OPENFLIPPER , OpenFlipper ){
ftgl()
message(ACG Library is Building for OpenFlipper )
}
DIRECTORIES = . Geometry Config/ Geometry/Types GL Glut IO Math QtWidgets Scenegraph QtScenegraph ShaderUtils Utils
win32 {
DEFINES += _USE_MATH_DEFINES NOMINMAX INCLUDE_TEMPLATES
# CONFIG += static
DEFINES += ACGDLL
contains( OPENFLIPPER , OpenFlipper ){
DESTDIR = $${TOPDIR}/OpenFlipper/$${BUILDDIRECTORY}
}
}
macx {
QMAKE_LFLAGS_SONAME = -install_name$${LITERAL_WHITESPACE}$${TOPDIR}/ACG/lib/$${BUILDDIRECTORY}/
export( QMAKE_LFLAGS_SONAME )
}
# Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
installs()
################################################################################
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenMesh_Core", "..\..\OpenMesh\Core\OpenMesh_Core.vcproj", "{ED38FC0A-3C42-4D41-B234-B2912430DE52}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenMesh_Tools", "..\..\OpenMesh\Tools\OpenMesh_Tools.vcproj", "{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}"
ProjectSection(ProjectDependencies) = postProject
{ED38FC0A-3C42-4D41-B234-B2912430DE52} = {ED38FC0A-3C42-4D41-B234-B2912430DE52}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ACG_VC2005", "ACG_VC2005\ACG_VC2005.vcproj", "{C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC}"
ProjectSection(ProjectDependencies) = postProject
{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C} = {682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}
{ED38FC0A-3C42-4D41-B234-B2912430DE52} = {ED38FC0A-3C42-4D41-B234-B2912430DE52}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MVIEW", "MVIEW\MVIEW.vcproj", "{F3285AAB-E8C1-40B6-BC57-C0D46F18BBE1}"
ProjectSection(ProjectDependencies) = postProject
{ED38FC0A-3C42-4D41-B234-B2912430DE52} = {ED38FC0A-3C42-4D41-B234-B2912430DE52}
{C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC} = {C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC}
{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C} = {682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ED38FC0A-3C42-4D41-B234-B2912430DE52}.Debug|Win32.ActiveCfg = Debug|Win32
{ED38FC0A-3C42-4D41-B234-B2912430DE52}.Debug|Win32.Build.0 = Debug|Win32
{ED38FC0A-3C42-4D41-B234-B2912430DE52}.Release|Win32.ActiveCfg = Release|Win32
{ED38FC0A-3C42-4D41-B234-B2912430DE52}.Release|Win32.Build.0 = Release|Win32
{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}.Debug|Win32.ActiveCfg = Debug|Win32
{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}.Debug|Win32.Build.0 = Debug|Win32
{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}.Release|Win32.ActiveCfg = Release|Win32
{682CF0FD-24AD-44AC-8438-A6BECD7ABE1C}.Release|Win32.Build.0 = Release|Win32
{C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC}.Debug|Win32.ActiveCfg = Debug|Win32
{C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC}.Debug|Win32.Build.0 = Debug|Win32
{C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC}.Release|Win32.ActiveCfg = Release|Win32
{C19056DB-9E3F-4D52-8D0E-0CEDD42B8DDC}.Release|Win32.Build.0 = Release|Win32
{F3285AAB-E8C1-40B6-BC57-C0D46F18BBE1}.Debug|Win32.ActiveCfg = Debug|Win32
{F3285AAB-E8C1-40B6-BC57-C0D46F18BBE1}.Debug|Win32.Build.0 = Debug|Win32
{F3285AAB-E8C1-40B6-BC57-C0D46F18BBE1}.Release|Win32.ActiveCfg = Release|Win32
{F3285AAB-E8C1-40B6-BC57-C0D46F18BBE1}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
This diff is collapsed.
========================================================================
STATIC LIBRARY : ACG_VC2008 Project Overview
========================================================================
AppWizard has created this ACG_VC2008 library project for you.
No source files were created as part of your project.
ACG_VC2008.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*
* DBSCAN.cc
*
* Created on: May 18, 2012
* Author: ebke
*/
#include <queue>
namespace ACG {
namespace Algorithm {
namespace _DBSCAN_PRIVATE {
template<typename VALUE_TYPE>
class constant_1 {
public:
inline double operator()(VALUE_TYPE it) const {
return 1.0;
}
};
template<typename INPUT_ITERATOR, typename WEIGHT_FUNC>
inline double neighborhoodWeight(INPUT_ITERATOR first, const INPUT_ITERATOR last, WEIGHT_FUNC &weight_func) {
double result = 0;
for (; first != last; ++first)
result += weight_func(**first);
return result;
}
/*
* Private functions.
*/
template<typename INPUT_ITERATOR, typename DISTANCE_FUNC, typename OUTPUT_ITERATOR>
inline
void region_query(INPUT_ITERATOR first, const INPUT_ITERATOR last, const INPUT_ITERATOR center,
DISTANCE_FUNC &distance_func, OUTPUT_ITERATOR result, const double epsilon) {
for (; first != last; ++first) {
if (center == first) continue;
if (distance_func(*center, *first) <= epsilon) {
*result++ = first;
}
}
}
template<typename INPUT_ITERATOR, typename DISTANCE_FUNC, typename WEIGHT_FUNC>
inline
void expand_cluster(INPUT_ITERATOR first, const INPUT_ITERATOR last, const INPUT_ITERATOR center,
DISTANCE_FUNC &distance_func, const double epsilon, const double n_min,
std::vector<int> &id_cache, const int current_cluster_id, WEIGHT_FUNC &weight_func) {
std::queue<INPUT_ITERATOR> bfq;
bfq.push(center);
id_cache[std::distance(first, center)] = current_cluster_id;
std::vector<INPUT_ITERATOR> neighborhood; neighborhood.reserve(std::distance(first, last));
while (!bfq.empty()) {
INPUT_ITERATOR current_element = bfq.front();
bfq.pop();
/*
* Precondition: id_cache[current_idx] > 0
*/
neighborhood.clear();
region_query(first, last, current_element, distance_func, std::back_inserter(neighborhood), epsilon);
/*
* If the current element is not inside a dense area,
* we don't use it as a seed to expand the cluster.
*/
if (neighborhoodWeight(neighborhood.begin(), neighborhood.end(), weight_func) < n_min)
continue;
/*
* Push yet unvisited elements onto the queue.
*/
for (typename std::vector<INPUT_ITERATOR>::iterator it = neighborhood.begin(), it_end = neighborhood.end();
it != it_end; ++it) {
const size_t neighbor_idx = std::distance(first, *it);
/*
* Is the element classified as non-noise, yet?
*/
if (id_cache[neighbor_idx] <= 0) {
/*
* Classify it and use it as a seed.
*/
id_cache[neighbor_idx] = current_cluster_id;
bfq.push(*it);
}
}
}
}
} /* namespace _DBSCAN_PRIVATE */
} /* namespace Algorithm */
} /* namespace ACG */
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*
* DBSCAN.hh
*
* Created on: May 18, 2012
* Author: ebke
*/
#ifndef DBSCAN_HH_
#define DBSCAN_HH_
#include <vector>
#include <iterator>
#include <algorithm>
/*
* Private functions.
*/
#include "DBSCANT.cc"
namespace ACG {
namespace Algorithm {
/**
* Implements the DBSCAN algorithm introduced in
*
* Ester, Martin, Hans-Peter Kriegel, Jörg S, and Xiaowei Xu. “A Density-based Algorithm for Discovering Clusters in Large Spatial Databases with Noise.” 226–231. AAAI Press, 1996.
*
* Classifies the sequence [first, last) into clusters. Outputs `int`s into the result sequence, one
* for each element in the input sequence. `0` means noise, values greater than 0 specify a cluster index.
*
* Returned cluster indices are guaranteed to be a continuous range starting at 1.
*
*
* Result has to support the operation `*result++ = <int>`.
*
* Example:
*
* std::vector<Point> points;
* std::vector<int> clusters;
* ...
* ACG::Algorithm::DBSCAN(points.begin(), points.end(), Point::DistanceFunc(),
* std::back_inserter(clusters), 4.0001, 3)
*
* @param Input iterator to the initial position of the data set.
* @param Input iterator to the final position of the data set.
* @param distance_func Binary function taking two elements as arguments. Returns the distance between these elements.
* @param result Output iterator to the initial position of the result range. The range includes as many elements as [first, last).
* @param epsilon The density-reachable neighborhood radius.
* @param n_min The density-reachable count threshold.
* @param weight_func Unary function taking an element as its argument. Returns the weight with which it is to be considered for DBSCAN.
* The off the shelf DBSCAN uses a constant 1, here.
* @return The number of clusters found.
*/
template<typename INPUT_ITERATOR, typename DISTANCE_FUNC, typename OUTPUT_ITERATOR, typename WEIGHT_FUNC>
int DBSCAN(const INPUT_ITERATOR first, const INPUT_ITERATOR last, DISTANCE_FUNC distance_func,
OUTPUT_ITERATOR result, const double epsilon, const double n_min, WEIGHT_FUNC weight_func) {
const size_t input_size = std::distance(first, last);
std::vector<int> id_cache(input_size, -1);
int idx = 0;
int current_cluster_id = 0;
for (INPUT_ITERATOR it = first; it != last; ++it, ++idx) {
// Visit every element only once.
if (id_cache[idx] >= 0) continue;
// Gather neighborhood.
std::vector<INPUT_ITERATOR> neighborhood; neighborhood.reserve(input_size);
_DBSCAN_PRIVATE::region_query(first, last, it, distance_func, std::back_inserter(neighborhood), epsilon);
if (_DBSCAN_PRIVATE::neighborhoodWeight(neighborhood.begin(), neighborhood.end(), weight_func) < n_min) {
// It's noise.
id_cache[idx] = 0;
} else {
// It's the seed of a cluster.
_DBSCAN_PRIVATE::expand_cluster(first, last, it, distance_func, epsilon, n_min, id_cache, ++current_cluster_id, weight_func);
}
}
std::copy(id_cache.begin(), id_cache.end(), result);
return current_cluster_id;
}
/**
* Version of DBSCAN with weight_func being a constant 1.
*/
template<typename INPUT_ITERATOR, typename DISTANCE_FUNC, typename OUTPUT_ITERATOR>
int DBSCAN(const INPUT_ITERATOR first, const INPUT_ITERATOR last, DISTANCE_FUNC distance_func,
OUTPUT_ITERATOR result, const double epsilon, const double n_min) {
return DBSCAN(first, last, distance_func, result, epsilon, n_min, typename _DBSCAN_PRIVATE::constant_1<typename INPUT_ITERATOR::value_type>());
}
} /* namespace Algorithm */
} /* namespace ACG */
#endif /* DBSCAN_HH_ */
include (ACGCommon)
acg_get_version ()
# Disable Library installation when not building ACG on its own but as part of another project!
if ( ${PROJECT_NAME} MATCHES "OpenFlipper")
set(ACG_NO_LIBRARY_INSTALL true)
endif()
acg_qt5 ()
if (NOT QT5_FOUND)
message(FATAL ERROR "Qt5 not found")
endif ()
acg_openmp ()
# check for OpenGL, GLEW and GLUT as our required dependencies
find_package (OpenGL)
if (NOT OPENGL_FOUND)
message (FATAL_ERROR "OpengGL not found!")
endif ()
find_package (GLEW)
if (NOT GLEW_FOUND)
message (FATAL_ERROR "GLEW not found!")
endif ()
find_package (GLUT)
if (NOT GLUT_FOUND)
message (FATAL_ERROR "GLUT not found!")
endif ()
find_package (OpenMesh)
if (NOT OPENMESH_FOUND)
message (FATAL_ERROR "OpenMesh not found!")
endif ()
set(INCLUDE_DIRS ${OPENMESH_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/ShaderUtils
${CMAKE_CURRENT_BINARY_DIR}
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIR}
${GLUT_INCLUDE_DIR} )
set(ADDITIONAL_LINK_LIBRARIES "" )
set(ADDITIONAL_BUILD_DIRS "" )
find_package (QJson)
if (QJSON_FOUND)
LIST(APPEND INCLUDE_DIRS ${QJSON_INCLUDE_DIR})
LIST(APPEND ADDITIONAL_LINK_LIBRARIES ${QJSON_LIBRARY})
endif ()
# use Qwt6 for QT5
if (QT5_FOUND)
find_package(Qwt6)
if (QWT6_FOUND)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${QWT6_INCLUDE_DIRS} )
set(ADDITIONAL_LINK_LIBRARIES ${ADDITIONAL_LINK_LIBRARIES} ${QWT6_LIBRARIES})
set(ADDITIONAL_BUILD_DIRS "QwtWidgets" )
endif()
endif()
include_directories (
..
${INCLUDE_DIRS}
)
link_directories (
${GLEW_LIBRARY_DIR}
${GLUT_LIBRARY_DIR}
)
#===================================================================
# ACG Library setup
#===================================================================
# source code directories
set (directories
.
Geometry
Config
Geometry/Types
Geometry/bsp
GL
Glut
IO
Math
QtWidgets
Scenegraph
QtScenegraph
ShaderUtils
Utils
${ADDITIONAL_BUILD_DIRS}
)
# generate dllexport macros on windows
if (WIN32)
add_definitions(-DACGDLL)
endif ()
# collect all header,source and ui files
acg_append_files (headers "*.hh" ${directories})
acg_append_files (sources "*.cc" ${directories})
acg_append_files (ui "*.ui" ${directories})
acg_append_files (qrc "*.qrc" ${directories} .)
# remove template cc files from source file list
acg_drop_templates (sources)
# genereate uic and moc targets
if (QT5_FOUND)
acg_qt5_autouic (uic_targets ${ui})
acg_qt5_automoc (moc_targets ${headers})
acg_qt5_autoqrc (qrc_targets ${qrc})
endif()
if (QT5_FOUND)
acg_add_library (ACG SHARED ${uic_targets} ${sources} ${headers} ${moc_targets} ${qrc_targets})
endif()
if ( NOT WIN32 )
set_target_properties (ACG PROPERTIES VERSION ${ACG_VERSION_MAJOR}.${ACG_VERSION_MINOR}
SOVERSION ${ACG_VERSION_MAJOR}.${ACG_VERSION_MINOR})
endif()
if (NOT ACG_PROJECT_MACOS_BUNDLE OR NOT APPLE)
install (TARGETS ACG DESTINATION ${ACG_PROJECT_LIBDIR})
endif ()
# display results
acg_print_configure_header (ACG "ACG")