GLVis  v4.2
Accurate and flexible finite element visualization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
aux_vis.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-443271.
4 //
5 // This file is part of the GLVis visualization tool and library. For more
6 // information and source code availability see https://glvis.org.
7 //
8 // GLVis is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 #ifndef GLVIS_AUX_VIS_HPP
13 #define GLVIS_AUX_VIS_HPP
14 
15 #include "gl/platform_gl.hpp"
16 #include "gl/types.hpp"
17 
18 #include "openglvis.hpp"
19 #include "sdl.hpp"
20 #include "font.hpp"
21 
22 #include <functional>
23 
24 void SDLMainLoop(bool server_mode = false);
25 
27 int InitVisualization(const char name[], int x, int y, int w, int h);
28 
30  int view = 3, const char *keys = NULL);
31 
33 void RunVisualization();
34 
36 void SendExposeEvent();
37 
38 void MyExpose();
39 
40 void MainLoop();
41 
44 
45 void SetLegacyGLOnly(bool status);
46 
47 void AddIdleFunc(void (*Func)(void));
48 void RemoveIdleFunc(void (*Func)(void));
49 
50 void LeftButtonDown (EventInfo *event);
51 void LeftButtonLoc (EventInfo *event);
52 void LeftButtonUp (EventInfo *event);
53 void MiddleButtonDown(EventInfo *event);
54 void MiddleButtonLoc (EventInfo *event);
55 void MiddleButtonUp (EventInfo *event);
56 void RightButtonDown (EventInfo *event);
57 void RightButtonLoc (EventInfo *event);
58 void RightButtonUp (EventInfo *event);
59 
60 void TouchPinch(SDL_MultiGestureEvent & e);
61 
62 void KeyCtrlP();
63 void KeyS();
64 void KeyQPressed();
65 void ToggleThreads();
66 void ThreadsPauseFunc(GLenum);
67 void ThreadsStop();
68 void ThreadsRun();
69 
70 void Key1Pressed();
71 void Key2Pressed();
72 void Key3Pressed();
73 void Key4Pressed();
74 void Key5Pressed();
75 void Key6Pressed();
76 void Key7Pressed();
77 void Key8Pressed();
78 void Key9Pressed();
79 
80 void Key0Pressed();
81 void KeyDeletePressed();
82 void KeyEnterPressed();
83 
84 void KeyLeftPressed(GLenum);
85 void KeyRightPressed(GLenum);
86 void KeyUpPressed(GLenum);
87 void KeyDownPressed(GLenum);
88 void KeyJPressed();
89 void KeyMinusPressed();
90 void KeyPlusPressed();
91 
92 void ZoomIn();
93 void ZoomOut();
94 void ScaleUp();
95 void ScaleDown();
96 void LookAt();
97 void ShrinkWindow();
98 void EnlargeWindow();
99 void MoveResizeWindow(int x, int y, int w, int h);
100 void ResizeWindow(int w, int h);
101 void SetWindowTitle(const char *title);
102 
104 int Screenshot(const char *fname, bool convert = false);
105 #ifdef GLVIS_USE_LIBPNG
106 int SaveAsPNG(const char *fname, int w, int h, bool is_hidpi,
107  bool with_alpha = false,
108  std::function<void(int,void*)> get_row = nullptr);
109 #endif
110 
112 void SendKeySequence(const char *seq);
113 
114 // Directly call the functions assigned to the given keys. Unlike the above
115 // function, SendKeySequence(), this function does not send X events and
116 // actually disables the function SendExposeEvent() used by many of the
117 // functions assigned to keys. Call MyExpose() after calling this function to
118 // update the visualization window.
119 void CallKeySequence(const char *seq);
120 
121 
122 void SetUseTexture(int ut);
123 int GetUseTexture();
124 void Set_Texture_Image();
125 int GetMultisample();
126 void SetMultisample(int m);
127 
128 void SetLineWidth(float width);
129 float GetLineWidth();
130 void SetLineWidthMS(float width_ms);
131 float GetLineWidthMS();
132 
133 void InitFont();
134 GlVisFont * GetFont();
135 bool SetFont(const vector<std::string>& patterns, int height);
136 void SetFont(const std::string& fn);
137 
138 void SetUseHiDPI(bool status);
139 
140 #endif
void SendExposeEvent()
Send expose event. In our case MyReshape is executed and Draw after it.
Definition: aux_vis.cpp:346
void MiddleButtonUp(EventInfo *)
Definition: aux_vis.cpp:746
void LookAt()
Definition: aux_vis.cpp:1504
void EnlargeWindow()
Definition: aux_vis.cpp:1528
void KeyMinusPressed()
Definition: aux_vis.cpp:1468
void Key4Pressed()
Definition: aux_vis.cpp:1352
void TouchPinch(SDL_MultiGestureEvent &e)
Definition: aux_vis.cpp:806
float GetLineWidth()
Definition: aux_vis.cpp:1609
void SendKeySequence(const char *seq)
Send a sequence of keystrokes to the visualization window.
Definition: aux_vis.cpp:198
int Screenshot(const char *fname, bool convert)
Take a screenshot using libtiff, libpng or sdl2.
Definition: aux_vis.cpp:970
void LeftButtonDown(EventInfo *event)
Definition: aux_vis.cpp:570
void Key1Pressed()
Definition: aux_vis.cpp:1377
float GetLineWidthMS()
Definition: aux_vis.cpp:1614
void SetLineWidthMS(float width_ms)
Definition: aux_vis.cpp:1599
void Key8Pressed()
Definition: aux_vis.cpp:1340
VisualizationScene * GetVisualizationScene()
Definition: aux_vis.cpp:63
bool SetFont(const vector< std::string > &font_patterns, int height)
Definition: aux_vis.cpp:1683
void KeyJPressed()
Definition: aux_vis.cpp:1462
void Key3Pressed()
Definition: aux_vis.cpp:1389
void KeyDeletePressed()
Definition: aux_vis.cpp:1306
void MyExpose(GLsizei w, GLsizei h)
Definition: aux_vis.cpp:389
void ThreadsPauseFunc(GLenum state)
Definition: aux_vis.cpp:1247
void SetUseTexture(int ut)
Definition: aux_vis.cpp:1561
void SetVisualizationScene(VisualizationScene *scene, int view, const char *keys)
Definition: aux_vis.cpp:307
void RightButtonLoc(EventInfo *event)
Definition: aux_vis.cpp:755
void AddIdleFunc(void(*Func)(void))
Definition: aux_vis.cpp:491
void Key6Pressed()
Definition: aux_vis.cpp:1371
void SDLMainLoop(bool server_mode)
Definition: aux_vis.cpp:53
int GetMultisample()
Definition: aux_vis.cpp:1573
void InitFont()
Definition: aux_vis.cpp:1646
void ZoomOut()
Definition: aux_vis.cpp:1486
void KeyEnterPressed()
Definition: aux_vis.cpp:1324
void MiddleButtonDown(EventInfo *event)
Definition: aux_vis.cpp:672
void RightButtonUp(EventInfo *)
Definition: aux_vis.cpp:803
void ToggleThreads()
Definition: aux_vis.cpp:1237
void KeyQPressed()
Definition: aux_vis.cpp:1231
void KeyS()
Definition: aux_vis.cpp:1119
void LeftButtonLoc(EventInfo *event)
Definition: aux_vis.cpp:588
void ThreadsStop()
Definition: aux_vis.cpp:1259
GlVisFont * GetFont()
Definition: aux_vis.cpp:1678
void KeyUpPressed(GLenum state)
Definition: aux_vis.cpp:1436
void RemoveIdleFunc(void(*Func)(void))
Definition: aux_vis.cpp:497
void Key0Pressed()
Definition: aux_vis.cpp:1296
int SaveAsPNG(const char *fname, int w, int h, bool is_hidpi, bool with_alpha, std::function< void(int, void *)> get_row)
Definition: aux_vis.cpp:895
void Key2Pressed()
Definition: aux_vis.cpp:1383
void ShrinkWindow()
Definition: aux_vis.cpp:1516
void LeftButtonUp(EventInfo *event)
Definition: aux_vis.cpp:646
void SetLineWidth(float width)
Definition: aux_vis.cpp:1590
void KeyRightPressed(GLenum state)
Definition: aux_vis.cpp:1423
void ResizeWindow(int w, int h)
Definition: aux_vis.cpp:1546
void Key5Pressed()
Definition: aux_vis.cpp:1358
SdlWindow * GetAppWindow()
Definition: aux_vis.cpp:58
void MoveResizeWindow(int x, int y, int w, int h)
Definition: aux_vis.cpp:1540
void SetLegacyGLOnly(bool status)
Definition: aux_vis.cpp:68
void MainLoop()
Definition: aux_vis.cpp:515
void KeyLeftPressed(GLenum state)
Definition: aux_vis.cpp:1410
void SetWindowTitle(const char *title)
Definition: aux_vis.cpp:1551
void KeyDownPressed(GLenum state)
Definition: aux_vis.cpp:1449
void KeyCtrlP()
Definition: aux_vis.cpp:1190
int InitVisualization(const char name[], int x, int y, int w, int h)
Initializes the visualization and some keys.
Definition: aux_vis.cpp:81
void RunVisualization()
Start the infinite visualization loop.
Definition: aux_vis.cpp:334
void SetMultisample(int m)
Definition: aux_vis.cpp:1578
void MiddleButtonLoc(EventInfo *event)
Definition: aux_vis.cpp:678
void KeyPlusPressed()
Definition: aux_vis.cpp:1474
void Set_Texture_Image()
void Key7Pressed()
Definition: aux_vis.cpp:1334
void ThreadsRun()
Definition: aux_vis.cpp:1267
void ScaleUp()
Definition: aux_vis.cpp:1492
void CallKeySequence(const char *seq)
Definition: aux_vis.cpp:253
void ZoomIn()
Definition: aux_vis.cpp:1480
void ScaleDown()
Definition: aux_vis.cpp:1498
int GetUseTexture()
Definition: aux_vis.cpp:1556
void SetUseHiDPI(bool status)
Definition: aux_vis.cpp:73
void RightButtonDown(EventInfo *event)
Definition: aux_vis.cpp:749
void Key9Pressed()
Definition: aux_vis.cpp:1346