Hermes2D  2.0
Hermes::Hermes2D::Views::BaseView< Scalar > Class Template Reference

Visualizes the basis functions of a space. More...

#include <base_view.h>

+ Inheritance diagram for Hermes::Hermes2D::Views::BaseView< Scalar >:

Public Member Functions

 BaseView (const char *title="BaseView", WinGeom *wg=NULL)
 
 BaseView (char *title, WinGeom *wg=NULL)
 
void show (const Space< Scalar > *space, double eps=HERMES_EPS_LOW, int item=H2D_FN_VAL_0)
 
- Public Member Functions inherited from Hermes::Hermes2D::Views::ScalarView
void init ()
 
 ScalarView (const char *title="ScalarView", WinGeom *wg=NULL)
 
 ScalarView (char *title, WinGeom *wg=NULL)
 
void show (MeshFunction< double > *sln, double eps=HERMES_EPS_NORMAL, int item=H2D_FN_VAL_0, MeshFunction< double > *xdisp=NULL, MeshFunction< double > *ydisp=NULL, double dmult=1.0)
 
void show_linearizer_data (double eps=HERMES_EPS_NORMAL, int item=H2D_FN_VAL_0)
 
void show_mesh (bool show=true)
 
void show_bounding_box (bool show=true)
 
void show_contours (double step, double orig=0.0)
 
void hide_contours ()
 
void set_3d_mode (bool enable=true)
 
void set_vertical_scaling (double sc)
 Sets the scaling on the vertical axis programmatically.
 
void set_min_max_range (double min, double max)
 Sets the limits on displayed values. More...
 
virtual void reset_view (bool force_reset)
 Resets 2d and 3d view. More...
 
Linearizerget_linearizer ()
 Returns the internal linearizer for the purpose of parameter settings.
 
- Public Member Functions inherited from Hermes::Hermes2D::Views::View
void init ()
 
 View (const char *title, WinGeom *wg=NULL)
 
 View (char *title, WinGeom *wg=NULL)
 
int create ()
 
void close ()
 
void refresh ()
 Refreshes views.
 
void set_title (const char *title)
 Changes the window name (in its title-bar) to 'title'.
 
void set_min_max_range (double min, double max)
 
void auto_min_max_range ()
 
void get_min_max_range (double &min, double &max)
 
void show_scale (bool show=true)
 
void set_scale_position (int horz, int vert)
 
void set_scale_size (int width, int height, int numticks)
 
void set_scale_format (const char *fmt)
 
void fix_scale_width (int width=80)
 
void save_screenshot (const char *bmpname, bool high_quality=false)
 
void save_numbered_screenshot (const char *format, int number, bool high_quality=false)
 
void set_palette (ViewPaletteType type)
 
void set_num_palette_steps (int num)
 
void set_palette_filter (bool linear)
 
void wait_for_keypress (const char *text=NULL)
 Waits for keypress. Deprecated.
 
void wait_for_close ()
 
void wait_for_draw ()
 
void draw_help ()
 

Protected Member Functions

void free ()
 
void update_solution ()
 
void update_title ()
 
virtual void on_special_key (int key, int x, int y)
 
virtual const char * get_help_text () const
 
template<>
void update_solution ()
 
template<>
void update_solution ()
 
- Protected Member Functions inherited from Hermes::Hermes2D::Views::ScalarView
void init_vertex_nodes (const Mesh *mesh)
 Creates a copy of vertex nodes for purpose of displaying and selection.
 
VertexNodeInfofind_nearest_node_in_range (float x, float y, float radius)
 Finds nearest node in range.
 
void draw_vertex_nodes ()
 Draws vertex nodes.
 
void draw_single_vertex_node (const VertexNodeInfo &node)
 Draws a single vertex node.
 
void create_nodes_widgets ()
 Creates vertex nodes widgets if not created already.
 
void init_element_info (const Mesh *mesh)
 Creates element info from mesh.
 
void create_element_info_widgets ()
 Creates element ID widgets if not created already.
 
void draw_element_infos_2d ()
 Draws elements infos in 2D mode.
 
void prepare_gl_geometry ()
 prepares geometry in a form compatible with GL arrays; Data are updated if lin is updated. In a case of a failure (out of memory), gl_verts is NULL and an old OpenGL rendering method has to be used.
 
void draw_values_2d ()
 draws values
 
void draw_edges_2d ()
 draws edges
 
void draw_normals_3d ()
 
void calculate_mesh_aabb (double *x_min, double *x_max, double *y_min, double *y_max)
 Calculates AABB from edges.
 
