GLVis  v4.2
Accurate and flexible finite element visualization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Functions | Variables
aux_vis.cpp File Reference

Go to the source code of this file.

Functions

void SDLMainLoop (bool server_mode)
 
SdlWindowGetAppWindow ()
 
VisualizationSceneGetVisualizationScene ()
 
void SetLegacyGLOnly (bool status)
 
void SetUseHiDPI (bool status)
 
void MyExpose (GLsizei w, GLsizei h)
 
void MyExpose ()
 
int InitVisualization (const char name[], int x, int y, int w, int h)
 Initializes the visualization and some keys. More...
 
void SendKeySequence (const char *seq)
 Send a sequence of keystrokes to the visualization window. More...
 
void CallKeySequence (const char *seq)
 
void InitIdleFuncs ()
 
void SetVisualizationScene (VisualizationScene *scene, int view, const char *keys)
 
void RunVisualization ()
 Start the infinite visualization loop. More...
 
void SendExposeEvent ()
 Send expose event. In our case MyReshape is executed and Draw after it. More...
 
void MyReshape (GLsizei w, GLsizei h)
 
bool MainIdleFunc ()
 
bool CommunicationIdleFunc ()
 
void AddIdleFunc (void(*Func)(void))
 
void RemoveIdleFunc (void(*Func)(void))
 
void MainLoop ()
 
double sqr (double t)
 
void ComputeSphereAngles (int &newx, int &newy, double &new_sph_u, double &new_sph_t)
 
void LeftButtonDown (EventInfo *event)
 
void LeftButtonLoc (EventInfo *event)
 
void LeftButtonUp (EventInfo *event)
 
void MiddleButtonDown (EventInfo *event)
 
void MiddleButtonLoc (EventInfo *event)
 
void MiddleButtonUp (EventInfo *)
 
void RightButtonDown (EventInfo *event)
 
void RightButtonLoc (EventInfo *event)
 
void RightButtonUp (EventInfo *)
 
void TouchPinch (SDL_MultiGestureEvent &e)
 
int InvertSurfaceVertical (SDL_Surface *surface)
 
int SaveAsPNG (const char *fname, int w, int h, bool is_hidpi, bool with_alpha, std::function< void(int, void *)> get_row)
 
int Screenshot (const char *fname, bool convert)
 Take a screenshot using libtiff, libpng or sdl2. More...
 
void KeyS ()
 
GL2PSvertex CreatePrintVtx (gl3::FeedbackVertex v)
 
void PrintCaptureBuffer (gl3::CaptureBuffer &cbuf)
 
void KeyCtrlP ()
 
void KeyQPressed ()
 
void ToggleThreads ()
 
void ThreadsPauseFunc (GLenum state)
 
void ThreadsStop ()
 
void ThreadsRun ()
 
void CheckSpin ()
 
void Key0Pressed ()
 
void KeyDeletePressed ()
 
void KeyEnterPressed ()
 
void Key7Pressed ()
 
void Key8Pressed ()
 
void Key9Pressed ()
 
void Key4Pressed ()
 
void Key5Pressed ()
 
void Key6Pressed ()
 
void Key1Pressed ()
 
void Key2Pressed ()
 
void Key3Pressed ()
 
void ShiftView (double dx, double dy)
 
void KeyLeftPressed (GLenum state)
 
void KeyRightPressed (GLenum state)
 
void KeyUpPressed (GLenum state)
 
void KeyDownPressed (GLenum state)
 
void KeyJPressed ()
 
void KeyMinusPressed ()
 
void KeyPlusPressed ()
 
void ZoomIn ()
 
void ZoomOut ()
 
void ScaleUp ()
 
void ScaleDown ()
 
void LookAt ()
 
void ShrinkWindow ()
 
void EnlargeWindow ()
 
void MoveResizeWindow (int x, int y, int w, int h)
 
void ResizeWindow (int w, int h)
 
void SetWindowTitle (const char *title)
 
int GetUseTexture ()
 
void SetUseTexture (int ut)
 
int GetMultisample ()
 
void SetMultisample (int m)
 
void SetLineWidth (float width)
 
void SetLineWidthMS (float width_ms)
 
float GetLineWidth ()
 
float GetLineWidthMS ()
 
void InitFont ()
 
GlVisFontGetFont ()
 
bool SetFont (const vector< std::string > &font_patterns, int height)
 
void SetFont (const std::string &fn)
 

Variables

thread_local int visualize = 0
 
thread_local VisualizationScenelocscene
 
thread_local GLVisCommandglvis_command = NULL
 
float line_w = 1.f
 
float line_w_aa = gl3::LINE_WIDTH_AA
 
