vtkSMSaveScreenshotProxy.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMSaveScreenshotProxy.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 =========================================================================*/
30 #ifndef vtkSMSaveScreenshotProxy_h
31 #define vtkSMSaveScreenshotProxy_h
32 
33 #include "vtkRemotingViewsModule.h" // needed for exports
34 #include "vtkSMProxy.h"
35 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
36 #include "vtkVector.h" // needed for vtkVector2i.
37 
38 class vtkImageData;
40 class vtkSMViewProxy;
41 
42 class VTKREMOTINGVIEWS_EXPORT vtkSMSaveScreenshotProxy : public vtkSMProxy
43 {
44 public:
45  static vtkSMSaveScreenshotProxy* New();
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
53  virtual bool WriteImage(const char* filename);
54 
58  virtual vtkSmartPointer<vtkImageData> CaptureImage();
59 
63  virtual void UpdateDefaultsAndVisibilities(const char* filename);
64 
70  static vtkSmartPointer<vtkImageData> CaptureImage(vtkSMViewProxy* view, const vtkVector2i& size);
71 
77  static vtkSmartPointer<vtkImageData> CaptureImage(
78  vtkSMViewLayoutProxy* view, const vtkVector2i& size);
79 
92  static vtkVector2i GetScaleFactorsAndSize(
93  const vtkVector2i& targetSize, vtkVector2i& size, bool* approximate = nullptr);
94 
102  static int ComputeMagnification(const vtkVector2i& targetSize, vtkVector2i& size);
103 
105 
109  std::string GetFileFormatFilters();
111 
112 protected:
114  ~vtkSMSaveScreenshotProxy() override;
115 
120  virtual vtkSmartPointer<vtkImageData> CapturePreppedImage();
121 
126  virtual bool Prepare();
127 
131  virtual bool Cleanup();
132 
133  vtkSMViewLayoutProxy* GetLayout();
134  vtkSMViewProxy* GetView();
135 
141  vtkSMProxy* GetFormatProxy(const std::string& filename);
142 
143  friend class pqCatalystExportReaction; // access to GetView,FormatProxy
144  friend class pqImmediateExportReaction; // access to GetView,FormatProxy
145  friend class pqTemporalExportReaction; // access to GetView,FormatProxy
146 private:
148  void operator=(const vtkSMSaveScreenshotProxy&) = delete;
149 
153  class vtkState;
154  class vtkStateView;
155  class vtkStateLayout;
156  vtkState* State;
157 };
158 
159 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Superclass for all view proxies.
Reaction to export a Catalyst script that will produce configured catalyst data products.
Reaction to export a script that will produce configured temporal data products simultaneously.
vtkSMMessage * State
Definition: vtkSMProxy.h:993
vtkSMViewLayoutProxy is used by ParaView to layout multiple views in a 2D KD-Tree layout.
static vtkSMProxy * New()
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
void operator=(const vtkSMProxy &)=delete
Reaction to export a set of configured data products now.
proxy to help with saving screenshots for views