Commit fc656be4 authored by Sylvain Thery's avatar Sylvain Thery

SCHNApps documentation

parent 3c68fbb4
......@@ -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 aname
* @param kmaxAttributeName ?? result attribute aname
* @param KminAttributeName ?? result attribute aname
* @param kminAttributeName ?? result attribute aname
* @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
......
......@@ -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();
......
......@@ -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
......
......@@ -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 ????
......
......@@ -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
*/
......
......@@ -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 removeVectorVBO
* @brief [PYTHON] remove VBO of the corresponding vector
* @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 changeVectorScaleFactor
* @brief [PYTHON] change the vector scale factor
* @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 changeVectorColor
* @brief [PYTHON] change thet vector color
* @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);
......
......@@ -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
......
......@@ -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");
......
......@@ -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)
*/
bool isShared() const;
/**
* @brief get the projection type
* @return PERSPECTIVE or ORTHOGRAPHIC
*/
qglviewer::Camera::Type getProjectionType();
/// drawing of camera (do not use)
/// is camera drawn ?
bool getDraw() const;
/// is camera path drawn ?
bool getDrawPath() const;
/**
* @brief get the list of views linked with the camera
* @warning not python callable
* @return the list
*/
const QList<View*>& getLinkedViews() const;
/**
* @brief is the camera linked to theiven view
* @param view
* @return
*/
bool isLinkedToView(View* view) const;
/**
* @briefset the projection type
* @brief [PYTHON] set the projection type
* @param t 0:perspective / 1::orthogonal
*/
void setProjectionType(int t);
/// drawing of camera (do not use)
/// [PYTHON] draw (or not) the camera (do not use)
void setDraw(bool b);
/// [PYTHON] draw (or not) the camera path (do not use)
void setDrawPath(bool b);
/**
* @brief Enable the camera to update automatically with view bounding box
* @brief [PYTHON] Enable the camera to update automatically with view bounding box
*/
void enableViewsBoundingBoxFitting();
/**
* @brief Enable the camera to update automatically with view bounding box
* @brief [PYTHON] Disable the camera to update automatically with view bounding box
*/
void disableViewsBoundingBoxFitting();
/**
* @brief store position and rotationof camera into a string
* @brief [PYTHON] store position and rotationof camera into a string
* @return the storage string
*/
QString toString();
/**
* @brief restore a camera from string storage
* @brief [PYTHON] restore a camera from string storage
* @param cam the string containing data
*/
void fromString(QString cam);
......@@ -105,14 +148,20 @@ signals:
void drawPathChanged(bool);
protected:
/// camera name
QString m_name;
/// pointer to schnapps object
SCHNApps* m_schnapps;
/// list of views that are using this camera
QList<View*> l_views;
bool b_draw;
bool b_drawPath;
/// fit the camera to the bounding box of view (xxxViewsBoundingBoxFitting())
bool b_fitToViewsBoundingBox;
};
......
......@@ -26,7 +26,19 @@
namespace CGoGN
{
/**
* A MapHandlerGen is a generic class that encapsulate a map.
* It mainly allows the management of:
* - Bounding-Box
* - VBOs
*
* VBO are OpenGL Vertex Buffer Objects, they are created from vertex-attribute of the map.
*
* One map is selected in SCHNApps
* MapHandlerGen is derived by using a typed map (EmbeddedMap2 / EmbeddedMap3 ...)
*
* Python callable slots are tagged with [PYTHON]
*/
namespace SCHNApps
{
......@@ -38,21 +50,23 @@ class SCHNAPPS_API MapHandlerGen : public QObject
public:
MapHandlerGen(const QString& name, SCHNApps* s, GenericMap* map);
virtual ~MapHandlerGen();
inline const QString& getName() const { return m_name; }
public slots: