|
Katana Plug-in APIs 0.1
|
00001 // Copyright (c) 2016 The Foundry Visionmongers Ltd. All Rights Reserved. 00002 00003 #ifndef FNVIEWER_FNVIEWPORTSUITE_H 00004 #define FNVIEWER_FNVIEWPORTSUITE_H 00005 00006 extern "C" 00007 { 00008 typedef struct FnViewportPluginStruct* FnViewportPluginHandle; 00009 typedef struct FnViewportHostStruct* FnViewportHostHandle; 00010 00011 typedef struct FnViewerDelegatePluginStruct* FnViewerDelegatePluginHandle; 00012 typedef struct FnViewerDelegateHostStruct* FnViewerDelegateHostHandle; 00013 00014 // Forward declarations 00015 struct FnViewerDelegatePluginSuite_v3; 00016 struct FnViewportLayerPluginSuite_v2; 00017 struct FnViewportCameraPluginSuite_v2; 00018 struct FnManipulatorPluginSuite_v1; 00019 00020 #include <FnAttribute/suite/FnAttributeSuite.h> 00021 #include <FnGeolib/suite/FnGeolibRuntimeSuite.h> 00022 00023 #include "FnViewerDelegateSuite.h" 00024 #include "FnViewportLayerSuite.h" 00025 #include "FnViewportCameraSuite.h" 00026 #include "FnManipulatorSuite.h" 00027 00028 #define FnViewportPluginSuite_version 2 00029 #define FnViewportHostSuite_version 3 00030 00031 struct FnViewportPluginSuite_v2 00032 { 00033 FnViewportPluginHandle (*create)(FnViewportHostHandle hostHandle); 00034 00035 void (*destroy)(FnViewportPluginHandle handle); 00036 00037 void (*setup)(FnViewportPluginHandle handle); 00038 00039 void (*cleanup)(FnViewportPluginHandle handle); 00040 00041 bool (*event)( FnViewportPluginHandle handle, 00042 FnAttributeHandle eventAttrHandle); 00043 00044 void (*draw)(FnViewportPluginHandle handle); 00045 00046 void (*resize)( FnViewportPluginHandle handle, 00047 unsigned int width, unsigned int height); 00048 00049 void (*hover)( FnViewportPluginHandle handle, uint8_t isHovering, 00050 int x, int y); 00051 00052 void (*setOption)( 00053 FnViewportPluginHandle handle, uint64_t optionId, 00054 FnAttributeHandle attr); 00055 00056 FnAttributeHandle (*getOption)( 00057 FnViewportPluginHandle handle, uint64_t optionId); 00058 00059 void (*freeze)(FnViewportPluginHandle handle); 00060 00061 void (*thaw)(FnViewportPluginHandle handle); 00062 00063 void (*pickerDraw)(FnViewportPluginHandle handle, 00064 unsigned int x, unsigned int y, 00065 unsigned int w, unsigned int h, 00066 FnAttributeHandle ignoreAttrHandle); 00067 00068 int (*customPick)(FnViewportPluginHandle handle, 00069 unsigned int x, unsigned int y, 00070 unsigned int w, unsigned int h, 00071 int deepPicking, 00072 FnAttributeHandle& pickedObjectsAttrHandle, 00073 float* singlePointDepth); 00074 }; 00075 00076 struct FnViewportHostSuite_v3 00077 { 00078 const char* (*getName)(FnViewportHostHandle handle); 00079 00080 void(*getViewerDelegate)( 00081 FnViewportHostHandle handle, 00082 FnViewerDelegateHostHandle* viewerDelegateHostHandle, 00083 FnViewerDelegatePluginHandle* viewerDelegatePluginHandle, 00084 FnViewerDelegatePluginSuite_v3** viewerDelegatePluginSuite); 00085 00086 void(*getActiveCamera)( 00087 FnViewportHostHandle handle, 00088 FnViewportCameraHostHandle* viewportCameraHostHandle, 00089 FnViewportCameraPluginHandle* viewportCameraPluginHandle, 00090 FnViewportCameraPluginSuite_v2** viewportCameraPluginSuite); 00091 00092 void(*addCamera)( 00093 FnViewportHostHandle handle, 00094 const char* pluginName, 00095 const char* name, 00096 FnViewportCameraHostHandle* viewportCameraHostHandle, 00097 FnViewportCameraPluginHandle* viewportCameraPluginHandle, 00098 FnViewportCameraPluginSuite_v2** viewportCameraPluginSuite); 00099 00100 void(*removeCamera)( 00101 FnViewportHostHandle handle, 00102 FnViewportCameraHostHandle camera); 00103 00104 void(*setActiveCamera)( 00105 FnViewportHostHandle handle, 00106 FnViewportCameraHostHandle camera); 00107 00108 void(*getCameraByName)( 00109 FnViewportHostHandle handle, const char* name, 00110 FnViewportCameraHostHandle* viewportCameraHostHandle, 00111 FnViewportCameraPluginHandle* viewportCameraPluginHandle, 00112 FnViewportCameraPluginSuite_v2** viewportCameraPluginSuite); 00113 00114 void(*getCameraByIndex)( 00115 FnViewportHostHandle handle, unsigned int index, 00116 FnViewportCameraHostHandle* viewportCameraHostHandle, 00117 FnViewportCameraPluginHandle* viewportCameraPluginHandle, 00118 FnViewportCameraPluginSuite_v2** viewportCameraPluginSuite); 00119 00120 void(*removeCameraByName)(FnViewportHostHandle handle, 00121 const char* name); 00122 00123 void(*removeCameraByIndex)(FnViewportHostHandle handle, 00124 unsigned int index); 00125 00126 int(*getNumberOfCameras)(FnViewportHostHandle handle); 00127 00128 const char* (*getCameraName)(FnViewportHostHandle handle, 00129 unsigned int index); 00130 00131 int(*getCameraIndex)(FnViewportHostHandle handle, 00132 const char* name); 00133 00134 00135 bool(*event)(FnViewportHostHandle handle, 00136 FnAttributeHandle eventAttrHandle); 00137 00138 void(*draw)(FnViewportHostHandle handle); 00139 00140 void(*resize)(FnViewportHostHandle handle, 00141 unsigned int width, unsigned int height); 00142 00143 unsigned int(*getWidth)(FnViewportHostHandle handle); 00144 00145 unsigned int(*getHeight)(FnViewportHostHandle handle); 00146 00147 int(*isDirty)(FnViewportHostHandle handle); 00148 00149 void(*setDirty)(FnViewportHostHandle handle, int dirty); 00150 00151 void(*addLayer)( 00152 FnViewportHostHandle handle, 00153 const char* pluginName, const char* name, 00154 FnViewportLayerHostHandle* viewportLayerHostHandle, 00155 FnViewportLayerPluginHandle* viewportLayerPluginHandle, 00156 FnViewportLayerPluginSuite_v2** viewportLayerPluginSuite); 00157 00158 void(*insertLayer)( 00159 FnViewportHostHandle handle, const char* pluginName, 00160 const char* name, unsigned int index, 00161 FnViewportLayerHostHandle* viewportLayerHostHandle, 00162 FnViewportLayerPluginHandle* viewportLayerPluginHandle, 00163 FnViewportLayerPluginSuite_v2** viewportLayerPluginSuite); 00164 00165 void(*getLayerByName)( 00166 FnViewportHostHandle handle, const char* name, 00167 FnViewportLayerHostHandle* viewportLayerHostHandle, 00168 FnViewportLayerPluginHandle* viewportLayerPluginHandle, 00169 FnViewportLayerPluginSuite_v2** viewportLayerPluginSuite); 00170 00171 void(*getLayerByIndex)( 00172 FnViewportHostHandle handle, unsigned int index, 00173 FnViewportLayerHostHandle* viewportLayerHostHandle, 00174 FnViewportLayerPluginHandle* viewportLayerPluginHandle, 00175 FnViewportLayerPluginSuite_v2** viewportLayerPluginSuite); 00176 00177 void(*removeLayerByName)(FnViewportHostHandle handle, 00178 const char* name); 00179 00180 void(*removeLayerByIndex)(FnViewportHostHandle handle, 00181 unsigned int index); 00182 00183 int(*getNumberOfLayers)(FnViewportHostHandle handle); 00184 00185 const char* (*getLayerName)(FnViewportHostHandle handle, 00186 unsigned int index); 00187 00188 int(*getLayerIndex)(FnViewportHostHandle handle, 00189 const char* name); 00190 00191 const double* (*getViewMatrix)(FnViewportHostHandle handle); 00192 00193 const double* (*getProjectionMatrix)(FnViewportHostHandle handle); 00194 void(*activateManipulator)(FnViewportHostHandle handle, 00195 const char* name, FnAttributeHandle locationPathsAttr); 00196 00197 void(*deactivateManipulator)(FnViewportHostHandle handle, 00198 const char* name); 00199 00200 void(*deactivateAllManipulators)(FnViewportHostHandle handle); 00201 00202 unsigned int(*getNumberOfActiveManipulators)( 00203 FnViewportHostHandle handle); 00204 00205 void(*getActiveManipulatorByIndex)( 00206 FnViewportHostHandle handle, unsigned int index, 00207 FnManipulatorHostHandle* manipulatorHostHandle, 00208 FnManipulatorPluginHandle* manipulatorPluginHandle, 00209 FnManipulatorPluginSuite_v1** manipulatorPluginSuite); 00210 00211 void(*getActiveManipulatorByName)( 00212 FnViewportHostHandle handle, const char* pluginName, 00213 FnManipulatorHostHandle* manipulatorHostHandle, 00214 FnManipulatorPluginHandle* manipulatorPluginHandle, 00215 FnManipulatorPluginSuite_v1** manipulatorPluginSuite); 00216 00218 int(*detectGLContext)(FnViewportHostHandle handle); 00219 00220 int(*makeGLContextCurrent)(FnViewportHostHandle handle); 00221 00222 int(*doneGLContextCurrent)(FnViewportHostHandle handle); 00223 00224 int(*isGLContextCurrent)(FnViewportHostHandle handle); 00225 00226 void(*enableCap)(FnViewportHostHandle handle, uint32_t cap); 00227 void(*disableCap)(FnViewportHostHandle handle, uint32_t cap); 00228 00229 uint64_t (*addPickableObject)(FnViewportHostHandle handle, 00230 FnAttributeHandle attrHandle); 00231 00232 FnAttributeHandle (*pick)(FnViewportHostHandle handle, 00233 unsigned int x, unsigned int y, 00234 unsigned int w, unsigned int h, 00235 int deepPicking, 00236 float* singlePointDepth); 00237 00238 void (*setViewFrozen)(FnViewportHostHandle handle, int isViewFrozen); 00239 int (*isViewFrozen)(FnViewportHostHandle handle); 00240 void (*setPanAndZoomActive)(FnViewportHostHandle handle, int active); 00241 int (*isPanAndZoomActive)(FnViewportHostHandle handle); 00242 00244 int (*initGLContext)(FnViewportHostHandle handle); 00245 00246 unsigned int (*getDefaultFramebufferObject)( 00247 FnViewportHostHandle handle); 00248 00249 float (*getHorizontalOffset)(FnViewportHostHandle handle); 00250 float (*getVerticalOffset)(FnViewportHostHandle handle); 00251 float (*getZoom)(FnViewportHostHandle handle); 00252 }; 00253 } 00254 00255 #endif //FNVIEWER_FNVIEWPORTSUITE_H
1.7.3