VTK  9.2.6
vtkWebApplication.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkWebApplication.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
27 #ifndef vtkWebApplication_h
28 #define vtkWebApplication_h
29 
30 #include "vtkObject.h"
31 #include "vtkWebCoreModule.h" // needed for exports
32 #include <string> // needed for std::string
33 
34 class vtkObjectIdMap;
35 class vtkRenderWindow;
38 
39 class VTKWEBCORE_EXPORT vtkWebApplication : public vtkObject
40 {
41 public:
42  static vtkWebApplication* New();
43  vtkTypeMacro(vtkWebApplication, vtkObject);
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
50  enum
51  {
52  ENCODING_NONE = 0,
53  ENCODING_BASE64 = 1
54  };
55  vtkSetClampMacro(ImageEncoding, int, ENCODING_NONE, ENCODING_BASE64);
56  vtkGetMacro(ImageEncoding, int);
58 
60 
63  enum
64  {
65  COMPRESSION_NONE = 0,
66  COMPRESSION_PNG = 1,
67  COMPRESSION_JPEG = 2
68  };
69  vtkSetClampMacro(ImageCompression, int, COMPRESSION_NONE, COMPRESSION_JPEG);
70  vtkGetMacro(ImageCompression, int);
72 
74 
78  void SetNumberOfEncoderThreads(vtkTypeUInt32);
79  vtkTypeUInt32 GetNumberOfEncoderThreads();
81 
83 
86  vtkUnsignedCharArray* StillRender(vtkRenderWindow* view, int quality = 100);
87  vtkUnsignedCharArray* InteractiveRender(vtkRenderWindow* view, int quality = 50);
88  const char* StillRenderToString(vtkRenderWindow* view, vtkMTimeType time = 0, int quality = 100);
89  vtkUnsignedCharArray* StillRenderToBuffer(
90  vtkRenderWindow* view, vtkMTimeType time = 0, int quality = 100);
92 
98  bool GetHasImagesBeingProcessed(vtkRenderWindow*);
99 
104  bool HandleInteractionEvent(vtkRenderWindow* view, vtkWebInteractionEvent* event);
105 
109  void InvalidateCache(vtkRenderWindow* view);
110 
112 
115  vtkGetMacro(LastStillRenderToMTime, vtkMTimeType);
117 
123  const char* GetWebGLSceneMetaData(vtkRenderWindow* view);
124 
129  const char* GetWebGLBinaryData(vtkRenderWindow* view, const char* id, int partIndex);
130 
131  vtkObjectIdMap* GetObjectIdMap();
132 
139  static std::string GetObjectId(vtkObject* obj);
140 
141 protected:
143  ~vtkWebApplication() override;
144 
148 
149 private:
150  vtkWebApplication(const vtkWebApplication&) = delete;
151  void operator=(const vtkWebApplication&) = delete;
152 
153  class vtkInternals;
154  vtkInternals* Internals;
155 };
156 
157 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
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:287
defines ParaViewWeb application interface.
a simple class to control print indentation
Definition: vtkIndent.h:39
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