Merge branch 'master' into remove_compile_order_check

This commit is contained in:
Jan Möbius
2020-06-24 09:28:35 +02:00
491 changed files with 39363 additions and 17798 deletions

View File

@@ -39,29 +39,18 @@ if ( BUILD_APPS )
# find needed packages for gui applications
find_package (OpenGL)
find_package (GLUT)
# try to use QT5 if possible otherwise stick to QT4
set (FORCE_QT4 OFF CACHE BOOL "Use Qt4 even if Qt5 was found")
# For the apps, we need qt and opengl to build them
if (NOT QT5_FOUND AND NOT FORCE_QT4)
if (NOT QT5_FOUND)
acg_qt5 ()
endif()
if (NOT QT5_FOUND AND NOT QT4_FOUND)
find_package (Qt4 COMPONENTS QtCore QtGui )
set (QT_USE_QTOPENGL 1)
include (${QT_USE_FILE})
endif ()
if ("${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles")
message(WARNING "GUI Apps are not build with mingw. (TODO)")
endif()
# check for OpenGL and GLUT as our required dependencies
if ((QT5_FOUND OR QT4_FOUND) AND OPENGL_FOUND AND GLUT_FOUND AND NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" )
# check for OpenGL as our required dependencies
if (( QT5_FOUND ) AND OPENGL_FOUND AND NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" )
add_subdirectory (Decimating/DecimaterGui)
add_subdirectory (QtViewer)
@@ -99,18 +88,14 @@ if ( BUILD_APPS )
else () # QT ,Opengl or glut not found
if (NOT QT4_FOUND AND NOT QT5_FOUND)
message ("QT 4 and 5 not found! Skipping some apps.")
if (NOT QT5_FOUND)
message ("QT5 not found! Skipping some apps.")
endif ()
if (NOT OPENGL_FOUND)
message ("OpengGL not found! Skipping some apps.")
endif ()
if (NOT GLUT_FOUND)
message ("GLUT not found! Skipping some apps.")
endif ()
endif ()
endif() # Project is OpenMesh standalone

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef CMDOPTION
#define CMDOPTION
@@ -56,7 +51,7 @@ public:
typedef T value_type;
CmdOption(const T& _val) : val_(_val), valid_(true), enabled_(false) { }
explicit CmdOption(const T& _val) : val_(_val), valid_(true), enabled_(false) { }
CmdOption() : val_(T()),valid_(false), enabled_(false) { }
// has been set and has a value
@@ -79,7 +74,7 @@ public:
operator T () const { return val_; }
// operator const T& () const { return val_; }
operator T* () const { return is_valid() ? &val_ : NULL; }
operator T* () const { return is_valid() ? &val_ : nullptr; }
private:

View File

@@ -1,54 +1,35 @@
include (ACGCommon)
include_directories (
../../../..
${CMAKE_CURRENT_SOURCE_DIR}
${GLUT_INCLUDE_DIR}
${QT_INCLUDE_DIR}
)
set (targetName DecimaterGui)
# source code directories
set (directories
../../QtViewer
../
)
# collect all header and source files
acg_append_files (headers "*.hh" ${directories})
set (sources
../../QtViewer/QGLViewerWidget.cc
../../QtViewer/MeshViewerWidgetT.cc
../DecimaterViewerWidget.cc
../decimaterviewer.cc
)
# remove template cc files from source file list
acg_drop_templates (sources)
# genereate uic and moc targets
if(QT5_FOUND)
acg_qt5_automoc (moc_targets ${headers})
else()
acg_qt4_automoc (moc_targets ${headers})
endif()
if (WIN32)
acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets})
# link to qtmain library to get WinMain function for a non terminal app
target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY})
else ()
acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets})
endif ()
target_link_libraries (${targetName}
OpenMeshCore
OpenMeshTools
${QT_LIBRARIES}
${OPENGL_LIBRARIES}
${GLUT_LIBRARIES}
)
include (ACGCommon)
include_directories (
../../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
set (headers
../DecimaterViewerWidget.hh
../../QtViewer/QGLViewerWidget.hh
../../QtViewer/MeshViewerWidgetT.hh
../../QtViewer/MeshViewerWidget.hh
../../QtViewer/MeshViewerWidgetT_impl.hh
)
set (sources
../../QtViewer/QGLViewerWidget.cc
../../QtViewer/MeshViewerWidget.cc
../DecimaterViewerWidget.cc
../decimaterviewer.cc
)
if (WIN32)
acg_add_executable (DecimaterGui WIN32 ${sources} ${headers})
else ()
acg_add_executable (DecimaterGui ${sources} ${headers} )
endif ()
target_link_libraries (DecimaterGui
OpenMeshCore
OpenMeshTools
Qt5::OpenGL
${OPENGL_LIBRARIES}
)

View File

@@ -1,24 +0,0 @@
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
Application()
INCLUDEPATH += ../../..
Application()
glew()
glut()
openmesh()
DIRECTORIES = ../../QtViewer ../
# Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
SOURCES += ../../QtViewer/QGLViewerWidget.cc ../../QtViewer/MeshViewerWidgetT.cc ../DecimaterViewerWidget.cc
SOURCES += ../decimaterviewer.cc
################################################################################

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//== INCLUDES =================================================================

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESHAPPS_DECIMATERVIEWERWIDGET_HH
@@ -96,18 +91,18 @@ struct MyTraits : public DEFAULT_TRAITS
};
typedef TRIMESH_KERNEL<MyTraits> mesh_t;
typedef MeshViewerWidgetT<mesh_t> MeshViewerWidget;
typedef MeshViewerWidgetT<mesh_t> MeshViewerWidgetDecimaterBase;
//== CLASS DEFINITION =========================================================
class DecimaterViewerWidget : public MeshViewerWidget
class DecimaterViewerWidget : public MeshViewerWidgetDecimaterBase
{
Q_OBJECT
public:
typedef MeshViewerWidget inherited_t;
typedef MeshViewerWidgetDecimaterBase inherited_t;
typedef Decimater::DecimaterT<mesh_t> decimater_t;
typedef Decimater::ModQuadricT< mesh_t >::Handle mod_quadric_t;
@@ -123,8 +118,8 @@ public:
/// default constructor
DecimaterViewerWidget(QWidget* _parent=0)
: MeshViewerWidget(_parent),
explicit DecimaterViewerWidget(QWidget* _parent=0)
: MeshViewerWidgetDecimaterBase(_parent),
animate_(false),
timer_(0),
steps_(1)
@@ -149,7 +144,7 @@ public:
public: // inherited
bool open_mesh(const char* _filename, OpenMesh::IO::Options _opt)
bool open_mesh(const char* _filename, OpenMesh::IO::Options _opt) override
{
bool rc;
@@ -175,7 +170,7 @@ protected slots:
protected:
virtual void keyPressEvent(QKeyEvent* _event);
virtual void keyPressEvent(QKeyEvent* _event) override;
private:

View File

@@ -5,16 +5,9 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
set (targetName commandlineDecimater)
acg_add_executable (commandlineDecimater ../decimater.cc)
# collect all header and source files
set (sources
../decimater.cc
)
acg_add_executable (${targetName} ${sources})
target_link_libraries (${targetName}
target_link_libraries (commandlineDecimater
OpenMeshCore
OpenMeshTools
)

View File

@@ -1,19 +0,0 @@
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
INCLUDEPATH += ../../..
Application()
glew()
glut()
openmesh()
DIRECTORIES = ..
# Input
SOURCES += ../decimater.cc
################################################################################

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#if !defined(OM_USE_OSG)
# define OM_USE_OSG 0
@@ -221,7 +216,7 @@ decimate(const std::string &_ifname,
using namespace std;
Mesh mesh;
OpenMesh::IO::Options opt;
OpenMesh::IO::Options readopt;
OpenMesh::Utils::Timer timer;
// ---------------------------------------- read source mesh
@@ -232,7 +227,7 @@ decimate(const std::string &_ifname,
if (gverbose)
clog << _ifname << endl;
if ( !(rc = OpenMesh::IO::read_mesh(mesh, _ifname, opt)) )
if ( !(rc = OpenMesh::IO::read_mesh(mesh, _ifname, readopt)) )
{
cerr << " ERROR: read failed!" << endl;
return rc;
@@ -243,7 +238,7 @@ decimate(const std::string &_ifname,
{
// ---- 0 - For module NormalFlipping one needs face normals
if ( !opt.check( OpenMesh::IO::Options::FaceNormal ) )
if ( !readopt.check( OpenMesh::IO::Options::FaceNormal ) )
{
if ( !mesh.has_face_normals() )
mesh.request_face_normals();
@@ -425,11 +420,11 @@ decimate(const std::string &_ifname,
ofname.insert(++pos, n );
}
OpenMesh::IO::Options opt;
OpenMesh::IO::Options writeopt;
//opt += OpenMesh::IO::Options::Binary;
if ( !OpenMesh::IO::write_mesh(mesh, ofname, opt ) )
if ( !OpenMesh::IO::write_mesh(mesh, ofname, writeopt ) )
{
std::cerr << " Cannot write decimated mesh to file '"
<< ofname << "'\n";
@@ -464,7 +459,7 @@ int main(int argc, char* argv[])
{
case 'D': opt.decorate_name = true; break;
case 'd': gdebug = true; break;
case 'h': usage_and_exit(0);
case 'h': usage_and_exit(0); break;
case 'i': ifname = optarg; break;
case 'M': opt.parse_argument( optarg ); break;
case 'n': opt.n_collapses = float(atof(optarg)); break;

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifdef _MSC_VER
# pragma warning(disable: 4267 4311)
@@ -58,12 +53,6 @@
#include "DecimaterViewerWidget.hh"
#ifdef ARCH_DARWIN
#include <glut.h>
#else
#include <GL/glut.h>
#endif
void usage_and_exit(int xcode);
@@ -77,13 +66,9 @@ int main(int argc, char **argv)
QApplication::setColorSpec( QApplication::CustomColor );
QApplication app(argc,argv);
#if !defined(__APPLE__)
glutInit(&argc,argv);
#endif
if ( !QGLFormat::hasOpenGL() ) {
QString msg = "System has no OpenGL support!";
QMessageBox::critical( NULL, "OpenGL", msg + argv[1] );
QMessageBox::critical( nullptr, "OpenGL", msg + argv[1] );
return -1;
}
@@ -98,6 +83,7 @@ int main(int argc, char **argv)
case 's': opt += OpenMesh::IO::Options::Swap; break;
case 'h':
usage_and_exit(0);
break;
default:
usage_and_exit(1);
}
@@ -117,7 +103,7 @@ int main(int argc, char **argv)
QString msg = "Cannot read mesh from file:\n '";
msg += argv[optind];
msg += "'";
QMessageBox::critical( NULL, w.windowTitle(), msg );
QMessageBox::critical( nullptr, w.windowTitle(), msg );
return 1;
}
}
@@ -132,7 +118,7 @@ int main(int argc, char **argv)
msg += "- Mesh file didn't provide texture coordinates\n";
msg += "- Texture file does not exist\n";
msg += "- Texture file is not accessible.\n";
QMessageBox::warning( NULL, w.windowTitle(), msg );
QMessageBox::warning( nullptr, w.windowTitle(), msg );
}
}

View File

@@ -2,18 +2,11 @@ include (ACGCommon)
include_directories (
../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
set (targetName Dualizer)
acg_add_executable (Dualizer dualizer.cc)
# collect all header and source files
acg_append_files (headers "*.hh" .)
acg_append_files (sources "*.cc" .)
acg_add_executable (${targetName} ${headers} ${sources})
target_link_libraries (${targetName}
target_link_libraries (Dualizer
OpenMeshCore
OpenMeshTools
)

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#include <iostream>

View File

@@ -3,62 +3,32 @@ include (ACGCommon)
include_directories (
../../..
${CMAKE_CURRENT_SOURCE_DIR}
${GLUT_INCLUDE_DIR}
${QT_INCLUDE_DIR}
)
set (targetName ProgViewer)
set( headers
ProgViewerWidget.hh
../QtViewer/QGLViewerWidget.hh
../QtViewer/MeshViewerWidgetT.hh
../QtViewer/MeshViewerWidgetT_impl.hh
)
# collect all header and source files
acg_append_files (headers "*.hh" .)
acg_append_files (sources "*.cc" .)
list (APPEND sources "../QtViewer/QGLViewerWidget.cc")
list (APPEND sources "../QtViewer/MeshViewerWidgetT.cc")
list (APPEND headers "../QtViewer/QGLViewerWidget.hh")
list (APPEND headers "../QtViewer/MeshViewerWidgetT.hh")
# # source code directories
# set (directories
# .
# ../QtViewer
# )
# # collect all header and source files
# acg_append_files (headers "*.hh" ${directories})
# set (sources
# ../../QtViewer/QGLViewerWidget.cc
# ../../QtViewer/MeshViewerWidgetT.cc
# ./ProgViewerWidget.cc
# )
# remove template cc files from source file list
acg_drop_templates (sources)
# genereate uic and moc targets
if(QT5_FOUND)
acg_qt5_automoc (moc_targets ${headers})
else()
acg_qt4_automoc (moc_targets ${headers})
endif()
set( sources
ProgViewerWidget.cc
progviewer.cc
../QtViewer/QGLViewerWidget.cc
)
if (WIN32)
acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets})
# link to qtmain library to get WinMain function for a non terminal app
target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY})
acg_add_executable( ProgViewer WIN32 ${sources} ${headers})
else ()
acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets})
acg_add_executable( ProgViewer ${sources} ${headers})
endif ()
target_link_libraries (${targetName}
target_link_libraries ( ProgViewer
OpenMeshCore
OpenMeshTools
${QT_LIBRARIES}
Qt5::OpenGL
${OPENGL_LIBRARIES}
${GLUT_LIBRARIES}
)

View File

@@ -1,274 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="OpenMesh_Apps_ProgViewer"
ProjectGUID="{6CC92D44-A0AC-47D0-9482-D983B1F27E63}"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="c:\glut\include;C:\glew\include;..\..\..;&quot;$(QTDIR)/include&quot;;&quot;$(QTDIR)/include/QtCore&quot;;&quot;$(QTDIR)/inlcude/Qt&quot;;&quot;$(QTDIR)/include/QtGUI&quot;;&quot;$(QTDIR)/include/QtOpenGL&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_MATH_DEFINES;QT_DLL"
MinimalRebuild="false"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
DisableLanguageExtensions="false"
ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/vc70.pdb"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="QtCore4.lib QtGUI4.lib QtOpenGL4.lib opengl32.lib"
OutputFile="..\..\bin\progviewer_dbg.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="$(QTDIR)/lib;C:\glut\lib;C:\glew\lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\$(TargetName).pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="c:\glut\include;C:\glew\include;..\..\..;&quot;$(QTDIR)/include&quot;;&quot;$(QTDIR)/include/QtCore&quot;;&quot;$(QTDIR)/inlcude/Qt&quot;;&quot;$(QTDIR)/include/QtGUI&quot;;&quot;$(QTDIR)/include/QtOpenGL&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_USE_MATH_DEFINES;QT_DLL"
RuntimeLibrary="2"
DisableLanguageExtensions="false"
ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="QtCore4.lib QtGUI4.lib QtOpenGL4.lib opengl32.lib"
OutputFile="..\..\bin\progviewer.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="$(QTDIR)/lib;C:\glut\lib;C:\glew\lib"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Generated Files"
>
<File
RelativePath=".\moc_ProgViewerWidget.cpp"
>
</File>
<File
RelativePath=".\moc_QGLViewerWidget.cpp"
>
</File>
</Filter>
<File
RelativePath="..\QtViewer\MeshViewerWidgetT.cc"
>
</File>
<File
RelativePath="..\QtViewer\QGLViewerWidget.cc"
>
</File>
<File
RelativePath="..\QtViewer\MeshViewerWidgetT.hh"
>
</File>
<File
RelativePath=".\progviewer.cc"
>
</File>
<File
RelativePath=".\ProgViewerWidget.cc"
>
</File>
<File
RelativePath=".\ProgViewerWidget.hh"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="MOC $(InputFileName)"
CommandLine="$(QTDIR)\bin\moc.exe $(InputFileName) -o moc_$(InputName).cpp&#x0D;&#x0A;"
Outputs="moc_$(InputName).cpp"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="MOC $(InputFileName)"
CommandLine="$(QTDIR)\bin\moc.exe $(InputFileName) -o moc_$(InputName).cpp&#x0D;&#x0A;"
Outputs="moc_$(InputName).cpp"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\QtViewer\QGLViewerWidget.hh"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="MOC $(InputFileName)"
CommandLine="$(QTDIR)\bin\moc.exe ..\QtViewer\$(InputFileName) -o moc_$(InputName).cpp&#x0D;&#x0A;"
Outputs="moc_$(InputName).cpp"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="MOC $(InputFileName)"
CommandLine="$(QTDIR)\bin\moc.exe ..\QtViewer\$(InputFileName) -o moc_$(InputName).cpp&#x0D;&#x0A;"
Outputs="moc_$(InputName).cpp"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\test1.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//== INCLUDES =================================================================

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESHAPPS_PROGVIEWERWIDGET_HH
@@ -68,7 +63,7 @@ using namespace OpenMesh;
using namespace OpenMesh::Attributes;
struct MyTraits : public OpenMesh::DefaultTraits
struct ProgTraits : public OpenMesh::DefaultTraits
{
VertexAttributes ( OpenMesh::Attributes::Normal |
OpenMesh::Attributes::Status );
@@ -79,28 +74,32 @@ struct MyTraits : public OpenMesh::DefaultTraits
};
typedef OpenMesh::TriMesh_ArrayKernelT<MyTraits> MyMesh;
typedef MeshViewerWidgetT<MyMesh> MeshViewerWidget;
typedef OpenMesh::TriMesh_ArrayKernelT<ProgTraits> MyMesh;
typedef MeshViewerWidgetT<MyMesh> MeshViewerWidgetProgBase;
//== CLASS DEFINITION =========================================================
class ProgViewerWidget : public MeshViewerWidget
class ProgViewerWidget : public MeshViewerWidgetProgBase
{
Q_OBJECT
public:
typedef MeshViewerWidget Base;
typedef MeshViewerWidgetProgBase Base;
typedef ProgViewerWidget This;
public:
/// default constructor
ProgViewerWidget(QWidget* _parent=0)
: MeshViewerWidget(_parent)
explicit ProgViewerWidget(QWidget* _parent=0)
: MeshViewerWidgetProgBase(_parent),
n_base_vertices_(0),
n_base_faces_(0),
n_detail_vertices_(0),
n_max_vertices_(0)
{
timer_ = new QTimer(this);
@@ -138,7 +137,7 @@ private:
/// coarsen mesh down to _n vertices
void coarsen(unsigned int _n);
virtual void keyPressEvent(QKeyEvent* _event);
virtual void keyPressEvent(QKeyEvent* _event) override;
// mesh data
bool animateRefinement_;

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifdef _MSC_VER
# pragma warning(disable: 4267 4311)
@@ -58,11 +53,6 @@
#include <QApplication>
#include <QGLWidget>
#ifdef ARCH_DARWIN
#include <glut.h>
#else
#include <GL/glut.h>
#endif
int main(int argc, char **argv)
{
@@ -70,8 +60,6 @@ int main(int argc, char **argv)
QApplication::setColorSpec( QApplication::CustomColor );
QApplication app(argc,argv);
glutInit(&argc,argv);
if ( !QGLFormat::hasOpenGL() ) {
std::cerr << "This system has no OpenGL support.\n";
return -1;

View File

@@ -3,48 +3,34 @@ include (ACGCommon)
include_directories (
../../..
${CMAKE_CURRENT_SOURCE_DIR}
${GLUT_INCLUDE_DIR}
${QT_INCLUDE_DIR}
)
set (targetName QtViewer)
# source code directories
set (directories
.
)
# collect all header and source files
acg_append_files (headers "*.hh" ${directories})
acg_append_files (sources "*.cc" ${directories})
acg_append_files (ui "*.ui" ${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})
else()
acg_qt4_autouic (uic_targets ${ui})
acg_qt4_automoc (moc_targets ${headers})
endif()
if (WIN32)
acg_add_executable (${targetName} WIN32 ${uic_targets} ${sources} ${headers} ${moc_targets})
# link to qtmain library to get WinMain function for a non terminal app
target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY})
else ()
acg_add_executable (${targetName} ${uic_targets} ${sources} ${headers} ${moc_targets})
endif ()
target_link_libraries (${targetName}
OpenMeshCore
OpenMeshTools
${QT_LIBRARIES}
${OPENGL_LIBRARIES}
${GLUT_LIBRARIES}
set (sources
MeshViewerWidget.cc
QGLViewerWidget.cc
meshviewer.cc
)
set (headers
MeshViewerWidget.hh
QGLViewerWidget.hh
)
if (WIN32)
acg_add_executable (QtViewer WIN32 ${sources} ${headers})
else ()
acg_add_executable (QtViewer ${sources} ${headers})
endif ()
target_link_libraries (QtViewer
OpenMeshCore
OpenMeshTools
Qt5::OpenGL
${OPENGL_LIBRARIES}
)

View File

@@ -0,0 +1,114 @@
/* ========================================================================= *
* *
* OpenMesh *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openmesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenMesh. *
*---------------------------------------------------------------------------*
* *
* 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. *
* *
* ========================================================================= */
#define OPENMESHAPPS_MESHVIEWERWIDGET_CC
//== INCLUDES =================================================================
#include <OpenMesh/Apps/QtViewer/MeshViewerWidget.hh>
//== IMPLEMENTATION ==========================================================
/// default constructor
MeshViewerWidget::MeshViewerWidget(QWidget* parent) : MeshViewerWidgetT<MyMesh>(parent)
{}
void MeshViewerWidget::open_mesh_gui(QString fname)
{
OpenMesh::Utils::Timer t;
t.start();
if ( fname.isEmpty() || !open_mesh(fname.toLocal8Bit(), _options) )
{
QString msg = "Cannot read mesh from file:\n '";
msg += fname;
msg += "'";
QMessageBox::critical( nullptr, windowTitle(), msg);
}
t.stop();
std::cout << "Loaded mesh in ~" << t.as_string() << std::endl;
}
void MeshViewerWidget::open_texture_gui(QString fname)
{
if ( fname.isEmpty() || !open_texture( fname.toLocal8Bit() ) )
{
QString msg = "Cannot load texture image from file:\n '";
msg += fname;
msg += "'\n\nPossible reasons:\n";
msg += "- Mesh file didn't provide texture coordinates\n";
msg += "- Texture file does not exist\n";
msg += "- Texture file is not accessible.\n";
QMessageBox::warning( nullptr, windowTitle(), msg );
}
}
void MeshViewerWidget::query_open_mesh_file() {
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open mesh file"),
tr(""),
tr("OBJ Files (*.obj);;"
"OFF Files (*.off);;"
"STL Files (*.stl);;"
"All Files (*)"));
if (!fileName.isEmpty())
open_mesh_gui(fileName);
}
void MeshViewerWidget::query_open_texture_file() {
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open texture file"),
tr(""),
tr("PNG Files (*.png);;"
"BMP Files (*.bmp);;"
"GIF Files (*.gif);;"
"JPEG Files (*.jpg);;"
"TIFF Files (*.tif);;"
"All Files (*)"));
if (!fileName.isEmpty())
open_texture_gui(fileName);
}
//=============================================================================

View File

@@ -39,15 +39,9 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESHAPPS_VIEWERWIDGET_HH
#define OPENMESHAPPS_VIEWERWIDGET_HH
#pragma once
//== INCLUDES =================================================================
@@ -55,6 +49,7 @@
#include <QString>
#include <QMessageBox>
#include <QFileDialog>
#include <iostream>
#include <OpenMesh/Tools/Utils/getopt.h>
#include <OpenMesh/Tools/Utils/Timer.hh>
#include <OpenMesh/Apps/QtViewer/MeshViewerWidgetT.hh>
@@ -66,12 +61,12 @@
using namespace OpenMesh;
using namespace OpenMesh::Attributes;
struct MyTraits : public OpenMesh::DefaultTraits
struct MeshViewerWidgetTraits : public OpenMesh::DefaultTraits
{
HalfedgeAttributes(OpenMesh::Attributes::PrevHalfedge);
};
typedef OpenMesh::TriMesh_ArrayKernelT<MyTraits> MyMesh;
typedef OpenMesh::TriMesh_ArrayKernelT<MeshViewerWidgetTraits> MyMesh;
@@ -80,70 +75,24 @@ typedef OpenMesh::TriMesh_ArrayKernelT<MyTraits> MyMesh;
class MeshViewerWidget : public MeshViewerWidgetT<MyMesh>
{
Q_OBJECT
public:
/// default constructor
MeshViewerWidget(QWidget* parent=0) : MeshViewerWidgetT<MyMesh>(parent)
{}
explicit MeshViewerWidget(QWidget* parent=0);
OpenMesh::IO::Options& options() { return _options; }
const OpenMesh::IO::Options& options() const { return _options; }
void setOptions(const OpenMesh::IO::Options& opts) { _options = opts; }
void open_mesh_gui(QString fname)
{
OpenMesh::Utils::Timer t;
t.start();
if ( fname.isEmpty() || !open_mesh(fname.toLocal8Bit(), _options) )
{
QString msg = "Cannot read mesh from file:\n '";
msg += fname;
msg += "'";
QMessageBox::critical( NULL, windowTitle(), msg);
}
t.stop();
std::cout << "Loaded mesh in ~" << t.as_string() << std::endl;
}
void open_texture_gui(QString fname)
{
if ( fname.isEmpty() || !open_texture( fname.toLocal8Bit() ) )
{
QString msg = "Cannot load texture image from file:\n '";
msg += fname;
msg += "'\n\nPossible reasons:\n";
msg += "- Mesh file didn't provide texture coordinates\n";
msg += "- Texture file does not exist\n";
msg += "- Texture file is not accessible.\n";
QMessageBox::warning( NULL, windowTitle(), msg );
}
}
void open_mesh_gui(QString fname);
void open_texture_gui(QString fname);
public slots:
void query_open_mesh_file() {
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open mesh file"),
tr(""),
tr("OBJ Files (*.obj);;"
"OFF Files (*.off);;"
"STL Files (*.stl);;"
"All Files (*)"));
if (!fileName.isEmpty())
open_mesh_gui(fileName);
}
void query_open_texture_file() {
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open texture file"),
tr(""),
tr("PNG Files (*.png);;"
"BMP Files (*.bmp);;"
"GIF Files (*.gif);;"
"JPEG Files (*.jpg);;"
"TIFF Files (*.tif);;"
"All Files (*)"));
if (!fileName.isEmpty())
open_texture_gui(fileName);
}
void query_open_mesh_file();
void query_open_texture_file();
private:
OpenMesh::IO::Options _options;
};
#endif

View File

@@ -39,16 +39,10 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESHAPPS_MESHVIEWERWIDGETT_HH
#define OPENMESHAPPS_MESHVIEWERWIDGETT_HH
#pragma once
//== INCLUDES =================================================================
@@ -75,6 +69,7 @@ class QImage;
template <typename M>
class MeshViewerWidgetT : public QGLViewerWidget
{
public:
typedef M Mesh;
@@ -82,7 +77,7 @@ public:
public:
/// default constructor
MeshViewerWidgetT(QWidget* _parent=0)
explicit MeshViewerWidgetT(QWidget* _parent=0)
: QGLViewerWidget(_parent),
f_strips_(false),
tex_id_(0),
@@ -90,7 +85,8 @@ public:
strips_(mesh_),
use_color_(true),
show_vnormals_(false),
show_fnormals_(false)
show_fnormals_(false),
normal_scale_(1.0)
{
add_draw_mode("Points");
add_draw_mode("Hidden-Line");
@@ -121,7 +117,7 @@ public:
protected:
/// inherited drawing method
virtual void draw_scene(const std::string& _draw_mode);
virtual void draw_scene(const std::string& _draw_mode) override;
protected:
@@ -175,7 +171,7 @@ protected: // Strip support
protected: // inherited
virtual void keyPressEvent( QKeyEvent* _event);
virtual void keyPressEvent( QKeyEvent* _event) override;
protected:
@@ -195,11 +191,9 @@ protected:
//=============================================================================
#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESHAPPS_MESHVIEWERWIDGET_CC)
#if defined(OM_INCLUDE_TEMPLATES)
# define OPENMESH_MESHVIEWERWIDGET_TEMPLATES
# include "MeshViewerWidgetT.cc"
# include "MeshViewerWidgetT_impl.hh"
#endif
//=============================================================================
#endif // OPENMESHAPPS_MESHVIEWERWIDGETT_HH defined
//=============================================================================

View File

@@ -39,14 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#define OPENMESHAPPS_MESHVIEWERWIDGET_CC
#pragma once
//== INCLUDES =================================================================
@@ -74,7 +67,6 @@ using namespace Qt;
# undef max
#endif
using namespace Qt;
//== IMPLEMENTATION ==========================================================
@@ -136,7 +128,6 @@ MeshViewerWidgetT<M>::open_mesh(const char* _filename, IO::Options _opt)
typename Mesh::ConstVertexIter vIt(mesh_.vertices_begin());
typename Mesh::ConstVertexIter vEnd(mesh_.vertices_end());
typedef typename Mesh::Point Point;
using OpenMesh::Vec3f;
Vec3f bbMin, bbMax;
@@ -151,7 +142,7 @@ MeshViewerWidgetT<M>::open_mesh(const char* _filename, IO::Options _opt)
// set center and radius
set_scene_pos( (bbMin+bbMax)*0.5, (bbMin-bbMax).norm()*0.5 );
set_scene_pos( (bbMin+bbMax)*0.5f, (bbMin-bbMax).norm()*0.5f );
// for normal display
normal_scale_ = (bbMax-bbMin).min()*0.05f;

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//== INCLUDES =================================================================
@@ -57,11 +52,7 @@
#include <sstream>
#include <algorithm>
// --------------------
#ifdef ARCH_DARWIN
# include <glut.h>
#else
# include <GL/glut.h>
#endif
// --------------------
#include <QApplication>
#include <QMenu>
@@ -271,21 +262,21 @@ QGLViewerWidget::draw_scene(const std::string& _draw_mode)
if (_draw_mode == "Wireframe")
{
glDisable(GL_LIGHTING);
glutWireTeapot(0.5);
// glutWireTeapot(0.5);
}
else if (_draw_mode == "Solid Flat")
{
glEnable(GL_LIGHTING);
glShadeModel(GL_FLAT);
glutSolidTeapot(0.5);
//glutSolidTeapot(0.5);
}
else if (_draw_mode == "Solid Smooth")
{
glEnable(GL_LIGHTING);
glShadeModel(GL_SMOOTH);
glutSolidTeapot(0.5);
//glutSolidTeapot(0.5);
}
}
@@ -590,8 +581,19 @@ QGLViewerWidget::update_projection_matrix()
makeCurrent();
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluPerspective(45.0, (GLfloat) width() / (GLfloat) height(),
0.01*radius_, 100.0*radius_);
const double fovY = 45.0;
const double aspect = static_cast<double>(width()) / static_cast<double>(height());
const double zNear = 0.01*radius_;
const double zFar = 100.0*radius_;
// Replacement for: gluPerspective(45.0, (GLfloat) width() / (GLfloat) height(), 0.01*radius_, 100.0*radius_);
const double pi = 3.1415926535897932384626433832795;
const double fH = tan( fovY / 360 * pi ) * zNear;
const double fW = fH * aspect;
glFrustum( -fW, fW, -fH, fH, zNear, zFar );
glGetDoublev( GL_PROJECTION_MATRIX, projection_matrix_);
glMatrixMode( GL_MODELVIEW );
}

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESHAPPS_QGLVIEWERWIDGET_HH
@@ -79,7 +74,7 @@ public:
typedef QGLWidget Super;
// Default constructor.
QGLViewerWidget( QWidget* _parent=0 );
explicit QGLViewerWidget( QWidget* _parent=0 );
//
QGLViewerWidget( QGLFormat& _fmt, QWidget* _parent=0 );

View File

@@ -1,19 +0,0 @@
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
Application()
glew()
glut()
openmesh()
DIRECTORIES = .
# Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
################################################################################

View File

@@ -39,13 +39,6 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifdef _MSC_VER
# pragma warning(disable: 4267 4311)
#endif
@@ -58,12 +51,6 @@
#include <QMenuBar>
#include <QFileDialog>
#ifdef ARCH_DARWIN
#include <glut.h>
#else
#include <GL/glut.h>
#endif
#include "MeshViewerWidget.hh"
@@ -75,9 +62,6 @@ int main(int argc, char **argv)
// OpenGL check
QApplication::setColorSpec( QApplication::CustomColor );
QApplication app(argc,argv);
#if !defined(__APPLE__)
glutInit(&argc,argv);
#endif
if ( !QGLFormat::hasOpenGL() ) {
QString msg = "System has no OpenGL support!";
@@ -95,6 +79,7 @@ int main(int argc, char **argv)
case 'b': opt += OpenMesh::IO::Options::Binary; break;
case 'h':
usage_and_exit(0);
break;
case 's': opt += OpenMesh::IO::Options::Swap; break;
default:
usage_and_exit(1);

View File

@@ -5,15 +5,9 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
set (targetName Smoothing)
acg_add_executable (Smoothing smooth.cc)
# collect all header and source files
acg_append_files (headers "*.hh" .)
acg_append_files (sources "*.cc" .)
acg_add_executable (${targetName} ${headers} ${sources})
target_link_libraries (${targetName}
target_link_libraries (Smoothing
OpenMeshCore
OpenMeshTools
)

View File

@@ -1,21 +0,0 @@
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
INCLUDEPATH += ../../..
Application()
glew()
glut()
openmesh()
DIRECTORIES = .
# Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
################################################################################

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#include <iostream>
@@ -136,7 +131,7 @@ int main(int argc, char **argv)
: SmootherT<MyMesh>::Normal;
break;
case 'h': usage_and_exit(0);
case 'h': usage_and_exit(0); break;
case '?':
default: usage_and_exit(1);
}

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESHAPPS_MESHVIEWERWIDGET_HH
@@ -71,21 +66,21 @@ typedef OpenMesh::TriMesh_ArrayKernelT<Traits> Mesh;
class MeshViewerWidget : public MeshViewerWidgetT<Mesh>
class MeshViewerWidgetSubdivider : public MeshViewerWidgetT<Mesh>
{
public:
typedef MeshViewerWidgetT<Mesh> Base;
/// default constructor
MeshViewerWidget(QWidget* _parent=0)
explicit MeshViewerWidgetSubdivider(QWidget* _parent=0)
: Base(_parent)
{}
/// destructor
~MeshViewerWidget() {}
~MeshViewerWidgetSubdivider() {}
/// open mesh
inline bool open_mesh(const char* _filename, OpenMesh::IO::Options _opt)
inline bool open_mesh(const char* _filename, OpenMesh::IO::Options _opt) override
{
if ( Base::open_mesh( _filename, _opt ) )
{

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
@@ -92,7 +87,7 @@ using namespace OpenMesh::Subdivider;
SubdivideWidget::
SubdivideWidget(QWidget* _parent, const char* _name)
: QWidget(_parent),
timer_(NULL), animate_step_(0), max_animate_steps_(4), msecs_(0)
timer_(nullptr), animate_step_(0), max_animate_steps_(4), msecs_(0)
{
setWindowTitle( QString(_name) );
@@ -103,7 +98,7 @@ SubdivideWidget(QWidget* _parent, const char* _name)
// sel_topo_type will be set when adding the radio button.;
// examiner widget
viewer_widget_ = new MeshViewerWidget();
viewer_widget_ = new MeshViewerWidgetSubdivider();
vbox->addWidget(viewer_widget_);

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
@@ -121,7 +116,7 @@ private slots:
private:
// widgets
MeshViewerWidget* viewer_widget_;
MeshViewerWidgetSubdivider* viewer_widget_;
QTimer *timer_;

View File

@@ -3,51 +3,32 @@ include (ACGCommon)
include_directories (
../../../..
${CMAKE_CURRENT_SOURCE_DIR}
${GLUT_INCLUDE_DIR}
${QT_INCLUDE_DIR}
)
set (targetName SubdividerGui)
# source code directories
set (directories
../../QtViewer
../
set (headers
../MeshViewerWidget.hh
../SubdivideWidget.hh
../../QtViewer/QGLViewerWidget.hh
../../QtViewer/MeshViewerWidgetT.hh
../../QtViewer/MeshViewerWidgetT_impl.hh
)
# collect all header and source files
acg_append_files (headers "*.hh" ${directories})
set (sources
../../QtViewer/QGLViewerWidget.cc
../../QtViewer/MeshViewerWidgetT.cc
../SubdivideWidget.cc
../qtsubdivider.cc
)
# remove template cc files from source file list
acg_drop_templates (sources)
# genereate uic and moc targets
if(QT5_FOUND)
acg_qt5_automoc (moc_targets ${headers})
else()
acg_qt4_automoc (moc_targets ${headers})
endif()
if (WIN32)
acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets})
# link to qtmain library to get WinMain function for a non terminal app
target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY})
acg_add_executable (SubdividerGui WIN32 ${sources} ${headers})
else ()
acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets})
acg_add_executable (SubdividerGui ${sources} ${headers})
endif ()
target_link_libraries (${targetName}
target_link_libraries (SubdividerGui
OpenMeshCore
OpenMeshTools
${QT_LIBRARIES}
Qt5::OpenGL
${OPENGL_LIBRARIES}
${GLUT_LIBRARIES}
)

View File

@@ -1,21 +0,0 @@
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
INCLUDEPATH += ../../..
Application()
glew()
glut()
openmesh()
DIRECTORIES = .. ../../QtViewer
# Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
SOURCES += ../../QtViewer/QGLViewerWidget.cc ../../QtViewer/MeshViewerWidgetT.cc ../SubdivideWidget.cc
SOURCES += ../qtsubdivider.cc
################################################################################

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
// -------------------------------------------------------------- includes ----
@@ -170,7 +165,7 @@ int main(int argc, char **argv)
case 'm': { std::stringstream s; s << optarg; s >> max_nv; } break;
case 'r': rule_sequence = optarg; break;
case 'U': uniform = true; break;
case 'h': usage_and_exit(argv[0],0);
case 'h': usage_and_exit(argv[0],0); break;
case '?':
default: usage_and_exit(argv[0],1);
}

View File

@@ -5,16 +5,9 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
set (targetName commandlineAdaptiveSubdivider)
acg_add_executable (commandlineAdaptiveSubdivider ../adaptive_subdivider.cc)
# collect all header and source files
set (sources
../adaptive_subdivider.cc
)
acg_add_executable (${targetName} ${sources})
target_link_libraries (${targetName}
target_link_libraries (commandlineAdaptiveSubdivider
OpenMeshCore
OpenMeshTools
)

View File

@@ -1,15 +0,0 @@
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
INCLUDEPATH += ../../..
Application()
openmesh()
# Input
SOURCES += ../adaptive_subdivider.cc
################################################################################

View File

@@ -5,16 +5,9 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
set (targetName commandlineSubdivider)
acg_add_executable (commandlineSubdivider ../subdivider.cc)
# collect all header and source files
set (sources
../subdivider.cc
)
acg_add_executable (${targetName} ${sources})
target_link_libraries (${targetName}
target_link_libraries (commandlineSubdivider
OpenMeshCore
OpenMeshTools
)

View File

@@ -1,15 +0,0 @@
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
INCLUDEPATH += ../../..
Application()
openmesh()
# Input
SOURCES += ../subdivider.cc
################################################################################

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifdef _MSC_VER
# pragma warning(disable: 4267 4311)
@@ -57,25 +52,15 @@
#include <QMessageBox>
#include "SubdivideWidget.hh"
#ifdef ARCH_DARWIN
#include <glut.h>
#else
#include <GL/glut.h>
#endif
int main(int argc, char **argv)
{
// OpenGL check
QApplication::setColorSpec( QApplication::CustomColor );
QApplication app(argc,argv);
#if !defined(__APPLE__)
glutInit(&argc,argv);
#endif
if ( !QGLFormat::hasOpenGL() ) {
QString msg = "System has no OpenGL support!";
QMessageBox::critical( NULL, "OpenGL", msg + argv[1], QMessageBox::Ok );
QMessageBox::critical( nullptr, "OpenGL", msg + argv[1], QMessageBox::Ok );
return -1;
}
@@ -92,7 +77,7 @@ int main(int argc, char **argv)
if ( ! w->open_mesh(argv[1]) )
{
QString msg = "Cannot read mesh from file ";
QMessageBox::critical( NULL, argv[1], msg + argv[1], QMessageBox::Ok );
QMessageBox::critical( nullptr, argv[1], msg + argv[1], QMessageBox::Ok );
return -1;
}
}

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#include <iostream>
#include <sstream>
@@ -234,7 +229,7 @@ int main(int argc, char **argv)
}
break;
}
case 'h': usage_and_exit(0);
case 'h': usage_and_exit(0); break;
case '?':
default: usage_and_exit(1);
}

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
@@ -128,7 +123,7 @@ private:
//=============================================================================
#if defined(INCLUDE_TEMPLATES) && !defined(OPENMESH_SOOPENMESHNODE_CC)
# define OPENMESH_SOOPENMESHMODE_TEMPLATES
# include "SoOpenMeshNodeT.cc"
# include "SoOpenMeshNodeT_impl.hh"
#endif
//=============================================================================
#endif // OPENMESH_SOOPENMESHNODE_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef SOOPENMESHSUPPORT_H
#define SOOPENMESHSUPPORT_H
@@ -83,9 +78,9 @@ PRIVATE_NODE_TYPESYSTEM_SOURCE(_class_); \
SO_NODE_SOURCE_TEMPLATE \
unsigned int _class_::classinstances = 0; \
SO_NODE_SOURCE_TEMPLATE \
const SoFieldData ** _class_::parentFieldData = NULL; \
const SoFieldData ** _class_::parentFieldData = nullptr; \
SO_NODE_SOURCE_TEMPLATE \
SoFieldData * _class_::fieldData = NULL; \
SoFieldData * _class_::fieldData = nullptr; \
\
SO_NODE_SOURCE_TEMPLATE \
const SoFieldData ** \

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#if !defined(USE_SOQT)

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifdef _MSC_VER
# pragma warning(disable: 4267 4311)
@@ -83,7 +78,7 @@ int main(int argc, char **argv)
if ( !QGLFormat::hasOpenGL() ) {
QString msg = "System has no OpenGL support!";
QMessageBox::critical( NULL, "OpenGL", msg + argv[1], 0 );
QMessageBox::critical( nullptr, "OpenGL", msg + argv[1], 0 );
return -1;
}
@@ -120,7 +115,7 @@ int main(int argc, char **argv)
QString msg = "Cannot read mesh from file:\n '";
msg += argv[optind];
msg += "'";
QMessageBox::critical( NULL, w->caption(), msg, 0 );
QMessageBox::critical( nullptr, w->caption(), msg, 0 );
return 1;
}
}
@@ -135,7 +130,7 @@ int main(int argc, char **argv)
msg += "- Mesh file didn't provide texture coordinates\n";
msg += "- Texture file does not exist\n";
msg += "- Texture file is not accessible.\n";
QMessageBox::warning( NULL, w->caption(), msg, 0 );
QMessageBox::warning( nullptr, w->caption(), msg, 0 );
}
}

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
// -------------------- STL
#include <memory>
@@ -330,7 +325,7 @@ void mouse(int button, int state, int x, int y)
{
g.mgr->mouseButtonRelease(button, x, y);
// if ( g.mode & FLYMODE )
// glutIdleFunc(NULL);
// glutIdleFunc(nullptr);
}
else
{

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESHAPPS_MESHVIEWERWIDGETT_HH
@@ -173,7 +168,7 @@ protected:
//=============================================================================
#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESHAPPS_MESHVIEWERWIDGET_CC)
# define OPENMESH_MESHVIEWERWIDGET_TEMPLATES
# include "MeshViewerWidgetT.cc"
# include "MeshViewerWidgetT_impl.hh"
#endif
//=============================================================================
#endif // OPENMESHAPPS_MESHVIEWERWIDGETT_HH defined

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#define OPENMESHAPPS_MESHVIEWERWIDGET_CC

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APPS_VDPMSTREAMING_CLIENT_MYMESH_HH
#define OPENMESH_APPS_VDPMSTREAMING_CLIENT_MYMESH_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//== INCLUDES =================================================================

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESHAPPS_QGLVIEWERWIDGET_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//== INCLUDES =================================================================
@@ -139,17 +134,15 @@ void VDPMClientViewerWidget::mesh_coloring()
vEnd(mesh_.vertices_end());
VHierarchyNodeHandle node_handle;
float ratio;
unsigned char r, g, b;
for (; vIt!=vEnd; ++vIt)
{
node_handle = mesh_.data(*vIt).vhierarchy_node_handle();
ratio = vhierarchy_.node(node_handle).ratio();
const float ratio = vhierarchy_.node(node_handle).ratio();
r = (unsigned char) ((1.0f - ratio) * myYellow[0] + ratio * myBlue[0]);
g = (unsigned char) ((1.0f - ratio) * myYellow[1] + ratio * myBlue[1]);
b = (unsigned char) ((1.0f - ratio) * myYellow[2] + ratio * myBlue[2]);
const unsigned char r = (unsigned char) ((1.0f - ratio) * myYellow[0] + ratio * myBlue[0]);
const unsigned char g = (unsigned char) ((1.0f - ratio) * myYellow[1] + ratio * myBlue[1]);
const unsigned char b = (unsigned char) ((1.0f - ratio) * myYellow[2] + ratio * myBlue[2]);
mesh_.set_color(*vIt, OpenMesh::Vec3uc(r,g,b));
}

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APPS_VDPMSTREAMING_CLIENT_VDPMCLIENTVIEWERWIDGET_HH
#define OPENMESH_APPS_VDPMSTREAMING_CLIENT_VDPMCLIENTVIEWERWIDGET_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
// #ifdef _MSC_VER
// # pragma warning(disable: 4267 4311)

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#include <iostream>
#include <fstream>

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APP_SERVERSIDEVDPM_HH
#define OPENMESH_APP_SERVERSIDEVDPM_HH
@@ -77,7 +72,7 @@ private:
public:
ServerSideVDPM() { clear(); }
ServerSideVDPM() :name_(""),tree_id_bits_(0) { clear(); }
void clear();
const char* name() const { return name_; }

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#include <OpenMesh/Apps/VDProgMesh/Streaming/Server/VDPMServerSession.hh>
#include <OpenMesh/Apps/VDProgMesh/Streaming/Server/VDPMServerViewerWidget.hh>
@@ -69,7 +64,7 @@ set_vdpm(const char _vdpm_name[256])
}
#endif
vdpm_ = ((VDPMServerViewerWidget *) ((VDPMServerSocket *) parent())->parent())->get_vdpm(_vdpm_name);
if (vdpm_ == NULL)
if (vdpm_ == nullptr)
return false;
vhierarchy_ = &vdpm_->vhierarchy();

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APP_VDPMSTREAMING_SERVER_VDPMSERVERSESSION_HH
#define OPENMESH_APP_VDPMSTREAMING_SERVER_VDPMSERVERSESSION_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APP_VDPMSTREAMING_SERVER_VDPMSERVERSOCKET_HH
#define OPENMESH_APP_VDPMSTREAMING_SERVER_VDPMSERVERSOCKET_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#include <QKeyEvent>
#include <iterator>
@@ -77,7 +72,7 @@ get_vdpm(const char _vdpm_name[256])
}
}
return NULL;
return nullptr;
}
void

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APP_VDPMSTREAMING_SERVER_VDPMSTREAMINGSERVERWIDGET_HH
#define OPENMESH_APP_VDPMSTREAMING_SERVER_VDPMSTREAMINGSERVERWIDGET_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#include <iostream>

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APP_VDPMSTREAMINGSERVER_HH
#define OPENMESH_APP_VDPMSTREAMINGSERVER_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESHAPPS_MESHVIEWERWIDGETT_HH
@@ -173,7 +168,7 @@ protected:
//=============================================================================
#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESHAPPS_MESHVIEWERWIDGET_CC)
# define OPENMESH_MESHVIEWERWIDGET_TEMPLATES
# include "MeshViewerWidgetT.cc"
# include "MeshViewerWidgetT_impl.hh"
#endif
//=============================================================================
#endif // OPENMESHAPPS_MESHVIEWERWIDGETT_HH defined

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#define OPENMESHAPPS_MESHVIEWERWIDGET_CC

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APPS_VDPMSTREAMING_CLIENT_MYMESH_HH
#define OPENMESH_APPS_VDPMSTREAMING_CLIENT_MYMESH_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//== INCLUDES =================================================================

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESHAPPS_QGLVIEWERWIDGET_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//== INCLUDES =================================================================
@@ -138,17 +133,15 @@ void VDPMClientViewerWidget::mesh_coloring()
vEnd(mesh_.vertices_end());
VHierarchyNodeHandle node_handle;
float ratio;
unsigned char r, g, b;
for (; vIt!=vEnd; ++vIt)
{
node_handle = mesh_.data(*vIt).vhierarchy_node_handle();
ratio = vhierarchy_.node(node_handle).ratio();
const float ratio = vhierarchy_.node(node_handle).ratio();
r = (unsigned char) ((1.0f - ratio) * myYellow[0] + ratio * myBlue[0]);
g = (unsigned char) ((1.0f - ratio) * myYellow[1] + ratio * myBlue[1]);
b = (unsigned char) ((1.0f - ratio) * myYellow[2] + ratio * myBlue[2]);
const unsigned char r = (unsigned char) ((1.0f - ratio) * myYellow[0] + ratio * myBlue[0]);
const unsigned char g = (unsigned char) ((1.0f - ratio) * myYellow[1] + ratio * myBlue[1]);
const unsigned char b = (unsigned char) ((1.0f - ratio) * myYellow[2] + ratio * myBlue[2]);
mesh_.set_color(*vIt, OpenMesh::Vec3uc(r,g,b));
}

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APPS_VDPMSTREAMING_CLIENT_VDPMCLIENTVIEWERWIDGET_HH
#define OPENMESH_APPS_VDPMSTREAMING_CLIENT_VDPMCLIENTVIEWERWIDGET_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
// #ifdef _MSC_VER
// # pragma warning(disable: 4267 4311)

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#include <iostream>
#include <fstream>

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APP_SERVERSIDEVDPM_HH
#define OPENMESH_APP_SERVERSIDEVDPM_HH
@@ -76,7 +71,7 @@ private:
public:
ServerSideVDPM() { clear(); }
ServerSideVDPM(): name_(""),tree_id_bits_(0) { clear(); }
void clear();
const char* name() const { return name_; }

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#include <OpenMesh/Apps/VDProgMesh/Streaming/Server/VDPMServerSession.hh>
#include <OpenMesh/Apps/VDProgMesh/Streaming/Server/VDPMServerViewerWidget.hh>
@@ -69,7 +64,7 @@ set_vdpm(const char _vdpm_name[256])
}
#endif
vdpm_ = ((VDPMServerViewerWidget *) ((VDPMServerSocket *) parent())->parent())->get_vdpm(_vdpm_name);
if (vdpm_ == NULL)
if (vdpm_ == nullptr)
return false;
vhierarchy_ = &vdpm_->vhierarchy();

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APP_VDPMSTREAMING_SERVER_VDPMSERVERSESSION_HH
#define OPENMESH_APP_VDPMSTREAMING_SERVER_VDPMSERVERSESSION_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APP_VDPMSTREAMING_SERVER_VDPMSERVERSOCKET_HH
#define OPENMESH_APP_VDPMSTREAMING_SERVER_VDPMSERVERSOCKET_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#include <iterator>
#include <OpenMesh/Apps/VDProgMesh/Streaming/Server/VDPMServerViewerWidget.hh>
@@ -76,7 +71,7 @@ get_vdpm(const char _vdpm_name[256])
}
}
return NULL;
return nullptr;
}
void

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APP_VDPMSTREAMING_SERVER_VDPMSTREAMINGSERVERWIDGET_HH
#define OPENMESH_APP_VDPMSTREAMING_SERVER_VDPMSTREAMINGSERVERWIDGET_HH

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#include <iostream>

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef OPENMESH_APP_VDPMSTREAMINGSERVER_HH
#define OPENMESH_APP_VDPMSTREAMINGSERVER_HH

