Visualization Class Reference

Provieds methods for displaying a mesh with OpenGL. More...

#include </usr1/tp517/Tumble/trunk/src/tumble/visualization.h>

Collaboration diagram for Visualization:

[legend]
List of all members.

Meshes

The meshes we are viewing

BezierMeshbezier_mesh
 The BezierMesh we are viewing.
BoundaryMeshbdry_mesh
 The BundaryMesh we are viewing.
 Visualization (Simulation *sim, int _screen_width, int _screen_height)
 Create a new Visualization.
 Visualization (Simulation *_sim)
 Create a new Visualization.
 Visualization (BezierMesh *_bezier_mesh, BoundaryMesh *_bdry_mesh, int _screen_width, int _screen_height)
 Create a new Visualization.
 Visualization (BezierMesh *_bezier_mesh, BoundaryMesh *_bdry_mesh)
 Create a new Visualization.
 Visualization (BezierMesh *_bezier_mesh, BoundaryMesh *_bdry_mesh, bool _project)
 Create a new Visualization.
 ~Visualization ()
 Destructor.
int map_color (int idx, const Color &color)
void set_accuracy (int edge_acc, int face_acc)
int write_jpeg (char *filename)
 Saves the current window contents to a JPEG file.
int write_tiff (char *filename)
 Saves the current window contents to a TIFF file.
int write_ppm (char *filename)
 Saves the current window contents to a PPM file.
void resize (int width, int height)
 Reproject the mesh onto a different sized OpenGL window.
void get_bbox (BezierTriangle *t[], int num, Point2D &top, Point2D &bot)
void compute_world_size ()
 Calculate the size of the mesh, and add a border.
void project ()
 Project the OpenGL environment onto the screen, accounting for zooming.
Point2D convert_from_screen_coords (int x, int y)
void zoomin (Point2D zt, Point2D zb)
void zoomout ()
int get_norms (std::vector< double > &min, std::vector< double > &max)
void draw (const Color &bdry_color, const Color &edge_color)
void draw_bezier (const Color &edge_color, const Color &tri_color)
void draw_solid (const Color &bdry_color, const Color &edge_color)
void draw_data (const Color &bdry_color, const Color &edge_color, unsigned rp, unsigned gp, unsigned bp)
void draw_debug (const Color &bdry_vert_color, const Color &bdry_edge_color, const Color &mesh_color)
void draw_debug (const Color &bdry_vert_color, const Color &bdry_edge_color, const Color &mesh_color, const Color &tri_color)
void draw_bdry_debug (const Color &vert_color, const Color &edge_color, const Color &control_color, const Color &deboor_color)
void draw_skeleton (const Color &bdry_color, const Color &edge_color, bool draw_edges)
void draw_solid (const Color &bdry_color, const Color &edge_color, bool draw_edges)
void draw_data_channel (const Color &bdry_color, const Color &edge_color, unsigned channel, double min, double max, bool draw_edges)
void draw_tuple (const BezierTuple &tup, const Color &vc, const Color &ec, const Color &fc)
void draw_point (BezierTriangle *t, double u, double v, const Color &tc, const Color &vc)
void draw_point (BezierEdge *e, double u, const Color &ec, const Color &vc)
void draw_point (const Point2D &p, const Color &color, double size)
void draw_circle (const Color &color, const Point2D &p, double radius)
void draw_boundary_vertex (BoundaryVertex *v, const Color &color)
void draw_boundary_edge (const BoundaryEdge *e, const Color &color)
void draw_boundary_edge_debug (const BoundaryEdge *e, const Color &edge, const Color &control, const Color &deboor)
void draw_bezier_vertex (BezierVertex *v, const Color &color)
void draw_bezier_edge (BezierEdge *e, const Color &color)
void draw_bezier_triangle (BezierTriangle *f)
void draw_bezier_triangle (BezierTriangle *f, const Color &color)
void draw_bezier_triangle (BezierTriangle *f, unsigned r, unsigned g, unsigned b)
void draw_bezier_triangle (BezierTriangle *f, unsigned channel, double min, double max)
void draw_control_net (BezierTriangle *t, const Color &color)
void draw_polygon (Point2D ps[], int len, const Color &color)
void draw_smooth_debug (BezierEdge *e, Point2D poly[], const Point2D &primary, const Point2D &secodary)
void draw_flip_debug (BezierEdge *e, Point2D poly[], const Point2D &primary, const Point2D &secodary)
void start_draw ()
void finish_draw ()
BezierTuple visual_locate (Point2D pt)
void visual_switch (int snum, BezierTuple &tup)
void draw_newton ()
void draw_inverted_classes ()
int draw_smoothable_edges ()
int draw_flippable_edges ()

