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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Etienne Schmitt
CGoGN
Commits
84bb3a4d
Commit
84bb3a4d
authored
Dec 19, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps: start new subdivision plugin
parent
8f0aab16
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
264 additions
and
61 deletions
+264
-61
SCHNApps/Plugins/CMakeLists.txt
SCHNApps/Plugins/CMakeLists.txt
+2
-1
SCHNApps/Plugins/importSurface/CMakeLists.txt
SCHNApps/Plugins/importSurface/CMakeLists.txt
+9
-9
SCHNApps/Plugins/importSurface/importSurface.cpp
SCHNApps/Plugins/importSurface/importSurface.cpp
+5
-18
SCHNApps/Plugins/importSurface/importSurface.h
SCHNApps/Plugins/importSurface/importSurface.h
+6
-7
SCHNApps/Plugins/render/render.cpp
SCHNApps/Plugins/render/render.cpp
+0
-9
SCHNApps/Plugins/render/render.h
SCHNApps/Plugins/render/render.h
+3
-3
SCHNApps/Plugins/renderVector/renderVector.cpp
SCHNApps/Plugins/renderVector/renderVector.cpp
+0
-8
SCHNApps/Plugins/renderVector/renderVector.h
SCHNApps/Plugins/renderVector/renderVector.h
+3
-3
SCHNApps/Plugins/subdivideSurface/CMakeLists.txt
SCHNApps/Plugins/subdivideSurface/CMakeLists.txt
+75
-0
SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp
SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp
+49
-0
SCHNApps/Plugins/subdivideSurface/subdivideSurface.h
SCHNApps/Plugins/subdivideSurface/subdivideSurface.h
+65
-0
SCHNApps/Plugins/subdivideSurface/subdivideSurface.ui
SCHNApps/Plugins/subdivideSurface/subdivideSurface.ui
+44
-0
SCHNApps/forms/window.ui
SCHNApps/forms/window.ui
+3
-3
SCHNApps/resources/cgogn/splash.png
SCHNApps/resources/cgogn/splash.png
+0
-0
No files found.
SCHNApps/Plugins/CMakeLists.txt
View file @
84bb3a4d
cmake_minimum_required
(
VERSION 2.8
)
ADD_SUBDIRECTORY
(
import
)
ADD_SUBDIRECTORY
(
import
Surface
)
ADD_SUBDIRECTORY
(
render
)
ADD_SUBDIRECTORY
(
renderVector
)
ADD_SUBDIRECTORY
(
subdivideSurface
)
SCHNApps/Plugins/import/CMakeLists.txt
→
SCHNApps/Plugins/import
Surface
/CMakeLists.txt
View file @
84bb3a4d
...
...
@@ -7,11 +7,11 @@ INCLUDE_DIRECTORIES(
)
SET
(
PLUGIN_SRC
${
SCHNApps_ROOT_DIR
}
/Plugins/import
/import
.cpp
${
SCHNApps_ROOT_DIR
}
/Plugins/import
Surface/importSurface
.cpp
)
SET
(
PLUGIN_H
${
SCHNApps_ROOT_DIR
}
/Plugins/import
/import
.h
${
SCHNApps_ROOT_DIR
}
/Plugins/import
Surface/importSurface
.h
)
IF
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
...
...
@@ -27,21 +27,21 @@ IF( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
# QT4_WRAP_UI( PLUGIN_UI ${PLUGIN_FORM} )
QT4_WRAP_CPP
(
PLUGIN_MOC
${
PLUGIN_H
}
)
ADD_LIBRARY
(
ImportPluginD SHARED
ADD_LIBRARY
(
Import
Surface
PluginD SHARED
${
PLUGIN_SRC
}
${
PLUGIN_UI
}
${
PLUGIN_MOC
}
)
TARGET_LINK_LIBRARIES
(
ImportPluginD
TARGET_LINK_LIBRARIES
(
Import
Surface
PluginD
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QGLVIEWER_LIBRARIES
}
)
ADD_DEPENDENCIES
(
ImportPluginD SCHNAppsD
)
ADD_DEPENDENCIES
(
Import
Surface
PluginD SCHNAppsD
)
SET_TARGET_PROPERTIES
(
ImportPluginD PROPERTIES COMPILE_DEFINITIONS
"DEBUG"
)
SET_TARGET_PROPERTIES
(
Import
Surface
PluginD PROPERTIES COMPILE_DEFINITIONS
"DEBUG"
)
ELSE
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
...
...
@@ -54,18 +54,18 @@ ELSE ( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
# QT4_WRAP_UI( PLUGIN_UI ${PLUGIN_FORM} )
QT4_WRAP_CPP
(
PLUGIN_MOC
${
PLUGIN_H
}
)
ADD_LIBRARY
(
ImportPlugin SHARED
ADD_LIBRARY
(
Import
Surface
Plugin SHARED
${
PLUGIN_SRC
}
${
PLUGIN_UI
}
${
PLUGIN_MOC
}
)
TARGET_LINK_LIBRARIES
(
ImportPlugin
TARGET_LINK_LIBRARIES
(
Import
Surface
Plugin
${
CGoGN_LIBS_R
}
${
COMMON_LIBS
}
${
QGLVIEWER_LIBRARIES
}
)
ADD_DEPENDENCIES
(
ImportPlugin SCHNApps
)
ADD_DEPENDENCIES
(
Import
Surface
Plugin SCHNApps
)
ENDIF
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
SCHNApps/Plugins/import
/import
.cpp
→
SCHNApps/Plugins/import
Surface/importSurface
.cpp
View file @
84bb3a4d
#include "import.h"
#include "import
Surface
.h"
#include "system.h"
#include "mapHandler.h"
#include "Algo/Import/import.h"
...
...
@@ -8,7 +7,7 @@
#include <QFileDialog>
#include <QFileInfo>
bool
ImportPlugin
::
enable
()
bool
Import
Surface
Plugin
::
enable
()
{
importAction
=
new
QAction
(
"import"
,
this
);
addMenuAction
(
"Import;Import Surface"
,
importAction
);
...
...
@@ -16,11 +15,7 @@ bool ImportPlugin::enable()
return
true
;
}
void
ImportPlugin
::
disable
()
{
}
void
ImportPlugin
::
cb_import
()
void
ImportSurfacePlugin
::
cb_import
()
{
QString
fileName
=
QFileDialog
::
getOpenFileName
(
m_window
,
"Import file"
,
m_window
->
getAppPath
(),
"Mesh Files (*.ply *.off)"
);
QFileInfo
fi
(
fileName
);
...
...
@@ -60,16 +55,8 @@ void ImportPlugin::cb_import()
}
}
/**
* If we want to compile this plugin in debug mode,
* we also define a DEBUG macro at the compilation
*/
#ifndef DEBUG
// essential Qt function:
// arguments are
// - the compiled name of the plugin
// - the main class of our plugin
Q_EXPORT_PLUGIN2
(
ImportPlugin
,
ImportPlugin
)
Q_EXPORT_PLUGIN2
(
ImportSurfacePlugin
,
ImportSurfacePlugin
)
#else
Q_EXPORT_PLUGIN2
(
Import
PluginD
,
Import
Plugin
)
Q_EXPORT_PLUGIN2
(
Import
SurfacePluginD
,
ImportSurface
Plugin
)
#endif
SCHNApps/Plugins/import
/import
.h
→
SCHNApps/Plugins/import
Surface/importSurface
.h
View file @
84bb3a4d
#ifndef _IMPORT_PLUGIN_H_
#define _IMPORT_PLUGIN_H_
#ifndef _IMPORT
SURFACE
_PLUGIN_H_
#define _IMPORT
SURFACE
_PLUGIN_H_
#include "plugin.h"
#include "view.h"
#include "Topology/generic/functor.h"
#include "Topology/generic/parameters.h"
...
...
@@ -21,22 +20,22 @@ struct PFP: public PFP_STANDARD
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
VEC3
VEC3
;
class
ImportPlugin
:
public
Plugin
class
Import
Surface
Plugin
:
public
Plugin
{
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
public:
ImportPlugin
()
Import
Surface
Plugin
()
{
setProvidesRendering
(
false
);
}
~
ImportPlugin
()
~
Import
Surface
Plugin
()
{}
virtual
bool
enable
();
virtual
void
disable
()
;
virtual
void
disable
()
{}
virtual
void
redraw
(
View
*
view
)
{}
...
...
SCHNApps/Plugins/render/render.cpp
View file @
84bb3a4d
...
...
@@ -181,16 +181,7 @@ void RenderDockTab::refreshUI(ParameterSet* params)
/**
* If we want to compile this plugin in debug mode,
* we also define a DEBUG macro at the compilation
*/
#ifndef DEBUG
// essential Qt function:
// arguments are
// - the compiled name of the plugin
// - the main class of our plugin
Q_EXPORT_PLUGIN2
(
RenderPlugin
,
RenderPlugin
)
#else
Q_EXPORT_PLUGIN2
(
RenderPluginD
,
RenderPlugin
)
...
...
SCHNApps/Plugins/render/render.h
View file @
84bb3a4d
...
...
@@ -4,9 +4,9 @@
#include "plugin.h"
#include "ui_render.h"
#include "Topology/generic/functor.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
//
#include "Topology/generic/functor.h"
//
#include "Topology/generic/parameters.h"
//
#include "Topology/map/embeddedMap2.h"
#include "Utils/Shaders/shaderFlat.h"
#include "Utils/Shaders/shaderPhong.h"
...
...
SCHNApps/Plugins/renderVector/renderVector.cpp
View file @
84bb3a4d
...
...
@@ -212,15 +212,7 @@ void RenderVectorDockTab::refreshUI(ParameterSet* params)
/**
* If we want to compile this plugin in debug mode,
* we also define a DEBUG macro at the compilation
*/
#ifndef DEBUG
// essential Qt function:
// arguments are
// - the compiled name of the plugin
// - the main class of our plugin
Q_EXPORT_PLUGIN2
(
RenderVectorPlugin
,
RenderVectorPlugin
)
#else
Q_EXPORT_PLUGIN2
(
RenderVectorPluginD
,
RenderVectorPlugin
)
...
...
SCHNApps/Plugins/renderVector/renderVector.h
View file @
84bb3a4d
...
...
@@ -4,9 +4,9 @@
#include "plugin.h"
#include "ui_renderVector.h"
#include "Topology/generic/functor.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
//
#include "Topology/generic/functor.h"
//
#include "Topology/generic/parameters.h"
//
#include "Topology/map/embeddedMap2.h"
#include "Utils/Shaders/shaderVectorPerVertex.h"
...
...
SCHNApps/Plugins/subdivideSurface/CMakeLists.txt
0 → 100644
View file @
84bb3a4d
cmake_minimum_required
(
VERSION 2.8
)
INCLUDE_DIRECTORIES
(
${
SCHNApps_ROOT_DIR
}
/include
${
SCHNApps_ROOT_DIR
}
/Plugins/import
${
CMAKE_CURRENT_BINARY_DIR
}
)
SET
(
PLUGIN_SRC
${
SCHNApps_ROOT_DIR
}
/Plugins/subdivideSurface/subdivideSurface.cpp
)
SET
(
PLUGIN_H
${
SCHNApps_ROOT_DIR
}
/Plugins/subdivideSurface/subdivideSurface.h
)
SET
(
PLUGIN_FORM
${
SCHNApps_ROOT_DIR
}
/Plugins/subdivideSurface/subdivideSurface.ui
)
IF
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
ADD_DEFINITIONS
(
-DDEBUG
)
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_UI
(
PLUGIN_UI
${
PLUGIN_FORM
}
)
QT4_WRAP_CPP
(
PLUGIN_MOC
${
PLUGIN_H
}
)
ADD_LIBRARY
(
SubdivideSurfacePluginD SHARED
${
PLUGIN_SRC
}
${
PLUGIN_UI
}
${
PLUGIN_MOC
}
)
TARGET_LINK_LIBRARIES
(
SubdivideSurfacePluginD
${
CGoGN_LIBS_D
}
${
COMMON_LIBS
}
${
QGLVIEWER_LIBRARIES
}
)
ADD_DEPENDENCIES
(
SubdivideSurfacePluginD SCHNAppsD
)
SET_TARGET_PROPERTIES
(
SubdivideSurfacePluginD 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_UI
(
PLUGIN_UI
${
PLUGIN_FORM
}
)
QT4_WRAP_CPP
(
PLUGIN_MOC
${
PLUGIN_H
}
)
ADD_LIBRARY
(
SubdivideSurfacePlugin SHARED
${
PLUGIN_SRC
}
${
PLUGIN_UI
}
${
PLUGIN_MOC
}
)
TARGET_LINK_LIBRARIES
(
SubdivideSurfacePlugin
${
CGoGN_LIBS_R
}
${
COMMON_LIBS
}
${
QGLVIEWER_LIBRARIES
}
)
ADD_DEPENDENCIES
(
SubdivideSurfacePlugin SCHNApps
)
ENDIF
(
${
CMAKE_BUILD_TYPE
}
STREQUAL Debug
)
SCHNApps/Plugins/subdivideSurface/subdivideSurface.cpp
0 → 100644
View file @
84bb3a4d
#include "subdivideSurface.h"
#include "mapHandler.h"
bool
SubdivideSurfacePlugin
::
enable
()
{
m_dockTab
=
new
SubdivideSurfaceDockTab
();
addTabInDock
(
m_dockTab
,
"SubdivideSurface"
);
connect
(
m_dockTab
->
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
cb_selectedMapChanged
()));
connect
(
m_window
,
SIGNAL
(
mapAdded
(
MapHandlerGen
*
)),
this
,
SLOT
(
cb_addMapToList
(
MapHandlerGen
*
)));
connect
(
m_window
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
cb_removeMapFromList
(
MapHandlerGen
*
)));
QList
<
MapHandlerGen
*>
maps
=
m_window
->
getMapsList
();
foreach
(
MapHandlerGen
*
m
,
maps
)
m_dockTab
->
mapList
->
addItem
(
m
->
getName
());
connect
(
m_dockTab
->
button_trianguleFaces
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
cb_trianguleFaces
()));
return
true
;
}
void
SubdivideSurfacePlugin
::
cb_selectedMapChanged
()
{
}
void
SubdivideSurfacePlugin
::
cb_addMapToList
(
MapHandlerGen
*
m
)
{
m_dockTab
->
mapList
->
addItem
(
m
->
getName
());
}
void
SubdivideSurfacePlugin
::
cb_removeMapFromList
(
MapHandlerGen
*
m
)
{
for
(
int
i
=
0
;
i
<
m_dockTab
->
mapList
->
count
();
++
i
)
{
if
(
m_dockTab
->
mapList
->
item
(
i
)
->
text
()
==
m
->
getName
())
{
delete
m_dockTab
->
mapList
->
item
(
i
);
return
;
}
}
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2
(
SubdivideSurfacePlugin
,
SubdivideSurfacePlugin
)
#else
Q_EXPORT_PLUGIN2
(
SubdivideSurfacePluginD
,
SubdivideSurfacePlugin
)
#endif
SCHNApps/Plugins/subdivideSurface/subdivideSurface.h
0 → 100644
View file @
84bb3a4d
#ifndef _SUBDIVIDESURFACE_PLUGIN_H_
#define _SUBDIVIDESURFACE_PLUGIN_H_
#include "plugin.h"
#include "ui_subdivideSurface.h"
#include "Topology/generic/functor.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
using
namespace
CGoGN
;
using
namespace
SCHNApps
;
class
SubdivideSurfaceDockTab
:
public
QWidget
,
public
Ui
::
SubdivideSurfaceWidget
{
public:
SubdivideSurfaceDockTab
()
{
setupUi
(
this
);
}
};
class
SubdivideSurfacePlugin
:
public
Plugin
{
Q_OBJECT
Q_INTERFACES
(
CGoGN
::
SCHNApps
::
Plugin
)
public:
SubdivideSurfacePlugin
()
{
setProvidesRendering
(
false
);
}
~
SubdivideSurfacePlugin
()
{}
virtual
bool
enable
();
virtual
void
disable
()
{}
virtual
void
redraw
(
View
*
view
)
{}
virtual
void
keyPress
(
View
*
view
,
int
key
)
{}
virtual
void
keyRelease
(
View
*
view
,
int
key
)
{}
virtual
void
mousePress
(
View
*
view
,
int
button
,
int
x
,
int
y
)
{}
virtual
void
mouseRelease
(
View
*
view
,
int
button
,
int
x
,
int
y
)
{}
virtual
void
mouseMove
(
View
*
view
,
int
buttons
,
int
x
,
int
y
)
{}
virtual
void
wheelEvent
(
View
*
view
,
int
delta
,
int
x
,
int
y
)
{}
virtual
void
viewLinked
(
View
*
view
)
{}
virtual
void
viewUnlinked
(
View
*
view
)
{}
virtual
void
currentViewChanged
(
View
*
view
)
{}
virtual
void
mapLinked
(
View
*
view
,
MapHandlerGen
*
m
)
{}
virtual
void
mapUnlinked
(
View
*
view
,
MapHandlerGen
*
m
)
{}
protected:
SubdivideSurfaceDockTab
*
m_dockTab
;
public
slots
:
void
cb_selectedMapChanged
();
void
cb_addMapToList
(
MapHandlerGen
*
m
);
void
cb_removeMapFromList
(
MapHandlerGen
*
m
);
};
#endif
SCHNApps/Plugins/subdivideSurface/subdivideSurface.ui
0 → 100644
View file @
84bb3a4d
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
SubdivideSurfaceWidget
</class>
<widget
class=
"QWidget"
name=
"SubdivideSurfaceWidget"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
174
</width>
<height>
397
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QListWidget"
name=
"mapList"
/>
</item>
<item>
<widget
class=
"QPushButton"
name=
"button_trianguleFaces"
>
<property
name=
"text"
>
<string>
Triangule Faces
</string>
</property>
</widget>
</item>
<item>
<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>
</layout>
</widget>
<resources/>
<connections/>
</ui>
SCHNApps/forms/window.ui
View file @
84bb3a4d
...
...
@@ -6,8 +6,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
8
00
</width>
<height>
6
00
</height>
<width>
10
00
</width>
<height>
8
00
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -23,7 +23,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
8
00
</width>
<width>
10
00
</width>
<height>
23
</height>
</rect>
</property>
...
...
SCHNApps/resources/cgogn/splash.png
View replaced file @
8f0aab16
View file @
84bb3a4d
172 KB
|
W:
|
H:
183 KB
|
W:
|
H:
2-up
Swipe
Onion skin
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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