vtkPVView.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
14 #ifndef vtkPVView_h
15 #define vtkPVView_h
16 
17 #include "vtkRemotingViewsModule.h" //needed for exports
18 #include "vtkView.h"
19 #include "vtkWeakPointer.h" // for vtkWeakPointer
20 
21 class vtkBoundingBox;
22 class vtkInformation;
28 class vtkPVSession;
29 class vtkRenderWindow;
30 class vtkViewLayout;
31 
33 {
34 public:
35  vtkTypeMacro(vtkPVView, vtkView);
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
38  static void SetEnableStreaming(bool);
39  static bool GetEnableStreaming();
40 
42 
46  virtual void SetPosition(int, int);
47  vtkGetVector2Macro(Position, int);
49 
51 
55  virtual void SetSize(int, int);
56  vtkGetVector2Macro(Size, int);
58 
64  virtual void SetPPI(int);
65  vtkGetMacro(PPI, int);
66 
71  virtual void StillRender() = 0;
72 
78  virtual void InteractiveRender() = 0;
79 
81 
86  virtual void SetViewTime(double value);
87  vtkGetMacro(ViewTime, double);
89 
93  vtkGetMacro(ViewTimeValid, bool);
94 
96 
103  vtkSetMacro(CacheKey, double);
104  vtkGetMacro(CacheKey, double);
106 
108 
112  vtkSetMacro(UseCache, bool);
113  vtkGetMacro(UseCache, bool);
115 
117 
120  virtual void PrepareForScreenshot();
121  virtual void CleanupAfterScreenshot();
123 
129  static vtkInformationObjectBaseKey* VIEW();
130 
137  static vtkInformationRequestKey* REQUEST_UPDATE();
138 
144  static vtkInformationRequestKey* REQUEST_UPDATE_LOD();
145 
151  static vtkInformationRequestKey* REQUEST_RENDER();
152 
157  void Update() override;
158 
162  bool InTileDisplayMode();
163 
168  bool InCaveDisplayMode();
169 
182  bool GetLocalProcessSupportsInteraction();
183 
191  vtkRenderWindow* GetRenderWindow() { return this->RenderWindow; }
192 
194 
199  static void SetUseGenericOpenGLRenderWindow(bool val);
200  static bool GetUseGenericOpenGLRenderWindow();
202 
204 
210  void SetTileScale(int x, int y);
211  void SetTileViewport(double x0, double y0, double x1, double y1);
213 
215 
219  virtual void SetLogName(const std::string& name) { this->LogName = name; }
220  const std::string& GetLogName() const { return this->LogName; }
222 
235  virtual void ScaleRendererViewports(const double viewport[4]);
236 
240  vtkMTimeType GetUpdateTimeStamp() { return this->UpdateTimeStamp; }
241 
243 
246  void SetDeliveryManager(vtkPVDataDeliveryManager*);
247  vtkGetObjectMacro(DeliveryManager, vtkPVDataDeliveryManager);
249 
250  static void SetPiece(vtkInformation* info, vtkPVDataRepresentation* repr, vtkDataObject* data,
251  unsigned long trueSize = 0, int port = 0);
252  static vtkDataObject* GetPiece(vtkInformation* info, vtkPVDataRepresentation* repr, int port = 0);
253  static vtkDataObject* GetDeliveredPiece(
254  vtkInformation* info, vtkPVDataRepresentation* repr, int port = 0);
255 
256  static void SetPieceLOD(vtkInformation* info, vtkPVDataRepresentation* repr, vtkDataObject* data,
257  unsigned long trueSize = 0, int port = 0);
258  static vtkDataObject* GetPieceLOD(
259  vtkInformation* info, vtkPVDataRepresentation* repr, int port = 0);
260  static vtkDataObject* GetDeliveredPieceLOD(
261  vtkInformation* info, vtkPVDataRepresentation* repr, int port = 0);
262 
268  virtual void Deliver(int use_lod, unsigned int size, unsigned int* representation_ids);
269 
275  virtual bool IsCached(vtkPVDataRepresentation*);
276 
282  virtual void ClearCache(vtkPVDataRepresentation*);
283 
284 protected:
285  vtkPVView(bool create_render_window = true);
286  ~vtkPVView() override;
287 
292  vtkRenderWindow* NewRenderWindow();
293 
299 
303  void AllReduce(const vtkBoundingBox& source, vtkBoundingBox& dest);
304 
311  void AllReduce(
312  vtkTypeUInt64 source, vtkTypeUInt64& dest, int operation, bool skip_data_server = false);
313 
315 
326 
328 
336 
338 
343  int CallProcessViewRequest(
344  vtkInformationRequestKey* passType, vtkInformation* request, vtkInformationVector* reply);
346 
347  vtkPVSession* GetSession();
348 
353  vtkGetMacro(InCaptureScreenshot, bool);
354 
355  double ViewTime;
356  double CacheKey;
357  bool UseCache;
358 
359  int Size[2];
360  int Position[2];
361  int PPI;
362 
367 
368  static vtkPVDataDeliveryManager* GetDeliveryManager(vtkInformation* info);
369 
374  void SynchronizeRepresentationTemporalPipelineStates();
375 
376 private:
377  vtkPVView(const vtkPVView&) = delete;
378  void operator=(const vtkPVView&) = delete;
379 
380  vtkRenderWindow* RenderWindow;
381  bool ViewTimeValid;
382  static bool EnableStreaming;
384  std::string LogName;
385 
386  static bool UseGenericOpenGLRenderWindow;
387 
388  bool InCaptureScreenshot;
389 
390  vtkPVDataDeliveryManager* DeliveryManager;
391 };
392 
393 #endif
data
manager for data-delivery.
used by vtkSMViewLayoutProxy.
Definition: vtkViewLayout.h:38
virtual void SetLogName(const std::string &name)
This is solely intended to simplify debugging and use for any other purpose is vehemently discouraged...
Definition: vtkPVView.h:219
#define VTKREMOTINGVIEWS_EXPORT
vtkPVDataRepresentation adds some ParaView specific API to data representations.
virtual void Update()
vtkInformation * RequestInformation
These are passed as arguments to vtkDataRepresentation::ProcessViewRequest().
Definition: vtkPVView.h:333
virtual void SetRenderWindow(vtkRenderWindow *renwin)
vtkRenderWindow * GetRenderWindow()
If this view needs a render window (not all views may use one), this method can be used to get the re...
Definition: vtkPVView.h:191
info
virtual void AddRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
extends vtkSession to add API for ParaView sessions.
Definition: vtkPVSession.h:23
vtkTypeUInt64 vtkMTimeType
baseclass for all ParaView views.
Definition: vtkPVView.h:32
vtkInformationVector * ReplyInformationVector
These are passed as arguments to vtkDataRepresentation::ProcessViewRequest().
Definition: vtkPVView.h:334
bool UseCache
Definition: vtkPVView.h:357
double ViewTime
Definition: vtkPVView.h:353
vtkMTimeType GetUpdateTimeStamp()
Provides access to the time when Update() was last called.
Definition: vtkPVView.h:240
const std::string & GetLogName() const
This is solely intended to simplify debugging and use for any other purpose is vehemently discouraged...
Definition: vtkPVView.h:220
size
source
void PrintSelf(ostream &os, vtkIndent indent)
vtkTimeStamp UpdateTimeStamp
Keeps track of the time when vtkPVRenderView::Update() was called.
Definition: vtkPVView.h:366
port
void operator=(const vtkObjectBase &)
virtual void RemoveRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
double CacheKey
Definition: vtkPVView.h:356