Public Attributes

ColorMap colormap
World Dimensions
These are the overall dimentions of the mesh in the mesh's coordinate system

Point2D world_top
 The top, right corner of the mesh.
Point2D world_bot
 The bottom, left corner of the mesh.
Point2D world_center
 The geometric center of the mesh.
double world_width
 The total width of the mesh.
double world_height
 The total height of the mesh.
double world_ratio
 The ratio of width to height of the total mesh.
Zoom Dimensions
These are the dimentions of the current zoom window. The actual view when zoomed may be wider or narrower than these coordinates, as the same aspect ratio as the original unzoomed view is maintained by adjusting the width of the zoomed image.

Point2D zoom_top
 The top, right corner of the zoom window.
Point2D zoom_bot
 The bottom, left corner of the zoom window.
Point2D zoom_center
 The geometric center of the zoom window.
double zoom_width
 The width of the zoom window.
double zoom_height
 The height of the zoom window.
double zoom_ratio
 The ratio of width to height of the zoom window.
bool zoomed
 Are we currently zoomed in?
View Dimensions
These are the dimentions, in the mesh's coordinate system, of the actual view that is displayed in the OpenGL window. They are calculated from the World and Zoom dimentions by the project() function.

Point2D view_top
 The coordinates at the top, right corner of the window.
Point2D view_bot
 The coordinates at the bottom, left corner of the window.
double pixel_area
 The area of occupied by one pixel in the window, in the mesh coordinate system.
Screen dimensions
This is the size of the screen(OpenGL window) in pixels. This is provided by the user, as they should have already created the window

int screen_width
 The width of the OpenGL window in pixels.
int screen_height
 The height of the OpenGL window in pixels.
double screen_ratio
 The ratio of width to height of the OpenGL window in pixels.
Drawing accuracy
These control how many linear elements are used to draw a bezier element. In most cases Edges should be set below 10 and above 4, while faces should normally be fine with 2 or 3.

int edge_draw_acc
 The number of linear edges to draw a BezierEdge.
int face_draw_acc
 The square root of the number of linear triangles to draw a BezierTriangle.

Private Member Functions

Pic * dump_pixels (Pic *&p)
 Dumps the current OpenGL window to an array of RGB values.
void init_zoom ()
void initialize (BezierMesh *_bezier_mesh, BoundaryMesh *_bdry_mesh, int _screen_width=-1, int _screen_height=-1, bool _project=false)
 Initialize a new Visualization.
bool is_visible (const Point2D &p)
 Check if the given Point2D is currently visible.
bool is_visible (const BoundaryVertex *v)
 Check if the given BoundaryVertex is currently visible.
bool is_visible (const BezierVertex *v)
 Check if the given BezierVertex is currently visible.
bool is_visible (const BezierEdge *e)
 Check if the given BezierEdge is currently visible.
bool is_visible (const BezierTriangle *t)
 Check if the given BezierTriangle is currently visible.

Detailed Description

Provieds methods for displaying a mesh with OpenGL.

For flexibility of use, Visualization does not set up an OpenGL environemnt or create any windows. It assumes that that has already been done, and simply accpets dimentions for the size of the window that as been allocated for it.

Visualizations have the ability to draw various elements of the mesh in many different styles, as well as a system to manage the progration of the mesh onto the windows, and to deal with zooming in/out.

Visualziations also can use the libpicio.so library to dump the screen to a image file.

Definition at line 49 of file visualization.h.


Constructor & Destructor Documentation

Visualization::Visualization ( Simulation sim,
int  _screen_width,
int  _screen_height 
)

Create a new Visualization.

Projects the mesh onto the specified screen size.

Parameters:
sim The Simulation containing the meshes to view
_screen_width The width in pixels of the OpenGL window to draw in
_screen_height The height in pixels of the OpenGL window to draw in

Definition at line 38 of file visualization.C.

References Simulation::get_bezier_mesh(), Simulation::get_boundary_mesh(), and initialize().

Here is the call graph for this function:

Visualization::Visualization ( Simulation sim  ) 

Create a new Visualization.

Projects the mesh onto the current screen.

Parameters:
sim The Simulation containing the meshes to view

Definition at line 53 of file visualization.C.

References Simulation::get_bezier_mesh(), Simulation::get_boundary_mesh(), and initialize().

Here is the call graph for this function:

Visualization::Visualization ( BezierMesh _bezier_mesh,
BoundaryMesh _bdry_mesh,
int  _screen_width,
int  _screen_height 
)

Create a new Visualization.

Projects the mesh onto the specified screen size.

Parameters:
_bezier_mesh The BezierMesh to view
_bdry_mesh The BoundaryMesh to view
_screen_width The width in pixels of the OpenGL window to draw in
_screen_height The height in pixels of the OpenGL window to draw in

