FlowVisCanvas Class Reference

OpenGL canvas which is used to display the flow data graphically. More...

#include <flowvis_canvas.h>

Collaboration diagram for FlowVisCanvas:

Collaboration graph
[legend]

List of all members.

Public Types

enum  RenderMode_E { FVC_SCREEN, FVC_VALUE_INTER, FVC_ARROW_INTER }
 Available Render Modes. More...

Public Member Functions

 FlowVisCanvas (wxWindow *parent, wxWindowID id=wxID_ANY)
 Constructor.
 ~FlowVisCanvas ()
 Destructor.
void SetData (std::auto_ptr< FlowVisData > data)
 Set pointer to flow data structure.
void SetBackgroundSet (int set_nr)
 Set the index of the data channel that is used to generate the background image.
void UpdateTransferFunction (TransferFunctionSampler *sampler, int set_to_update)
 Specifies how to map background data values to color and opacity.
void LoadArrowTexture ()
 Load the texture used for drawing arrows.
void LoadGlyphTexture ()
 Load the texture used for drawing glyphs on streamlines.
void SetArrows (int x, int y)
 Creates an evenly spaced set of arrows on the velocity field.
void Prepare_Streamlines ()
 Calculate evenly spaces streamlines for the current velocity field.
void RenderToFile (const wxString &file_name, int width, int height)
 Render an image, according to the current setting, with given width/height and store it in a file.
Enable/Disable the available presentation layers
void SetArrowPlot (bool plot_arrows)
void SetStreamlinePlot (bool plot_streamlines)
void SetBackgroundPlot (bool plot_background)
Specify the apearance of streamlines
void SetLineColor (wxColour new_color)
void SetLineTapering (bool plot_tapering)
void SetLineGlyphs (bool plot_glyphs)
void SetGlyphDensity (int new_density)
Specify the parameters used in streamline calculation
void SetDsep (float dsep)
void SetDtest (float dtest)
void SetIntegType (int integ_index)
void SetMaxIter (int maxiter)
void SetStepSize (float step_size)

Public Attributes

RenderMode_E m_mode
 Current rendering mode.

Protected Member Functions

Event handling
void OnPaint (wxPaintEvent &event)
 Called when a repaint is needed.
void OnSize (wxSizeEvent &event)
 Called when the client area is resized.
void OnEraseBackground (wxEraseEvent &event)
 Called when the background should be redrawn. Does nothing to prevent flickering.

Private Types

enum  GLStatus { GLS_INIT_PENDING, GLS_INIT_FAILED, GLS_OK }
 Enum used to determine the OpenGL initialisation status. More...

Private Member Functions

void Render ()
 Does the rendering.
bool InitGL ()
 Initialises OpenGL. Returns false on failure.
bool CheckGL ()
 Initialises OpenGL if not yet done and returns true on success.
void InitTextures ()
 Create and initialize all textures.
void CreateEvenlySpacedArrows ()
 Create an evenly spaced grid of data points on the velocity field.
Render functions to produce the selected image layers
void Render_Background ()
void Render_Arrows ()
void Render_ToScreen ()
void Render_ValueInter (int set)
void Render_ArrowInter ()
void Render_Streamlines ()

Private Attributes

GLStatus m_glstatus
 Initialisation status.
std::auto_ptr< FlowVisDatam_data
 Data storage containing flow data.
std::auto_ptr< FlowVisProgramm_program
 Pointer to class providing custom shader support.
std::vector< GLuint > m_tex_background
 Texture holding the background data.
std::vector< GLuint > m_tex_bg_trafu
 Texture used for transfer function mapping.
int m_background_set
 Currently selected data channel for the background image.
GLint m_viewport_width
 Height of the canvas.
GLint m_viewport_height
 Width of the canvas.
std::vector< Streamlinem_streamlines
bool m_plot_background
 Collection of all streamlines (in -1 ... +1 mapping).
StreamlinePlotSettings m_sl_settings
StreamlineAlgSettings m_sl_algorithm
float m_line_base_thickness
Arrows m_arrow_data


Detailed Description

OpenGL canvas which is used to display the flow data graphically.

Definition at line 145 of file flowvis_canvas.h.


Member Enumeration Documentation

Available Render Modes.

Enumerator:
FVC_SCREEN 
FVC_VALUE_INTER 
FVC_ARROW_INTER 

Definition at line 149 of file flowvis_canvas.h.

enum FlowVisCanvas::GLStatus [private]

Enum used to determine the OpenGL initialisation status.

Enumerator:
GLS_INIT_PENDING 
GLS_INIT_FAILED 
GLS_OK 