thread_local SdlWindowwnd = nullptr
 
bool wndLegacyGl = false
 
bool wndUseHiDPI = true
 
thread_local bool disableSendExposeEvent = false
 
thread_local Array< void(*)()> IdleFuncs
 
thread_local int LastIdleFunc
 
thread_local bool use_idle = false
 
thread_local double xang = 0.
 
thread_local double yang = 0.
 
thread_local gl3::GlMatrix srot
 
thread_local double sph_t
 
thread_local double sph_u
 
thread_local GLint oldx
 
thread_local GLint oldy
 
thread_local GLint startx
 
thread_local GLint starty
 
thread_local int constrained_spinning = 0
 
const char * glvis_screenshot_ext = ".tif"
 
Uint32 rmask = 0xff000000
 
Uint32 gmask = 0x00ff0000
 
Uint32 bmask
 
Uint32 amask = 0xff000000
 
const double xang_step = 0.2
 
const double window_scale_factor = 1.1
 
vector< string > fc_font_patterns
 
constexpr int default_font_size = 12
 
int font_size = default_font_size
 
thread_local GlVisFont glvis_font
 
std::string priority_font
 

Function Documentation

void AddIdleFunc ( void(*)(void)  Func)

Definition at line 491 of file aux_vis.cpp.

void CallKeySequence ( const char *  seq)

Definition at line 253 of file aux_vis.cpp.

void CheckSpin ( )

Definition at line 1275 of file aux_vis.cpp.

bool CommunicationIdleFunc ( )

Definition at line 429 of file aux_vis.cpp.

void ComputeSphereAngles ( int &  newx,
int &  newy,
double &  new_sph_u,
double &  new_sph_t 
)
inline

Definition at line 547 of file aux_vis.cpp.

GL2PSvertex CreatePrintVtx ( gl3::FeedbackVertex  v)
inline

Definition at line 1147 of file aux_vis.cpp.

void EnlargeWindow ( )

Definition at line 1528 of file aux_vis.cpp.

SdlWindow* GetAppWindow ( )

Definition at line 58 of file aux_vis.cpp.

GlVisFont* GetFont ( )

Definition at line 1678 of file aux_vis.cpp.

float GetLineWidth ( )

Definition at line 1609 of file aux_vis.cpp.

float GetLineWidthMS ( )

Definition at line 1614 of file aux_vis.cpp.

int GetMultisample ( )

Definition at line 1573 of file aux_vis.cpp.

int GetUseTexture ( )

Definition at line 1556 of file aux_vis.cpp.

VisualizationScene* GetVisualizationScene ( )

Definition at line 63 of file aux_vis.cpp.

void InitFont ( )

Definition at line 1646 of file aux_vis.cpp.

void InitIdleFuncs ( )

Definition at line 419 of file aux_vis.cpp.

int InitVisualization ( const char  name[],
int  x,
int  y,
int  w,
int  h 
)

Initializes the visualization and some keys.

Definition at line 81 of file aux_vis.cpp.

int InvertSurfaceVertical ( SDL_Surface *  surface)

Definition at line 838 of file aux_vis.cpp.

void Key0Pressed ( )

Definition at line 1296 of file aux_vis.cpp.

void Key1Pressed ( )

Definition at line 1377 of file aux_vis.cpp.

void Key2Pressed ( )

Definition at line 1383 of file aux_vis.cpp.

void Key3Pressed ( )

Definition at line 1389 of file aux_vis.cpp.

void Key4Pressed ( )

Definition at line 1352 of file aux_vis.cpp.

void Key5Pressed ( )

Definition at line 1358 of file aux_vis.cpp.

void Key6Pressed ( )

Definition at line 1371 of file aux_vis.cpp.

void Key7Pressed ( )

Definition at line 1334 of file aux_vis.cpp.

void Key8Pressed ( )

Definition at line 1340 of file aux_vis.cpp.

void Key9Pressed ( )

Definition at line 1346 of file aux_vis.cpp.

void KeyCtrlP ( )

Definition at line 1190 of file aux_vis.cpp.

void KeyDeletePressed ( )

Definition at line 1306 of file aux_vis.cpp.

void KeyDownPressed ( GLenum  state)

Definition at line 1449 of file aux_vis.cpp.

void KeyEnterPressed ( )

Definition at line 1324 of file aux_vis.cpp.

void KeyJPressed ( )

Definition at line 1462 of file aux_vis.cpp.

void KeyLeftPressed ( GLenum  state)

Definition at line 1410 of file aux_vis.cpp.

void KeyMinusPressed ( )

Definition at line 1468 of file aux_vis.cpp.

void KeyPlusPressed ( )

