/* 
 * This software is governed by the CeCILL-B license under French law and
 * abiding by the rules of distribution of free software.  You can  use, 
 * modify and/ or redistribute the software under the terms of the CeCILL-B
 * license as circulated by CEA, CNRS and INRIA at the following URL
 * "http://www.cecill.info" or the LICENCE.txt file present in this project.
*/
--------------------------------------------------------------------------------
Introduction:
--------------------------------------------------------------------------------

This is a toy application made to demonstrate the use of Hermite radial basis 
function (HRBF). We use them to interpolate a set of points and normals 
and produce a surface.

Go to: rodolphe-vaillant.fr/?e=12 
For more a tutorial about the technique and its implementation.

--------------------------------------------------------------------------------
GUI Usage:
--------------------------------------------------------------------------------
Controls for moving points and camera are almost the same as blender:

- You can select an object with "right click", and edit it with "tab".
  (In edit mode the points and normals should appear in blue)
  
- you can add more points with "left click" and pressing "n" at the same time. 
  (When adding points click onto the existing object they will appear on its surface,
  otherwise they will be added at the center of the scene.)
   
- "Right click" to select samples: maintain "maj" to select multiples or unselect them.

- "Right click" and "move the cursor" to translate objects 
        -> "Right click" again will reset the position to its previous state.
        -> "Left click" to set to the new position
                
- Delete points with "del".

- "Left click" on the axis of the object manipulator to translate rotate ...

Camera:
    - "Scroll" to zoom
    - "middle click" to rotate.
    - Numeric pad to change views and projection mode

More controls are available but should not be very usefull just for this toy app

--------------------------------------------------------------------------------
Compiling:
--------------------------------------------------------------------------------
You should only need qmake, qt framework 4.8 and the glew

Go in the build directory
# cd build

# qmake CONFIG+=Debug  CONFIG+=declarative_debug ../source_project/hrbf_viewer.pro
or for release
# qmake ../source_project/hrbf_viewer.pro

Compile with 16 threads
# make -j16

launch app from the root directory for the shader's files to be found
# ./build/hrbf_viewer

--------------------------------------------------------------------------------
Note for developers:
--------------------------------------------------------------------------------
There should be no CUDA dependencies whatsoever, 
CUDA API calls are disable with "NCUDA" macro symbol (otherwise it's a mistake)

Here some folders/files that may interest you:

- source_project/src/hrbf : all that is related to an HRBF object. Its gui,
  moving/adding/supressing/... samples. Solving of the linear system to 
  produce the implicit surface and evaluation of the scalar field.
  
- source_project/src/rendering/marching_cubes : The marching cube algorithm to
  visualize implicit surfaces. Uses multiple threads and GPU with glsl shaders.
  
- source_project/src/rendering/rendering.cpp : rendering loop where we call 
  the marching cube at each frame in "draw_polygonize_obj()"