Definition at line 70 of file visualization.C.

References initialize().

Here is the call graph for this function:

Visualization::Visualization ( BezierMesh _bezier_mesh,
BoundaryMesh _bdry_mesh 
)

Create a new Visualization.

Projects the mesh onto the current screen.

Parameters:
_bezier_mesh The BezierMesh to view
_bdry_mesh The BoundaryMesh to view

Definition at line 81 of file visualization.C.

References initialize().

Here is the call graph for this function:

Visualization::Visualization ( BezierMesh _bezier_mesh,
BoundaryMesh _bdry_mesh,
bool  _project 
)

Create a new Visualization.

Parameters:
_bezier_mesh The BezierMesh to view
_bdry_mesh The BoundaryMesh to view
_project Deterimes wether to project or not

Definition at line 92 of file visualization.C.

References initialize().

Here is the call graph for this function:

Visualization::~Visualization (  ) 

Destructor.

Definition at line 137 of file visualization.C.


Member Function Documentation

Pic * Visualization::dump_pixels ( Pic *&  p  )  [private]

Dumps the current OpenGL window to an array of RGB values.

Make sure to free the returned array with pic_free().

Parameters:
p The array of RGB values
Returns:
p

Definition at line 149 of file visualization.C.

References screen_height, and screen_width.

Referenced by write_jpeg(), write_ppm(), and write_tiff().

void Visualization::init_zoom (  )  [private]

Definition at line 894 of file visualization.C.

References zoomed.

Referenced by initialize().

void Visualization::initialize ( BezierMesh _bezier_mesh,
BoundaryMesh _bdry_mesh,
int  _screen_width = -1,
int  _screen_height = -1,
bool  _project = false 
) [private]

Initialize a new Visualization.

Projects the mesh onto the specified screen size.

Parameters:
_bezier_mesh The BezierMesh to view
_bdry_mesh The BoundaryMesh to view
_screen_width The width in pixels of the OpenGL window to draw in
_screen_height The height in pixels of the OpenGL window to draw in
_project Projects the mesh onto the current screen, otherwise does no projection

Definition at line 107 of file visualization.C.

References bdry_mesh, bezier_mesh, colormap, compute_world_size(), default_opengl_color_map(), edge_draw_acc, face_draw_acc, init_zoom(), resize(), view_bot, view_top, world_bot, and world_top.

Referenced by Visualization().

Here is the call graph for this function:

bool Visualization::is_visible ( const Point2D p  )  [private]

Check if the given Point2D is currently visible.

Parameters:
p The point to check
Returns:
true if currently visible, false otherwise

Definition at line 945 of file visualization.C.

References view_bot, view_top, Point2D::x(), and Point2D::y().

Referenced by draw_bezier_edge(), draw_bezier_triangle(), draw_bezier_vertex(), draw_boundary_vertex(), draw_control_net(), and is_visible().

Here is the call graph for this function:

bool Visualization::is_visible ( const BoundaryVertex v  )  [private]

Check if the given BoundaryVertex is currently visible.

Parameters:
v The BoundaryVertex to check
Returns:
true if currently visible, false otherwise

Definition at line 955 of file visualization.C.

References BoundaryVertex::get_cp(), and is_visible().

Here is the call graph for this function:

bool Visualization::is_visible ( const BezierVertex v  )  [private]

Check if the given BezierVertex is currently visible.

Parameters:
v The BezierVertex to check
Returns:
true if currently visible, false otherwise

Definition at line 964 of file visualization.C.

References BezierVertex::get_cp(), and is_visible().

Here is the call graph for this function:

bool Visualization::is_visible ( const BezierEdge e  )  [private]

Check if the given BezierEdge is currently visible.

Parameters:
e The BezierEdge to check
Returns:
true if currently visible, false otherwise

Definition at line 973 of file visualization.C.

References BezierEdge::get_cp(), and is_visible().

Here is the call graph for this function:

bool Visualization::is_visible ( const BezierTriangle t  )  [private]

Check if the given BezierTriangle is currently visible.

This function not only checks if the triangle is off screen as the other is_visible() methods do, but it also checks if the triangle is so small that it will not be visible. This is done by comparing the approximate triangle size to the size of a pixel in the current view.

Parameters:
v The BezierTriangle to check
Returns:
true if currently visible, false otherwise

Definition at line 988 of file visualization.C.

References BezierTriangle::get_cp(), is_visible(), pixel_area, Point2D::x(), and Point2D::y().

Here is the call graph for this function:

int Visualization::map_color ( int  idx,
const Color color 
)

Definition at line 161 of file visualization.C.