void draw_edges (DrawSingleEdgeCallback draw_single_edge, void *param, bool boundary_only)
 Draws edges of elements and boundary of mesh. Functions assumes that data are locked.
 
void draw_aabb ()
 Draws the axes-aligned bounding box of the model. Assumes a model/view matrix to be the current matrix on the OpenGL stack.
 
double calculate_ztrans_to_fit_view ()
 Calculates the z-coordinate (in eye coordinates) of the closest viewpoint from which we can still see the whole model. Assumes a model/view matrix to be the current matrix on the OpenGL stack. More...
 
virtual void update_layout ()
 Updates layout, i.e., centers 2d and 3d mesh.
 
void draw_tri_contours (double3 *vert, int3 *tri)
 
void calculate_normals (double3 *verts, int num_verts, int3 *tris, int num_tris)
 Initializes normals.
 
void init_lighting ()
 
void update_mesh_info ()
 Updates mesh info. Assumes that data lock is locked.
 
virtual void on_display ()
 
virtual void on_key_down (unsigned char key, int x, int y)
 
virtual void on_mouse_move (int x, int y)
 
virtual void on_right_mouse_down (int x, int y)
 Handles selecting/deselecting of nodes.
 
virtual void on_middle_mouse_down (int x, int y)
 
virtual void on_middle_mouse_up (int x, int y)
 
virtual void on_close ()
 
- Protected Member Functions inherited from Hermes::Hermes2D::Views::View
void draw_fps ()
 draws current FPS
 
virtual void on_create (int output_id)
 
virtual void on_reshape (int width, int height)
 
virtual void on_left_mouse_down (int x, int y)
 
virtual void on_left_mouse_up (int x, int y)
 
virtual void on_left_mouse_double_click (int x, int y)
 
virtual void on_right_mouse_up (int x, int y)
 
virtual void on_right_mouse_double_click (int x, int y)
 
virtual void on_middle_mouse_double_click (int x, int y)
 
virtual void on_entry (int state)
 
void create_gl_palette ()
 Creates pallete texture in OpenGL. Assumes that view_sync is locked.
 
virtual void get_palette_color (double x, float *gl_color)
 Fills gl_color with palette color. Assumes that gl_color points to a vector of three components (RGB).
 
double transform_x (double x)
 
double transform_y (double y)
 
double untransform_x (double x)
 
double untransform_y (double y)
 
virtual void clear_background ()
 Clears background.
 
void pre_display ()
 
void display_antialiased ()
 
void set_ortho_projection (bool no_jitter=false)
 
void set_3d_projection (int fov, double znear, double zfar)
 
void draw_text (double x, double y, const char *text, int align=-1)
 
int get_text_width (const char *text)
 
char * get_screenshot_file_name ()
 
void save_screenshot_internal (const char *filename)
 
virtual void scale_dispatch ()
 
virtual int measure_scale_labels ()
 
void draw_continuous_scale (char *title, bool righttext)
 
void draw_discrete_scale (int numboxes, const char *boxnames[], const float boxcolors[][3])
 
void update_tex_adjust ()
 

Protected Attributes

const Space< Scalar > * space
 
PrecalcShapesetpss
 
Solution< Scalar > * sln
 
double eps
 
int ndof
 
int item
 
int base_index
 
std::string basic_title
 
- Protected Attributes inherited from Hermes::Hermes2D::Views::ScalarView
Linearizerlin
 Linearizer class responsible for obtaining linearized data.
 
Hermes::vector< VertexNodeInfovertex_nodes
 Vertex nodes. Sorted accordin to the X-axis.
 
VertexNodeInfopointed_vertex_node
 A vertex node that is under the mouse cursor. NULL if none.
 
bool allow_node_selection
 
unsigned int pointed_node_widget
 

True if node selection is allowed


 
unsigned int selected_node_widget
 

A GL display-list denoting a pointed vertex node. The geometry assumes the size of a pixel is 1x1.


 
const int node_pixel_radius
 

A GL display-list denoting a selected mesh node. The geometry assumes the size of a pixel is 1x1.

More...
 
const int node_widget_vert_cnt
 A number of vertices for a mesh node widget.
 
Hermes::vector< ElementInfoelement_infos
 Element info.
 
unsigned int element_id_widget
 A GL display-list denoting a element ID widget. The geometry assumes the size of a pixel is 1x1.
 
bool show_element_info
 true, to draw element info (currently ID) in 2D mode
 
bool lin_updated
 true, if lin now contains new values
 
unsigned int gl_coord_buffer
 Vertex coordinate buffer. (x, y, t)
 
unsigned int gl_index_buffer
 Index data buffer.
 