Definition at line 259 of file flowvis_canvas.h.


Constructor & Destructor Documentation

FlowVisCanvas::FlowVisCanvas ( wxWindow *  parent,
wxWindowID  id = wxID_ANY 
)

FlowVisCanvas::~FlowVisCanvas (  )  [inline]

Destructor.

Definition at line 160 of file flowvis_canvas.h.


Member Function Documentation

void FlowVisCanvas::SetData ( std::auto_ptr< FlowVisData data  ) 

Set pointer to flow data structure.

Definition at line 50 of file flowvis_canvas.cpp.

References InitTextures(), m_background_set, m_data, Prepare_Streamlines(), Render_ValueInter(), and SetArrows().

Referenced by FlowVisFrame::OnOpen().

void FlowVisCanvas::SetBackgroundSet ( int  set_nr  ) 

Set the index of the data channel that is used to generate the background image.

Definition at line 469 of file flowvis_canvas.cpp.

References m_background_set.

Referenced by FlowVisFrame::OnBGComboChange().

void FlowVisCanvas::UpdateTransferFunction ( TransferFunctionSampler sampler,
int  set_to_update 
)

void FlowVisCanvas::LoadArrowTexture (  ) 

Load the texture used for drawing arrows.

Exceptions:
std::exception if an error occurs.

Definition at line 90 of file flowvis_canvas.cpp.

References Arrows::arrow_texture, and m_arrow_data.

Referenced by FlowVisCanvas().

void FlowVisCanvas::LoadGlyphTexture (  ) 

Load the texture used for drawing glyphs on streamlines.

Exceptions:
std::exception if an error occurs.

Definition at line 122 of file flowvis_canvas.cpp.

References StreamlinePlotSettings::glyph_texture, and m_sl_settings.

Referenced by FlowVisCanvas().

void FlowVisCanvas::SetArrows ( int  x,
int  y 
)

Creates an evenly spaced set of arrows on the velocity field.

Definition at line 570 of file flowvis_canvas.cpp.

References CreateEvenlySpacedArrows(), m_arrow_data, Arrows::nr_x, and Arrows::nr_y.

Referenced by FlowVisFrame::OnChangeNrArrows(), and SetData().

void FlowVisCanvas::SetArrowPlot ( bool  plot_arrows  ) 

Definition at line 578 of file flowvis_canvas.cpp.

References m_arrow_data, and Arrows::plot.

Referenced by FlowVisFrame::OnPlotSettingsChange().

void FlowVisCanvas::SetStreamlinePlot ( bool  plot_streamlines  ) 

void FlowVisCanvas::SetBackgroundPlot ( bool  plot_background  ) 

Definition at line 589 of file flowvis_canvas.cpp.

References m_plot_background.

Referenced by FlowVisFrame::OnPlotSettingsChange().

void FlowVisCanvas::SetLineColor ( wxColour  new_color  ) 

void FlowVisCanvas::SetLineTapering ( bool  plot_tapering  ) 

void FlowVisCanvas::SetLineGlyphs ( bool  plot_glyphs  ) 

void FlowVisCanvas::SetGlyphDensity ( int  new_density  ) 

void FlowVisCanvas::SetDsep ( float  dsep  ) 

Definition at line 628 of file flowvis_canvas.cpp.

References StreamlineAlgSettings::dsep, and m_sl_algorithm.

Referenced by FlowVisFrame::TransferCalcSettings().

void FlowVisCanvas::SetDtest ( float  dtest  ) 

Definition at line 633 of file flowvis_canvas.cpp.

References StreamlineAlgSettings::dtest, and m_sl_algorithm.

Referenced by FlowVisFrame::TransferCalcSettings().

void FlowVisCanvas::SetIntegType ( int  integ_index  ) 

void FlowVisCanvas::SetMaxIter ( int  maxiter  ) 

void FlowVisCanvas::SetStepSize ( float  step_size  ) 

void FlowVisCanvas::Prepare_Streamlines (  ) 

void FlowVisCanvas::RenderToFile ( const wxString &  file_name,
int  width,
int  height 
)

Render an image, according to the current setting, with given width/height and store it in a file.

Definition at line 653 of file flowvis_canvas.cpp.

References CheckGL(), m_viewport_height, m_viewport_width, and Render_ToScreen().

Referenced by FlowVisFrame::OnSave().

void FlowVisCanvas::OnPaint ( wxPaintEvent &  event  )  [protected]

Called when a repaint is needed.

Definition at line 65 of file flowvis_canvas.cpp.

References CheckGL(), m_line_base_thickness, m_viewport_height, m_viewport_width, and Render().

