VTKFIG  0.25.0
Easy VTK based in situ visualization
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
vtkfig::Frame Class Reference

Provide a framework wrapping window+interactor+renderers from vtk. More...

+ Collaboration diagram for vtkfig::Frame:

Classes

struct  SubFrame
 Data structure decribing subframe Each subframe can hold several figures. More...
 

Public Member Functions

void SetLayout (int nvpx, int nvpy)
 Set layout of subframe grid. More...
 
void RefreshState (int figurepos)
 Refresh frame state for figure. More...
 
void WritePNG (std::string fname)
 Write png image of frame content. More...
 
void StartVideo (std::string fname)
 Start video recording. More...
 
void StopVideo ()
 Stop video recording. More...
 
void AddFigure (std::shared_ptr< Figure > figure)
 Add figure at position (0) More...
 
void AddFigure (std::shared_ptr< Figure > figure, int ipos)
 Add figure at position in frame. More...
 
void RemoveFigure (std::shared_ptr< Figure > figure)
 Remove figure. More...
 
void Clear (void)
 Remove all figures. More...
 
void Unmap ()
 Unmap frame from screen. More...
 
void LinkCamera (int ivp, Frame &frame, int livp)
 Link camera to other camera. More...
 
void LinkCamera (int ivp, std::shared_ptr< Frame > frame, int livp)
 Link camera to other camera. More...
 
void LinkCamera (int ivp, Frame *frame, int livp)
 Link camera to other camera. More...
 
void LinkCamera (std::shared_ptr< Frame > frame)
 Link camera to other frame at default positions. More...
 
void LinkCamera (Frame &frame)
 Link camera to other frame at default positions. More...
 
void SetSize (int x, int y)
 Set frame size in pixels. More...
 
void SetWindowTitle (const std::string title)
 Set window title. More...
 
void SetFrameTitle (const std::string title)
 Set Frame title. More...
 
void SetPosition (int x, int y)
 Set frame position on screen. More...
 
void SetSingleSubFrameView (bool b)
 Toggle single/multi view for frame with mutiple figures. More...
 
void SetActiveSubFrame (int iframe)
 Set active subframe number for editing, single/multiview etc. More...
 
void SetActiveSubFrameCameraViewAngle (double angle)
 Set view angle for camera in active frame relative to default. More...
 
void SetActiveSubFrameCameraFocalPoint (double x, double y, double z)
 Set focal point for camera in active frame relative to default. More...
 
void SetActiveSubFrameCameraPosition (double x, double y, double z)
 Set view position for camera in active frame relative to default. More...
 
void Show ()
 Show frame content and continue. More...
 
void Interact ()
 Show frame content and wait for interaction. More...
 
int pos (const int ivpx, const int ivpy)
 Subframe position algebra. More...
 
void SendCommand (std::string source, internals::Communicator::Command cmd)
 Blocking send of commands to main thread. More...
 
void RTInit ()
 Init title actor. More...
 

Static Public Member Functions

static std::shared_ptr< FrameNew ()
 Create smart pointer to frame. More...
 
static FrameFindFrame (int number_in_framelist)
 Find frame with number. More...
 

Public Attributes

int number_in_frame_list =-1
 Number of this frame in global frame list. More...
 
std::set< std::shared_ptr< Figure > > figures
 List of all figures in frame. More...
 
int nvpx
 Number of viewports in x direction. More...
 
int nvpy
 Number of viewports in y direction. More...
 
std::vector< SubFramesubframes
 List of subframes. More...
 
const double default_camera_focal_point [3] ={0.65,0.5,0}
 Default camera data. More...
 
