Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CGoGN
CGoGN
Commits
54ec8819
Commit
54ec8819
authored
Nov 27, 2012
by
Sylvain Thery
Browse files
Merge branch 'master' of cgogn:CGoGN
parents
d5fb4a51
2cb5349c
Changes
322
Hide whitespace changes
Inline
Side-by-side
Apps/Examples/clipping.cpp
View file @
54ec8819
...
...
@@ -23,6 +23,7 @@
*******************************************************************************/
#include
"clipping.h"
#include
"Utils/vbo.h"
#include
"Utils/static_assert.h"
/*******************************************************************************
...
...
Apps/Examples/concave_rendering.cpp
View file @
54ec8819
...
...
@@ -35,6 +35,7 @@
#include
"Algo/Render/GL2/mapRender.h"
#include
"Utils/Shaders/shaderSimpleColor.h"
#include
"Utils/vbo.h"
#include
<glm/gtc/type_ptr.hpp>
...
...
Apps/Examples/extrusionView.cpp
View file @
54ec8819
...
...
@@ -40,6 +40,7 @@
#include
"Algo/Render/GL2/mapRender.h"
#include
"Utils/Shaders/shaderFlat.h"
#include
"Utils/Shaders/shaderSimpleColor.h"
#include
"Utils/vbo.h"
#include
<vector>
...
...
Apps/Examples/mcmesh.h
View file @
54ec8819
...
...
@@ -38,6 +38,7 @@
#include
"Algo/Render/GL2/mapRender.h"
#include
"Utils/Shaders/shaderFlat.h"
#include
"Utils/Shaders/shaderSimpleColor.h"
#include
"Utils/vbo.h"
#include
"Algo/Geometry/boundingbox.h"
#include
"Algo/MC/marchingcube.h"
...
...
Apps/Examples/texturesExample.cpp
View file @
54ec8819
...
...
@@ -25,6 +25,7 @@
#include
"texturesExample.h"
#include
"Algo/Geometry/boundingbox.h"
#include
"Algo/Modelisation/polyhedron.h"
#include
"Utils/vbo.h"
TexView
::
TexView
()
:
m_render
(
NULL
),
...
...
Apps/Examples/viewer.h
View file @
54ec8819
...
...
@@ -46,7 +46,7 @@
#include
"Utils/Shaders/shaderVectorPerVertex.h"
#include
"Utils/pointSprite.h"
#include
"Utils/text3d.h"
#include
"Utils/vbo
Render
.h"
#include
"Utils/vbo.h"
#include
"Utils/Qt/qtInputs.h"
...
...
Apps/Tuto/tuto1.cpp
View file @
54ec8819
...
...
@@ -46,6 +46,10 @@ int main(int argc, char **argv)
void
MyQT
::
createMap
()
{
// creation of a new attribute on vertices of type 3D vector for position.
// a handler to this attribute is returned
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
// creation of 2 new faces: 1 triangle and 1 square
Dart
d1
=
myMap
.
newFace
(
3
);
Dart
d2
=
myMap
.
newFace
(
4
);
...
...
@@ -53,10 +57,6 @@ void MyQT::createMap()
// sew these faces along one of their edge
myMap
.
sewFaces
(
d1
,
d2
);
// creation of a new attribute on vertices of type 3D vector for position.
// a handler to this attribute is returned
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
// affect position by moving in the map
position
[
d1
]
=
VEC3
(
0
,
0
,
0
);
position
[
PHI1
(
d1
)]
=
VEC3
(
2
,
0
,
0
);
...
...
Apps/Tuto/tuto2.h
View file @
54ec8819
...
...
@@ -41,6 +41,7 @@
#include
"Algo/Render/GL2/mapRender.h"
#include
"Utils/Shaders/shaderSimpleColor.h"
#include
"Utils/Shaders/shaderColorPerVertex.h"
#include
"Utils/vbo.h"
using
namespace
CGoGN
;
...
...
Apps/Tuto/tuto5.h
View file @
54ec8819
...
...
@@ -45,7 +45,7 @@
#include
"Topology/generic/cellmarker.h"
#include
"Utils/text3d.h"
#include
"Utils/vbo.h"
#include
"Utils/pointSprite.h"
#include
"Utils/Shaders/shaderSimpleColor.h"
#include
"Utils/Shaders/shaderVectorPerVertex.h"
...
...
Apps/Tuto/tuto_histo.h
View file @
54ec8819
...
...
@@ -35,7 +35,7 @@
#include
"Algo/Render/GL2/mapRender.h"
#include
"Utils/Shaders/shaderSimpleColor.h"
#include
"Utils/Shaders/shaderColorPerVertex.h"
#include
"Utils/vbo.h"
#include
"Algo/Histogram/histogram.h"
#include
"Utils/Qt/qthistodraw.h"
...
...
Apps/Tuto/tuto_mt.h
View file @
54ec8819
...
...
@@ -37,6 +37,7 @@
#include
"Utils/Shaders/shaderSimpleColor.h"
#include
"Utils/Shaders/shaderVectorPerVertex.h"
#include
"Utils/vbo.h"
#include
"Utils/cgognStream.h"
#include
"Utils/Qt/qtSimple.h"
...
...
Apps/Tuto/tuto_oper3.cpp
View file @
54ec8819
...
...
@@ -330,6 +330,7 @@ void MyQT::cb_mousePress(int button, int x, int y)
{
if
(
d
!=
Dart
::
nil
())
m_selected
=
d
;
std
::
cout
<<
myMap
.
edgeCanCollapse
(
d
)
<<
std
::
endl
;
}
if
(
button
==
Qt
::
RightButton
)
{
...
...
@@ -650,11 +651,14 @@ void MyQT::importMesh(std::string& filename)
else
{
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
}
m_selected
=
NIL
;
m_selected2
=
NIL
;
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_ex1
,
m_ex2
,
m_ex3
,
nb
);
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
setParamObject
(
bb
.
maxSize
(),
bb
.
center
().
data
())
;
m_shift
=
bb
.
maxSize
()
/
200.0
f
;
...
...
Apps/deprecated/tp_master.cpp
View file @
54ec8819
...
...
@@ -92,7 +92,7 @@ private:
// Assigne un nouveau plongement au sommet. Les anciens plongements sont libérés.
void
newVertex
(
Dart
d
)
{
embed
NewCell
<
VERTEX
>
(
d
);
setOrbitEmbeddingOn
NewCell
<
VERTEX
>
(
d
);
}
public:
...
...
Apps/deprecated/tutoriel.cpp
View file @
54ec8819
...
...
@@ -88,6 +88,15 @@ AttributeHandler<PFP::VEC3> normal;
class
QuadMesh
:
public
EmbeddedMap2
{
private:
// 3 brins de la carte
Dart
d_carre
;
Dart
d_tri
;
Dart
d_multiFaces
;
// Assigne un nouveau plongement au sommet. Les anciens plongements sont libérés.
void
newVertex
(
Dart
d
)
{
setOrbitEmbeddingOnNewCell
(
VERTEX
,
d
);
}
public:
void
createMesh
()
{
...
...
CMakeLists.txt
View file @
54ec8819
...
...
@@ -135,6 +135,7 @@ IF(APPLE)
SET
(
CMAKE_SHARED_LINKER_FLAGS
"
${
CMAKE_SHARED_LINKER_FLAGS
}
-Wl,-undefined -Wl,dynamic_lookup"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DMAC_OSX"
)
SET
(
CMAKE_OSX_ARCHITECTURES x86_64
)
SET
(
CGoGN_EXT_LIBS
${
CGoGN_EXT_LIBS
}
"-framework Foundation -framework cocoa"
)
ENDIF
(
APPLE
)
IF
(
WIN32
)
...
...
SCHNApps/CMakeLists.txt
0 → 100644
View file @
54ec8819
cmake_minimum_required
(
VERSION 2.8
)
project
(
SCHNApps
)
SET
(
QT_USE_QTOPENGL TRUE
)
SET
(
QT_USE_QTXML TRUE
)
SET
(
QT_USE_QTDESIGNER TRUE
)
SET
(
QT_USE_QTGUI TRUE
)
SET
(
QT_USE_QTPLUGIN TRUE
)
#========CGoGN========#
SET
(
CGoGN_ROOT_DIR
${
CMAKE_SOURCE_DIR
}
/.. CACHE STRING
"CGoGN root dir"
)
INCLUDE
(
${
CGoGN_ROOT_DIR
}
/apps_cmake.txt
)
find_package
(
Qt4 REQUIRED
)
#=======QGLViewer=========#
find_package
(
QGLViewer REQUIRED
)
#======SCHNApps=======#
SET
(
SCHNApps_ROOT_DIR
${
CGoGN_ROOT_DIR
}
/SCHNApps
)
SET
(
EXECUTABLE_OUTPUT_PATH
${
SCHNApps_ROOT_DIR
}
/bin
)
SET
(
LIBRARY_OUTPUT_PATH
${
SCHNApps_ROOT_DIR
}
/Plugins
)
ADD_SUBDIRECTORY
(
${
CMAKE_SOURCE_DIR
}
/Release Release
)
IF
(
NOT WIN32
)
ADD_SUBDIRECTORY
(
${
CMAKE_SOURCE_DIR
}
/Debug Debug
)
ENDIF
(
NOT WIN32
)
configure_file
(
${
CMAKE_SOURCE_DIR
}
/settings/state_save.xml
${
EXECUTABLE_OUTPUT_PATH
}
/state_save.xml @ONLY
)
#======Documentation=======#
find_package
(
Doxygen
)
if
(
DOXYGEN_FOUND
)
configure_file
(
${
CMAKE_SOURCE_DIR
}
/doc/Doxyfile.in
${
CMAKE_CURRENT_BINARY_DIR
}
/Doxyfile @ONLY
)
add_custom_target
(
doc
${
DOXYGEN_EXECUTABLE
}
${
CMAKE_CURRENT_BINARY_DIR
}
/Doxyfile
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
/Doc
COMMENT
"Generating API documentation with Doxygen"
VERBATIM
)
endif
(
DOXYGEN_FOUND
)
SCHNApps/Debug/CMakeLists.txt
0 → 100644
View file @
54ec8819
cmake_minimum_required
(
VERSION 2.8
)
SET
(
CMAKE_BUILD_TYPE Debug
)
IF
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ELSE
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Debug
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ENDIF
(
WIN32
)
INCLUDE_DIRECTORIES
(
${
CGoGN_ROOT_DIR
}
/include
${
COMMON_INCLUDES
}
${
CMAKE_CURRENT_SOURCE_DIR
}
${
CMAKE_CURRENT_BINARY_DIR
}
${
QGLVIEWER_INCLUDE_DIR
}
${
SCHNApps_ROOT_DIR
}
/include
)
file
(
GLOB
SCHNApps_SRC_FILES
${
SCHNApps_ROOT_DIR
}
/src/main.cpp
${
SCHNApps_ROOT_DIR
}
/src/interface/*.cpp
${
SCHNApps_ROOT_DIR
}
/src/visualization/*.cpp
${
SCHNApps_ROOT_DIR
}
/src/dialogs/*.cpp
)
SET
(
SCHNApps_H_OBJECT_FILES
${
SCHNApps_ROOT_DIR
}
/include/interface/window.h
${
SCHNApps_ROOT_DIR
}
/include/interface/system.h
${
SCHNApps_ROOT_DIR
}
/include/interface/viewButtonArea.h
${
SCHNApps_ROOT_DIR
}
/include/interface/splitArea.h
${
SCHNApps_ROOT_DIR
}
/include/visualization/view.h
${
SCHNApps_ROOT_DIR
}
/include/visualization/scene.h
${
SCHNApps_ROOT_DIR
}
/include/dialogs/newSceneDialog.h
${
SCHNApps_ROOT_DIR
}
/include/dialogs/sceneSelector.h
${
SCHNApps_ROOT_DIR
}
/include/dialogs/cameraViewDialog.h
${
SCHNApps_ROOT_DIR
}
/include/dialogs/cameraOptionDialog.h
${
SCHNApps_ROOT_DIR
}
/include/dialogs/cameraSceneDialog.h
${
SCHNApps_ROOT_DIR
}
/include/dialogs/globalCameraDialog.h
${
SCHNApps_ROOT_DIR
}
/include/dialogs/pluginDialog.h
${
SCHNApps_ROOT_DIR
}
/include/dialogs/linkViewDialog.h
${
SCHNApps_ROOT_DIR
}
/include/dialogs/mapPluginDialog.h
)
file
(
GLOB
SCHNApps_FORM_FILES
${
SCHNApps_ROOT_DIR
}
/forms/*.ui
)
QT4_WRAP_UI
(
UI_H_FILES
${
SCHNApps_FORM_FILES
}
)
QT4_WRAP_CPP
(
MOC_FILES
${
SCHNApps_H_OBJECT_FILES
}
)
QT4_ADD_RESOURCES
(
RCC_FILES
${
SCHNApps_ROOT_DIR
}
/resources/resources.qrc
)
ADD_EXECUTABLE
(
SCHNAppsD
${
SCHNApps_SRC_FILES
}
${
UI_H_FILES
}
${
MOC_FILES
}
${
RCC_FILES
}
)
TARGET_LINK_LIBRARIES
(
SCHNAppsD
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QGLVIEWER_LIBRARIES
}
)
ADD_SUBDIRECTORY
(
${
SCHNApps_ROOT_DIR
}
/Plugins PluginsD
)
SCHNApps/Plugins/CMakeLists.txt
0 → 100644
View file @
54ec8819
cmake_minimum_required
(
VERSION 2.8
)
ADD_SUBDIRECTORY
(
firstPlugin
)
SCHNApps/Plugins/firstPlugin/CMakeLists.txt
0 → 100644
View file @
54ec8819
cmake_minimum_required
(
VERSION 2.8
)
INCLUDE_DIRECTORIES
(
${
SCHNApps_ROOT_DIR
}
/include
${
SCHNApps_ROOT_DIR
}
/Plugins/firstPlugin/include
${
CMAKE_CURRENT_BINARY_DIR
}
)
SET
(
FIRSTPLUGIN_PLUGIN_SRC
${
SCHNApps_ROOT_DIR
}
/src/plugins/visualPlugin.cpp
${
SCHNApps_ROOT_DIR
}
/Plugins/firstPlugin/src/firstPlugin.cpp
)
SET
(
FIRSTPLUGIN_PLUGIN_H
${
SCHNApps_ROOT_DIR
}
/include/plugins/visualPlugin.h
${
SCHNApps_ROOT_DIR
}
/Plugins/firstPlugin/include/firstPlugin.h
)
IF
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
IF
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ELSE
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Debug
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ENDIF
(
WIN32
)
QT4_WRAP_CPP
(
FIRSTPLUGIN_MOC
${
FIRSTPLUGIN_PLUGIN_H
}
)
ADD_LIBRARY
(
FirstPluginD SHARED
${
FIRSTPLUGIN_PLUGIN_SRC
}
${
FIRSTPLUGIN_MOC
}
)
TARGET_LINK_LIBRARIES
(
FirstPluginD
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QGLVIEWER_LIBRARIES
}
)
ADD_DEPENDENCIES
(
FirstPluginD SCHNAppsD
)
SET_TARGET_PROPERTIES
(
FirstPluginD PROPERTIES COMPILE_DEFINITIONS
"DEBUG"
)
ELSE
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
IF
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ELSE
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/Release
)
ENDIF
(
WIN32
)
QT4_WRAP_CPP
(
FIRSTPLUGIN_MOC
${
FIRSTPLUGIN_PLUGIN_H
}
)
ADD_LIBRARY
(
FirstPlugin SHARED
${
FIRSTPLUGIN_PLUGIN_SRC
}
${
FIRSTPLUGIN_MOC
}
)
TARGET_LINK_LIBRARIES
(
FirstPlugin
${
CGoGN_LIBS_R
}
${
COMMON_LIBS
}
${
QGLVIEWER_LIBRARIES
}
)
ADD_DEPENDENCIES
(
FirstPlugin SCHNApps
)
ENDIF
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
SCHNApps/Plugins/firstPlugin/include/firstPlugin.h
0 → 100644
View file @
54ec8819
#ifndef _FIRSTPLUGIN_H_
#define _FIRSTPLUGIN_H_
#include
"plugins/visualPlugin.h"
/**---CGoGN includes **/
#include
"Topology/generic/parameters.h"
#include
"Topology/map/embeddedMap2.h"
#include
"Algo/Render/GL2/topoRender.h"
/**---CGoGN includes **/
/**---Definitions specific to CGoGN ---*/
using
namespace
CGoGN
;
/**
* Struct that contains some informations about the types of the manipulated objects
* Mainly here to be used by the algorithms that are parameterized by it
*/
struct
PFP
:
public
PFP_STANDARD
{
// definition of the map
typedef
EmbeddedMap2
MAP
;
};
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
VEC3
VEC3
;
/**---Definitions specific to CGoGN ---*/
/**
* This class is a basic minimal plugin.
* All the methods in this class are overloaded methods.
* In order to create a valid plugin, all the method in this
* needs to be declared (they are actually overloaded methods
* from VisualPlugin), even if your plugin doesn't make any
* drawing.
*/
/**
* Our plugin must inherit from VisualPlugin,
* that is a class that itself is an implementation
* of the Plugin interface (virtual class). It contains
* many useful and essantial methods.
*/
class
FirstPlugin
:
public
VisualPlugin
{
/**
* Essential Qt macros.
*/
Q_OBJECT
Q_INTERFACES
(
Plugin
)
public:
FirstPlugin
()
{}
~
FirstPlugin
()
{}
/**
* The classical call back for the initGL method
* When a scene will be link to this plugin, it will call
* back this method with itself as a parameter.
*/
void
cb_initGL
(
Scene
*
scene
);
/**
* The drawing method that needs to be overloaded.
* Each time a scene (that is to say, at least one of the
* views that is contains) needs to be refresh, it calls back
* this method with itself as a parameter
*/
void
cb_redraw
(
Scene
*
scene
);
/**
* The plugin's activation method
* Each time the main application loads this plugin,
* it call this method. Writing this method is
* the occasion to initialize the plugin and check certain
* conditions.
* If this methods return 'false', the plugin load will be aborted.
*/
bool
activate
();
/**
* The plugin's disabling method
* Each time the main application will unload the plugin
* it will call this method.
*/
void
disable
();
protected:
/** Attributes that are specific to this plugin **/
MAP
myMap
;
// attribute for vertices positions
VertexAttribute
<
VEC3
>
position
;
// render (for the topo)
Algo
::
Render
::
GL2
::
TopoRender
*
m_render_topo
;
// just for more compact writing
inline
Dart
PHI1
(
Dart
d
)
{
return
myMap
.
phi1
(
d
);
}
inline
Dart
PHI_1
(
Dart
d
)
{
return
myMap
.
phi_1
(
d
);
}
inline
Dart
PHI2
(
Dart
d
)
{
return
myMap
.
phi2
(
d
);
}
template
<
int
X
>
Dart
PHI
(
Dart
d
)
{
return
myMap
.
phi
<
X
>
(
d
);
}
/** Attributes that are specific to this plugin **/
};
#endif // _FIRSTPLUGIN_H_
Prev
1
2
3
4
5
…
17
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment