MeVisLab Toolbox Reference
View2DCine.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2017, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 
15 
16 #pragma once
17 
18 #include "SoView2DSystem.h"
19 
20 #include <Inventor/fields/SoFields.h>
21 #include <Inventor/sensors/SoTimerSensor.h>
22 
23 
25 {
27  int startZ;
29  int endZ;
32 
34  int startT;
36  int endT;
39 
47  float speed;
48 
52 };
53 
54 
56 {
57 public:
59  View2DCine(SoSFInt32* slice, SoSFInt32* time, SoSFBool* isActive = nullptr);
61 
64 
67 
69  void start();
70 
72  void stop();
73 
76 
79 
80 
81 private:
82  int getSlice() const;
83 
84  void setSlice(int slice);
85 
86  int getTime() const;
87 
88  void setTime(int time);
89 
90  void setIsActive(bool active);
91 
93  static void timerSensorCB(void *data, SoSensor* a);
95  void timerSensor();
96 
101  bool advanceZ(bool backwards, bool wrapAround);
102  bool advanceT(bool backwards, bool wrapAround);
103 
104 
105  View2DCineParameters _parameters;
106 
108  SoSFInt32* _slice;
109  SoSFInt32* _time;
110  SoSFBool* _isActive;
112 
114  SoTimerSensor *_timer;
115 
117  bool _nextFrameRequested;
119  bool _backward;
120 };
View2DCineDir
View2DCineMode
View2DCineRepeat
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
void stop()
stop the cine mode
const View2DCineParameters & setParameters(const View2DCineParameters &parameters)
set the parameters to use; returns the parameters that are actually used
View2DCineParameters getParameters() const
the currently used parameters
void start()
start the cine mode
void doAnimationFrame()
this method does one animation frame; to be called directly in unit test only
void requestNextFrame()
request the next frame, e.g. if the current frame has been rendered
View2DCine(SoSFInt32 *slice, SoSFInt32 *time, SoSFBool *isActive=nullptr)
Constructor and destructor.
This class provides the cine mode for SoView2D and SoView2DCine.
Definition: View2DCine.h:25
bool resetOnStart
always reset to start slice/time and forward direction on start (start with current position and dire...
Definition: View2DCine.h:51
View2DCineMode mode
dimensions to loop through (Z, T, ZT, TZ)
Definition: View2DCine.h:41
float speed
speed of the cine mode (in seconds); the minimum cine speed is fixed to one repaint per image
Definition: View2DCine.h:47
int incrementT
the time increment when looping through time
Definition: View2DCine.h:38
int endZ
the end slice when looping through slices
Definition: View2DCine.h:29
int incrementZ
the slice increment when looping through slices
Definition: View2DCine.h:31
int endT
the end time when looping through time
Definition: View2DCine.h:36
int startT
the start time when looping through time
Definition: View2DCine.h:34
int startZ
the start slice when looping through slices
Definition: View2DCine.h:27
View2DCineDir direction
direction of cine mode (forward loop or ping-pong)
Definition: View2DCine.h:43
View2DCineRepeat repeat
flag to indicated if cine mode should automatically stop after the first cycle
Definition: View2DCine.h:45