vtkPVView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVView.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
26 #ifndef vtkPVView_h
27 #define vtkPVView_h
28 
29 #include "vtkRemotingViewsModule.h" //needed for exports
30 #include "vtkView.h"
31 #include "vtkWeakPointer.h" // for vtkWeakPointer
32 
33 class vtkBoundingBox;
34 class vtkInformation;
40 class vtkPVSession;
41 class vtkRenderWindow;
42 class vtkViewLayout;
43 
45 {
46 public:
47  vtkTypeMacro(vtkPVView, vtkView);
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
50  static void SetEnableStreaming(bool);
51  static bool GetEnableStreaming();
52 
54 
58  virtual void SetPosition(int, int);
59  vtkGetVector2Macro(Position, int);
61 
63 
67  virtual void SetSize(int, int);
68  vtkGetVector2Macro(Size, int);
70 
76  virtual void SetPPI(int);
77  vtkGetMacro(PPI, int);
78 
83  virtual void StillRender() = 0;
84 
90  virtual void InteractiveRender() = 0;
91 
93 
98  virtual void SetViewTime(double value);
99  vtkGetMacro(ViewTime, double);
101 
103 
110  vtkSetMacro(CacheKey, double);
111  vtkGetMacro(CacheKey, double);
113 
115 
119  vtkSetMacro(UseCache, bool);
120  vtkGetMacro(UseCache, bool);
122 
124 
127  virtual void PrepareForScreenshot();
128  virtual void CleanupAfterScreenshot();
130 
136  static vtkInformationObjectBaseKey* VIEW();
137 
144  static vtkInformationRequestKey* REQUEST_UPDATE();
145 
151  static vtkInformationRequestKey* REQUEST_UPDATE_LOD();
152 
158  static vtkInformationRequestKey* REQUEST_RENDER();
159 
164  void Update() override;
165 
169  bool InTileDisplayMode();
170 
175  bool InCaveDisplayMode();
176 
189  bool GetLocalProcessSupportsInteraction();
190 
198  vtkRenderWindow* GetRenderWindow() { return this->RenderWindow; }
199 
201 
206  static void SetUseGenericOpenGLRenderWindow(bool val);
207  static bool GetUseGenericOpenGLRenderWindow();
209 
211 
217  void SetTileScale(int x, int y);
218  void SetTileViewport(double x0, double y0, double x1, double y1);
220 
222 
226  virtual void SetLogName(const std::string& name) { this->LogName = name; }
227  const std::string& GetLogName() const { return this->LogName; }
229 
242  virtual void ScaleRendererViewports(const double viewport[4]);
243 
247  vtkMTimeType GetUpdateTimeStamp() { return this->UpdateTimeStamp; }
248 
250 
253  void SetDeliveryManager(vtkPVDataDeliveryManager*);
254  vtkGetObjectMacro(DeliveryManager, vtkPVDataDeliveryManager);
256 
257  static void SetPiece(vtkInformation* info, vtkPVDataRepresentation* repr, vtkDataObject* data,
258  unsigned long trueSize = 0, int port = 0);
259  static vtkDataObject* GetPiece(vtkInformation* info, vtkPVDataRepresentation* repr, int port = 0);
260  static vtkDataObject* GetDeliveredPiece(
261  vtkInformation* info, vtkPVDataRepresentation* repr, int port = 0);
262 
263  static void SetPieceLOD(vtkInformation* info, vtkPVDataRepresentation* repr, vtkDataObject* data,
264  unsigned long trueSize = 0, int port = 0);
265  static vtkDataObject* GetPieceLOD(
266  vtkInformation* info, vtkPVDataRepresentation* repr, int port = 0);
267  static vtkDataObject* GetDeliveredPieceLOD(
268  vtkInformation* info, vtkPVDataRepresentation* repr, int port = 0);
269 
275  virtual void Deliver(int use_lod, unsigned int size, unsigned int* representation_ids);
276 
282  virtual bool IsCached(vtkPVDataRepresentation*);
283 
289  virtual void ClearCache(vtkPVDataRepresentation*);
290 
291 protected:
292  vtkPVView(bool create_render_window = true);
293  ~vtkPVView() override;
294 
299  vtkRenderWindow* NewRenderWindow();
300 
306 
310  void AllReduce(const vtkBoundingBox& source, vtkBoundingBox& dest);
311 
318  void AllReduce(
319  vtkTypeUInt64 source, vtkTypeUInt64& dest, int operation, bool skip_data_server = false);
320 
322 
333 
335 
343 
345 
350  int CallProcessViewRequest(
351  vtkInformationRequestKey* passType, vtkInformation* request, vtkInformationVector* reply);
353 
354  vtkPVSession* GetSession();
355 
360  vtkGetMacro(InCaptureScreenshot, bool);
361 
362  double ViewTime;
363  double CacheKey;
364  bool UseCache;
365 
366  int Size[2];
367  int Position[2];
368  int PPI;
369 
374 
375  static vtkPVDataDeliveryManager* GetDeliveryManager(vtkInformation* info);
376 
377 private:
378  vtkPVView(const vtkPVView&) = delete;
379  void operator=(const vtkPVView&) = delete;
380 
385  void SynchronizeRepresentationTemporalPipelineStates();
386 
387  vtkRenderWindow* RenderWindow;
388  bool ViewTimeValid;
389  static bool EnableStreaming;
391  std::string LogName;
392 
393  static bool UseGenericOpenGLRenderWindow;
394 
395  bool InCaptureScreenshot;
396 
397  vtkPVDataDeliveryManager* DeliveryManager;
398 };
399 
400 #endif
data
manager for data-delivery.
used by vtkSMViewLayoutProxy.
Definition: vtkViewLayout.h:50
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:226
#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:340
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:198
info
virtual void AddRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
extends vtkSession to add API for ParaView sessions.
Definition: vtkPVSession.h:35
vtkTypeUInt64 vtkMTimeType
baseclass for all ParaView views.
Definition: vtkPVView.h:44
vtkInformationVector * ReplyInformationVector
These are passed as arguments to vtkDataRepresentation::ProcessViewRequest().
Definition: vtkPVView.h:341
bool UseCache
Definition: vtkPVView.h:364
double ViewTime
Definition: vtkPVView.h:360
vtkMTimeType GetUpdateTimeStamp()
Provides access to the time when Update() was last called.
Definition: vtkPVView.h:247
const std::string & GetLogName() const
This is solely intended to simplify debugging and use for any other purpose is vehemently discouraged...
Definition: vtkPVView.h:227
size
source
void PrintSelf(ostream &os, vtkIndent indent)
vtkTimeStamp UpdateTimeStamp
Keeps track of the time when vtkPVRenderView::Update() was called.
Definition: vtkPVView.h:373
port
void operator=(const vtkObjectBase &)
virtual void RemoveRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
double CacheKey
Definition: vtkPVView.h:363