Definition at line 1474 of file aux_vis.cpp.

void KeyQPressed ( )

Definition at line 1231 of file aux_vis.cpp.

void KeyRightPressed ( GLenum  state)

Definition at line 1423 of file aux_vis.cpp.

void KeyS ( )

Definition at line 1119 of file aux_vis.cpp.

void KeyUpPressed ( GLenum  state)

Definition at line 1436 of file aux_vis.cpp.

void LeftButtonDown ( EventInfo event)

Definition at line 570 of file aux_vis.cpp.

void LeftButtonLoc ( EventInfo event)

Definition at line 588 of file aux_vis.cpp.

void LeftButtonUp ( EventInfo event)

Definition at line 646 of file aux_vis.cpp.

void LookAt ( )

Definition at line 1504 of file aux_vis.cpp.

bool MainIdleFunc ( )

Definition at line 445 of file aux_vis.cpp.

void MainLoop ( )

Definition at line 515 of file aux_vis.cpp.

void MiddleButtonDown ( EventInfo event)

Definition at line 672 of file aux_vis.cpp.

void MiddleButtonLoc ( EventInfo event)

Definition at line 678 of file aux_vis.cpp.

void MiddleButtonUp ( EventInfo )

Definition at line 746 of file aux_vis.cpp.

void MoveResizeWindow ( int  x,
int  y,
int  w,
int  h 
)

Definition at line 1540 of file aux_vis.cpp.

void MyExpose ( GLsizei  w,
GLsizei  h 
)

Definition at line 389 of file aux_vis.cpp.

void MyExpose ( )

Definition at line 404 of file aux_vis.cpp.

void MyReshape ( GLsizei  w,
GLsizei  h 
)

Definition at line 352 of file aux_vis.cpp.

void PrintCaptureBuffer ( gl3::CaptureBuffer cbuf)

Definition at line 1156 of file aux_vis.cpp.

void RemoveIdleFunc ( void(*)(void)  Func)

Definition at line 497 of file aux_vis.cpp.

void ResizeWindow ( int  w,
int  h 
)

Definition at line 1546 of file aux_vis.cpp.

void RightButtonDown ( EventInfo event)

Definition at line 749 of file aux_vis.cpp.

void RightButtonLoc ( EventInfo event)

Definition at line 755 of file aux_vis.cpp.

void RightButtonUp ( EventInfo )

Definition at line 803 of file aux_vis.cpp.

void RunVisualization ( )

Start the infinite visualization loop.

Definition at line 334 of file aux_vis.cpp.

int SaveAsPNG ( const char *  fname,
int  w,
int  h,
bool  is_hidpi,
bool  with_alpha,
std::function< void(int, void *)>  get_row 
)

Definition at line 895 of file aux_vis.cpp.

void ScaleDown ( )

Definition at line 1498 of file aux_vis.cpp.

void ScaleUp ( )

Definition at line 1492 of file aux_vis.cpp.

int Screenshot ( const char *  fname,
bool  convert 
)

Take a screenshot using libtiff, libpng or sdl2.

Definition at line 970 of file aux_vis.cpp.

void SDLMainLoop ( bool  server_mode)

Definition at line 53 of file aux_vis.cpp.

void SendExposeEvent ( )

Send expose event. In our case MyReshape is executed and Draw after it.

Definition at line 346 of file aux_vis.cpp.

void SendKeySequence ( const char *  seq)

Send a sequence of keystrokes to the visualization window.

Definition at line 198 of file aux_vis.cpp.

bool SetFont ( const vector< std::string > &  font_patterns,
int  height 
)

Definition at line 1683 of file aux_vis.cpp.

void SetFont ( const std::string &  fn)

Definition at line 1767 of file aux_vis.cpp.

void SetLegacyGLOnly ( bool  status)

Definition at line 68 of file aux_vis.cpp.

void SetLineWidth ( float  width)

Definition at line 1590 of file aux_vis.cpp.

void SetLineWidthMS ( float  width_ms)

Definition at line 1599 of file aux_vis.cpp.

void SetMultisample ( int  m)

Definition at line 1578 of file aux_vis.cpp.

void SetUseHiDPI ( bool  status)

Definition at line 73 of file aux_vis.cpp.

void SetUseTexture ( int  ut)

Definition at line 1561 of file aux_vis.cpp.

void SetVisualizationScene ( VisualizationScene scene,
int  view,
const char *  keys 
)

Definition at line 307 of file aux_vis.cpp.

void SetWindowTitle ( const char *  title)

Definition at line 1551 of file aux_vis.cpp.

void ShiftView ( double  dx,
double  dy 
)

Definition at line 1395 of file aux_vis.cpp.

