VTK  9.0.1
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 =========================================================================*/
24 #ifndef vtkWebApplication_h
25 #define vtkWebApplication_h
26 
27 #include "vtkObject.h"
28 #include "vtkWebCoreModule.h" // needed for exports
29 #include <string> // needed for std::string
30 
31 class vtkObjectIdMap;
32 class vtkRenderWindow;
35 
36 class VTKWEBCORE_EXPORT vtkWebApplication : public vtkObject
37 {
38 public:
39  static vtkWebApplication* New();
40  vtkTypeMacro(vtkWebApplication, vtkObject);
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
47  enum
48  {
49  ENCODING_NONE = 0,
50  ENCODING_BASE64 = 1
51  };
52  vtkSetClampMacro(ImageEncoding, int, ENCODING_NONE, ENCODING_BASE64);
53  vtkGetMacro(ImageEncoding, int);
55 
57 
60  enum
61  {
62  COMPRESSION_NONE = 0,
63  COMPRESSION_PNG = 1,
64  COMPRESSION_JPEG = 2
65  };
66  vtkSetClampMacro(ImageCompression, int, COMPRESSION_NONE, COMPRESSION_JPEG);
67  vtkGetMacro(ImageCompression, int);
69 
71 
75  void SetNumberOfEncoderThreads(vtkTypeUInt32);
76  vtkTypeUInt32 GetNumberOfEncoderThreads();
78 
80 
83  vtkUnsignedCharArray* StillRender(vtkRenderWindow* view, int quality = 100);
84  vtkUnsignedCharArray* InteractiveRender(vtkRenderWindow* view, int quality = 50);
85  const char* StillRenderToString(vtkRenderWindow* view, vtkMTimeType time = 0, int quality = 100);
86  vtkUnsignedCharArray* StillRenderToBuffer(
87  vtkRenderWindow* view, vtkMTimeType time = 0, int quality = 100);
89 
95  bool GetHasImagesBeingProcessed(vtkRenderWindow*);
96 
101  bool HandleInteractionEvent(vtkRenderWindow* view, vtkWebInteractionEvent* event);
102 
106  void InvalidateCache(vtkRenderWindow* view);
107 
109 
112  vtkGetMacro(LastStillRenderToMTime, vtkMTimeType);
114 
120  const char* GetWebGLSceneMetaData(vtkRenderWindow* view);
121 
126  const char* GetWebGLBinaryData(vtkRenderWindow* view, const char* id, int partIndex);
127 
128  vtkObjectIdMap* GetObjectIdMap();
129 
136  static std::string GetObjectId(vtkObject* obj);
137 
138 protected:
140  ~vtkWebApplication() override;
141 
145 
146 private:
147  vtkWebApplication(const vtkWebApplication&) = delete;
148  void operator=(const vtkWebApplication&) = delete;
149 
150  class vtkInternals;
151  vtkInternals* Internals;
152 };
153 
154 #endif
vtkWebApplication::LastStillRenderToMTime
vtkMTimeType LastStillRenderToMTime
Definition: vtkWebApplication.h:144
vtkWebApplication
defines ParaViewWeb application interface.
Definition: vtkWebApplication.h:36
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:35
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkX3D::time
@ time
Definition: vtkX3D.h:503
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkWebApplication::ImageCompression
int ImageCompression
Definition: vtkWebApplication.h:143
vtkObjectIdMap
class used to assign Id to any VTK object and be able to retrieve it base on its id.
Definition: vtkObjectIdMap.h:27
vtkObject.h
vtkX3D::string
@ string
Definition: vtkX3D.h:496
vtkWebApplication::ImageEncoding
int ImageEncoding
Definition: vtkWebApplication.h:142
vtkWebInteractionEvent
Definition: vtkWebInteractionEvent.h:27
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:93
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293