VTK
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:
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);
88  const char* StillRenderToString(vtkRenderWindow* view, vtkMTimeType time = 0, int quality = 100);
90 
97 
104 
109 
111 
114  vtkGetMacro(LastStillRenderToMTime, vtkMTimeType);
116 
123 
128  const char* GetWebGLBinaryData(vtkRenderWindow *view, const char* id, int partIndex);
129 
131 
139 
140 protected:
142  ~vtkWebApplication() override;
143 
147 
148 private:
149  vtkWebApplication(const vtkWebApplication&) = delete;
150  void operator=(const vtkWebApplication&) = delete;
151 
152  class vtkInternals;
153  vtkInternals* Internals;
154 
155 };
156 
157 #endif
vtkWebApplication::InvalidateCache
void InvalidateCache(vtkRenderWindow *view)
Invalidate view cache.
vtkWebApplication::LastStillRenderToMTime
vtkMTimeType LastStillRenderToMTime
Definition: vtkWebApplication.h:146
vtkWebApplication::SetNumberOfEncoderThreads
void SetNumberOfEncoderThreads(vtkTypeUInt32)
Set the number of worker threads to use for image encoding.
vtkWebApplication
defines ParaViewWeb application interface.
Definition: vtkWebApplication.h:40
vtkWebApplication::HandleInteractionEvent
bool HandleInteractionEvent(vtkRenderWindow *view, vtkWebInteractionEvent *event)
Communicate mouse interaction to a view.
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:42
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkWebApplication::GetObjectId
static std::string GetObjectId(vtkObject *obj)
Return a hexadecimal formatted string of the VTK object's memory address, useful for uniquely identif...
vtkX3D::time
@ time
Definition: vtkX3D.h:497
vtkWebApplication::GetWebGLSceneMetaData
const char * GetWebGLSceneMetaData(vtkRenderWindow *view)
Return the Meta data description of the input scene in JSON format.
vtkWebApplication::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkWebApplication::InteractiveRender
vtkUnsignedCharArray * InteractiveRender(vtkRenderWindow *view, int quality=50)
vtkWebApplication::StillRenderToString
const char * StillRenderToString(vtkRenderWindow *view, vtkMTimeType time=0, int quality=100)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkWebApplication::New
static vtkWebApplication * New()
vtkWebApplication::GetWebGLBinaryData
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.
vtkWebApplication::ImageCompression
int ImageCompression
Definition: vtkWebApplication.h:145
vtkObjectIdMap
class used to assign Id to any VTK object and be able to retrieve it base on its id.
Definition: vtkObjectIdMap.h:31
vtkObject.h
vtkWebApplication::GetHasImagesBeingProcessed
bool GetHasImagesBeingProcessed(vtkRenderWindow *)
StillRenderToString() need not necessary returns the most recently rendered image.
vtkWebApplication::GetNumberOfEncoderThreads
vtkTypeUInt32 GetNumberOfEncoderThreads()
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkWebApplication::vtkWebApplication
vtkWebApplication()
vtkWebApplication::ImageEncoding
int ImageEncoding
Definition: vtkWebApplication.h:144
vtkWebApplication::StillRender
vtkUnsignedCharArray * StillRender(vtkRenderWindow *view, int quality=100)
Render a view and obtain the rendered image.
vtkWebInteractionEvent
Definition: vtkWebInteractionEvent.h:28
vtkWebApplication::~vtkWebApplication
~vtkWebApplication() override
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:88
vtkWebApplication::GetObjectIdMap
vtkObjectIdMap * GetObjectIdMap()
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302