scene Class Reference

Collaboration diagram for scene:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 scene ()
 Empty constructor for the scene.
void load_model ()
 Method called only once at the beginning (load files ...).
void draw_scene ()
 Method called at every frame.
void build_spline_surface (const unsigned int &N_samples)
 Build a full spline surface of with a given sample rate.
void fill_patch (const unsigned int &index_surface, const cpe::patch4 &p, const unsigned int &N_samples)
 Fill a 4x4 patch by the surface.
void compute_curve_spline ()
 Compute the curves at the boundary of each patch.
void update_high_res ()
 Update the surface given with the high sampling ratio.
void update_low_res ()
 Update the surface given with the low sampling ratio (for interactive edition).
void picking_grid (const cpe::v3 &center_ray, const cpe::v3 &direction_ray)
 Helper function for picking position of the grid.
void translate_picking (const cpe::v3 t)
 Translate the selected position of the grid.
void add_u_back_line ()
 add a u line at the end of the grid
void add_v_back_line ()
 add a v line at the end of the grid
void add_u_front_line ()
 add a u line at the front of the grid
void add_v_front_line ()
 add a v line at the front of the grid
void erase_u_back_line ()
 suppress a u line at the end of the grid
void erase_v_back_line ()
 suppress a v line at the end of the grid
void erase_u_front_line ()
 suppress a u line at the beginning of the grid
void erase_v_front_line ()
 suppress a v line at the beginning of the grid
void duplicate_boundary ()
 duplicate each position of the grid at the boundary
void load_grid ()
 save a grid into file for storage and exchange
void save_grid () const
 load a grid from a file for storage and exchange
void set_glwidget (glwidget *p_widget)
 Set the GLWidget pointer.
cpe::gui_interfacegui_visible_interface ()
 get the gui helper class

Private Member Functions

void preload_sphere ()
 Init the sphere loading.
void init_gui_visibility ()
 Init the visibility gui parameters.
void init_color_table ()
 Init the colortable for the patches.

Private Attributes

cpe::grid g0
 The control grid for the spline.
std::vector
< cpe::surface_param_drawable
surf
 The Spline surface.
std::vector< cpe::v3color_table
 the color_table of the patches
std::vector< std::vector
< cpe::v3 > > 
curve_spline
 The curve of the boundaries.
cpe::mesh sphere
 storage for the sphere (to draw the grid position)
std::vector< cpe::v3sphere_normal
 storage for the sphere normal (to draw the grid position)
cpe::picking_data pick
 storage for picking parameters
std::string filename_grid
 name of the stored grid
unsigned int N_sample_high_res
 The sampling for the high resolution surface.
unsigned int N_sample_low_res
 The sampling for the low resolution surface.
cpe::gui_interface gui_visible
 Storage class for visibility modified in the gui.
unsigned int counter_update
 counter to update the surface at some time

Constructor & Destructor Documentation

scene::scene (  ) 

Empty constructor for the scene.

References counter_update, filename_grid, init_color_table(), init_gui_visibility(), N_sample_high_res, and N_sample_low_res.

Here is the call graph for this function:


Member Function Documentation

void scene::add_u_back_line (  ) 

add a u line at the end of the grid

References cpe::grid::add_back_u(), g0, and update_low_res().

Referenced by Window::add_u_back_button_clicked().

Here is the call graph for this function:

void scene::add_u_front_line (  ) 

add a u line at the front of the grid

References cpe::grid::add_front_u(), g0, and update_low_res().

Referenced by Window::add_u_front_button_clicked().

Here is the call graph for this function:

void scene::add_v_back_line (  ) 

add a v line at the end of the grid

References cpe::grid::add_back_v(), g0, and update_low_res().

Referenced by Window::add_v_back_button_clicked().

Here is the call graph for this function:

void scene::add_v_front_line (  ) 

add a v line at the front of the grid

References cpe::grid::add_front_v(), g0, and update_low_res().

Referenced by Window::add_v_front_button_clicked().

Here is the call graph for this function:

void scene::build_spline_surface ( const unsigned int &  N_samples  ) 

Build a full spline surface of with a given sample rate.

References fill_patch(), g0, cpe::grid::get_patch(), cpe::grid::size_u(), cpe::grid::size_v(), and surf.

Referenced by translate_picking(), update_high_res(), and update_low_res().

Here is the call graph for this function:

void scene::compute_curve_spline (  ) 

Compute the curves at the boundary of each patch.

References curve_spline, g0, cpe::grid::get_patch(), cpe::patch4::get_x(), cpe::patch4::get_y(), cpe::patch4::get_z(), cpe::grid::size_u(), and cpe::grid::size_v().

Referenced by translate_picking(), update_high_res(), and update_low_res().

Here is the call graph for this function:

void scene::draw_scene (  ) 
void scene::duplicate_boundary (  ) 

duplicate each position of the grid at the boundary

References cpe::grid::duplicate_boundary(), g0, and update_low_res().

Referenced by Window::duplicateboundary_button_clicked().

Here is the call graph for this function:

void scene::erase_u_back_line (  ) 

suppress a u line at the end of the grid

References g0, cpe::grid::suppress_back_u(), and update_low_res().

Referenced by Window::erase_u_back_button_clicked().

Here is the call graph for this function:

void scene::erase_u_front_line (  ) 