References colormap, and Color::is_valid().

Here is the call graph for this function:

void Visualization::set_accuracy ( int  edge_acc,
int  face_acc 
) [inline]

Definition at line 151 of file visualization.h.

References edge_draw_acc, and face_draw_acc.

int Visualization::write_jpeg ( char *  filename  ) 

Saves the current window contents to a JPEG file.

Parameters:
filename The name of the file with a ".jpg" extension
Returns:
0 in success

Definition at line 219 of file visualization.C.

References add_filename_extension(), dump_pixels(), FALSE, and MAX_FILENAME.

Here is the call graph for this function:

int Visualization::write_tiff ( char *  filename  ) 

Saves the current window contents to a TIFF file.

Parameters:
filename The name of the file with a ".tiff" extension
Returns:
0 in success

Definition at line 237 of file visualization.C.

References add_filename_extension(), dump_pixels(), FALSE, and MAX_FILENAME.

Here is the call graph for this function:

int Visualization::write_ppm ( char *  filename  ) 

Saves the current window contents to a PPM file.

Parameters:
filename The name of the file with a ".ppm" extension
Returns:
0 in success

Definition at line 254 of file visualization.C.

References add_filename_extension(), dump_pixels(), FALSE, and MAX_FILENAME.

Referenced by BezierMesh::draw_insert_error(), and BezierMesh::draw_smooth_error().

Here is the call graph for this function:

void Visualization::resize ( int  _screen_width,
int  _screen_height 
)

Reproject the mesh onto a different sized OpenGL window.

This will re-project the mesh onto an OpenGL window of the specified size. Make sure to call this function when the GUI resizes the window.

Definition at line 785 of file visualization.C.

References project(), screen_height, screen_ratio, and screen_width.

Referenced by initialize().

Here is the call graph for this function:

void Visualization::get_bbox ( BezierTriangle t[],
int  num,
Point2D top,
Point2D bot 
)

Definition at line 922 of file visualization.C.

References Point2D::coords, Point2D::x(), and Point2D::y().

Referenced by BezierMesh::draw_insert_error(), and draw_smooth_debug().

Here is the call graph for this function:

void Visualization::compute_world_size (  ) 

Calculate the size of the mesh, and add a border.

Calculates a bounding box for the mesh, and adds a small buffer as a border. This is stored in the various world_top and world_bot variables

Definition at line 799 of file visualization.C.

References Point2D::assign(), BoundaryMesh::bbox(), bdry_mesh, Point2D::coords, world_bot, world_center, world_height, world_ratio, world_top, world_width, Point2D::x(), and Point2D::y().

Referenced by initialize(), and project().

Here is the call graph for this function:

void Visualization::project (  ) 

Project the OpenGL environment onto the screen, accounting for zooming.

This function generates the correct projection of the mesh's coordinates system onto the screen. It takes into account wether the view is currently zoomed. When zoomed, the projection will maintain the overall aspect ratio of the unzoomed image. If the zoom window is not of the same ratio, it will change the width of the zoom window to correct the ratio.

Once the correct projection is determined the coordinates of that projecttion are stored in the view_top and view_bot variables.

Definition at line 838 of file visualization.C.

References Point2D::assign(), compute_world_size(), Point2D::coords, pixel_area, screen_height, screen_ratio, screen_width, view_bot, view_top, world_bot, world_center, world_height, world_ratio, world_top, world_width, Point2D::x(), Point2D::y(), zoom_bot, zoom_height, zoom_top, and zoomed.

Referenced by resize(), zoomin(), and zoomout().

Here is the call graph for this function:

Point2D Visualization::convert_from_screen_coords ( int  x,
int  y 
)

Definition at line 915 of file visualization.C.

References Point2D::coords, screen_height, screen_width, view_bot, view_top, Point2D::x(), and Point2D::y().

Here is the call graph for this function:

void Visualization::zoomin ( Point2D  zt,
Point2D  zb 
)

Definition at line 898 of file visualization.C.

References Point2D::coords, project(), Point2D::x(), Point2D::y(), zoom_bot, zoom_center, zoom_height, zoom_ratio, zoom_top, zoom_width, and zoomed.

Referenced by BezierMesh::draw_insert_error(), and draw_smooth_debug().

Here is the call graph for this function:

void Visualization::zoomout (  ) 

Definition at line 910 of file visualization.C.

References project(), and zoomed.

Referenced by BezierMesh::draw_smooth_error().

Here is the call graph for this function:

int Visualization::get_norms ( std::vector< double > &  min,
std::vector< double > &  max 
)

void Visualization::draw ( const Color bdry_color,
const Color edge_color 
)

Definition at line 269 of file visualization.C.

