Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
a6fafab3
Commit
a6fafab3
authored
Jun 17, 2016
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 'develop'
LSM plugin + plugin dll export symbols See merge request
!87
parents
aa81c0e3
b27412a1
Changes
53
Hide whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
1093 additions
and
16 deletions
+1093
-16
Apps/Benches/CMakeLists.txt
Apps/Benches/CMakeLists.txt
+3
-0
CGoGN/include/Algo/Import/import2tables.h
CGoGN/include/Algo/Import/import2tables.h
+1
-1
SCHNApps/Plugins/CMakeLists.txt
SCHNApps/Plugins/CMakeLists.txt
+1
-0
SCHNApps/Plugins/surface_deformation/CMakeLists.txt
SCHNApps/Plugins/surface_deformation/CMakeLists.txt
+2
-0
SCHNApps/Plugins/surface_deformation/include/dll.h
SCHNApps/Plugins/surface_deformation/include/dll.h
+9
-0
SCHNApps/Plugins/surface_deformation/include/surface_deformation.h
...Plugins/surface_deformation/include/surface_deformation.h
+2
-1
SCHNApps/Plugins/surface_differentialProperties/CMakeLists.txt
...pps/Plugins/surface_differentialProperties/CMakeLists.txt
+2
-0
SCHNApps/Plugins/surface_differentialProperties/include/dll.h
...Apps/Plugins/surface_differentialProperties/include/dll.h
+9
-0
SCHNApps/Plugins/surface_differentialProperties/include/surface_differentialProperties.h
...entialProperties/include/surface_differentialProperties.h
+2
-1
SCHNApps/Plugins/surface_distance/CMakeLists.txt
SCHNApps/Plugins/surface_distance/CMakeLists.txt
+2
-0
SCHNApps/Plugins/surface_distance/include/dll.h
SCHNApps/Plugins/surface_distance/include/dll.h
+9
-0
SCHNApps/Plugins/surface_distance/include/surface_distance.h
SCHNApps/Plugins/surface_distance/include/surface_distance.h
+2
-1
SCHNApps/Plugins/surface_import/CMakeLists.txt
SCHNApps/Plugins/surface_import/CMakeLists.txt
+2
-0
SCHNApps/Plugins/surface_import/include/dll.h
SCHNApps/Plugins/surface_import/include/dll.h
+9
-0
SCHNApps/Plugins/surface_import/include/surface_import.h
SCHNApps/Plugins/surface_import/include/surface_import.h
+2
-1
SCHNApps/Plugins/surface_lsm/CMakeLists.txt
SCHNApps/Plugins/surface_lsm/CMakeLists.txt
+34
-0
SCHNApps/Plugins/surface_lsm/forms/surface_lsm.ui
SCHNApps/Plugins/surface_lsm/forms/surface_lsm.ui
+105
-0
SCHNApps/Plugins/surface_lsm/include/dll.h
SCHNApps/Plugins/surface_lsm/include/dll.h
+9
-0
SCHNApps/Plugins/surface_lsm/include/surface_lsm.h
SCHNApps/Plugins/surface_lsm/include/surface_lsm.h
+116
-0
SCHNApps/Plugins/surface_lsm/include/surface_lsm_dockTab.h
SCHNApps/Plugins/surface_lsm/include/surface_lsm_dockTab.h
+50
-0
SCHNApps/Plugins/surface_lsm/src/surface_lsm.cpp
SCHNApps/Plugins/surface_lsm/src/surface_lsm.cpp
+392
-0
SCHNApps/Plugins/surface_lsm/src/surface_lsm_dockTab.cpp
SCHNApps/Plugins/surface_lsm/src/surface_lsm_dockTab.cpp
+197
-0
SCHNApps/Plugins/surface_modelisation/CMakeLists.txt
SCHNApps/Plugins/surface_modelisation/CMakeLists.txt
+2
-0
SCHNApps/Plugins/surface_modelisation/include/dll.h
SCHNApps/Plugins/surface_modelisation/include/dll.h
+9
-0
SCHNApps/Plugins/surface_modelisation/include/surface_modelisation.h
...ugins/surface_modelisation/include/surface_modelisation.h
+2
-1
SCHNApps/Plugins/surface_radiance/CMakeLists.txt
SCHNApps/Plugins/surface_radiance/CMakeLists.txt
+2
-0
SCHNApps/Plugins/surface_radiance/include/dll.h
SCHNApps/Plugins/surface_radiance/include/dll.h
+9
-0
SCHNApps/Plugins/surface_radiance/include/surface_radiance.h
SCHNApps/Plugins/surface_radiance/include/surface_radiance.h
+2
-1
SCHNApps/Plugins/surface_render/CMakeLists.txt
SCHNApps/Plugins/surface_render/CMakeLists.txt
+2
-0
SCHNApps/Plugins/surface_render/include/dll.h
SCHNApps/Plugins/surface_render/include/dll.h
+9
-0
SCHNApps/Plugins/surface_render/include/surface_render.h
SCHNApps/Plugins/surface_render/include/surface_render.h
+4
-2
SCHNApps/Plugins/surface_render/src/surface_render.cpp
SCHNApps/Plugins/surface_render/src/surface_render.cpp
+1
-1
SCHNApps/Plugins/surface_renderScalar/CMakeLists.txt
SCHNApps/Plugins/surface_renderScalar/CMakeLists.txt
+2
-0
SCHNApps/Plugins/surface_renderScalar/include/dll.h
SCHNApps/Plugins/surface_renderScalar/include/dll.h
+9
-0
SCHNApps/Plugins/surface_renderScalar/include/surface_renderScalar.h
...ugins/surface_renderScalar/include/surface_renderScalar.h
+2
-1
SCHNApps/Plugins/surface_renderTopo/CMakeLists.txt
SCHNApps/Plugins/surface_renderTopo/CMakeLists.txt
+2
-0
SCHNApps/Plugins/surface_renderTopo/include/dll.h
SCHNApps/Plugins/surface_renderTopo/include/dll.h
+9
-0
SCHNApps/Plugins/surface_renderTopo/include/surface_renderTopo.h
...s/Plugins/surface_renderTopo/include/surface_renderTopo.h
+2
-1
SCHNApps/Plugins/surface_renderVector/CMakeLists.txt
SCHNApps/Plugins/surface_renderVector/CMakeLists.txt
+2
-0
SCHNApps/Plugins/surface_renderVector/include/dll.h
SCHNApps/Plugins/surface_renderVector/include/dll.h
+9
-0
SCHNApps/Plugins/surface_renderVector/include/surface_renderVector.h
...ugins/surface_renderVector/include/surface_renderVector.h
+2
-1
SCHNApps/Plugins/surface_selection/CMakeLists.txt
SCHNApps/Plugins/surface_selection/CMakeLists.txt
+2
-0
SCHNApps/Plugins/surface_selection/include/dll.h
SCHNApps/Plugins/surface_selection/include/dll.h
+9
-0
SCHNApps/Plugins/surface_selection/include/surface_selection.h
...pps/Plugins/surface_selection/include/surface_selection.h
+2
-1
SCHNApps/Plugins/surface_subdivision/CMakeLists.txt
SCHNApps/Plugins/surface_subdivision/CMakeLists.txt
+2
-0
SCHNApps/Plugins/surface_subdivision/include/dll.h
SCHNApps/Plugins/surface_subdivision/include/dll.h
+9
-0
SCHNApps/Plugins/surface_subdivision/include/surface_subdivision.h
...Plugins/surface_subdivision/include/surface_subdivision.h
+2
-1
SCHNApps/Plugins/volume_import/CMakeLists.txt
SCHNApps/Plugins/volume_import/CMakeLists.txt
+2
-0
SCHNApps/Plugins/volume_import/include/dll.h
SCHNApps/Plugins/volume_import/include/dll.h
+9
-0
SCHNApps/Plugins/volume_import/include/volume_import.h
SCHNApps/Plugins/volume_import/include/volume_import.h
+2
-1
SCHNApps/Plugins/volume_render/CMakeLists.txt
SCHNApps/Plugins/volume_render/CMakeLists.txt
+2
-0
SCHNApps/Plugins/volume_render/include/dll.h
SCHNApps/Plugins/volume_render/include/dll.h
+9
-0
ThirdParty/include/Eigen/src/Core/Matrix.h
ThirdParty/include/Eigen/src/Core/Matrix.h
+2
-0
No files found.
Apps/Benches/CMakeLists.txt
View file @
a6fafab3
...
...
@@ -10,3 +10,6 @@ target_link_libraries( bench_remesh ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
add_executable
(
bench_compact bench_compact.cpp
)
target_link_libraries
(
bench_compact
${
CGoGN_LIBS
}
${
CGoGN_EXT_LIBS
}
)
add_executable
(
bench_import_trav bench_import_trav.cpp
)
target_link_libraries
(
bench_import_trav
${
CGoGN_LIBS
}
${
CGoGN_EXT_LIBS
}
)
CGoGN/include/Algo/Import/import2tables.h
View file @
a6fafab3
...
...
@@ -62,7 +62,7 @@ class MeshTablesSurface
public:
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
VEC3
::
DATA_TYPE
DATA_TYPE
;
typedef
typename
VEC3
::
DATA_TYPE
DATA_TYPE
;
typedef
typename
PFP
::
REAL
REAL
;
protected:
...
...
SCHNApps/Plugins/CMakeLists.txt
View file @
a6fafab3
...
...
@@ -23,6 +23,7 @@ ADD_SUBDIRECTORY(surface_differentialProperties)
ADD_SUBDIRECTORY
(
surface_subdivision
)
ADD_SUBDIRECTORY
(
surface_selection
)
ADD_SUBDIRECTORY
(
surface_deformation
)
ADD_SUBDIRECTORY
(
surface_lsm
)
ADD_SUBDIRECTORY
(
surface_modelisation
)
ADD_SUBDIRECTORY
(
surface_radiance
)
ADD_SUBDIRECTORY
(
surface_distance
)
...
...
SCHNApps/Plugins/surface_deformation/CMakeLists.txt
View file @
a6fafab3
...
...
@@ -4,6 +4,8 @@ SET( PLUGIN_NAME Surface_Deformation )
SET
(
PLUGIN_ROOT_DIR
${
SCHNApps_ROOT_DIR
}
/Plugins/surface_deformation
)
ADD_DEFINITIONS
(
-DSURFACE_DEFORMATION_DLL_EXPORT
)
INCLUDE_DIRECTORIES
(
${
PLUGIN_ROOT_DIR
}
/include
${
CMAKE_CURRENT_BINARY_DIR
}
...
...
SCHNApps/Plugins/surface_deformation/include/dll.h
0 → 100644
View file @
a6fafab3
#ifdef WIN32
#if defined SURFACE_DEFORMATION_DLL_EXPORT
#define SURFACE_DEFORMATION_API __declspec(dllexport)
#else
#define SURFACE_DEFORMATION_API __declspec(dllimport)
#endif
#else
#define SURFACE_DEFORMATION_API
#endif
SCHNApps/Plugins/surface_deformation/include/surface_deformation.h
View file @
a6fafab3
#ifndef _SURFACE_DEFORMATION_PLUGIN_H_
#define _SURFACE_DEFORMATION_PLUGIN_H_
#include "dll.h"
#include "plugin_interaction.h"
#include "surface_deformation_dockTab.h"
...
...
@@ -46,7 +47,7 @@ struct MapParameters
NLContext
nlContext
;
};
class
Surface_Deformation_Plugin
:
public
PluginInteraction
class
S
URFACE_DEFORMATION_API
S
urface_Deformation_Plugin
:
public
PluginInteraction
{
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
...
...
SCHNApps/Plugins/surface_differentialProperties/CMakeLists.txt
View file @
a6fafab3
...
...
@@ -4,6 +4,8 @@ SET( PLUGIN_NAME Surface_DifferentialProperties )
SET
(
PLUGIN_ROOT_DIR
${
SCHNApps_ROOT_DIR
}
/Plugins/surface_differentialProperties
)
ADD_DEFINITIONS
(
-DSURFACE_DIFFERENTIAL_PROPERTIES_DLL_EXPORT
)
INCLUDE_DIRECTORIES
(
${
PLUGIN_ROOT_DIR
}
/include
${
CMAKE_CURRENT_BINARY_DIR
}
...
...
SCHNApps/Plugins/surface_differentialProperties/include/dll.h
0 → 100644
View file @
a6fafab3
#ifdef WIN32
#if defined SURFACE_DIFFERENTIAL_PROPERTIES_DLL_EXPORT
#define SURFACE_DIFFERENTIAL_PROPERTIES_API __declspec(dllexport)
#else
#define SURFACE_DIFFERENTIAL_PROPERTIES_API __declspec(dllimport)
#endif
#else
#define SURFACE_DIFFERENTIAL_PROPERTIES_API
#endif
SCHNApps/Plugins/surface_differentialProperties/include/surface_differentialProperties.h
View file @
a6fafab3
#ifndef _SURFACE_DIFFERENTIALPROPERTIES_PLUGIN_H_
#define _SURFACE_DIFFERENTIALPROPERTIES_PLUGIN_H_
#include "dll.h"
#include "plugin_processing.h"
#include "dialog_computeNormal.h"
...
...
@@ -16,7 +17,7 @@ namespace SCHNApps
* - Normals
* - Curvatures
*/
class
Surface_DifferentialProperties_Plugin
:
public
PluginProcessing
class
S
URFACE_DIFFERENTIAL_PROPERTIES_API
S
urface_DifferentialProperties_Plugin
:
public
PluginProcessing
{
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
...
...
SCHNApps/Plugins/surface_distance/CMakeLists.txt
View file @
a6fafab3
...
...
@@ -4,6 +4,8 @@ SET( PLUGIN_NAME Surface_Distance )
SET
(
PLUGIN_ROOT_DIR
${
SCHNApps_ROOT_DIR
}
/Plugins/surface_distance
)
ADD_DEFINITIONS
(
-DSURFACE_DISTANCE_DLL_EXPORT
)
INCLUDE_DIRECTORIES
(
${
PLUGIN_ROOT_DIR
}
/include
${
CMAKE_CURRENT_BINARY_DIR
}
...
...
SCHNApps/Plugins/surface_distance/include/dll.h
0 → 100644
View file @
a6fafab3
#ifdef WIN32
#if defined SURFACE_DISTANCE_DLL_EXPORT
#define SURFACE_DISTANCE_API __declspec(dllexport)
#else
#define SURFACE_DISTANCE_API __declspec(dllimport)
#endif
#else
#define SURFACE_DISTANCE_API
#endif
SCHNApps/Plugins/surface_distance/include/surface_distance.h
View file @
a6fafab3
#ifndef _SURFACE_DISTANCE_PLUGIN_H_
#define _SURFACE_DISTANCE_PLUGIN_H_
#include "dll.h"
#include "plugin_processing.h"
#include "dialog_computeDistance.h"
...
...
@@ -11,7 +12,7 @@ namespace CGoGN
namespace
SCHNApps
{
class
Surface_Distance_Plugin
:
public
PluginProcessing
class
S
URFACE_DISTANCE_API
S
urface_Distance_Plugin
:
public
PluginProcessing
{
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
...
...
SCHNApps/Plugins/surface_import/CMakeLists.txt
View file @
a6fafab3
...
...
@@ -4,6 +4,8 @@ SET( PLUGIN_NAME Surface_Import )
SET
(
PLUGIN_ROOT_DIR
${
SCHNApps_ROOT_DIR
}
/Plugins/surface_import
)
ADD_DEFINITIONS
(
-DSURFACE_IMPORT_DLL_EXPORT
)
INCLUDE_DIRECTORIES
(
${
PLUGIN_ROOT_DIR
}
/include
${
CMAKE_CURRENT_BINARY_DIR
}
...
...
SCHNApps/Plugins/surface_import/include/dll.h
0 → 100644
View file @
a6fafab3
#ifdef WIN32
#if defined SURFACE_IMPORT_DLL_EXPORT
#define SURFACE_IMPORT_API __declspec(dllexport)
#else
#define SURFACE_IMPORT_API __declspec(dllimport)
#endif
#else
#define SURFACE_IMPORT_API
#endif
SCHNApps/Plugins/surface_import/include/surface_import.h
View file @
a6fafab3
#ifndef _SURFACE_IMPORT_PLUGIN_H_
#define _SURFACE_IMPORT_PLUGIN_H_
#include "dll.h"
#include "plugin_processing.h"
namespace
CGoGN
...
...
@@ -13,7 +14,7 @@ namespace SCHNApps
* The import image function allow the creation of a mesh with a face by pixel.
* Image format support is given by Qt.
*/
class
Surface_Import_Plugin
:
public
PluginProcessing
class
S
URFACE_IMPORT_API
S
urface_Import_Plugin
:
public
PluginProcessing
{
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
...
...
SCHNApps/Plugins/surface_lsm/CMakeLists.txt
0 → 100644
View file @
a6fafab3
cmake_minimum_required
(
VERSION 2.8
)
SET
(
PLUGIN_NAME Surface_LSM
)
SET
(
PLUGIN_ROOT_DIR
${
SCHNApps_ROOT_DIR
}
/Plugins/surface_lsm
)
ADD_DEFINITIONS
(
-DSURFACE_LSM_DLL_EXPORT
)
INCLUDE_DIRECTORIES
(
${
PLUGIN_ROOT_DIR
}
/include
${
CMAKE_CURRENT_BINARY_DIR
}
)
file
(
GLOB_RECURSE
PLUGIN_FILES
${
PLUGIN_ROOT_DIR
}
/src/*.cpp
${
PLUGIN_ROOT_DIR
}
/include/*.h
${
PLUGIN_ROOT_DIR
}
/include/*.hpp
)
file
(
GLOB_RECURSE
PLUGIN_UI_FILES
${
PLUGIN_ROOT_DIR
}
/forms/*.ui
)
SET
(
PLUGIN_QOBJECT_FILES
${
PLUGIN_ROOT_DIR
}
/include/surface_lsm.h
${
PLUGIN_ROOT_DIR
}
/include/surface_lsm_dockTab.h
)
include
(
${
SCHNApps_ROOT_DIR
}
/Plugins/plugins_cmake.txt
)
SCHNApps/Plugins/surface_lsm/forms/surface_lsm.ui
0 → 100644
View file @
a6fafab3
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
Surface_LSM_TabWidget
</class>
<widget
class=
"QWidget"
name=
"Surface_LSM_TabWidget"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
216
</width>
<height>
545
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"6"
column=
"0"
colspan=
"2"
>
<widget
class=
"QComboBox"
name=
"combo_freeSelector"
>
<item>
<property
name=
"text"
>
<string>
- select selector -
</string>
</property>
</item>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Position :
</string>
</property>
</widget>
</item>
<item
row=
"5"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
Free vertices selector :
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"combo_positionAttribute"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<item>
<property
name=
"text"
>
<string>
- select attribute -
</string>
</property>
</item>
</widget>
</item>
<item
row=
"9"
column=
"0"
colspan=
"2"
>
<widget
class=
"Line"
name=
"line"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
<item
row=
"10"
column=
"0"
colspan=
"2"
>
<widget
class=
"QPushButton"
name=
"button_start_stop"
>
<property
name=
"text"
>
<string>
Start
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
colspan=
"2"
>
<widget
class=
"QComboBox"
name=
"combo_handleSelector"
>
<item>
<property
name=
"text"
>
<string>
- select selector -
</string>
</property>
</item>
</widget>
</item>
<item
row=
"11"
column=
"0"
colspan=
"2"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
156
</width>
<height>
161
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"3"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Handle vertices selector :
</string>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>
combo_positionAttribute
</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
SCHNApps/Plugins/surface_lsm/include/dll.h
0 → 100644
View file @
a6fafab3
#ifdef WIN32
#if defined SURFACE_LSM_DLL_EXPORT
#define SURFACE_LSM_API __declspec(dllexport)
#else
#define SURFACE_LSM_API __declspec(dllimport)
#endif
#else
#define SURFACE_LSM_API
#endif
SCHNApps/Plugins/surface_lsm/include/surface_lsm.h
0 → 100644
View file @
a6fafab3
#ifndef _SURFACE_DEFORMATION_PLUGIN_H_
#define _SURFACE_DEFORMATION_PLUGIN_H_
#include "dll.h"
#include "plugin_interaction.h"
#include "surface_lsm_dockTab.h"
#include "mapHandler.h"
#include "Container/fakeAttribute.h"
#include "NL/nl.h"
#include "Algo/LinearSolving/basic.h"
#include "Eigen/Dense"
namespace
CGoGN
{
namespace
SCHNApps
{
typedef
NoTypeNameAttribute
<
Eigen
::
Matrix3f
>
Eigen_Matrix3f
;
struct
MapParameters
{
MapParameters
();
~
MapParameters
();
void
start
(
MapHandlerGen
*
mh
);
void
stop
(
MapHandlerGen
*
mh
);
VertexAttribute
<
PFP2
::
VEC3
,
PFP2
::
MAP
>
positionAttribute
;
CellSelector
<
PFP2
::
MAP
,
VERTEX
>*
handleSelector
;
CellSelector
<
PFP2
::
MAP
,
VERTEX
>*
freeSelector
;
bool
initialized
;
VertexAttribute
<
unsigned
int
,
PFP2
::
MAP
>
vIndex
;
unsigned
int
nb_vertices
;
NLContext
nlContext
;
};
class
SURFACE_LSM_API
Surface_LSM_Plugin
:
public
PluginInteraction
{
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
#if CGOGN_QT_DESIRED_VERSION == 5
Q_PLUGIN_METADATA
(
IID
"CGoGN.SCHNapps.Plugin"
)
#endif
friend
class
Surface_LSM_DockTab
;
public:
Surface_LSM_Plugin
()
:
m_draginit
(
false
),
m_dragging
(
false
)
{}
~
Surface_LSM_Plugin
()
{}
virtual
bool
enable
();
virtual
void
disable
();
virtual
void
draw
(
View
*
view
);
virtual
void
drawMap
(
View
*
view
,
MapHandlerGen
*
map
)
{}
virtual
void
keyPress
(
View
*
view
,
QKeyEvent
*
event
);
virtual
void
keyRelease
(
View
*
,
QKeyEvent
*
)
{}
virtual
void
mousePress
(
View
*
,
QMouseEvent
*
)
{}
virtual
void
mouseRelease
(
View
*
,
QMouseEvent
*
)
{}
virtual
void
mouseMove
(
View
*
view
,
QMouseEvent
*
event
);
virtual
void
wheelEvent
(
View
*
,
QWheelEvent
*
)
{}
virtual
void
viewLinked
(
View
*
view
)
{}
virtual
void
viewUnlinked
(
View
*
view
)
{}
private
slots
:
// slots called from SCHNApps signals
void
selectedMapChanged
(
MapHandlerGen
*
prev
,
MapHandlerGen
*
cur
);
void
mapAdded
(
MapHandlerGen
*
map
);
void
mapRemoved
(
MapHandlerGen
*
map
);
// slots called from MapHandler signals
void
attributeAdded
(
unsigned
int
orbit
,
const
QString
&
name
);
void
cellSelectorAdded
(
unsigned
int
orbit
,
const
QString
&
name
);
void
cellSelectorRemoved
(
unsigned
int
orbit
,
const
QString
&
name
);
void
selectedCellsChanged
(
CellSelectorGen
*
cs
);
public
slots
:
// slots for Python calls
void
changePositionAttribute
(
const
QString
&
map
,
const
QString
&
name
);
void
changeHandleSelector
(
const
QString
&
map
,
const
QString
&
name
);
void
changeFreeSelector
(
const
QString
&
map
,
const
QString
&
name
);
protected:
void
toggleMapDeformation
(
MapHandlerGen
*
map
);
void
lsm
(
MapHandlerGen
*
map
);
protected:
Surface_LSM_DockTab
*
m_dockTab
;
QHash
<
MapHandlerGen
*
,
MapParameters
>
h_parameterSet
;
bool
m_draginit
;
bool
m_dragging
;
PFP2
::
REAL
m_dragZ
;
qglviewer
::
Vec
m_dragPrevious
;
};
}
// namespace SCHNApps
}
// namespace CGoGN
#endif
SCHNApps/Plugins/surface_lsm/include/surface_lsm_dockTab.h
0 → 100644
View file @
a6fafab3
#ifndef _SURFACE_DEFORMATION_DOCK_TAB_H_
#define _SURFACE_DEFORMATION_DOCK_TAB_H_
#include "ui_surface_lsm.h"
namespace
CGoGN
{
namespace
SCHNApps
{
class
SCHNApps
;
class
Surface_LSM_Plugin
;
struct
MapParameters
;
class
Surface_LSM_DockTab
:
public
QWidget
,
public
Ui
::
Surface_LSM_TabWidget
{
Q_OBJECT
friend
class
Surface_LSM_Plugin
;
public:
Surface_LSM_DockTab
(
SCHNApps
*
s
,
Surface_LSM_Plugin
*
p
);
private:
SCHNApps
*
m_schnapps
;
Surface_LSM_Plugin
*
m_plugin
;
bool
b_updatingUI
;
private
slots
:
void
positionAttributeChanged
(
int
index
);
void
handleSelectorChanged
(
int
index
);
void
freeSelectorChanged
(
int
index
);
void
startStopButtonClicked
();
private:
void
addVertexAttribute
(
const
QString
&
nameAttr
);
void
addVertexSelector
(
const
QString
&
name
);
void
removeVertexSelector
(
const
QString
&
name
);
void
mapParametersInitialized
(
bool
b
);
void
updateMapParameters
();
};
}
// namespace SCHNApps
}
// namespace CGoGN
#endif
SCHNApps/Plugins/surface_lsm/src/surface_lsm.cpp
0 → 100644
View file @
a6fafab3
#include "surface_lsm.h"
#include "Algo/Geometry/normal.h"
#include "Algo/Geometry/laplacian.h"
#include "Algo/LinearSolving/basic.h"
#include "Algo/Topo/basic.h"
#include "camera.h"
#include <QKeyEvent>
#include <QMouseEvent>
namespace
CGoGN
{
namespace
SCHNApps
{
MapParameters
::
MapParameters
()
:
handleSelector
(
NULL
),
freeSelector
(
NULL
),
initialized
(
false
),
nlContext
(
NULL
)
{}
MapParameters
::~
MapParameters
()
{
if
(
nlContext
)
nlDeleteContext
(
nlContext
);
}
void
MapParameters
::
start
(
MapHandlerGen
*
mhg
)
{
if
(
!
initialized
)
{
if
(
positionAttribute
.
isValid
()
&&
handleSelector
&&
freeSelector
)
{
MapHandler
<
PFP2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
mhg
);
vIndex
=
mh
->
getAttribute
<
unsigned
int
,
VERTEX
>
(
"vIndex"
);
if
(
!
vIndex
.
isValid
())
vIndex
=
mh
->
addAttribute
<
unsigned
int
,
VERTEX
>
(
"vIndex"
);
PFP2
::
MAP
*
map
=
static_cast
<
MapHandler
<
PFP2
>*>
(
mh
)
->
getMap
();
nb_vertices
=
Algo
::
Topo
::
computeIndexCells
<
VERTEX
>
(
*
map
,
vIndex
);
if
(
nlContext
)
nlDeleteContext
(
nlContext
);
nlContext
=
nlNewContext
();
nlSolverParameteri
(
NL_NB_VARIABLES
,
nb_vertices
);
nlSolverParameteri
(
NL_LEAST_SQUARES
,
NL_TRUE
);
nlSolverParameteri
(
NL_SOLVER
,
NL_CHOLMOD_EXT
);
initialized
=
true
;
}
}
}
void
MapParameters
::
stop
(
MapHandlerGen
*
mh
)
{
if
(
initialized
)
{
// if(vIndex.isValid())
// mh->removeAttribute(vIndex);
if
(
nlContext
)
nlDeleteContext
(
nlContext
);
initialized
=
false
;
}
}
bool
Surface_LSM_Plugin
::
enable
()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap
::
copyAllStatics
(
m_schnapps
->
getStaticPointers
());
m_dockTab
=
new
Surface_LSM_DockTab
(
m_schnapps
,
this
);
m_schnapps
->
addPluginDockTab
(
this
,
m_dockTab
,
"Surface_LSM"
);
connect
(
m_schnapps
,
SIGNAL
(
selectedMapChanged
(
MapHandlerGen
*
,
MapHandlerGen
*
)),
this
,
SLOT
(
selectedMapChanged
(
MapHandlerGen
*
,
MapHandlerGen
*
)));
connect
(
m_schnapps
,
SIGNAL
(
mapAdded
(
MapHandlerGen
*
)),
this
,
SLOT
(
mapAdded
(
MapHandlerGen
*
)));
connect
(
m_schnapps
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
mapRemoved
(
MapHandlerGen
*
)));
foreach
(
MapHandlerGen
*
map
,
m_schnapps
->
getMapSet
().
values
())
mapAdded
(
map
);
m_dockTab
->
updateMapParameters
();
return
true
;
}
void
Surface_LSM_Plugin
::
disable
()
{
disconnect
(
m_schnapps
,
SIGNAL
(
selectedMapChanged
(
MapHandlerGen
*
,
MapHandlerGen
*
)),
this
,
SLOT
(
selectedMapChanged
(
MapHandlerGen
*
,
MapHandlerGen
*
)));
}
void
Surface_LSM_Plugin
::
draw
(
View
*
view
)
{
}
void
Surface_LSM_Plugin
::
keyPress
(
View
*
view
,
QKeyEvent
*
event
)
{
switch
(
event
->
key
())
{
case
Qt
::
Key_D
:
{
MapHandlerGen
*
mh
=
m_schnapps
->
getSelectedMap
();
if
(
mh
)
{
const
MapParameters
&
p
=
h_parameterSet
[
mh
];