suppress a u line at the beginning of the grid

References g0, cpe::grid::suppress_front_u(), and update_low_res().

Referenced by Window::erase_u_front_button_clicked().

Here is the call graph for this function:

void scene::erase_v_back_line (  ) 

suppress a v line at the end of the grid

References g0, cpe::grid::suppress_back_v(), and update_low_res().

Referenced by Window::erase_v_back_button_clicked().

Here is the call graph for this function:

void scene::erase_v_front_line (  ) 

suppress a v line at the beginning of the grid

References g0, cpe::grid::suppress_front_v(), and update_low_res().

Referenced by Window::erase_v_front_button_clicked().

Here is the call graph for this function:

void scene::fill_patch ( const unsigned int &  index_surface,
const cpe::patch4 p,
const unsigned int &  N_samples 
)

Fill a 4x4 patch by the surface.

References cpe::v3::cross(), cpe::evaluator_spline::diff_u(), cpe::evaluator_spline::diff_v(), cpe::patch4::get_x(), cpe::patch4::get_y(), cpe::patch4::get_z(), and surf.

Referenced by build_spline_surface().

Here is the call graph for this function:

gui_interface & scene::gui_visible_interface (  ) 
void scene::init_color_table (  )  [private]

Init the colortable for the patches.

References color_table.

Referenced by scene().

void scene::init_gui_visibility (  )  [private]
void scene::load_grid (  ) 

save a grid into file for storage and exchange

References filename_grid, g0, pick, cpe::picking_data::set_is_up_to_date(), and update_high_res().

Referenced by Window::load_grid_button_clicked().

Here is the call graph for this function:

void scene::load_model (  ) 

Method called only once at the beginning (load files ...).

References cpe::grid::build_meshgrid(), g0, preload_sphere(), cpe::grid::resize(), and update_high_res().

Referenced by glwidget::initializeGL().

Here is the call graph for this function:

void scene::picking_grid ( const cpe::v3 center_ray,
const cpe::v3 direction_ray 
)

Helper function for picking position of the grid.

References g0, cpe::picking_data::get_picked_index(), pick, cpe::picking_data::set_is_picked(), cpe::picking_data::set_picked_index(), cpe::grid::size_u(), and cpe::grid::size_v().

Referenced by glwidget::mousePressEvent().

Here is the call graph for this function:

void scene::preload_sphere (  )  [private]

Init the sphere loading.

References cpe::mesh::load_off_file(), cpe::mesh::normal_vertex(), cpe::mesh::scale(), sphere, and sphere_normal.

Referenced by load_model().

Here is the call graph for this function:

void scene::save_grid (  )  const

load a grid from a file for storage and exchange

References filename_grid, g0, and cpe::grid::write().

Referenced by Window::save_grid_button_clicked().

Here is the call graph for this function:

void scene::set_glwidget ( glwidget p_widget  ) 

Set the GLWidget pointer.

void scene::translate_picking ( const cpe::v3  t  ) 

Translate the selected position of the grid.

References build_spline_surface(), compute_curve_spline(), g0, cpe::picking_data::get_is_picked(), cpe::picking_data::get_picked_index(), N_sample_low_res, pick, cpe::picking_data::set_is_up_to_date(), and surf.

Referenced by glwidget::mouseMoveEvent().

Here is the call graph for this function:

void scene::update_high_res (  ) 

Update the surface given with the high sampling ratio.

References build_spline_surface(), compute_curve_spline(), cpe::picking_data::get_is_up_to_date(), N_sample_high_res, pick, cpe::picking_data::set_is_up_to_date(), and surf.

Referenced by draw_scene(), load_grid(), load_model(), and glwidget::mouseReleaseEvent().

Here is the call graph for this function:

void scene::update_low_res (  ) 

Member Data Documentation

std::vector<cpe::v3> scene::color_table [private]

the color_table of the patches

Referenced by draw_scene(), and init_color_table().

unsigned int scene::counter_update [private]

counter to update the surface at some time

Referenced by draw_scene(), scene(), and update_low_res().

std::vector<std::vector<cpe::v3> > scene::curve_spline [private]

The curve of the boundaries.

Referenced by compute_curve_spline(), and draw_scene().

std::string scene::filename_grid [private]

name of the stored grid

Referenced by load_grid(), save_grid(), and scene().

cpe::grid scene::g0 [private]

Storage class for visibility modified in the gui.

Referenced by draw_scene(), gui_visible_interface(), and init_gui_visibility().

unsigned int scene::N_sample_high_res [private]

The sampling for the high resolution surface.

Referenced by scene(), and update_high_res().

unsigned int scene::N_sample_low_res [private]

The sampling for the low resolution surface.

Referenced by scene(), translate_picking(), and update_low_res().

storage for picking parameters

Referenced by draw_scene(), load_grid(), picking_grid(), translate_picking(), update_high_res(), and update_low_res().

storage for the sphere (to draw the grid position)

Referenced by draw_scene(), and preload_sphere().

std::vector<cpe::v3> scene::sphere_normal [private]

storage for the sphere normal (to draw the grid position)

Referenced by draw_scene(), and preload_sphere().

std::vector<cpe::surface_param_drawable> scene::surf [private]

The documentation for this class was generated from the following files:
Generated on Mon Feb 27 18:30:13 2012 by  doxygen 1.6.3