File: vtkPVComparativeView.h

package info (click to toggle)
paraview 5.4.1%2Bdfsg4-3.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 218,616 kB
  • sloc: cpp: 2,331,508; ansic: 322,365; python: 111,051; xml: 79,203; tcl: 47,013; yacc: 4,877; java: 4,438; perl: 3,238; sh: 2,920; lex: 1,908; f90: 748; makefile: 273; pascal: 228; objc: 83; fortran: 31
file content (227 lines) | stat: -rw-r--r-- 5,574 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
/*=========================================================================

  Program:   ParaView
  Module:    vtkPVComparativeView.h

  Copyright (c) Kitware, Inc.
  All rights reserved.
  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
/**
 * @class   vtkPVComparativeView
 * @brief   view for comparative visualization/
 * film-strips.
 *
 * vtkPVComparativeView is the view used to generate/view comparative
 * visualizations/film-strips. This is not a proxy
*/

#ifndef vtkPVComparativeView_h
#define vtkPVComparativeView_h

#include "vtkObject.h"
#include "vtkPVServerManagerRenderingModule.h" //needed for exports

class vtkCollection;
class vtkImageData;
class vtkSMComparativeAnimationCueProxy;
class vtkSMProxy;
class vtkSMViewProxy;

class VTKPVSERVERMANAGERRENDERING_EXPORT vtkPVComparativeView : public vtkObject
{
public:
  static vtkPVComparativeView* New();
  vtkTypeMacro(vtkPVComparativeView, vtkObject);
  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;

  /**
   * Provides empty handlers to simulate the vtkPVView API.
   */
  void Initialize(unsigned int){};

  /**
   * Call StillRender() on the root view.
   */
  void StillRender();

  /**
   * Call InteractiveRender() on the root view.
   */
  void InteractiveRender();

  /**
   * Initialize the vtkPVComparativeView giving the root view proxy to be used
   * to create the comparative views.
   */
  void Initialize(vtkSMViewProxy* rootView);

  /**
   * Builds the MxN views. This method simply creates the MxN internal view modules.
   * It does not generate the visualization i.e. play the animation scene(s).
   * This method does nothing unless the dimensions have changed, in which case
   * it creates new internal view modules (or destroys extra ones). Note that
   * the it's the responsibility of the application to lay the views out so that
   * they form a MxN grid.
   */
  void Build(int dx, int dy);

  //@{
  /**
   * When set to true, all comparisons are shown in the same view. Otherwise,
   * they are tiled in separate views.
   */
  void SetOverlayAllComparisons(bool);
  vtkGetMacro(OverlayAllComparisons, bool);
  //@}

  //@{
  /**
   * Returns the dimensions used by the most recent Build() request.
   */
  vtkGetVector2Macro(Dimensions, int);
  //@}

  /**
   * Adds a representation proxy to this view.
   */
  void AddRepresentation(vtkSMProxy*);

  /**
   * Removes a representation proxy from this view.
   */
  void RemoveRepresentation(vtkSMProxy*);

  /**
   * Updates the data pipelines for all visible representations.
   */
  void Update();

  /**
   * Get all the internal views. The views should only be used to be layed out
   * by the GUI. It's not recommended to directly change the properties of the
   * views.
   */
  void GetViews(vtkCollection* collection);

  //@{
  /**
   * Returns the root view proxy.
   */
  vtkGetObjectMacro(RootView, vtkSMViewProxy);
  //@}

  //@{
  /**
   * ViewSize, ViewPosition need to split up among all the component
   * views correctly.
   */
  void SetViewSize(int x, int y)
  {
    this->ViewSize[0] = x;
    this->ViewSize[1] = y;
    this->UpdateViewLayout();
  }
  //@}

  //@{
  /**
   * ViewSize, ViewPosition need to split up among all the component
   * views correctly.
   */
  void SetViewPosition(int x, int y)
  {
    this->ViewPosition[0] = x;
    this->ViewPosition[1] = y;
    this->UpdateViewLayout();
  }
  //@}

  /**
   * Satisfying vtkPVView API. We don't need to do anything here since the
   * subviews have their own PPI settings.
   */
  void SetPPI(int) {}

  //@{
  /**
   * Set spacing between views.
   */
  vtkSetVector2Macro(Spacing, int);
  vtkGetVector2Macro(Spacing, int);
  //@}

  //@{
  /**
   * Add/Remove parameter cues.
   */
  void AddCue(vtkSMComparativeAnimationCueProxy*);
  void RemoveCue(vtkSMComparativeAnimationCueProxy*);
  //@}

  //@{
  /**
   * Get/Set the view time.
   */
  vtkGetMacro(ViewTime, double);
  void SetViewTime(double time)
  {
    if (this->ViewTime != time)
    {
      this->ViewTime = time;
      this->Modified();
      this->MarkOutdated();
    }
  }
  //@}

  /**
   * Marks the view dirty i.e. on next Update() it needs to regenerate the
   * comparative vis by replaying the animation(s).
   */
  void MarkOutdated() { this->Outdated = true; }

  /**
   * These methods mimic the vtkPVView API. They do nothing here since each view
   * internal view will call PrepareForScreenshot and CleanupAfterScreenshot
   * explicitly when we capture the images from each of them as needed.
   */
  void PrepareForScreenshot() {}
  void CleanupAfterScreenshot() {}
  vtkImageData* CaptureWindow(int magnification);

protected:
  vtkPVComparativeView();
  ~vtkPVComparativeView();

  /**
   * Update layout for internal views.
   */
  void UpdateViewLayout();

  int Dimensions[2];
  int ViewSize[2];
  int ViewPosition[2];
  int Spacing[2];
  double ViewTime;
  bool OverlayAllComparisons;
  bool Outdated;

  void SetRootView(vtkSMViewProxy*);
  vtkSMViewProxy* RootView;

private:
  vtkPVComparativeView(const vtkPVComparativeView&) VTK_DELETE_FUNCTION;
  void operator=(const vtkPVComparativeView&) VTK_DELETE_FUNCTION;

  class vtkInternal;
  vtkInternal* Internal;
  vtkCommand* MarkOutdatedObserver;
};

#endif