VTKFIG
0.25.0
Easy VTK based in situ visualization
|
Go to the documentation of this file.
14 #include <vtkSmartPointer.h>
15 #include <vtkRenderer.h>
16 #include <vtkCornerAnnotation.h>
17 #include <vtkOggTheoraWriter.h>
19 #include "internals/vtkfigCommunicator.h"
28 class InteractorStyle;
50 static std::shared_ptr<Frame>
New();
86 void AddFigure(std::shared_ptr<Figure> figure);
95 void AddFigure(std::shared_ptr<Figure> figure,
int ipos);
219 int GetStepNumber() {
return step_number;}
220 void SetStepNumber(
int n) { step_number=std::max(n,0);}
223 vtkSmartPointer<vtkRenderer> GetRenderer(std::shared_ptr<Figure> fig);
231 --------------------------------------
234 Space Frame Block/unblock calculation, increase step number
235 BackSpace Frame Block/unblock calculation, decrease step number
236 Escape Figure Finish plane/level editing
237 Return Figure Store edited plane/level value and create new one
238 Delete Figure Delete last plane/level value
239 Prior Frame Show previous figure in single figure mode
240 Next Frame Show next figure in single figure mode
241 a Figure Start arrow scale editing
242 h Frame Print this help to standard output
243 l Figure Start isolevel editing
244 p Frame Write frame to png
245 r Figure Reset camera (must left click to see the result)
246 x Figure Start x plane editing (3D only)
247 y Figure Start y plane editing (3D only)
248 z Figure Start z plane editing (3D only)
249 A Figure Toggle axis+box visibility
250 B Figure Toggle boundary cell visibility in vtkfig::GridView
251 C Figure Toggle interior cell visibility in vtkfig::GridView
252 E Figure Toggle elevation view (2D only)
253 I Figure Toggle isosurface view (3D only)
254 L Figure Generate 11 equally spaced isolevels.
255 O Figure Toggle outline visibility
256 S Figure Toggle surface visibility
257 W Figure Toggle wireframe mode
258 * Frame Toggle single/multi figure view
259 ? Frame Print this help to standard output
260 / Figure Switch signs of cut plane
261 ctrl-q Frame Abort (calls std::terminate)
263 In edit mode, left mouse, as well as cursor keys increase
264 resp. decrease the value of the plane/isolevel/arrowscale, respectively.
266 Figures must be first clicked on before editing works.
267 --------------------------------------
277 friend class internals::InteractorStyle;
278 friend class internals::TimerCallback;
297 void RTSetLayout(
int nvpx,
int nvpy);
298 void RTCalculateViewports(
int nx,
int ny);
299 void RTSetSingleViewport(
int nx,
int ny);
300 void RTResetRenderers(
bool from_scratch);
303 void RTSetActiveSubFrameCameraViewAngle(
SubFrame& sf,
double a);
304 void RTSetActiveSubFrameCameraFocalPoint(
SubFrame& sf,
double a[3]);
305 void RTSetActiveSubFrameCameraPosition(
SubFrame& sf,
double a[3]);
309 void RTRemoveFigure(std::shared_ptr<Figure> figure);
310 void RTHideSubframe(
SubFrame &subframe);
311 void RTUnHideSubframe(
SubFrame &subframe);
312 void RTSetSingleView(
bool single_viewport);
313 void RTSetActiveSubFrame(
int isub,
bool hide_old);
314 void SetAutoLayout(
int nfig);
327 vtkSmartPointer<vtkRenderer>
renderer;
334 bool single_subframe_view=
false;
335 size_t active_subframe=0;
342 int pos(
const int ivpx,
const int ivpy) {
return (
nvpy-ivpy-1)*
nvpx+ivpx;}
349 const double default_camera_position[3]={0.65,0.5,10};
350 const double default_camera_view_angle={15};
357 std::string filename;
358 std::string wintitle=
"vtkfig";
359 std::string frametitle=
"";
368 double camera_view_angle=15;
369 double camera_focal_point[3]={0.65,0.5,0};
370 double camera_position[3]={0.65,0.5,10};
372 int camlinkthisframepos;
379 int single_subframe_view;
382 std::shared_ptr<Figure> current_figure;
389 void SendCommand(std::string source, internals::Communicator::Command cmd);
int number_in_frame_list
Number of this frame in global frame list.
Definition: vtkfigFrame.h:284
static Frame & FindFrame(int number_in_framelist)
Find frame with number.
int pos(const int ivpx, const int ivpy)
Subframe position algebra.
Definition: vtkfigFrame.h:342
double viewport[4]
Viewport within frame.
Definition: vtkfigFrame.h:330
vtkSmartPointer< vtkRenderWindow > window
Window vontaining frame.
Definition: vtkfigFrame.h:392
void SetPosition(int x, int y)
Set frame position on screen.
Data structure decribing subframe Each subframe can hold several figures.
Definition: vtkfigFrame.h:319
const double default_camera_focal_point[3]
Default camera data.
Definition: vtkfigFrame.h:348
std::vector< SubFrame > subframes
List of subframes.
Definition: vtkfigFrame.h:338
void SetActiveSubFrameCameraViewAngle(double angle)
Set view angle for camera in active frame relative to default.
struct vtkfig::Frame::@2 parameter
Parameters to be passed between threads.
vtkSmartPointer< vtkRenderer > renderer
vtkRenderer
Definition: vtkfigFrame.h:323
void RemoveFigure(std::shared_ptr< Figure > figure)
Remove figure.
void AddFigure(std::shared_ptr< Figure > figure)
Add figure at position (0)
void LinkCamera(int ivp, std::shared_ptr< Frame > frame, int livp)
Link camera to other camera.
Definition: vtkfigFrame.h:124
void SetLayout(int nvpx, int nvpy)
Set layout of subframe grid.
void Clear(void)
Remove all figures.
void Unmap()
Unmap frame from screen.
void LinkCamera(Frame &frame)
Link camera to other frame at default positions.
Definition: vtkfigFrame.h:141
vtkSmartPointer< vtkCornerAnnotation > title_actor
Actor for frame title annotation.
Definition: vtkfigFrame.h:395
vtkSmartPointer< vtkOggTheoraWriter > videowriter
Video writer.
Definition: vtkfigFrame.h:401
friend class internals::Thread
!! private:
Definition: vtkfigFrame.h:276
void StartVideo(std::string fname)
Start video recording.
void SetFrameTitle(const std::string title)
Set Frame title.
Provide a framework wrapping window+interactor+renderers from vtk.
Definition: vtkfigFrame.h:38
void SetActiveSubFrame(int iframe)
Set active subframe number for editing, single/multiview etc.
std::shared_ptr< internals::Thread > mainthread
The spinning main thread.
Definition: vtkfigFrame.h:386
void StopVideo()
Stop video recording.
void SendCommand(std::string source, internals::Communicator::Command cmd)
Blocking send of commands to main thread.
void Show()
Show frame content and continue.
Client side visualization setup.
Definition: vtkfigClient.h:30
int nvpx
Number of viewports in x direction.
Definition: vtkfigFrame.h:290
void SetWindowTitle(const std::string title)
Set window title.
void SetActiveSubFrameCameraPosition(double x, double y, double z)
Set view position for camera in active frame relative to default.
std::set< std::shared_ptr< Figure > > figures
List of all figures in frame.
Definition: vtkfigFrame.h:287
int nvpy
Number of viewports in y direction.
Definition: vtkfigFrame.h:293
static constexpr const char * KeyboardHelp
Help string printed when pressing "h"/"?".
Definition: vtkfigFrame.h:229
int winsize_x
window sizes
Definition: vtkfigFrame.h:362
void SetSize(int x, int y)
Set frame size in pixels.
void Interact()
Show frame content and wait for interaction.
void RefreshState(int figurepos)
Refresh frame state for figure.
void LinkCamera(int ivp, Frame *frame, int livp)
Link camera to other camera.
Definition: vtkfigFrame.h:131
void LinkCamera(std::shared_ptr< Frame > frame)
Link camera to other frame at default positions.
Definition: vtkfigFrame.h:136
void WritePNG(std::string fname)
Write png image of frame content.
void RTInit()
Init title actor.
void LinkCamera(int ivp, Frame &frame, int livp)
Link camera to other camera.
void SetActiveSubFrameCameraFocalPoint(double x, double y, double z)
Set focal point for camera in active frame relative to default.
void SetSingleSubFrameView(bool b)
Toggle single/multi view for frame with mutiple figures.
static std::shared_ptr< Frame > New()
Create smart pointer to frame.