References bdry_mesh, bezier_mesh, draw_bezier_edge(), draw_boundary_edge(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_begin(), and CellComplex< Vertex, Edge, Face, Tuple >::get_edges_end().

Referenced by BezierMesh::coarsen_draw_debug(), draw_smooth_debug(), BezierMesh::draw_smooth_error(), and visual_switch().

Here is the call graph for this function:

void Visualization::draw_bezier ( const Color edge_color,
const Color tri_color 
)

Definition at line 281 of file visualization.C.

References bezier_mesh, draw_bezier_edge(), draw_bezier_triangle(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_end(), CellComplex< Vertex, Edge, Face, Tuple >::get_faces_begin(), and CellComplex< Vertex, Edge, Face, Tuple >::get_faces_end().

Here is the call graph for this function:

void Visualization::draw_solid ( const Color bdry_color,
const Color edge_color 
)

Definition at line 295 of file visualization.C.

References bdry_mesh, bezier_mesh, draw_bezier_edge(), draw_bezier_triangle(), draw_boundary_edge(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_end(), CellComplex< Vertex, Edge, Face, Tuple >::get_faces_begin(), and CellComplex< Vertex, Edge, Face, Tuple >::get_faces_end().

Here is the call graph for this function:

void Visualization::draw_data ( const Color bdry_color,
const Color edge_color,
unsigned  rp,
unsigned  gp,
unsigned  bp 
)

Definition at line 312 of file visualization.C.

References bdry_mesh, bezier_mesh, draw_bezier_edge(), draw_bezier_triangle(), draw_boundary_edge(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_end(), CellComplex< Vertex, Edge, Face, Tuple >::get_faces_begin(), and CellComplex< Vertex, Edge, Face, Tuple >::get_faces_end().

Here is the call graph for this function:

void Visualization::draw_debug ( const Color bdry_vert_color,
const Color bdry_edge_color,
const Color mesh_color 
)

Definition at line 329 of file visualization.C.

References bdry_mesh, bezier_mesh, draw_bezier_edge(), draw_bezier_triangle(), draw_bezier_vertex(), draw_boundary_edge(), draw_boundary_vertex(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_end(), CellComplex< Vertex, Edge, Face, Tuple >::get_faces_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_faces_end(), CellComplex< Vertex, Edge, Face, Tuple >::get_vertices_begin(), and CellComplex< Vertex, Edge, Face, Tuple >::get_vertices_end().

Here is the call graph for this function:

void Visualization::draw_debug ( const Color bdry_vert_color,
const Color bdry_edge_color,
const Color mesh_color,
const Color tri_color 
)

Definition at line 360 of file visualization.C.

References bdry_mesh, bezier_mesh, draw_bezier_edge(), draw_bezier_triangle(), draw_bezier_vertex(), draw_boundary_edge(), draw_boundary_vertex(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_end(), CellComplex< Vertex, Edge, Face, Tuple >::get_faces_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_faces_end(), CellComplex< Vertex, Edge, Face, Tuple >::get_vertices_begin(), and CellComplex< Vertex, Edge, Face, Tuple >::get_vertices_end().

Here is the call graph for this function:

void Visualization::draw_bdry_debug ( const Color vert_color,
const Color edge_color,
const Color control_color,
const Color deboor_color 
)

Definition at line 391 of file visualization.C.

References bdry_mesh, draw_boundary_edge_debug(), draw_boundary_vertex(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_end(), CellComplex< Vertex, Edge, Face, Tuple >::get_vertices_begin(), and CellComplex< Vertex, Edge, Face, Tuple >::get_vertices_end().

Here is the call graph for this function:

void Visualization::draw_skeleton ( const Color bdry_color,
const Color edge_color,
bool  draw_edges 
)

Definition at line 410 of file visualization.C.

References bdry_mesh, bezier_mesh, draw_bezier_edge(), draw_boundary_edge(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_begin(), and CellComplex< Vertex, Edge, Face, Tuple >::get_edges_end().

Here is the call graph for this function:

void Visualization::draw_solid ( const Color bdry_color,
const Color edge_color,
bool  draw_edges 
)

Definition at line 425 of file visualization.C.

References bdry_mesh, bezier_mesh, draw_bezier_edge(), draw_bezier_triangle(), draw_boundary_edge(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_end(), CellComplex< Vertex, Edge, Face, Tuple >::get_faces_begin(), and CellComplex< Vertex, Edge, Face, Tuple >::get_faces_end().

Here is the call graph for this function:

void Visualization::draw_data_channel ( const Color bdry_color,
const Color edge_color,
unsigned  channel,
double  min,
double  max,
bool  draw_edges 
)

Definition at line 445 of file visualization.C.

References bdry_mesh, bezier_mesh, draw_bezier_edge(), draw_bezier_triangle(), draw_boundary_edge(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_end(), CellComplex< Vertex, Edge, Face, Tuple >::get_faces_begin(), and CellComplex< Vertex, Edge, Face, Tuple >::get_faces_end().

Here is the call graph for this function:

void Visualization::draw_tuple ( const BezierTuple tup,
const Color vc,
const Color ec,
const Color fc 
)

Definition at line 511 of file visualization.C.

References draw_bezier_edge(), draw_bezier_triangle(), draw_bezier_vertex(), CellTuple< Vertex, Edge, Face >::e, CellTuple< Vertex, Edge, Face >::f, and CellTuple< Vertex, Edge, Face >::v.

Referenced by BezierMesh::draw_insert_error(), and visual_switch().

Here is the call graph for this function:

void Visualization::draw_point ( BezierTriangle t,
double  u,
double  v,
const Color tc,
const Color vc 
)

Definition at line 472 of file visualization.C.

References draw_bezier_triangle(), and BezierTriangle::eval().

Referenced by BezierMesh::coarsen_draw_debug(), BezierMesh::draw_insert_error(), draw_point(), draw_smooth_debug(), and visual_locate().

Here is the call graph for this function:

void Visualization::draw_point ( BezierEdge e,
double  u,
const Color ec,
const Color vc 
)

Definition at line 478 of file visualization.C.

References draw_bezier_edge(), draw_point(), and BezierEdge::eval().

Here is the call graph for this function:

void Visualization::draw_point ( const Point2D p,
const Color color,
double  size 
)

Definition at line 484 of file visualization.C.

References Point2D::coords, and Color::v.

void Visualization::draw_circle ( const Color color,
const Point2D p,
double  radius 
)

Definition at line 494 of file visualization.C.

References Point2D::assign(), Point2D::coords, PI, Color::v, Point2D::x(), and Point2D::y().

Referenced by BezierMesh::coarsen_draw_debug().

Here is the call graph for this function:

void Visualization::draw_boundary_vertex ( BoundaryVertex v,
const Color color 
)

Definition at line 519 of file visualization.C.

References BoundaryVertex::get_cp(), is_visible(), and Color::v.

Referenced by draw_bdry_debug(), and draw_debug().

Here is the call graph for this function:

void Visualization::draw_boundary_edge ( const BoundaryEdge e,
const Color color 
)

Definition at line 527 of file visualization.C.

References QBSpline::b, Point2D::coords, edge_draw_acc, QBSpline::evaluate_segment(), BoundaryEdge::get_spline(), and Color::v.

Referenced by draw(), draw_data(), draw_data_channel(), draw_debug(), draw_skeleton(), and draw_solid().

Here is the call graph for this function:

void Visualization::draw_boundary_edge_debug ( const BoundaryEdge e,
const Color edge,
const Color control,
const Color deboor 
)

Definition at line 540 of file visualization.C.

References QBSpline::b, Point2D::coords, edge_draw_acc, QBSpline::evaluate_segment(), QBSpline::get_deboor(), QBSpline::get_num_deboor(), BoundaryEdge::get_spline(), and Color::v.

Referenced by draw_bdry_debug().

Here is the call graph for this function:

void Visualization::draw_bezier_vertex ( BezierVertex v,
const Color color 
)

Definition at line 577 of file visualization.C.

References Point2D::coords, BezierVertex::get_cp(), is_visible(), and Color::v.

Referenced by draw_debug(), and draw_tuple().

Here is the call graph for this function:

void Visualization::draw_bezier_edge ( BezierEdge e,
const Color color 
)

Definition at line 585 of file visualization.C.

References Point2D::coords, edge_draw_acc, BezierEdge::eval(), is_visible(), and Color::v.

Referenced by draw(), draw_bezier(), draw_data(), draw_data_channel(), draw_debug(), draw_flippable_edges(), draw_point(), draw_skeleton(), draw_smoothable_edges(), draw_solid(), and draw_tuple().

Here is the call graph for this function:

void Visualization::draw_bezier_triangle ( BezierTriangle f  ) 

Definition at line 595 of file visualization.C.

References colormap, and BezierTriangle::get_color().

Referenced by draw_bezier(), draw_data(), draw_data_channel(), draw_debug(), draw_inverted_classes(), draw_point(), draw_smooth_debug(), draw_solid(), and draw_tuple().

Here is the call graph for this function:

void Visualization::draw_bezier_triangle ( BezierTriangle f,
const Color color 
)

Definition at line 600 of file visualization.C.

References Point2D::coords, BezierTriangle::eval(), face_draw_acc, is_visible(), and Color::v.

Here is the call graph for this function:

void Visualization::draw_bezier_triangle ( BezierTriangle f,
unsigned  r,
unsigned  g,
unsigned  b 
)

Definition at line 629 of file visualization.C.

References Point2D::coords, BezierTriangle::dataeval(), BezierTriangle::eval(), face_draw_acc, and is_visible().

Here is the call graph for this function:

void Visualization::draw_bezier_triangle ( BezierTriangle f,
unsigned  channel,
double  min,
double  max 
)

Definition at line 668 of file visualization.C.

References Point2D::coords, BezierTriangle::dataeval(), BezierTriangle::eval(), face_draw_acc, is_visible(), and spectrum_color().

Here is the call graph for this function:

void Visualization::draw_control_net ( BezierTriangle t,
const Color color 
)

Definition at line 716 of file visualization.C.

References Point2D::coords, BezierTriangle::get_cp(), is_visible(), and Color::v.

Referenced by BezierMesh::draw_insert_error(), and draw_smooth_debug().

Here is the call graph for this function:

void Visualization::draw_polygon ( Point2D  ps[],
int  len,
const Color color 
)

Definition at line 741 of file visualization.C.

References Color::v.

Referenced by draw_smooth_debug().

void Visualization::draw_smooth_debug ( BezierEdge e,
Point2D  poly[],
const Point2D primary,
const Point2D secodary 
)

Definition at line 755 of file visualization.C.

References EdgeCell::begin_faces(), BLUE, CYAN, DARKRED, DIMCYAN, DIMYELLOW, draw(), draw_bezier_triangle(), draw_control_net(), draw_point(), draw_polygon(), get_bbox(), GREEN, MAGENTA, EdgeCell::num_faces(), RED, YELLOW, and zoomin().

Referenced by draw_flip_debug(), and BezierMesh::draw_smooth_error().

Here is the call graph for this function:

void Visualization::draw_flip_debug ( BezierEdge e,
Point2D  poly[],
const Point2D primary,
const Point2D secodary 
)

Definition at line 750 of file visualization.C.

References draw_smooth_debug().

Here is the call graph for this function:

void Visualization::start_draw (  ) 

Definition at line 1016 of file visualization.C.

Referenced by BezierMesh::coarsen_draw_debug(), BezierMesh::draw_insert_error(), and BezierMesh::draw_smooth_error().

void Visualization::finish_draw (  ) 

Definition at line 1024 of file visualization.C.

Referenced by BezierMesh::coarsen_draw_debug(), BezierMesh::draw_insert_error(), and BezierMesh::draw_smooth_error().

BezierTuple Visualization::visual_locate ( Point2D  pt  ) 

Draw the searched-for point in green, draw what we found in red. If we found an edge or a face, draw it in yellow.

Definition at line 1044 of file visualization.C.

References bezier_mesh, BezierMesh::blind_locate_point(), draw_point(), CellTuple< Vertex, Edge, Face >::e, CellTuple< Vertex, Edge, Face >::f, CellComplex< Vertex, Edge, Face, Tuple >::get_tuple(), GREEN, RED, and YELLOW.

Here is the call graph for this function:

void Visualization::visual_switch ( int  snum,
BezierTuple tup 
)

Definition at line 1030 of file visualization.C.

References bezier_mesh, BLUE, draw(), draw_tuple(), GRAY2, GREEN, RED, CellComplex< Vertex, Edge, Face, Tuple >::Switch(), and WHITE.

Here is the call graph for this function:

void Visualization::draw_newton (  ) 

Definition at line 1411 of file visualization.C.

References bezier_mesh, Point2D::coords, CellComplex< Vertex, Edge, Face, Tuple >::get_faces_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_faces_end(), and newton_iterations.

Here is the call graph for this function:

void Visualization::draw_inverted_classes (  ) 

Definition at line 1464 of file visualization.C.

References bezier_mesh, BezierMesh::classify_inverted_triangles(), draw_bezier_triangle(), CellComplex< Vertex, Edge, Face, Tuple >::get_num_faces(), GREEN, RED, and YELLOW.

Here is the call graph for this function:

int Visualization::draw_smoothable_edges (  ) 

Definition at line 1477 of file visualization.C.

References bezier_mesh, BLUE, BezierMesh::can_smooth(), draw_bezier_edge(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_end(), GREEN, BezierEdge::is_boundary(), and RED.

Here is the call graph for this function:

int Visualization::draw_flippable_edges (  ) 

Definition at line 1496 of file visualization.C.

References bezier_mesh, BLUE, BezierMesh::can_flip(), CYAN, draw_bezier_edge(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_begin(), CellComplex< Vertex, Edge, Face, Tuple >::get_edges_end(), GREEN, BezierEdge::is_boundary(), RED, and BezierMesh::should_flip().

Here is the call graph for this function:


Member Data Documentation

Point2D Visualization::world_top

The top, right corner of the mesh.

Definition at line 68 of file visualization.h.

Referenced by compute_world_size(), initialize(), and project().

Point2D Visualization::world_bot

The bottom, left corner of the mesh.

Definition at line 69 of file visualization.h.

Referenced by compute_world_size(), initialize(), and project().

Point2D Visualization::world_center

The geometric center of the mesh.

Definition at line 70 of file visualization.h.

Referenced by compute_world_size(), and project().

double Visualization::world_width

The total width of the mesh.

Definition at line 71 of file visualization.h.

Referenced by compute_world_size(), and project().

double Visualization::world_height

The total height of the mesh.

Definition at line 72 of file visualization.h.

Referenced by compute_world_size(), and project().

double Visualization::world_ratio

The ratio of width to height of the total mesh.

Definition at line 73 of file visualization.h.

Referenced by compute_world_size(), and project().

Point2D Visualization::zoom_top

The top, right corner of the zoom window.

Definition at line 83 of file visualization.h.

Referenced by project(), and zoomin().

Point2D Visualization::zoom_bot

The bottom, left corner of the zoom window.

Definition at line 84 of file visualization.h.

Referenced by project(), and zoomin().

Point2D Visualization::zoom_center

The geometric center of the zoom window.

Definition at line 85 of file visualization.h.

Referenced by zoomin().

double Visualization::zoom_width

The width of the zoom window.

Definition at line 86 of file visualization.h.

Referenced by zoomin().

double Visualization::zoom_height

The height of the zoom window.

Definition at line 87 of file visualization.h.

Referenced by project(), and zoomin().

double Visualization::zoom_ratio

The ratio of width to height of the zoom window.

Definition at line 88 of file visualization.h.

Referenced by zoomin().

bool Visualization::zoomed

Are we currently zoomed in?

Definition at line 89 of file visualization.h.

Referenced by init_zoom(), project(), zoomin(), and zoomout().

Point2D Visualization::view_top

The coordinates at the top, right corner of the window.

Definition at line 99 of file visualization.h.

Referenced by convert_from_screen_coords(), initialize(), is_visible(), and project().

Point2D Visualization::view_bot

The coordinates at the bottom, left corner of the window.

Definition at line 100 of file visualization.h.

Referenced by convert_from_screen_coords(), initialize(), is_visible(), and project().

double Visualization::pixel_area

The area of occupied by one pixel in the window, in the mesh coordinate system.

Definition at line 101 of file visualization.h.

Referenced by is_visible(), and project().

int Visualization::screen_width

The width of the OpenGL window in pixels.

Definition at line 113 of file visualization.h.

Referenced by convert_from_screen_coords(), dump_pixels(), project(), and resize().

int Visualization::screen_height

The height of the OpenGL window in pixels.

Definition at line 114 of file visualization.h.

Referenced by convert_from_screen_coords(), dump_pixels(), project(), and resize().

double Visualization::screen_ratio

The ratio of width to height of the OpenGL window in pixels.

Definition at line 115 of file visualization.h.

Referenced by project(), and resize().

ColorMap Visualization::colormap

Definition at line 118 of file visualization.h.

Referenced by draw_bezier_triangle(), initialize(), and map_color().

int Visualization::edge_draw_acc

The number of linear edges to draw a BezierEdge.

Definition at line 127 of file visualization.h.

Referenced by draw_bezier_edge(), draw_boundary_edge(), draw_boundary_edge_debug(), initialize(), and set_accuracy().

int Visualization::face_draw_acc

The square root of the number of linear triangles to draw a BezierTriangle.

Definition at line 128 of file visualization.h.

Referenced by draw_bezier_triangle(), initialize(), and set_accuracy().

BezierMesh* Visualization::bezier_mesh

The BezierMesh we are viewing.

Definition at line 134 of file visualization.h.

Referenced by draw(), draw_bezier(), draw_data(), draw_data_channel(), draw_debug(), draw_flippable_edges(), draw_inverted_classes(), draw_newton(), draw_skeleton(), draw_smoothable_edges(), draw_solid(), initialize(), visual_locate(), and visual_switch().

BoundaryMesh* Visualization::bdry_mesh

The BundaryMesh we are viewing.

Definition at line 135 of file visualization.h.

Referenced by compute_world_size(), draw(), draw_bdry_debug(), draw_data(), draw_data_channel(), draw_debug(), draw_skeleton(), draw_solid(), and initialize().


The documentation for this class was generated from the following files:
Generated on Mon May 24 09:53:35 2010 for TUMBLE by  doxygen 1.5.2