View File

@@ -1,26 +0,0 @@
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
INCLUDEPATH += ../../../..
CONFIG += glew glut
Application()
LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY} -lCore
LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY} -lTools
LIBS += -lglut
QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY}
QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY}
DIRECTORIES = .
# Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
################################################################################

View File

@@ -5,16 +5,9 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
set (targetName Analyzer)
acg_add_executable (Analyzer vdpmanalyzer.cc)
# collect all header and source files
set (sources
./vdpmanalyzer.cc
)
acg_add_executable (${targetName} ${sources})
target_link_libraries (${targetName}
target_link_libraries (Analyzer
OpenMeshCore
OpenMeshTools
)

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
// -------------------------------------------------------------- includes ----
@@ -276,7 +271,7 @@ int main(int argc, char **argv)
{
case 'v': verbose = true; break;
case 'o': ofname = optarg; break;
case 'h': usage_and_exit(0);
case 'h': usage_and_exit(0); break;
default: usage_and_exit(1);
}
}

View File

@@ -3,44 +3,28 @@ include (ACGCommon)
include_directories (
../../../..
${CMAKE_CURRENT_SOURCE_DIR}
${GLUT_INCLUDE_DIR}
${QT_INCLUDE_DIR}
)
set (targetName Synthesizer)
set (headers
VDPMSynthesizerViewerWidget.hh
)
# collect all header and source files
acg_append_files (headers "*.hh" .)
acg_append_files (sources "*.cc" .)
set (sources
../../QtViewer/QGLViewerWidget.cc
vdpmsynthesizer.cc
VDPMSynthesizerViewerWidget.cc
)
list (APPEND sources "../../QtViewer/QGLViewerWidget.cc")
list (APPEND sources "../../QtViewer/MeshViewerWidgetT.cc")
list (APPEND headers "../../QtViewer/QGLViewerWidget.hh")
list (APPEND headers "../../QtViewer/MeshViewerWidgetT.hh")
# remove template cc files from source file list
acg_drop_templates (sources)
# genereate uic and moc targets
if(QT5_FOUND)
acg_qt5_automoc (moc_targets ${headers})
else()
acg_qt4_automoc (moc_targets ${headers})
endif()
if (WIN32)
acg_add_executable (${targetName} WIN32 ${sources} ${headers} ${moc_targets})
# link to qtmain library to get WinMain function for a non terminal app
target_link_libraries (${targetName} ${QT_QTMAIN_LIBRARY})
acg_add_executable (Synthesizer WIN32 ${sources} ${headers})
else ()
acg_add_executable (${targetName} ${sources} ${headers} ${moc_targets})
acg_add_executable (Synthesizer ${sources} ${headers})
endif ()
target_link_libraries (${targetName}
target_link_libraries (Synthesizer
OpenMeshCore
OpenMeshTools
${QT_LIBRARIES}
Qt5::OpenGL
${OPENGL_LIBRARIES}
${GLUT_LIBRARIES}
)

View File

@@ -1,27 +0,0 @@
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
INCLUDEPATH += ../../../..
CONFIG += glew glut
Application()
LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY} -lCore
LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY} -lTools
LIBS += -lglut
QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY}
QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY}
DIRECTORIES = . ../../QtViewer
# Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
SOURCES -= ../../QtViewer/meshviewer.cc
FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
################################################################################

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
@@ -67,13 +62,6 @@
#include <QFileDialog>
#include <QDataStream>
#ifdef ARCH_DARWIN
#include <glut.h>
#else
#include <GL/glut.h>
#endif
#include <OpenMesh/Core/IO/MeshIO.hh>
#include <OpenMesh/Core/IO/BinaryHelper.hh>
#include <OpenMesh/Core/Utils/Endian.hh>
@@ -90,7 +78,14 @@ namespace OpenMesh {
//== IMPLEMENTATION ==========================================================
VDPMSynthesizerViewerWidget::VDPMSynthesizerViewerWidget(QWidget* _parent, const char* _name)
: MeshViewerWidget(_parent)
: MeshViewerWidget(_parent),
kappa_square_(0.0),
adaptive_mode_(false),
n_base_vertices_(0),
n_base_edges_(0),
n_base_faces_(0),
n_details_(0)
{
adaptive_mode_ = true;
}

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#ifdef _MSC_VER
# pragma warning(disable: 4267 4311)
@@ -57,21 +52,12 @@
#include "VDPMSynthesizerViewerWidget.hh"
#ifdef ARCH_DARWIN
#include <glut.h>
#else
#include <GL/glut.h>
#endif
int main(int argc, char **argv)
{
// OpenGL check
QApplication::setColorSpec( QApplication::CustomColor );
QApplication app(argc,argv);
#if !defined(__APPLE__)
glutInit(&argc,argv);
#endif
if ( !QGLFormat::hasOpenGL() ) {
std::cerr << "This system has no OpenGL support.\n";

View File

@@ -5,16 +5,9 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
set (targetName mkbalancedpm)
acg_add_executable (mkbalancedpm mkbalancedpm.cc)
# collect all header and source files
set (sources
./mkbalancedpm.cc
)
acg_add_executable (${targetName} ${sources})
target_link_libraries (${targetName}
target_link_libraries (mkbalancedpm
OpenMeshCore
OpenMeshTools
)

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
// -------------------- STL
#include <iostream>
@@ -89,7 +84,7 @@ public:
public:
/// Constructor
ModBalancerT( D &_dec )
explicit ModBalancerT( D &_dec )
: BaseModQ( _dec ),
max_level_(0), n_roots_(0), n_vertices_(0)
{
@@ -112,14 +107,14 @@ public:
public: // inherited
void initialize(void)
void initialize(void) override
{
BaseModQ::initialize();
n_vertices_ = BaseModQ::mesh().n_vertices();
n_roots_ = calc_bits_for_roots(n_vertices_);
}
virtual float collapse_priority(const CollapseInfo& _ci)
virtual float collapse_priority(const CollapseInfo& _ci) override
{
level_t newlevel = std::max( BaseModQ::mesh().property( level_, _ci.v0 ),
BaseModQ::mesh().property( level_, _ci.v1 ) )+1;
@@ -140,7 +135,7 @@ public: // inherited
}
/// post-process halfedge collapse (accumulate quadrics)
void postprocess_collapse(const CollapseInfo& _ci)
void postprocess_collapse(const CollapseInfo& _ci) override
{
BaseModQ::postprocess_collapse( _ci );
@@ -259,6 +254,7 @@ int main(int argc, char **argv)
case 'I': enable_modIS = true; break;
case 'h':
usage_and_exit(0);
break;
default:
usage_and_exit(1);
}

View File

@@ -1,26 +0,0 @@
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
INCLUDEPATH += ../../../..
CONFIG += glew glut
Application()
LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY} -lCore
LIBS += -Wl,-rpath=$${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY} -lTools
LIBS += -lglut
QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Core/lib/$${BUILDDIRECTORY}
QMAKE_LIBDIR += $${TOPDIR}/OpenMesh/Tools/lib/$${BUILDDIRECTORY}
DIRECTORIES = .
# Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
################################################################################

View File

@@ -2,18 +2,11 @@ include (ACGCommon)
include_directories (
../../..
${CMAKE_CURRENT_SOURCE_DIR}
)
set (targetName mconvert)
acg_add_executable (mconvert mconvert.cc)
# collect all header and source files
acg_append_files (headers "*.hh" .)
acg_append_files (sources "*.cc" .)
acg_add_executable (${targetName} ${headers} ${sources})
target_link_libraries (${targetName}
target_link_libraries (mconvert
OpenMeshCore
OpenMeshTools
)

View File

@@ -1,195 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="VS2008MConvert"
ProjectGUID="{C2F9DF8D-9293-4B6C-839C-57A38D1C873B}"
RootNamespace="VS2008MConvert"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_MATH_DEFINES"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="../../../"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_USE_MATH_DEFINES"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\mconvert.cc"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -39,12 +39,7 @@
* *
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
#include <iostream>
#include <iterator>
@@ -183,6 +178,7 @@ int main(int argc, char *argv[] )
case 'o': ofname = optarg; break;
case 'h':
usage_and_exit(0);
break;
case '?':
default:
usage_and_exit(1);

View File

@@ -1,22 +0,0 @@
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
Application()
INCLUDEPATH += ../../..
glew()
glut()
openmesh()
DIRECTORIES = .
# Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
################################################################################

View File

@@ -24,10 +24,6 @@ set (directories
acg_append_files (headers "*.hh" ${directories})
acg_append_files (sources "*.cc" ${directories})
#Drop the template only cc files
acg_drop_templates(sources)
# Disable Library installation when not building OpenMesh on its own but as part of another project!
if ( NOT ${PROJECT_NAME} MATCHES "OpenMesh")
set(ACG_NO_LIBRARY_INSTALL true)
@@ -81,16 +77,16 @@ endif()
# Install Header Files (Apple)
if ( NOT ACG_PROJECT_MACOS_BUNDLE AND APPLE )
FILE(GLOB files_install_Geometry "${CMAKE_CURRENT_SOURCE_DIR}/Geometry/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Geometry/*T.cc" )
FILE(GLOB files_install_IO "${CMAKE_CURRENT_SOURCE_DIR}/IO/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/*T.cc" "${CMAKE_CURRENT_SOURCE_DIR}/IO/*.inl" )
FILE(GLOB files_install_IO_importer "${CMAKE_CURRENT_SOURCE_DIR}/IO/importer/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/importer/*T.cc" )
FILE(GLOB files_install_IO_exporter "${CMAKE_CURRENT_SOURCE_DIR}/IO/exporter/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/exporter/*T.cc" )
FILE(GLOB files_install_IO_reader "${CMAKE_CURRENT_SOURCE_DIR}/IO/reader/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/reader/*T.cc" )
FILE(GLOB files_install_IO_writer "${CMAKE_CURRENT_SOURCE_DIR}/IO/writer/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/writer/*T.cc" )
FILE(GLOB files_install_Mesh "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/*T.cc" )
FILE(GLOB files_install_Mesh_Gen "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/gen/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/gen/*T.cc" )
FILE(GLOB files_install_System "${CMAKE_CURRENT_SOURCE_DIR}/System/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/System/*T.cc" "${CMAKE_CURRENT_SOURCE_DIR}/System/config.h" )
FILE(GLOB files_install_Utils "${CMAKE_CURRENT_SOURCE_DIR}/Utils/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Utils/*T.cc" )
FILE(GLOB files_install_Geometry "${CMAKE_CURRENT_SOURCE_DIR}/Geometry/*.hh" )
FILE(GLOB files_install_IO "${CMAKE_CURRENT_SOURCE_DIR}/IO/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/*.inl" )
FILE(GLOB files_install_IO_importer "${CMAKE_CURRENT_SOURCE_DIR}/IO/importer/*.hh" )
FILE(GLOB files_install_IO_exporter "${CMAKE_CURRENT_SOURCE_DIR}/IO/exporter/*.hh" )
FILE(GLOB files_install_IO_reader "${CMAKE_CURRENT_SOURCE_DIR}/IO/reader/*.hh" )
FILE(GLOB files_install_IO_writer "${CMAKE_CURRENT_SOURCE_DIR}/IO/writer/*.hh" )
FILE(GLOB files_install_Mesh "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/*.hh" )
FILE(GLOB files_install_Mesh_Gen "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/gen/*.hh" )
FILE(GLOB files_install_System "${CMAKE_CURRENT_SOURCE_DIR}/System/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/System/config.h" )
FILE(GLOB files_install_Utils "${CMAKE_CURRENT_SOURCE_DIR}/Utils/*.hh" )
INSTALL(FILES ${files_install_Geometry} DESTINATION include/OpenMesh/Core/Geometry )
INSTALL(FILES ${files_install_IO} DESTINATION include/OpenMesh/Core/IO )
INSTALL(FILES ${files_install_IO_importer} DESTINATION include/OpenMesh/Core/IO/importer )
@@ -118,17 +114,6 @@ install(DIRECTORY .
PATTERN "Templates" EXCLUDE
PATTERN "Debian*" EXCLUDE)
#install Template cc files (required by headers)
install(DIRECTORY .
DESTINATION include/OpenMesh/Core
FILES_MATCHING
PATTERN "*T.cc"
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "tmp" EXCLUDE
PATTERN "Templates" EXCLUDE
PATTERN "Debian*" EXCLUDE)
#install the config file
install(FILES System/config.h DESTINATION include/OpenMesh/Core/System)
@@ -138,14 +123,21 @@ install(DIRECTORY IO/
FILES_MATCHING
PATTERN "*.inl"
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN "reader" EXCLUDE
PATTERN "writer" EXCLUDE
PATTERN "importer" EXCLUDE
PATTERN "exporter" EXCLUDE
PATTERN "tmp" EXCLUDE
PATTERN "Debian*" EXCLUDE )
PATTERN ".svn" EXCLUDE
PATTERN "reader" EXCLUDE
PATTERN "writer" EXCLUDE
PATTERN "importer" EXCLUDE
PATTERN "exporter" EXCLUDE
PATTERN "tmp" EXCLUDE
PATTERN "Debian*" EXCLUDE )
endif ()
target_include_directories(OpenMeshCore PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..>
$<INSTALL_INTERFACE:include>)
install(TARGETS OpenMeshCore EXPORT OpenMeshConfig
ARCHIVE DESTINATION ${ACG_PROJECT_LIBDIR}
LIBRARY DESTINATION ${ACG_PROJECT_LIBDIR}
RUNTIME DESTINATION ${ACG_PROJECT_BINDIR})

View File

@@ -1,43 +0,0 @@
################################################################################
#
################################################################################
include( $$TOPDIR/qmake/all.include )
Library()
contains( OPENFLIPPER , OpenFlipper ){
DESTDIR = $${TOPDIR}/OpenMesh/lib
} else {
DESTDIR = $${TOPDIR}/lib
}
DIRECTORIES = . Geometry IO IO/exporter IO/importer IO/reader IO/writer \
Mesh Mesh/gen System Utils
INCLUDEPATH += ../..
CONFIG( debug, debug|release ){
TARGET = OpenMeshCored
} else {
TARGET = OpenMeshCore
}
win32 {
DEFINES += _USE_MATH_DEFINES NOMINMAX
CONFIG += static
}
macx {
# Set library binary header to the correct path
QMAKE_LFLAGS_SONAME = -install_name$${LITERAL_WHITESPACE}$${DESTDIR}/
export(QMAKE_LFLAGS_SONAME)
}
# Input
HEADERS += $$getFilesFromDir($$DIRECTORIES,*.hh)
SOURCES += $$getFilesFromDir($$DIRECTORIES,*.cc)
FORMS += $$getFilesFromDir($$DIRECTORIES,*.ui)
################################################################################

View File

@@ -40,12 +40,7 @@
* ========================================================================= */
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================

View File

@@ -0,0 +1,104 @@
/* ========================================================================= *
* *
* OpenMesh *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openmesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenMesh. *
*---------------------------------------------------------------------------*
* *
* 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. *
* *
* ========================================================================= */
/** This file contains all code required to use Eigen3 vectors as Mesh
* vectors
*/
#pragma once
#include <Eigen/Core>
#include <Eigen/Dense>
#include <Eigen/Geometry>
namespace OpenMesh {
template <typename _Scalar, int _Rows, int _Cols, int _Options>
struct vector_traits<Eigen::Matrix<_Scalar, _Rows, _Cols, _Options>> {
static_assert(_Rows != Eigen::Dynamic && _Cols != Eigen::Dynamic,
"Should not use dynamic vectors.");
static_assert(_Rows == 1 || _Cols == 1, "Should not use matrices.");
using vector_type = Eigen::Matrix<_Scalar, _Rows, _Cols, _Options>;
using value_type = _Scalar;
static const size_t size_ = _Rows * _Cols;
static size_t size() { return size_; }
};
} // namespace OpenMesh
namespace Eigen {
template <typename Derived>
typename Derived::Scalar dot(const MatrixBase<Derived> &x,
const MatrixBase<Derived> &y) {
return x.dot(y);
}
template <typename Derived>
typename MatrixBase< Derived >::PlainObject cross(const MatrixBase<Derived> &x, const MatrixBase<Derived> &y) {
return x.cross(y);
}
template <typename Derived>
typename Derived::Scalar norm(const MatrixBase<Derived> &x) {
return x.norm();
}
template <typename Derived>
typename Derived::Scalar sqrnorm(const MatrixBase<Derived> &x) {
return x.dot(x);
}
template <typename Derived>
MatrixBase<Derived> &normalize(MatrixBase<Derived> &x) {
x /= x.norm();
return x;
}
template <typename Derived>
MatrixBase<Derived> &vectorize(MatrixBase<Derived> &x,
typename Derived::Scalar const &val) {
x.fill(val);
return x;
}
} // namespace Eigen

Some files were not shown because too many files have changed in this diff Show More