void FlowVisCanvas::OnSize ( wxSizeEvent &  event  )  [protected]

Called when the client area is resized.

Definition at line 78 of file flowvis_canvas.cpp.

void FlowVisCanvas::OnEraseBackground ( wxEraseEvent &  event  )  [protected]

Called when the background should be redrawn. Does nothing to prevent flickering.

Definition at line 85 of file flowvis_canvas.cpp.

void FlowVisCanvas::Render (  )  [private]

Does the rendering.

Definition at line 173 of file flowvis_canvas.cpp.

References AngleR(), m_data, and Render_ToScreen().

Referenced by OnPaint().

void FlowVisCanvas::Render_Background (  )  [private]

void FlowVisCanvas::Render_Arrows (  )  [private]

void FlowVisCanvas::Render_ToScreen (  )  [private]

void FlowVisCanvas::Render_ValueInter ( int  set  )  [private]

Definition at line 412 of file flowvis_canvas.cpp.

References m_data, and m_tex_background.

Referenced by SetData().

void FlowVisCanvas::Render_ArrowInter (  )  [private]

void FlowVisCanvas::Render_Streamlines (  )  [private]

bool FlowVisCanvas::InitGL (  )  [private]

Initialises OpenGL. Returns false on failure.

Definition at line 449 of file flowvis_canvas.cpp.

Referenced by CheckGL().

bool FlowVisCanvas::CheckGL (  )  [private]

Initialises OpenGL if not yet done and returns true on success.

Definition at line 457 of file flowvis_canvas.cpp.

References GLS_INIT_FAILED, GLS_INIT_PENDING, GLS_OK, InitGL(), and m_glstatus.

Referenced by FlowVisCanvas(), OnPaint(), and RenderToFile().

void FlowVisCanvas::InitTextures (  )  [private]

Create and initialize all textures.

Definition at line 474 of file flowvis_canvas.cpp.

References m_data, m_tex_background, and m_tex_bg_trafu.

Referenced by SetData().

void FlowVisCanvas::CreateEvenlySpacedArrows (  )  [private]

Create an evenly spaced grid of data points on the velocity field.

Definition at line 541 of file flowvis_canvas.cpp.

References Arrows::arrow_points, m_arrow_data, m_data, Arrows::nr_x, Arrows::nr_y, x, and y.

Referenced by SetArrows().


Member Data Documentation

Current rendering mode.

Definition at line 213 of file flowvis_canvas.h.

Initialisation status.

Definition at line 265 of file flowvis_canvas.h.

Referenced by CheckGL().

std::auto_ptr<FlowVisData> FlowVisCanvas::m_data [private]

std::auto_ptr<FlowVisProgram> FlowVisCanvas::m_program [private]

Pointer to class providing custom shader support.

Definition at line 267 of file flowvis_canvas.h.

Referenced by FlowVisCanvas(), Render_Background(), and Render_Streamlines().

std::vector<GLuint> FlowVisCanvas::m_tex_background [private]

Texture holding the background data.

Definition at line 269 of file flowvis_canvas.h.

Referenced by InitTextures(), Render_Background(), and Render_ValueInter().

std::vector<GLuint> FlowVisCanvas::m_tex_bg_trafu [private]

Texture used for transfer function mapping.

Definition at line 270 of file flowvis_canvas.h.

Referenced by InitTextures(), Render_Background(), and UpdateTransferFunction().

Currently selected data channel for the background image.

Definition at line 271 of file flowvis_canvas.h.

Referenced by Render_Background(), SetBackgroundSet(), and SetData().

Height of the canvas.

Definition at line 272 of file flowvis_canvas.h.

Referenced by OnPaint(), Render_Arrows(), Render_ToScreen(), and RenderToFile().

Width of the canvas.

Definition at line 273 of file flowvis_canvas.h.

Referenced by OnPaint(), Render_Arrows(), Render_ToScreen(), and RenderToFile().

std::vector<Streamline> FlowVisCanvas::m_streamlines [private]

Definition at line 275 of file flowvis_canvas.h.

Referenced by Prepare_Streamlines(), and Render_Streamlines().

Collection of all streamlines (in -1 ... +1 mapping).

Definition at line 276 of file flowvis_canvas.h.

Referenced by Render_ToScreen(), and SetBackgroundPlot().

Definition at line 281 of file flowvis_canvas.h.

Referenced by OnPaint(), and Render_Streamlines().


The documentation for this class was generated from the following files:

Generated on Wed Jan 21 16:22:24 2009 for FlowVis by  doxygen 1.5.6