unsigned int gl_edge_inx_buffer
 A buffer for edge indices. The side of the buffer is H2DV_GL_MAX_EDGE_BUFFER pairs of indids.
 
int max_gl_verts
 A maximum allocated number of vertices.
 
int max_gl_tris
 A maximum allocated number of triangles.
 
int gl_tri_cnt
 A number of OpenGL triangles.
 
bool show_values
 true to show values
 
bool show_edges
 true to show edges of mesh
 
bool show_aabb
 true to show the bounding box
 
float edges_color [3]
 color of edges
 
bool contours
 true to enable drawing of contours
 
double cont_orig
 
double cont_step
 contour settings.
 
float cont_color [3]
 color of contours (RGB)
 
bool do_zoom_to_fit
 true to automatically translate the view so that the whole model si displayed
 
bool is_constant
 true if the function to be displayed is constant
 
bool pmode
 
bool mode3d
 
bool panning
 
double xrot
 
double yrot
 
double xtrans
 
double ytrans
 
double ztrans
 
double xzscale
 
double yscale
 
double xctr
 
double yctr
 
double zctr
 Information about the range of vertex values.
 
double value_irange
 
double value_range_avg
 
double3 * normals
 
- Protected Attributes inherited from Hermes::Hermes2D::Views::View
double rendering_frames [FPS_FRAME_SIZE]
 time spend in rendering of frames[in ms]
 
int rendering_frames_top
 the new location of the next FPS
 
bool view_not_reset
 True if the view was not reset and therefore it has to be.
 
double vertices_min_x
 
double vertices_max_x
 
double vertices_min_y
 
double vertices_max_y
 AABB of shown mesh.
 
double scale
 
double log_scale
 
double trans_x
 
double trans_y
 
double center_x
 
double center_y
 
int margin
 
int lspace
 
int rspace
 
int mouse_x
 
int mouse_y
 
int scx
 
int scy
 
double objx
 
double objy
 
bool dragging
 
bool scaling
 
std::string title
 
int output_id
 
int output_x
 
int output_y
 
int output_width
 
int output_height
 
float jitter_x
 
float jitter_y
 
bool hq_frame
 
bool frame_ready
 
ViewPaletteType pal_type
 
int pal_steps
 
int pal_filter
 
double tex_scale
 
double tex_shift
 
bool range_auto
 
double range_min
 
double range_max
 
bool b_scale
 
bool b_help
 
bool scale_focused
 
bool scale_dragging
 
int pos_horz
 
int pos_vert
 
int scale_x
 
int scale_y
 
int scale_width
 
int scale_height
 
int labels_width
 
int scale_numticks
 
int scale_box_height
 
int scale_box_skip
 
char scale_fmt [20]
 
int scale_fixed_width
 
bool want_screenshot
 
std::string screenshot_filename
 
unsigned int gl_pallete_tex_id
 OpenGL texture object ID.
 

Additional Inherited Members

- Static Public Member Functions inherited from Hermes::Hermes2D::Views::View
static void wait (const char *text)
 Closes all views at once.
 
static void wait (ViewWaitEvent wait_event=HERMES_WAIT_CLOSE, const char *text=NULL)
 Waits for an event.
 
- Protected Types inherited from Hermes::Hermes2D::Views::ScalarView
typedef void(* DrawSingleEdgeCallback )(int inx_vert_a, int inx_vert_b, ScalarView *viewer, void *param)
 A callback function that draws edge using specified vertex indices. Param is user supplied parameter.
 
- Static Protected Member Functions inherited from Hermes::Hermes2D::Views::ScalarView
static bool compare_vertex_nodes_x (const VertexNodeInfo &a, const VertexNodeInfo &b)
 Returns true, if a's X-axis coordinate is lower than b's one. Used to sort mesh nodes for searching purposes.
 
static void draw_gl_edge (int inx_vert_a, int inx_vert_b, ScalarView *viewer, void *param)
 Draws edge specified by edge indices using GL. Functions assumes that data are locked.
 
- Static Protected Attributes inherited from Hermes::Hermes2D::Views::ScalarView
static const int fovy = 50
 Field of view in the vertical direction (in degrees).
 
static const double znear = 0.05
 Distance of the near clipping plane of the viewing frustum from the camera.
 
static const double zfar = 10
 Distance of the Far clipping plane of the viewing frustum from the camera.
 

Detailed Description

template<typename Scalar>
class Hermes::Hermes2D::Views::BaseView< Scalar >

Visualizes the basis functions of a space.

BaseView is a debugging tool for the visualization of the basis functions
of a given space.

Definition at line 36 of file space.h.


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