void ShrinkWindow ( )

Definition at line 1516 of file aux_vis.cpp.

double sqr ( double  t)
inline

Definition at line 542 of file aux_vis.cpp.

void ThreadsPauseFunc ( GLenum  state)

Definition at line 1247 of file aux_vis.cpp.

void ThreadsRun ( )

Definition at line 1267 of file aux_vis.cpp.

void ThreadsStop ( )

Definition at line 1259 of file aux_vis.cpp.

void ToggleThreads ( )

Definition at line 1237 of file aux_vis.cpp.

void TouchPinch ( SDL_MultiGestureEvent &  e)

Definition at line 806 of file aux_vis.cpp.

void ZoomIn ( )

Definition at line 1480 of file aux_vis.cpp.

void ZoomOut ( )

Definition at line 1486 of file aux_vis.cpp.

Variable Documentation

Uint32 amask = 0xff000000

Definition at line 831 of file aux_vis.cpp.

Uint32 bmask
Initial value:
= 0x0000ff00:
Uint32 amask = 0x000000ff
Uint32 amask
Definition: aux_vis.cpp:831

Definition at line 825 of file aux_vis.cpp.

thread_local int constrained_spinning = 0

Definition at line 512 of file aux_vis.cpp.

constexpr int default_font_size = 12

Definition at line 1640 of file aux_vis.cpp.

thread_local bool disableSendExposeEvent = false

Definition at line 251 of file aux_vis.cpp.

vector<string> fc_font_patterns
Initial value:
=
{
"Ubuntu Light:style=Regular",
"Ubuntu:style=Regular:weight=80",
"OpenSans:style=Regular",
"DejaVu Sans:style=Book:width=Normal",
"DejaVu LGC Sans:style=Book:width=Normal",
"Bitstream Vera Sans:style=Roman",
"FreeSans:style=Medium",
"Ubuntu Mono:style=Regular",
"DejaVu Sans Mono:style=Book",
"DejaVu LGC Sans Mono:style=Book",
"Helvetica:style=Regular",
"Arial:style=Regular:weight=80"
}

Definition at line 1624 of file aux_vis.cpp.

int font_size = default_font_size

Definition at line 1641 of file aux_vis.cpp.

thread_local GLVisCommand* glvis_command = NULL

Definition at line 39 of file aux_vis.cpp.

thread_local GlVisFont glvis_font

Definition at line 1643 of file aux_vis.cpp.

const char * glvis_screenshot_ext = ".tif"

Definition at line 814 of file aux_vis.cpp.

Uint32 gmask = 0x00ff0000

Definition at line 824 of file aux_vis.cpp.

thread_local Array<void (*)()> IdleFuncs

Definition at line 413 of file aux_vis.cpp.

thread_local int LastIdleFunc

Definition at line 414 of file aux_vis.cpp.

float line_w = 1.f

Definition at line 47 of file aux_vis.cpp.

float line_w_aa = gl3::LINE_WIDTH_AA

Definition at line 48 of file aux_vis.cpp.

thread_local VisualizationScene* locscene

Definition at line 38 of file aux_vis.cpp.

thread_local GLint oldx

Definition at line 510 of file aux_vis.cpp.

thread_local GLint oldy

Definition at line 510 of file aux_vis.cpp.

std::string priority_font

Definition at line 1644 of file aux_vis.cpp.

Uint32 rmask = 0xff000000

Definition at line 823 of file aux_vis.cpp.

thread_local double sph_t

Definition at line 509 of file aux_vis.cpp.

thread_local double sph_u

Definition at line 509 of file aux_vis.cpp.

thread_local gl3::GlMatrix srot

Definition at line 508 of file aux_vis.cpp.

thread_local GLint startx

Definition at line 510 of file aux_vis.cpp.

thread_local GLint starty

Definition at line 510 of file aux_vis.cpp.

thread_local bool use_idle = false

Definition at line 415 of file aux_vis.cpp.

thread_local int visualize = 0

Definition at line 37 of file aux_vis.cpp.

const double window_scale_factor = 1.1

Definition at line 1514 of file aux_vis.cpp.

thread_local SdlWindow* wnd = nullptr

Definition at line 50 of file aux_vis.cpp.

bool wndLegacyGl = false

Definition at line 51 of file aux_vis.cpp.

bool wndUseHiDPI = true

Definition at line 52 of file aux_vis.cpp.

thread_local double xang = 0.

Definition at line 507 of file aux_vis.cpp.

const double xang_step = 0.2

Definition at line 1294 of file aux_vis.cpp.

thread_local double yang = 0.

Definition at line 507 of file aux_vis.cpp.