struct {
   int   winsize_x =400
 window sizes More...
 
parameter
 Parameters to be passed between threads. More...
 
std::shared_ptr< internals::Thread > mainthread
 The spinning main thread. More...
 
vtkSmartPointer< vtkRenderWindow > window
 Window vontaining frame. More...
 
vtkSmartPointer< vtkCornerAnnotation > title_actor =0
 Actor for frame title annotation. More...
 
vtkSmartPointer< vtkOggTheoraWriter > videowriter =0
 Video writer. More...
 

Static Public Attributes

static constexpr const char * KeyboardHelp
 Help string printed when pressing "h"/"?". More...
 

Friends

class internals::Thread
 !! private: More...
 

Detailed Description

Provide a framework wrapping window+interactor+renderers from vtk.

A frame contains a grid of subframes. Each subframe can contain several overlapping figures.

Member Function Documentation

◆ New()

static std::shared_ptr<Frame> vtkfig::Frame::New ( )
static

◆ SetLayout()

void vtkfig::Frame::SetLayout ( int  nvpx,
int  nvpy 
)

Set layout of subframe grid.

Parameters
nvpxnumber of rows
nvpynumber of columns
Examples
example-multifig.cxx.

◆ RefreshState()

void vtkfig::Frame::RefreshState ( int  figurepos)

Refresh frame state for figure.

◆ WritePNG()

void vtkfig::Frame::WritePNG ( std::string  fname)

Write png image of frame content.

Parameters
fnameImage file name
Examples
example-multifig.cxx.

◆ StartVideo()

void vtkfig::Frame::StartVideo ( std::string  fname)

Start video recording.

Parameters
fnameVideo file name

◆ StopVideo()

void vtkfig::Frame::StopVideo ( )

Stop video recording.

◆ AddFigure() [1/2]

void vtkfig::Frame::AddFigure ( std::shared_ptr< Figure figure)

◆ AddFigure() [2/2]

void vtkfig::Frame::AddFigure ( std::shared_ptr< Figure figure,
int  ipos 
)

Add figure at position in frame.

Parameters
figureFigure to be added
iposNumber of position in frame grid

◆ RemoveFigure()

void vtkfig::Frame::RemoveFigure ( std::shared_ptr< Figure figure)

Remove figure.

◆ Clear()

void vtkfig::Frame::Clear ( void  )

Remove all figures.

◆ Unmap()

void vtkfig::Frame::Unmap ( )

Unmap frame from screen.

◆ LinkCamera() [1/5]

void vtkfig::Frame::LinkCamera ( int  ivp,
Frame frame,
int  livp 
)

Link camera to other camera.

Parameters
ivpnumber of viewport
frameother frame to be linked with
livpnumber of link viewport
Examples
example-multifig.cxx, and example-multiframe.cxx.

◆ LinkCamera() [2/5]

void vtkfig::Frame::LinkCamera ( int  ivp,
std::shared_ptr< Frame frame,
int  livp 
)
inline

Link camera to other camera.

Parameters
ivpnumber of viewport
frameother frame to be linked with
livpnumber of link viewport
+ Here is the call graph for this function:

◆ LinkCamera() [3/5]

void vtkfig::Frame::LinkCamera ( int  ivp,
Frame frame,
int  livp 
)
inline

Link camera to other camera.

Parameters
ivpnumber of viewport
frameother frame to be linked with
livpnumber of link viewport
+ Here is the call graph for this function:

◆ LinkCamera() [4/5]

void vtkfig::Frame::LinkCamera ( std::shared_ptr< Frame frame)
inline

Link camera to other frame at default positions.

Parameters
frameother frame to be linked with
+ Here is the call graph for this function:

◆ LinkCamera() [5/5]

void vtkfig::Frame::LinkCamera ( Frame frame)
inline

Link camera to other frame at default positions.

Parameters
frameother frame to be linked with
+ Here is the call graph for this function:

◆ SetSize()

void vtkfig::Frame::SetSize ( int  x,
int  y 
)

Set frame size in pixels.

Parameters
xPixels in x direction
yPixels in y direction
Examples
example-gridview2d.cxx, example-gridview3d.cxx, example-multifig.cxx, and example-multiframe.cxx.

◆ SetWindowTitle()

void vtkfig::Frame::SetWindowTitle ( const std::string  title)

Set window title.

This title will show up in the title bar of the window.

Parameters
titleTitle
Examples
example-multifig.cxx.

◆ SetFrameTitle()

void vtkfig::Frame::SetFrameTitle ( const std::string  title)

Set Frame title.

This title will show up within the frame

Parameters
titleTitle
Examples
example-multifig.cxx.

◆ SetPosition()

void vtkfig::Frame::SetPosition ( int  x,
int  y 
)

Set frame position on screen.

Parameters
xx origin in pixels
yy origin in pixels
Examples
example-multiframe.cxx.

◆ SetSingleSubFrameView()

void vtkfig::Frame::SetSingleSubFrameView ( bool  b)

Toggle single/multi view for frame with mutiple figures.

◆ SetActiveSubFrame()

void vtkfig::Frame::SetActiveSubFrame ( int  iframe)

Set active subframe number for editing, single/multiview etc.

◆ SetActiveSubFrameCameraViewAngle()

void vtkfig::Frame::SetActiveSubFrameCameraViewAngle ( double  angle)

Set view angle for camera in active frame relative to default.

◆ SetActiveSubFrameCameraFocalPoint()

void vtkfig::Frame::SetActiveSubFrameCameraFocalPoint ( double  x,
double  y,
double  z 
)

Set focal point for camera in active frame relative to default.

◆ SetActiveSubFrameCameraPosition()

void vtkfig::Frame::SetActiveSubFrameCameraPosition ( double  x,
double  y,
double  z 
)

Set view position for camera in active frame relative to default.

◆ Show()

void vtkfig::Frame::Show ( )

Show frame content and continue.

Without interaction, this triggers a non-blocking run of the event loop. It can be blocked however by the space key.

Examples
example-custom-vtkfig.cxx, example-multifig.cxx, and example-multiframe.cxx.

◆ Interact()

void vtkfig::Frame::Interact ( )

Show frame content and wait for interaction.

This performs a blocking run of the event loop. It can be unblocked however by the space key.

Examples
example-gridview2d.cxx, and example-gridview3d.cxx.

◆ FindFrame()

static Frame& vtkfig::Frame::FindFrame ( int  number_in_framelist)
static

Find frame with number.

◆ pos()

int vtkfig::Frame::pos ( const int  ivpx,
const int  ivpy 
)
inline

Subframe position algebra.

◆ SendCommand()

void vtkfig::Frame::SendCommand ( std::string  source,
internals::Communicator::Command  cmd 
)

Blocking send of commands to main thread.

◆ RTInit()

void vtkfig::Frame::RTInit ( )

Init title actor.

Friends And Related Function Documentation

◆ internals::Thread

friend class internals::Thread
friend

!! private:

Member Data Documentation

◆ KeyboardHelp

constexpr const char* vtkfig::Frame::KeyboardHelp
staticconstexpr
Initial value:
=
R"(
--------------------------------------
Key Realm Action
Space Frame Block/unblock calculation, increase step number
BackSpace Frame Block/unblock calculation, decrease step number
Escape Figure Finish plane/level editing
Return Figure Store edited plane/level value and create new one
Delete Figure Delete last plane/level value
Prior Frame Show previous figure in single figure mode
Next Frame Show next figure in single figure mode
a Figure Start arrow scale editing
h Frame Print this help to standard output
l Figure Start isolevel editing
p Frame Write frame to png
r Figure Reset camera (must left click to see the result)
x Figure Start x plane editing (3D only)
y Figure Start y plane editing (3D only)
z Figure Start z plane editing (3D only)
A Figure Toggle axis+box visibility
B Figure Toggle boundary cell visibility in vtkfig::GridView
C Figure Toggle interior cell visibility in vtkfig::GridView
E Figure Toggle elevation view (2D only)
I Figure Toggle isosurface view (3D only)
L Figure Generate 11 equally spaced isolevels.
O Figure Toggle outline visibility
S Figure Toggle surface visibility
W Figure Toggle wireframe mode
* Frame Toggle single/multi figure view
? Frame Print this help to standard output
/ Figure Switch signs of cut plane
ctrl-q Frame Abort (calls std::terminate)
In edit mode, left mouse, as well as cursor keys increase
resp. decrease the value of the plane/isolevel/arrowscale, respectively.
Figures must be first clicked on before editing works.
--------------------------------------
)"

