VTK: Rendering/ZSpace/vtkZSpaceCoreCompatibilitySDKManager.h Source File

| VTK 9.3.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
34 struct zSpaceCoreCompatEntryPoints
35 {
36 // Use the zSpace Core Compatibilty 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
43 ZC_COMPAT_REFLECTION_LIST_UNDECORATED_FUNC_NAMES(ZC_COMPAT_SAMPLE_LOCAL_ENTRY_POINT_MEMBER)
44 #undef ZC_COMPAT_SAMPLE_LOCAL_ENTRY_POINT_MEMBER
45 };
46
47 class vtkRenderWindow;
48 class vtkMatrix4x4;
49
50 class vtkZSpaceCoreCompatibilitySDKManager : public vtkZSpaceSDKManager
51 {
52 public:
53 static vtkZSpaceCoreCompatibilitySDKManager* New();
54 vtkTypeMacro(vtkZSpaceCoreCompatibilitySDKManager, vtkZSpaceSDKManager);
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 SetRenderWindow(vtkRenderWindow*) override;
104
105 protected:
106 vtkZSpaceCoreCompatibilitySDKManager();
107 ~vtkZSpaceCoreCompatibilitySDKManager() override;
108
109 ZCCompatContext ZSpaceContext = nullptr;
110 ZCCompatDisplay DisplayHandle = nullptr;
111 ZCCompatViewport ViewportHandle = nullptr;
112 ZCCompatFrustum FrustumHandle = nullptr;
113 ZCCompatTarget StylusHandle = nullptr;
114
115 // Store the API functions entry points.
116 zSpaceCoreCompatEntryPoints EntryPts;
117
118 // Handle to the zSpace Core Compatibility API dynamic library (.dll).
119 HMODULE zSpaceCoreCompatDllModuleHandle;
120
121 // Handle to the current window
122 HWND WidondowHandle;
123
128 bool loadZspaceCoreCompatibilityEntryPoints(const char* zSpaceCoreCompatDllFilePath,
129 HMODULE& zSpaceCoreCompatDllModuleHandle, zSpaceCoreCompatEntryPoints& entryPoints);
130
135 void ConvertAndTransposeZSpaceMatrixToVTKMatrix(ZSMatrix4 zSpaceMatrix, vtkMatrix4x4* vtkMatrix);
136
141 void ConvertZSpaceMatrixToVTKMatrix(ZSMatrix4 zSpaceMatrix, vtkMatrix4x4* vtkMatrix);
142
147 bool Initialized = false;
148
149 private:
150 vtkZSpaceCoreCompatibilitySDKManager(const vtkZSpaceCoreCompatibilitySDKManager&) = delete;
151 void operator=(const vtkZSpaceCoreCompatibilitySDKManager&) = delete;
152 };
153
154 VTK_ABI_NAMESPACE_END
155
156 #endif
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:40
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:95
vtkZSpaceCoreCompatibilitySDKManager
zSpace Core Compatibility SDK manager class.
Definition: vtkZSpaceCoreCompatibilitySDKManager.h:51
vtkZSpaceCoreCompatibilitySDKManager::ConvertZSpaceMatrixToVTKMatrix
void ConvertZSpaceMatrixToVTKMatrix(ZSMatrix4 zSpaceMatrix, vtkMatrix4x4 *vtkMatrix)
zSpace stores matrix in column-major format (as OpenGL).
vtkZSpaceCoreCompatibilitySDKManager::ConvertAndTransposeZSpaceMatrixToVTKMatrix
void ConvertAndTransposeZSpaceMatrixToVTKMatrix(ZSMatrix4 zSpaceMatrix, vtkMatrix4x4 *vtkMatrix)
zSpace stores matrix in column-major format (as OpenGL).
vtkZSpaceCoreCompatibilitySDKManager::UpdateViewport
void UpdateViewport() override
Update the zSpace viewport position and size based on the position and size of the application window...
vtkZSpaceCoreCompatibilitySDKManager::WidondowHandle
HWND WidondowHandle
Definition: vtkZSpaceCoreCompatibilitySDKManager.h:122
vtkZSpaceCoreCompatibilitySDKManager::UpdateTrackers
void UpdateTrackers() override
Update the position of the stylus and head trakers.
vtkZSpaceCoreCompatibilitySDKManager::CalculateFrustumFit
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.
vtkZSpaceCoreCompatibilitySDKManager::Initialized
bool Initialized
Set to true if zSpaceCoreCompatibility dynamic libraries are found upon vtkZSpaceCoreCompatibilitySDK...
Definition: vtkZSpaceCoreCompatibilitySDKManager.h:147
vtkZSpaceCoreCompatibilitySDKManager::InitializeZSpace
void InitializeZSpace() override
Initialize the zSpace SDK and check for zSpace devices : the display, the stylus and the head tracker...
vtkZSpaceCoreCompatibilitySDKManager::New
static vtkZSpaceCoreCompatibilitySDKManager * New()
vtkZSpaceCoreCompatibilitySDKManager::EntryPts
zSpaceCoreCompatEntryPoints EntryPts
Definition: vtkZSpaceCoreCompatibilitySDKManager.h:116
vtkZSpaceCoreCompatibilitySDKManager::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkZSpaceCoreCompatibilitySDKManager::~vtkZSpaceCoreCompatibilitySDKManager
~vtkZSpaceCoreCompatibilitySDKManager() override
vtkZSpaceCoreCompatibilitySDKManager::vtkZSpaceCoreCompatibilitySDKManager
vtkZSpaceCoreCompatibilitySDKManager()
vtkZSpaceCoreCompatibilitySDKManager::StylusHandle
ZCCompatTarget StylusHandle
Definition: vtkZSpaceCoreCompatibilitySDKManager.h:113
vtkZSpaceCoreCompatibilitySDKManager::ZSpaceContext
ZCCompatContext ZSpaceContext
Definition: vtkZSpaceCoreCompatibilitySDKManager.h:109
vtkZSpaceCoreCompatibilitySDKManager::loadZspaceCoreCompatibilityEntryPoints
bool loadZspaceCoreCompatibilityEntryPoints(const char *zSpaceCoreCompatDllFilePath, HMODULE &zSpaceCoreCompatDllModuleHandle, zSpaceCoreCompatEntryPoints &entryPoints)
Load the "zSpaceCoreCompatibility64.dll" shared library then load the zSpace Core Compatibility API e...
vtkZSpaceCoreCompatibilitySDKManager::zSpaceCoreCompatDllModuleHandle
HMODULE zSpaceCoreCompatDllModuleHandle
Definition: vtkZSpaceCoreCompatibilitySDKManager.h:119
vtkZSpaceCoreCompatibilitySDKManager::DisplayHandle
ZCCompatDisplay DisplayHandle
Definition: vtkZSpaceCoreCompatibilitySDKManager.h:110
vtkZSpaceCoreCompatibilitySDKManager::FrustumHandle
ZCCompatFrustum FrustumHandle
Definition: vtkZSpaceCoreCompatibilitySDKManager.h:112
vtkZSpaceCoreCompatibilitySDKManager::UpdateButtonState
void UpdateButtonState() override
Update the stylus buttons state.
vtkZSpaceCoreCompatibilitySDKManager::BeginFrame
void BeginFrame() override
Notify the zSpace SDK for the begining/end of a frame.
vtkZSpaceCoreCompatibilitySDKManager::UpdateViewAndProjectionMatrix
void UpdateViewAndProjectionMatrix() override
Update the zSpace view and projection matrix for each eye.
vtkZSpaceCoreCompatibilitySDKManager::EndFrame
void EndFrame() override
Notify the zSpace SDK for the begining/end of a frame.
vtkZSpaceCoreCompatibilitySDKManager::SetRenderWindow
void SetRenderWindow(vtkRenderWindow *) override
Set the render windwow the manager makes viewport computations from.
vtkZSpaceCoreCompatibilitySDKManager::ViewportHandle
ZCCompatViewport ViewportHandle
Definition: vtkZSpaceCoreCompatibilitySDKManager.h:111
vtkZSpaceSDKManager
Abstract zSpace SDK manager class.
Definition: vtkZSpaceSDKManager.h:50
vtkX3D::position
@ position
Definition: vtkX3D.h:261
zSpaceCoreCompatEntryPoints
Structure holding the loaded zSpace Core Compatibility API entry point function pointers.
Definition: vtkZSpaceCoreCompatibilitySDKManager.h:35
ZSMatrix4
Union representing 4x4 matrix (right-handed OpenGL column-major format). / This structure is used by ...
Definition: zSpaceTypes.h:80
ZC_COMPAT_SAMPLE_LOCAL_ENTRY_POINT_MEMBER
#define ZC_COMPAT_SAMPLE_LOCAL_ENTRY_POINT_MEMBER(undecoratedFuncName)
Definition: vtkZSpaceCoreCompatibilitySDKManager.h:40
vtkZSpaceSDKManager.h
ZC_COMPAT_REFLECTION_LIST_UNDECORATED_FUNC_NAMES
#define ZC_COMPAT_REFLECTION_LIST_UNDECORATED_FUNC_NAMES(_)
Definition: zSpaceCoreCompatibilityReflection.h:11
ZCCompatTarget
struct ZCCompatTargetOpaque * ZCCompatTarget
Definition: zSpaceCoreCompatibilityTypes.h:34
ZCCompatDisplay
struct ZCCompatDisplayOpaque * ZCCompatDisplay
Definition: zSpaceCoreCompatibilityTypes.h:25
ZCCompatViewport
struct ZCCompatViewportOpaque * ZCCompatViewport
Definition: zSpaceCoreCompatibilityTypes.h:28
ZCCompatContext
struct ZCCompatContextOpaque * ZCCompatContext
Definition: zSpaceCoreCompatibilityTypes.h:22
ZCCompatFrustum
struct ZCCompatFrustumOpaque * ZCCompatFrustum
Definition: zSpaceCoreCompatibilityTypes.h:31
zSpaceCoreCompatibility.h