Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
David Cazier
CGoGN
Commits
fc656be4
Commit
fc656be4
authored
Jul 06, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps documentation
parent
3c68fbb4
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
577 additions
and
132 deletions
+577
-132
SCHNApps/Plugins/surface_differentialProperties/include/surface_differentialProperties.h
...entialProperties/include/surface_differentialProperties.h
+6
-6
SCHNApps/Plugins/surface_import/include/surface_import.h
SCHNApps/Plugins/surface_import/include/surface_import.h
+9
-5
SCHNApps/Plugins/surface_render/include/surface_render.h
SCHNApps/Plugins/surface_render/include/surface_render.h
+23
-14
SCHNApps/Plugins/surface_renderScalar/include/surface_renderScalar.h
...ugins/surface_renderScalar/include/surface_renderScalar.h
+11
-4
SCHNApps/Plugins/surface_renderTopo/include/surface_renderTopo.h
...s/Plugins/surface_renderTopo/include/surface_renderTopo.h
+18
-10
SCHNApps/Plugins/surface_renderVector/include/surface_renderVector.h
...ugins/surface_renderVector/include/surface_renderVector.h
+16
-10
SCHNApps/Plugins/surface_selection/include/surface_selection.h
...pps/Plugins/surface_selection/include/surface_selection.h
+14
-7
SCHNApps/Plugins/surface_subdivision/include/surface_subdivision.h
...Plugins/surface_subdivision/include/surface_subdivision.h
+36
-1
SCHNApps/include/camera.h
SCHNApps/include/camera.h
+60
-11
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+128
-21
SCHNApps/include/plugin.h
SCHNApps/include/plugin.h
+5
-0
SCHNApps/include/plugin_interaction.h
SCHNApps/include/plugin_interaction.h
+13
-0
SCHNApps/include/schnapps.h
SCHNApps/include/schnapps.h
+89
-30
SCHNApps/include/view.h
SCHNApps/include/view.h
+39
-12
SCHNApps/schnapps.md
SCHNApps/schnapps.md
+106
-0
SCHNApps/src/schnapps.cpp
SCHNApps/src/schnapps.cpp
+4
-1
No files found.
SCHNApps/Plugins/surface_differentialProperties/include/surface_differentialProperties.h
View file @
fc656be4
...
...
@@ -44,7 +44,7 @@ private slots:
public
slots
:
/**
* @brief compute the normals of a mesh
* @brief
[PYTHON]
compute the normals of a mesh
* @param mapName name of the 2d map (mesh)
* @param positionAttributeName name of position attribute used for computation
* @param normalAttributeName name of result attribute
...
...
@@ -56,14 +56,14 @@ public slots:
bool
autoUpdate
=
true
);
/**
* @brief compute curvatures of a mesh
* @brief
[PYTHON]
compute curvatures of a mesh
* @param mapName name of 2d map
* @param positionAttributeName name of input position attribute
* @param normalAttributeName name of input normal attributes
* @param KmaxAttributeName ?? result attribute
a
name
* @param kmaxAttributeName ?? result attribute
a
name
* @param KminAttributeName ?? result attribute
a
name
* @param kminAttributeName ?? result attribute
a
name
* @param KmaxAttributeName ?? result attribute name
* @param kmaxAttributeName ?? result attribute name
* @param KminAttributeName ?? result attribute name
* @param kminAttributeName ?? result attribute name
* @param KnormalAttributeName ?? result attribute aname
* @param compute_kmean compute the mean curvature
* @param compute_kgaussian compute the gaussian curvature
...
...
SCHNApps/Plugins/surface_import/include/surface_import.h
View file @
fc656be4
...
...
@@ -8,7 +8,11 @@ namespace CGoGN
namespace
SCHNApps
{
/**
* Plugin for 2D mesh import. Supported mesh file format are: off/obj/ply.
* 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
{
Q_OBJECT
...
...
@@ -30,26 +34,26 @@ private:
public
slots
:
/**
* @brief import a mesh from a file
* @brief
[PYTHON]
import a mesh from a file
* @param fileName file name of mesh file
* @return the new maphandler that handle the mesh
*/
MapHandlerGen
*
importMeshFromFile
(
const
QString
&
fileName
);
/**
* @brief import a mesh by opening a FileDialog
* @brief
[PYTHON]
import a mesh by opening a FileDialog
*/
void
importMeshFromFileDialog
();
/**
* @brief import an image into a mesh from a file
* @brief
[PYTHON]
import an image into a mesh from a file
* @param fileName file name of mesh file
* @return
*/
MapHandlerGen
*
importImageFromFile
(
const
QString
&
fileName
);
/**
* @brief import image into a mesh by opening a FileDialog
* @brief
[PYTHON]
import image into a mesh by opening a FileDialog
*/
void
importImageFromFileDialog
();
...
...
SCHNApps/Plugins/surface_render/include/surface_render.h
View file @
fc656be4
...
...
@@ -60,6 +60,15 @@ struct MapParameters
Geom
::
Vec4f
backColor
;
};
/**
* Plugin for 2-Maps topology rendering.
* Some parameters are per view / per map:
* - drawing of relations and dart
* - colors
* Others are only per map:
* - position attribute
* - scale factors
*/
class
Surface_Render_Plugin
:
public
PluginInteraction
{
Q_OBJECT
...
...
@@ -112,7 +121,7 @@ private slots:
public
slots
:
// slots for Python calls
/**
* @brief change the position VBO use for rendering for specific view and map
* @brief
[PYTHON]
change the position VBO use for rendering for specific view and map
* @param view the view name
* @param map the map name
* @param vbo the positionvbo name
...
...
@@ -120,7 +129,7 @@ public slots:
void
changePositionVBO
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
);
/**
* @brief change the normal VBO use for rendering (phong) for specific view and map
* @brief
[PYTHON]
change the normal VBO use for rendering (phong) for specific view and map
* @param view the view name
* @param map the map name
* @param vbo the normal vbo name
...
...
@@ -128,7 +137,7 @@ public slots:
void
changeNormalVBO
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
);
/**
* @brief change the color VBO use for rendering for specific view and map
* @brief
[PYTHON]
change the color VBO use for rendering for specific view and map
* @param view the view name
* @param map the map name
* @param vbo the normal vbo name
...
...
@@ -136,7 +145,7 @@ public slots:
void
changeColorVBO
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
);
/**
* @brief choice if vertices should be rendered (for specific view and map)
* @brief
[PYTHON]
choice if vertices should be rendered (for specific view and map)
* @param view the view name
* @param map the map name
* @param b rendered or not
...
...
@@ -144,7 +153,7 @@ public slots:
void
changeRenderVertices
(
const
QString
&
view
,
const
QString
&
map
,
bool
b
);
/**
* @brief change the size of vertices VerticesScaleFactor
* @brief
[PYTHON]
change the size of vertices VerticesScaleFactor
* @param view the view name
* @param map the map name
* @param f scale parameter [0,2]
...
...
@@ -152,7 +161,7 @@ public slots:
void
changeVerticesScaleFactor
(
const
QString
&
view
,
const
QString
&
map
,
float
f
);
/**
* @brief choice if edges should be rendered (for specific view and map)
* @brief
[PYTHON]
choice if edges should be rendered (for specific view and map)
* @param view the view name
* @param map the map name
* @param b rendered or not
...
...
@@ -160,7 +169,7 @@ public slots:
void
changeRenderEdges
(
const
QString
&
view
,
const
QString
&
map
,
bool
b
);
/**
* @brief choice if faces should be rendered (for specific view and map)
* @brief
[PYTHON]
choice if faces should be rendered (for specific view and map)
* @param view the view name
* @param map the map name
* @param b rendered or not
...
...
@@ -168,7 +177,7 @@ public slots:
void
changeRenderFaces
(
const
QString
&
view
,
const
QString
&
map
,
bool
b
);
/**
* @brief change the style of rendering of faces (flat of phong)
* @brief
[PYTHON]
change the style of rendering of faces (flat of phong)
* @param view the view name
* @param map the map name
* @param style 0:flat 1:phong
...
...
@@ -176,7 +185,7 @@ public slots:
void
changeFacesStyle
(
const
QString
&
view
,
const
QString
&
map
,
int
style
);
/**
* @brief choose if boundary should be rendered or not.
* @brief
[PYTHON]
choose if boundary should be rendered or not.
* @param view the view name
* @param map the map name
* @param b rendered or not
...
...
@@ -184,7 +193,7 @@ public slots:
void
changeRenderBoundary
(
const
QString
&
view
,
const
QString
&
map
,
bool
b
);
/**
* @brief change the color use for face rendering (when no volor VBO is used)
* @brief
[PYTHON]
change the color use for face rendering (when no volor VBO is used)
* @param view the view name
* @param map the map name
* @param r red value [0,1]
...
...
@@ -194,7 +203,7 @@ public slots:
void
changeFaceColor
(
const
QString
&
view
,
const
QString
&
map
,
float
r
,
float
g
,
float
b
);
/**
* @brief change the color use for edge line rendering.
* @brief
[PYTHON]
change the color use for edge line rendering.
* @param view the view name
* @param map the map name
* @param r red value [0,1]
...
...
@@ -204,7 +213,7 @@ public slots:
void
changeEdgeColor
(
const
QString
&
view
,
const
QString
&
map
,
float
r
,
float
g
,
float
b
);
/**
* @brief change the color use for vertices point sprite rendering.
* @brief
[PYTHON]
change the color use for vertices point sprite rendering.
* @param view the view name
* @param map the map name
* @param r red value [0,1]
...
...
@@ -214,7 +223,7 @@ public slots:
void
changeVertexColor
(
const
QString
&
view
,
const
QString
&
map
,
float
r
,
float
g
,
float
b
);
/**
* @brief change the color use for back-faces.
* @brief
[PYTHON]
change the color use for back-faces.
* @param view the view name
* @param map the map name
* @param r red value [0,1]
...
...
@@ -224,7 +233,7 @@ public slots:
void
changeBackColor
(
const
QString
&
view
,
const
QString
&
map
,
float
r
,
float
g
,
float
b
);
/**
* @brief choose if back-faces should be rendered.
* @brief
[PYTHON]
choose if back-faces should be rendered.
* @param view the view name
* @param map the map name
* @param b
...
...
SCHNApps/Plugins/surface_renderScalar/include/surface_renderScalar.h
View file @
fc656be4
...
...
@@ -37,6 +37,13 @@ struct MapParameters
int
expansion
;
};
/**
* Plugin for rendering a scalar attribute over a surface with colormap.
* The scalar attribute to render must have its generated VBO.
* A position VBO must be provided for surface rendering.
* All parameters are per view / per map.
*/
class
Surface_RenderScalar_Plugin
:
public
PluginInteraction
{
Q_OBJECT
...
...
@@ -84,7 +91,7 @@ private slots:
public
slots
:
// slots for Python calls
/**
* @brief change the position VBO use for rendering (for specific view and map)
* @brief
[PYTHON]
change the position VBO use for rendering (for specific view and map)
* @param view the view name
* @param map the map name
* @param vbo the position vbo name
...
...
@@ -92,7 +99,7 @@ public slots:
void
changePositionVBO
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
);
/**
* @brief change the scalar VBO use for rendering (for specific view and map)
* @brief
[PYTHON]
change the scalar VBO use for rendering (for specific view and map)
* @param view the view name
* @param map the map name
* @param vbo the scalar vbo name
...
...
@@ -100,7 +107,7 @@ public slots:
void
changeScalarVBO
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
);
/**
* @brief change the kind of colormap.
* @brief
[PYTHON]
change the kind of colormap.
* @param view the view name
* @param map the map name
* @param c 0:BWR 1:CWR 2:BCGYR 3:BGR
...
...
@@ -108,7 +115,7 @@ public slots:
void
changeColorMap
(
const
QString
&
view
,
const
QString
&
map
,
int
c
);
/**
* @brief change the expansion of color-map
* @brief
[PYTHON]
change the expansion of color-map
* @param view the view name
* @param map the map name
* @param i ????
...
...
SCHNApps/Plugins/surface_renderTopo/include/surface_renderTopo.h
View file @
fc656be4
...
...
@@ -14,7 +14,15 @@ namespace CGoGN
namespace
SCHNApps
{
/**
* Plugin for 2-Maps topology rendering.
* Some parameters are per view / per map:
* - drawing of relations and dart
* - colors
* Others are only per map (due to computation time):
* - position attribute
* - scale factors
*/
class
Surface_RenderTopo_Plugin
:
public
PluginInteraction
{
Q_OBJECT
...
...
@@ -96,7 +104,7 @@ private slots:
public
slots
:
// slots for Python calls
/**
* @brief choose to draw (or not) the darts
* @brief
[PYTHON]
choose to draw (or not) the darts
* @param view the view name
* @param map the map name
* @param b draw or not
...
...
@@ -104,7 +112,7 @@ public slots:
void
changeDrawDarts
(
const
QString
&
view
,
const
QString
&
map
,
bool
b
);
/**
* @brief choose to draw (or not) the phi1 relations
* @brief
[PYTHON]
choose to draw (or not) the phi1 relations
* @param view the view name
* @param map the map name
* @param b draw or not
...
...
@@ -112,7 +120,7 @@ public slots:
void
changeDrawPhi1
(
const
QString
&
view
,
const
QString
&
map
,
bool
b
);
/**
* @brief choose to draw (or not) the phi2 relations
* @brief
[PYTHON]
choose to draw (or not) the phi2 relations
* @param view the view name
* @param map the map name
* @param b draw or not
...
...
@@ -120,7 +128,7 @@ public slots:
void
changeDrawPhi2
(
const
QString
&
view
,
const
QString
&
map
,
bool
b
);
/**
* @brief change the color use for dart
* @brief
[PYTHON]
change the color use for dart
* @param view the view name
* @param map the map name
* @param color
...
...
@@ -128,7 +136,7 @@ public slots:
void
changeDartsColor
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
color
);
/**
* @brief change the color use for phi1
* @brief
[PYTHON]
change the color use for phi1
* @param view the view name
* @param map the map name
* @param color
...
...
@@ -136,7 +144,7 @@ public slots:
void
changePhi1Color
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
color
);
/**
* @brief change the color use for phi2
* @brief
[PYTHON]
change the color use for phi2
* @param view the view name
* @param map the map name
* @param color
...
...
@@ -144,21 +152,21 @@ public slots:
void
changePhi2Color
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
color
);
/**
* @brief change the position attribute of map for topo rendering
* @brief
[PYTHON]
change the position attribute of map for topo rendering
* @param map the map name
* @param attrName position attribute name
*/
void
changePositionAttribute
(
const
QString
&
map
,
const
QString
&
attrName
);
/**
* @brief change the edges scaling factor
* @brief
[PYTHON]
change the edges scaling factor
* @param map the map name
* @param s scaling factor
*/
void
changeEdgesScaleFactor
(
const
QString
&
map
,
float
s
);
/**
* @brief change the faces scaling factor
* @brief
[PYTHON]
change the faces scaling factor
* @param map the map name
* @param s scaling factor
*/
...
...
SCHNApps/Plugins/surface_renderVector/include/surface_renderVector.h
View file @
fc656be4
...
...
@@ -24,6 +24,12 @@ struct MapParameters
QList
<
float
>
scaleFactors
;
};
/**
* Plugin for vector attributes rendering over a surface mesh
* Each vector attribute to render must be of dim 3, and have a VBO
* The length and color of each vector can be changed.
* All parameters are per view / per map.
*/
class
Surface_RenderVector_Plugin
:
public
PluginInteraction
{
Q_OBJECT
...
...
@@ -70,7 +76,7 @@ private slots:
public
slots
:
// slots for Python calls
/**
* @brief change the position VBO use for rendering for specific view and map
* @brief
[PYTHON]
change the position VBO use for rendering for specific view and map
* @param view the view name
* @param map the map name
* @param vbo
...
...
@@ -78,7 +84,7 @@ public slots:
void
changePositionVBO
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
);
/**
* @brief add a VBO use for rendering for specific view and map
* @brief
[PYTHON]
add a VBO use for rendering for specific view and map
* @param view the view name
* @param map the map name
* @param vbo
...
...
@@ -86,28 +92,28 @@ public slots:
void
addVectorVBO
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
);
/**
* @brief
removeV
ector
VBO
* @brief
[PYTHON] remove VBO of the corresponding v
ector
* @param view the view name
* @param map the map name
* @param vbo
* @param vbo
the vbo name
*/
void
removeVectorVBO
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
);
/**
* @brief
changeV
ector
S
cale
F
actor
* @brief
[PYTHON] change the v
ector
s
cale
f
actor
* @param view the view name
* @param map the map name
* @param vbo
* @param f
* @param vbo
vbo vector name on which apply the scale
* @param f
the floating point scale value
*/
void
changeVectorScaleFactor
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
,
float
f
);
/**
* @brief
changeV
ector
C
olor
* @brief
[PYTHON] change thet v
ector
c
olor
* @param view the view name
* @param map the map name
* @param vbo
* @param col
* @param vbo
the vbo vector name
* @param col
the color in QString format ("red" or "#FF0000")
*/
void
changeVectorColor
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
,
const
QString
&
col
);
...
...
SCHNApps/Plugins/surface_selection/include/surface_selection.h
View file @
fc656be4
...
...
@@ -35,6 +35,13 @@ struct MapParameters
QColor
color
;
};
/**
* Plugin for cell selection (in conjonction with CellSelectors of MapHandlers)
* Selection of cells can be done:
* - individually
* - in a sphere
* - with a give variation of the normal.
*/
class
Surface_Selection_Plugin
:
public
PluginInteraction
{
Q_OBJECT
...
...
@@ -81,49 +88,49 @@ private slots:
public
slots
:
/**
* @brief change the position attribute
* @brief
[PYTHON]
change the position attribute
* @param map map name
* @param name position attribute name
*/
void
changePositionAttribute
(
const
QString
&
map
,
const
QString
&
name
);
/**
* @brief change the normal attribute
* @brief
[PYTHON]
change the normal attribute
* @param map map name
* @param name normal attribute name
*/
void
changeNormalAttribute
(
const
QString
&
map
,
const
QString
&
name
);
/**
* @brief change the selection
* @brief
[PYTHON]
change the selection
* @param map map name
* @param method selection method 0:single Cell / 1: WithinSphere / 2: Normal angle
*/
void
changeSelectionMethod
(
const
QString
&
map
,
unsigned
int
method
);
/**
* @brief change the vertices scale factor
* @brief
[PYTHON]
change the vertices scale factor
* @param map map name
* @param f scaling factor 0 - 2
*/
void
changeVerticesScaleFactor
(
const
QString
&
map
,
float
f
);
/**
* @brief change the vertices rendering size (when scaling is 1)
* @brief
[PYTHON]
change the vertices rendering size (when scaling is 1)
* @param map map name
* @param f vertex size ( in object frame)
*/
void
changeVerticesBaseSize
(
const
QString
&
map
,
float
f
);
/**
* @brief change the color for rendering selected cells
* @brief
[PYTHON]
change the color for rendering selected cells
* @param map map name
* @param col color in Qt string format "#rrggbb". Each component is given in hexa, for example red is #ff0000
*/
void
changeSelectedColor
(
const
QString
&
map
,
const
QString
&
col
);
/**
* @brief clear the selection
* @brief
[PYTHON]
clear the selection
* @param map map name
* @param orbit orbit selector 0:DART 1:VERTEX 2:EDGE 3:FACE
* @param selectorName name of selector
...
...
SCHNApps/Plugins/surface_subdivision/include/surface_subdivision.h
View file @
fc656be4
...
...
@@ -10,7 +10,16 @@ namespace CGoGN
namespace
SCHNApps
{
/**
* Plugin that manage the subdivision of surface algorithms
* Supported algorithms:
* - Loop
* - Catmull-Clark approximation
* - Catmull-Clark interpolation
* - Do-Sabin
* - linear triangulation
* - linear quadrangulation
*/
class
Surface_Subdivision_Plugin
:
public
Plugin
{
Q_OBJECT
...
...
@@ -34,23 +43,49 @@ private slots:
void
schnappsClosing
();
public
slots
:
/**
* @brief [PYTHON] apply a Loop subdivision
* @param mapName name of map
* @param positionAttributeName position attribute name
*/
void
loopSubdivision
(
const
QString
&
mapName
,
const
QString
&
positionAttributeName
=
"position"
);
/**
* @brief [PYTHON] apply a Catmull-Clark subdivision
* @param mapName name of map
* @param positionAttributeName position attribute name
* @param interp use interpolation scheme instead of approximation ?
*/
void
CCSubdivision
(
const
QString
&
mapName
,
const
QString
&
positionAttributeName
=
"position"
,
bool
interp
=
false
);
/**
* @brief [PYTHON] apply a Do-Sabin subdivision
* @param mapName name of map
* @param positionAttributeName position attribute name
*/
void
DoSabinSubdivision
(
const
QString
&
mapName
,
const
QString
&
positionAttributeName
=
"position"
);
/**
* @brief [PYTHON] triangule all faces (with central point)
* @param mapName name of map
* @param positionAttributeName position attribute name
*/
void
trianguleFaces
(
const
QString
&
mapName
,
const
QString
&
positionAttributeName
=
"position"
);
/**
* @brief [PYTHON] quandrangule all faces (cut edges and add central points)
* @param mapName name of map
* @param positionAttributeName position attribute name
*/
void
quadranguleFaces
(
const
QString
&
mapName
,
const
QString
&
positionAttributeName
=
"position"
);
...
...
SCHNApps/include/camera.h
View file @
fc656be4
...
...
@@ -15,7 +15,13 @@ namespace SCHNApps
{
class
SCHNApps
;
/**
* The camera class inherit from [qglviewer::Camera](http://libqglviewer.com/refManual/classqglviewer_1_1Camera.html)
* A camera object is generated with each new view (named camera_0 for view_O, etc..).
* Cameras can be shared among views.
*
* Python callable slots are tagged with [PYTHON]
*/
class
SCHNAPPS_API
Camera
:
public
qglviewer
::
Camera
{
Q_OBJECT
...
...
@@ -23,70 +29,107 @@ class SCHNAPPS_API Camera : public qglviewer::Camera
friend
class
View
;
public:
/// camera counter for easy camera unique naming
static
unsigned
int
cameraCount
;
/**
* @brief Camera constructor
* @param name
* @param s
*/
Camera
(
const
QString
&
name
,
SCHNApps
*
s
);
~
Camera
();
/**
* @brief get the name of Camera object
* @return const ref on name
*/
const
QString
&
getName
()
const
{
return
m_name
;
}
public
slots
:
/**
* @brief get the name
* @brief
[PYTHON]
get the name
of Camera object
* @return name
*/
QString
getName
();
/**
* @brief get the schnapps objet ptr
* @return the ptr
*/
SCHNApps
*
getSCHNApps
()
const
;
/**
* @brief test if camera is used by one view
* @brief
[PYTHON]
test if camera is used by one view
* @return used / not used
*/
bool
isUsed
()
const
;
/**
* @brief test is camera is used by several view
* @brief
[PYTHON]
test is camera is used by several view
* @return shared / not shared (by view)
*/