VTK  9.3.1
vtkWebApplication.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
15 #ifndef vtkWebApplication_h
16 #define vtkWebApplication_h
17 
18 #include "vtkObject.h"
19 #include "vtkWebCoreModule.h" // needed for exports
20 #include <string> // needed for std::string
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class vtkObjectIdMap;
24 class vtkRenderWindow;
27 
28 class VTKWEBCORE_EXPORT vtkWebApplication : public vtkObject
29 {
30 public:
31  static vtkWebApplication* New();
32  vtkTypeMacro(vtkWebApplication, vtkObject);
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
36 
39  enum
40  {
41  ENCODING_NONE = 0,
42  ENCODING_BASE64 = 1
43  };
44  vtkSetClampMacro(ImageEncoding, int, ENCODING_NONE, ENCODING_BASE64);
45  vtkGetMacro(ImageEncoding, int);
47 
49 
52  enum
53  {
54  COMPRESSION_NONE = 0,
55  COMPRESSION_PNG = 1,
56  COMPRESSION_JPEG = 2
57  };
58  vtkSetClampMacro(ImageCompression, int, COMPRESSION_NONE, COMPRESSION_JPEG);
59  vtkGetMacro(ImageCompression, int);
61 
63 
67  void SetNumberOfEncoderThreads(vtkTypeUInt32);
68  vtkTypeUInt32 GetNumberOfEncoderThreads();
70 
72 
75  vtkUnsignedCharArray* StillRender(vtkRenderWindow* view, int quality = 100);
76  vtkUnsignedCharArray* InteractiveRender(vtkRenderWindow* view, int quality = 50);
77  const char* StillRenderToString(vtkRenderWindow* view, vtkMTimeType time = 0, int quality = 100);
78  vtkUnsignedCharArray* StillRenderToBuffer(
79  vtkRenderWindow* view, vtkMTimeType time = 0, int quality = 100);
81 
87  bool GetHasImagesBeingProcessed(vtkRenderWindow*);
88 
93  bool HandleInteractionEvent(vtkRenderWindow* view, vtkWebInteractionEvent* event);
94 
98  void InvalidateCache(vtkRenderWindow* view);
99 
101 
104  vtkGetMacro(LastStillRenderToMTime, vtkMTimeType);
106 
112  const char* GetWebGLSceneMetaData(vtkRenderWindow* view);
113 
118  const char* GetWebGLBinaryData(vtkRenderWindow* view, const char* id, int partIndex);
119 
120  vtkObjectIdMap* GetObjectIdMap();
121 
128  static std::string GetObjectId(vtkObject* obj);
129 
130 protected:
132  ~vtkWebApplication() override;
133 
137 
138 private:
139  vtkWebApplication(const vtkWebApplication&) = delete;
140  void operator=(const vtkWebApplication&) = delete;
141 
142  class vtkInternals;
143  vtkInternals* Internals;
144 };
145 
146 VTK_ABI_NAMESPACE_END
147 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
class used to assign Id to any VTK object and be able to retrieve it base on its id.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
defines ParaViewWeb application interface.
a simple class to control print indentation
Definition: vtkIndent.h:28
dynamic, self-adjusting array of unsigned char
create a window for renderers to draw into
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkMTimeType LastStillRenderToMTime