VTK  9.7.1
vtkZSpaceCoreCompatibilitySDKManager.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 vtkZSpaceCoreCompatibilitySDKManager_h
16 #define vtkZSpaceCoreCompatibilitySDKManager_h
17 
18 #include "vtkZSpaceSDKManager.h"
19 
20 // Disable "anonymous struct/union" warning on zSpace compat headers
21 #pragma warning(disable : 4201)
22 #include "zSpaceCoreCompatibility.h" // zSpace header
23 #pragma warning(default : 4201)
24 
25 #include <vector> // for std::vector
26 #include <windows.h> // for HMODULE
27 
28 VTK_ABI_NAMESPACE_BEGIN
29 
35 {
36  // Use the zSpace Core Compatibility API function name reflection macro to
37  // auto-generate function pointer members for all zSpace Core Compatibility
38  // API entry point functions.
39 
40 #define ZC_COMPAT_SAMPLE_LOCAL_ENTRY_POINT_MEMBER(undecoratedFuncName) \
41  ZCCompat##undecoratedFuncName##FuncPtrType zccompat##undecoratedFuncName;
42 
44 #undef ZC_COMPAT_SAMPLE_LOCAL_ENTRY_POINT_MEMBER
45 };
46 
47 class vtkRenderWindow;
48 class vtkMatrix4x4;
49 
51 {
52 public:
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
61  void InitializeZSpace() override;
62 
67  void UpdateViewport() override;
68 
72  void UpdateTrackers() override;
73 
77  void UpdateViewAndProjectionMatrix() override;
78 
82  void UpdateButtonState() override;
83 
88  void CalculateFrustumFit(const double bounds[6], double position[3], double viewUp[3]) override;
89 
91 
94  void BeginFrame() override;
95  void EndFrame() override;
97 
103  void EnableGraphicsBinding() override;
104 
113  void SubmitFrame(unsigned int leftText, unsigned int rightText) override;
114 
120  void GetPerEyeImageResolution(signed int* width, signed int* height) override;
121 
131 
133 
140  void SetStereoDisplayEnabled(bool enabled) override;
141  bool GetStereoDisplayEnabled() override;
143 
148  void ShutDown() override;
149 
155  void SetRenderWindow(vtkRenderWindow*) override;
156 
157 protected:
160 
166 
167  // Store the API functions entry points.
169 
170  // Handle to the zSpace Core Compatibility API dynamic library (.dll).
172 
177  bool loadZspaceCoreCompatibilityEntryPoints(const char* zSpaceCoreCompatDllFilePath,
178  HMODULE& zSpaceCoreCompatDllModuleHandle, zSpaceCoreCompatEntryPoints& entryPoints);
179 
185 
190  void ConvertZSpaceMatrixToVTKMatrix(ZSMatrix4 zSpaceMatrix, vtkMatrix4x4* vtkMatrix);
191 
196  bool Initialized = false;
197 
198 private:
200  void operator=(const vtkZSpaceCoreCompatibilitySDKManager&) = delete;
201 };
202 
203 VTK_ABI_NAMESPACE_END
204 
205 #endif
struct ZCCompatFrustumOpaque * ZCCompatFrustum
struct ZCCompatContextOpaque * ZCCompatContext
void GetPerEyeImageResolution(signed int *width, signed int *height) override
Request from the zSpace Core Compatibility API the resolution needed to create left / right eye textu...
void EnableGraphicsBinding() override
Allow the zSpace Core Compatibility API to create its internal OpenGL resources and prepare to accept...
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:31
void UpdateTrackers() override
Update the position of the stylus and head trackers.
void CalculateFrustumFit(const double bounds[6], double position[3], double viewUp[3]) override
Let zSpace compute the viewer scale, camera position and camera view up from the input bounds...
Structure holding the loaded zSpace Core Compatibility API entry point function pointers.
static vtkZSpaceCoreCompatibilitySDKManager * New()
void ConvertAndTransposeZSpaceMatrixToVTKMatrix(ZSMatrix4 zSpaceMatrix, vtkMatrix4x4 *vtkMatrix)
zSpace stores matrix in column-major format (as OpenGL).
bool loadZspaceCoreCompatibilityEntryPoints(const char *zSpaceCoreCompatDllFilePath, HMODULE &zSpaceCoreCompatDllModuleHandle, zSpaceCoreCompatEntryPoints &entryPoints)
Load the "zSpaceCoreCompatibility64.dll" shared library then load the zSpace Core Compatibility API e...
#define ZC_COMPAT_SAMPLE_LOCAL_ENTRY_POINT_MEMBER(undecoratedFuncName)
bool Initialized
Set to true if zSpaceCoreCompatibility dynamic libraries are found upon vtkZSpaceCoreCompatibilitySDK...
bool GetStereoDisplayEnabled() override
Set/Get if the "Stereo Display" is enabled.
void ShutDown() override
Shutdown the zSpace SDK (clean its internal state).
void UpdateViewAndProjectionMatrix() override
Update the zSpace view and projection matrix for each eye.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void UpdateButtonState() override
Update the stylus buttons state.
a simple class to control print indentation
Definition: vtkIndent.h:28
Union representing 4x4 matrix (right-handed OpenGL column-major format). / This structure is used by ...
Definition: zSpaceTypes.h:77
Abstract zSpace SDK manager class.
void EndFrame() override
Notify the zSpace SDK for the beginning/end of a frame.
void BeginFrame() override
Notify the zSpace SDK for the beginning/end of a frame.
void InitializeZSpace() override
Initialize the zSpace SDK and check for zSpace devices : the display, the stylus and the head tracker...
create a window for renderers to draw into
#define ZC_COMPAT_REFLECTION_LIST_UNDECORATED_FUNC_NAMES(_)
struct ZCCompatDisplayOpaque * ZCCompatDisplay
zSpace Core Compatibility SDK manager class.
void ConvertZSpaceMatrixToVTKMatrix(ZSMatrix4 zSpaceMatrix, vtkMatrix4x4 *vtkMatrix)
zSpace stores matrix in column-major format (as OpenGL).
void UpdateViewport() override
Update the zSpace viewport position and size based on the position and size of the application window...
StereoDisplayMode GetStereoDisplayMode() override
Return the actual stereo display mode, depending on zSpace hardware.
struct ZCCompatViewportOpaque * ZCCompatViewport
void SetRenderWindow(vtkRenderWindow *) override
Set the render window the manager makes viewport computations from.
void SetStereoDisplayEnabled(bool enabled) override
Set/Get if the "Stereo Display" is enabled.
struct ZCCompatTargetOpaque * ZCCompatTarget
void SubmitFrame(unsigned int leftText, unsigned int rightText) override
Submit left / right eyes textures to the zSpace Core Compatibility API in order to let it handle the ...