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:
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);
85  const char* StillRenderToString(vtkRenderWindow* view, vtkMTimeType time = 0, int quality = 100);
87  vtkRenderWindow* view, vtkMTimeType time = 0, int quality = 100);
89 
96 
102 
107 
109 
112  vtkGetMacro(LastStillRenderToMTime, vtkMTimeType);
114 
121 
126  const char* GetWebGLBinaryData(vtkRenderWindow* view, const char* id, int partIndex);
127 
129 
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
a simple class to control print indentation
Definition: vtkIndent.h:34
class used to assign Id to any VTK object and be able to retrieve it base on its id.
abstract base class for most VTK objects
Definition: vtkObject.h:63
create a window for renderers to draw into
dynamic, self-adjusting array of unsigned char
defines ParaViewWeb application interface.
bool HandleInteractionEvent(vtkRenderWindow *view, vtkWebInteractionEvent *event)
Communicate mouse interaction to a view.
vtkTypeUInt32 GetNumberOfEncoderThreads()
vtkUnsignedCharArray * StillRender(vtkRenderWindow *view, int quality=100)
Render a view and obtain the rendered image.
const char * StillRenderToString(vtkRenderWindow *view, vtkMTimeType time=0, int quality=100)
static std::string GetObjectId(vtkObject *obj)
Return a hexadecimal formatted string of the VTK object's memory address, useful for uniquely identif...
vtkUnsignedCharArray * StillRenderToBuffer(vtkRenderWindow *view, vtkMTimeType time=0, int quality=100)
const char * GetWebGLSceneMetaData(vtkRenderWindow *view)
Return the Meta data description of the input scene in JSON format.
vtkUnsignedCharArray * InteractiveRender(vtkRenderWindow *view, int quality=50)
void SetNumberOfEncoderThreads(vtkTypeUInt32)
Set the number of worker threads to use for image encoding.
static vtkWebApplication * New()
void InvalidateCache(vtkRenderWindow *view)
Invalidate view cache.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkWebApplication() override
const char * GetWebGLBinaryData(vtkRenderWindow *view, const char *id, int partIndex)
Return the binary data given the part index and the webGL object piece id in the scene.
vtkMTimeType LastStillRenderToMTime
bool GetHasImagesBeingProcessed(vtkRenderWindow *)
StillRenderToString() need not necessary returns the most recently rendered image.
vtkObjectIdMap * GetObjectIdMap()
@ time
Definition: vtkX3D.h:503
@ string
Definition: vtkX3D.h:496
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293