Help string printed when pressing "h"/"?".

◆ number_in_frame_list

int vtkfig::Frame::number_in_frame_list =-1

Number of this frame in global frame list.

◆ figures

std::set<std::shared_ptr<Figure> > vtkfig::Frame::figures

List of all figures in frame.

◆ nvpx

int vtkfig::Frame::nvpx

Number of viewports in x direction.

◆ nvpy

int vtkfig::Frame::nvpy

Number of viewports in y direction.

◆ subframes

std::vector<SubFrame> vtkfig::Frame::subframes

List of subframes.

◆ default_camera_focal_point

const double vtkfig::Frame::default_camera_focal_point[3] ={0.65,0.5,0}

Default camera data.

◆ winsize_x

int vtkfig::Frame::winsize_x =400

window sizes

◆ parameter

struct { ... } vtkfig::Frame::parameter

Parameters to be passed between threads.

◆ mainthread

std::shared_ptr<internals::Thread> vtkfig::Frame::mainthread

The spinning main thread.

◆ window

vtkSmartPointer<vtkRenderWindow> vtkfig::Frame::window

Window vontaining frame.

◆ title_actor

vtkSmartPointer<vtkCornerAnnotation> vtkfig::Frame::title_actor =0

Actor for frame title annotation.

◆ videowriter

vtkSmartPointer<vtkOggTheoraWriter> vtkfig::Frame::videowriter =0

Video writer.


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