NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
polaris.h
Go to the documentation of this file.
1 /*=======================================================================
2 
3  Program: NDI Combined API C Interface Library
4  Module: $RCSfile: polaris.h,v $
5  Creator: David Gobbi <dgobbi@atamai.com>
6  Language: C++
7  Author: $Author: dgobbi $
8  Date: $Date: 2005/07/01 22:52:05 $
9  Version: $Revision: 1.2 $
10 
11 ==========================================================================
12 
13 Copyright (c) 2000-2005 Atamai, Inc.
14 
15 Use, modification and redistribution of the software, in source or
16 binary forms, are permitted provided that the following terms and
17 conditions are met:
18 
19 1) Redistribution of the source code, in verbatim or modified
20  form, must retain the above copyright notice, this license,
21  the following disclaimer, and any notices that refer to this
22  license and/or the following disclaimer.
23 
24 2) Redistribution in binary form must include the above copyright
25  notice, a copy of this license and the following disclaimer
26  in the documentation or with other materials provided with the
27  distribution.
28 
29 3) Modified copies of the source code must be clearly marked as such,
30  and must not be misrepresented as verbatim copies of the source code.
31 
32 THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS"
33 WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO,
34 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
35 PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY
36 MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE
37 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES
38 (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE
39 OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF
40 THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE
41 POSSIBILITY OF SUCH DAMAGES.
42 
43 =======================================================================*/
44 
49 #ifndef POLARIS_H
50 #define POLARIS_H 1
51 
52 #define POLARIS_MAJOR_VERSION 3
53 #define POLARIS_MINOR_VERSION 2
54 
55 #include "PlusConfigure.h"
56 
57 #include "ndicapi.h"
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 #include <stdarg.h>
64 #include <stdio.h>
65 #include <string.h>
66 
67 typedef struct ndicapi polaris;
68 
69 /*=====================================================================*/
86 static char *plDeviceName(int i) { return ndiDeviceName(i); }
87 
109 static int plProbe(const char *device) { return ndiProbe(device); }
110 
120 static polaris *plOpen(const char *device) { return ndiOpen(device); }
121 
128 static void plClose(polaris *pol) { ndiClose(pol); }
129 
155 static void plSetThreadMode(polaris *pol, int mode) { ndiSetThreadMode(pol,mode); }
156 
193 static char *plCommand(polaris *pol, const char *format, ...) {
194  char *reply; va_list ap; va_start(ap,format);
195  reply = ndiCommandVA(pol, format, ap); va_end(ap); return reply; }
196 
202 static char *plCommandVA(polaris *pol, const char *format, va_list ap) {
203  return ndiCommandVA(pol, format, ap); }
204 
209 
218 static void plSetErrorCallback(polaris *pol,
219  PLErrorCallback callback,
220  void *userdata) {
221  ndiSetErrorCallback(pol, callback, userdata); }
222 
223 /*=====================================================================*/
235 /*\{*/
240 #define plRESET(p) plCommand((p),NULL)
241 
246 #define plINIT(p) plCommand((p),"INIT:")
247 
260 #define plCOMM(p,baud,dps,h) plCommand((p),"COMM:%d%03d%d",(baud),(dps),(h))
261 
274 #define plPVWR(p,port,a,x) plCommand((p),"PVWR:%c%04X%.128s",(port),(a),(x))
275 
282 #define plPVCLR(p,port) plCommand((p),"PVCLR:%c",(port))
283 
289 #define plPINIT(p,port) plCommand((p),"PINIT:%c",(port))
290 
297 #define plPENA(p,port,mode) plCommand((p),"PENA:%c%c",(port),(mode))
298 
304 #define plPDIS(p,port) plCommand((p),"PDIS:%c",(port))
305 
309 #define plTSTART(p) plCommand((p),"TSTART:")
310 
314 #define plTSTOP(p) plCommand((p),"TSTOP:")
315 
341 #define plGX(p,mode) plCommand((p),"GX:%04X",(mode))
342 
352 #define plLED(p,port,led,s) plCommand((p),"LED:%c%d%c",(port),(led),(s))
353 
364 #define plBEEP(p,n) plCommand((p),"BEEP:%i",(n))
365 
376 #define plVER(p,n) plCommand((p),"VER:%d",(n))
377 
394 #define plSFLIST(p,mode) plCommand((p),"SFLIST:%02X",(mode))
395 
402 #define plVSEL(p,n) plCommand((p),"VSEL:%d",(n))
403 
427 #define plPSTAT(p,format) plCommand((p),"PSTAT:%04X",(format))
428 
445 #define plSSTAT(p,format) plCommand((p),"SSTAT:%04X",(format))
446 
448 #define plPPRD(p,port,addr) plCommand((p),"PPRD:%c%04X",(port),(addr))
449 
451 #define plPPWR(p,port,a,x) plCommand((p),"PPWR:%c%04X%.128s",(port),(a),(x))
452 
454 #define plPURD(p,port,addr) plCommand((p),"PURD:%c%04X",(port),(addr))
455 
457 #define plPUWR(p,port,a,x) plCommand((p),"PPWR:%c%04X%.128s",(port),(a),(x))
458 
460 #define plPSEL(p,port,id) plCommand((p),"PSEL:%c%s",(port),(id))
461 
463 #define plPSRCH(p,port) plCommand((p),"PSRCH:%c",(port))
464 
466 #define plPVTIP(p,port,tip,np) plCommand((p),"PVTIP:%c%d%d",(port),(tip),(np))
467 
469 #define plTTCFG(p,port) plCommand((p),"TTCFG:%c",(port))
470 
472 #define plTCTST(p,port) plCommand((p),"TCTST:%c",(port))
473 
477 #define plDSTART(p) plCommand((p),"DSTART:")
478 
482 #define plDSTOP(p) plCommand((p),"DSTOP:")
483 
488 #define plIRINIT(p) plCommand((p),"IRINIT:")
489 
501 #define plIRCHK(p,mode) plCommand((p),"IRCHK:%04X",(mode))
502 
510 #define plIRED(p,port,sig) plCommand((p),"IRED:%c%08X",(port),(sig))
511 
523 #define pl3D(p,port,mode) plCommand((p),"3D:%c%d",(port),(mode))
524 
542 static int plPVWRFromFile(polaris *pol, int port, char *filename) {
543  unsigned char buffer[1024];
544  char hexdata[128];
545  FILE *file=NULL;
546  int addr;
547 
548  errno_t err = fopen_s (&file,filename, "rb");
549  if( err != 0)
550  {
551  LOG_ERROR("Error opening file: " << filename << " Error No.: " << err);
552  return -1;
553  }
554 
555  memset(buffer, 0, 1024); /* clear buffer to zero */
556  fread(buffer, 1, 1024, file); /* read at most 1k from file */
557  if (ferror(file)) {
558  fclose(file);
559  return -1;
560  }
561  fclose(file);
562 
563  for (addr = 0; addr < 1024; addr += 64) { /* write in chunks of 64 bytes */
564  plPVWR(pol, port, addr, ndiHexEncode(hexdata, &buffer[addr], 64));
565  if (ndiGetError(pol) != NDI_OKAY) {
566  return -1;
567  }
568  }
569 
570  return 0;
571 }
572 /*\}*/
573 
574 /*=====================================================================*/
598 static int plGetError(polaris *pol) { return ndiGetError(pol); }
599 
603 static char *plGetDeviceName(polaris *pol) { return ndiGetDeviceName(pol); }
604 
605 typedef NDIFileHandle PLFileHandle;
606 
612 static PLFileHandle plGetDeviceHandle(polaris *pol) { return ndiGetDeviceHandle(pol); }
613 
617 static int plGetThreadMode(polaris *pol) { return ndiGetThreadMode(pol); }
618 
648 static int plGetGXTransform(polaris *pol, int port, double transform[8]) {
649  return ndiGetGXTransform(pol, port, transform); }
650 
670 static int plGetGXPortStatus(polaris *pol, int port) {
671  return ndiGetGXPortStatus(pol, port); }
672 
686 static int plGetGXSystemStatus(polaris *pol) {
687  return ndiGetGXSystemStatus(pol); }
688 
704 static int plGetGXToolInfo(polaris *pol, int port) {
705  return ndiGetGXToolInfo(pol, port); }
706 
725 static int plGetGXMarkerInfo(polaris *pol, int port, int marker) {
726  return ndiGetGXMarkerInfo(pol, port, marker); }
727 
745 static int plGetGXSingleStray(polaris *pol, int port, double coord[3]) {
746  return ndiGetGXSingleStray(pol, port, coord); }
747 
760 static unsigned long plGetGXFrame(polaris *pol, int port) {
761  return ndiGetGXFrame(pol, port); }
762 
777  return ndiGetGXNumberOfPassiveStrays(pol); }
778 
799 static int plGetGXPassiveStray(polaris *pol, int i, double coord[3]) {
800  return ndiGetGXPassiveStray(pol, i, coord); }
801 
822 static int plGetPSTATPortStatus(polaris *pol, int port) {
823  return ndiGetPSTATPortStatus(pol, port); }
824 
845 static int plGetPSTATToolInfo(polaris *pol, int port, char information[30]) {
846  return ndiGetPSTATToolInfo(pol, port, information); }
847 
860 static unsigned long plGetPSTATCurrentTest(polaris *pol, int port) {
861  return ndiGetPSTATCurrentTest(pol, port); }
862 
881 static int plGetPSTATPartNumber(polaris *pol, int port, char part[20]) {
882  return ndiGetPSTATPartNumber(pol, port, part); }
883 
907 static int plGetPSTATAccessories(polaris *pol, int port) {
908  return plGetPSTATAccessories(pol, port); }
909 
935 static int plGetPSTATMarkerType(polaris *pol, int port) {
936  return ndiGetPSTATMarkerType(pol, port); }
937 
950 static int plGetSSTATControl(polaris *pol) {
951  return ndiGetSSTATControl(pol); }
952 
969 static int plGetSSTATSensors(polaris *pol) {
970  return ndiGetSSTATSensors(pol); }
971 
988 static int plGetSSTATTIU(polaris *pol) {
989  return ndiGetSSTATTIU(pol); }
990 
1001 static int plGetIRCHKDetected(polaris *pol) {
1002  return ndiGetIRCHKDetected(pol); }
1003 
1016 static int plGetIRCHKNumberOfSources(polaris *pol, int side) {
1017  return ndiGetIRCHKNumberOfSources(pol, side); }
1018 
1036 static int plGetIRCHKSourceXY(polaris *pol, int side, int i, double xy[2]) {
1037  return ndiGetIRCHKSourceXY(pol, side, i, xy); }
1038 
1039 /*=====================================================================*/
1051 static char *plErrorString(int errnum) {
1052  return ndiErrorString(errnum); }
1053 
1061 static unsigned long plHexToUnsignedLong(const char *cp, int n) {
1062  return ndiHexToUnsignedLong(cp, n); }
1063 
1072 static long plSignedToLong(const char *cp, int n) {
1073  return ndiSignedToLong(cp, n); }
1074 
1087 static char *plHexEncode(char *cp, const void *data, int n) {
1088  return ndiHexEncode(cp, data, n); }
1089 
1099 static void *plHexDecode(void *data, const char *cp, int n) {
1100  return ndiHexDecode(data, cp, n); }
1101 
1102 /*=====================================================================*/
1115 /*\{*/
1116 #define PL_OKAY 0x00
1117 #define PL_INVALID 0x01
1118 #define PL_TOO_LONG 0x02
1119 #define PL_TOO_SHORT 0x03
1120 #define PL_BAD_COMMAND_CRC 0x04
1121 #define PL_INTERN_TIMEOUT 0x05
1122 #define PL_COMM_FAIL 0x06
1123 #define PL_PARAMETERS 0x07
1124 #define PL_INVALID_PORT 0x08
1125 #define PL_INVALID_MODE 0x09
1126 #define PL_INVALID_LED 0x0a
1127 #define PL_LED_STATE 0x0b
1128 #define PL_BAD_MODE 0x0c
1129 #define PL_NO_TOOL 0x0d
1130 #define PL_PORT_NOT_INIT 0x0e
1131 #define PL_PORT_DISABLED 0x0f
1132 #define PL_INITIALIZATION 0x10
1133 #define PL_TSTOP_FAIL 0x11
1134 #define PL_TSTART_FAIL 0x12
1135 #define PL_PINIT_FAIL 0x13
1136 #define PL_CAMERA 0x14
1137 #define PL_INIT_FAIL 0x15
1138 #define PL_DSTART_FAIL 0x16
1139 #define PL_DSTOP_FAIL 0x17
1140 #define PL_IRCHK_FAIL 0x18
1141 #define PL_FIRMWARE 0x19
1142 #define PL_INTERNAL 0x1a
1143 #define PL_IRINIT_FAIL 0x1b
1144 #define PL_IRED_FAIL 0x1c
1145 #define PL_SROM_FAIL 0x1d
1146 #define PL_SROM_READ 0x1e
1147 #define PL_SROM_WRITE 0x1f
1148 #define PL_SROM_SELECT 0x20
1149 #define PL_PORT_CURRENT 0x21
1150 #define PL_WAVELENGTH 0x22
1151 #define PL_PARAMETER_RANGE 0x23
1152 #define PL_VOLUME 0x24
1153 #define PL_FEATURES 0x25
1155 #define PL_ENVIRONMENT 0xf1
1157 #define PL_EPROM_READ 0xf6
1158 #define PL_EPROM_WRITE 0xf5
1159 #define PL_EPROM_ERASE 0xf4
1161 /* error codes returned by the C api */
1162 
1163 #define PL_BAD_CRC 0x0100
1164 #define PL_OPEN_ERROR 0x0200
1165 #define PL_BAD_COMM 0x0300
1166 #define PL_TIMEOUT 0x0400
1167 #define PL_WRITE_ERROR 0x0500
1168 #define PL_READ_ERROR 0x0600
1169 #define PL_RESET_FAIL 0x0700
1170 #define PL_PROBE_FAIL 0x0800
1171 /*\}*/
1172 
1173 
1174 /* plCOMM() baud rates */
1175 /*\{*/
1176 #define PL_9600 0
1177 #define PL_14400 1
1178 #define PL_19200 2
1179 #define PL_38400 3
1180 #define PL_57600 4
1181 #define PL_115200 5
1182 /*\}*/
1183 
1184 /* plCOMM() data bits, parity and stop bits */
1185 /*\{*/
1186 #define PL_8N1 0 /* 8 data bits, no parity, 1 stop bit */
1187 #define PL_8N2 1 /* etc. */
1188 #define PL_8O1 10
1189 #define PL_8O2 11
1190 #define PL_8E1 20
1191 #define PL_8E2 21
1192 #define PL_7N1 100
1193 #define PL_7N2 101
1194 #define PL_7O1 110
1195 #define PL_7O2 111
1196 #define PL_7E1 120
1197 #define PL_7E2 121
1198 /*\}*/
1199 
1200 /* plCOMM() hardware handshaking */
1201 /*\{*/
1202 #define PL_NOHANDSHAKE 0
1203 #define PL_HANDSHAKE 1
1204 /*\}*/
1205 
1206 /* plPENA() tracking modes */
1207 /*\{*/
1208 #define PL_STATIC 'S' /* relatively immobile tool */
1209 #define PL_DYNAMIC 'D' /* dynamic tool (e.g. probe) */
1210 #define PL_BUTTON_BOX 'B' /* tool with no IREDs */
1211 /*\}*/
1212 
1213 /* plGX() reply mode bit definitions */
1214 /*\{*/
1215 #define PL_XFORMS_AND_STATUS 0x0001 /* transforms and status */
1216 #define PL_ADDITIONAL_INFO 0x0002 /* additional tool transform info */
1217 #define PL_SINGLE_STRAY 0x0004 /* stray active marker reporting */
1218 #define PL_FRAME_NUMBER 0x0008 /* frame number for each tool */
1219 #define PL_PASSIVE 0x8000 /* report passive tool information */
1220 #define PL_PASSIVE_EXTRA 0x2000 /* add 6 extra passive tools */
1221 #define PL_PASSIVE_STRAY 0x1000 /* stray passive marker reporting */
1222 /*\}*/
1223 
1224 /* return values that give the reason behind missing data */
1225 /*\{*/
1226 #define PL_DISABLED 1
1227 #define PL_MISSING 2
1228 #define PL_UNOCCUPIED 3
1229 /*\}*/
1230 
1231 /* plGetGXPortStatus() and plGetPSTATPortStatus() return value bits */
1232 /*\{*/
1233 #define PL_TOOL_IN_PORT 0x01
1234 #define PL_SWITCH_1_ON 0x02
1235 #define PL_SWITCH_2_ON 0x04
1236 #define PL_SWITCH_3_ON 0x08
1237 #define PL_INITIALIZED 0x10
1238 #define PL_ENABLED 0x20
1239 #define PL_OUT_OF_VOLUME 0x40 /* only for plGetGXPortStatus() */
1240 #define PL_PARTIALLY_IN_VOLUME 0x80 /* only for plGetGXPortStatus() */
1241 #define PL_CURRENT_DETECT 0x80 /* only for plGetPSTATPortStatus() */
1242 /*\}*/
1243 
1244 /* plGetGXSystemStatus() return value bits */
1245 /*\{*/
1246 #define PL_COMM_SYNC_ERROR 0x01
1247 #define PL_TOO_MUCH_EXTERNAL_INFRARED 0x02
1248 #define PL_COMM_CRC_ERROR 0x04
1249 /*\}*/
1250 
1251 /* plGetGXToolInfo() return value bits */
1252 /*\{*/
1253 #define PL_BAD_TRANSFORM_FIT 0x01
1254 #define PL_NOT_ENOUGH_MARKERS 0x02
1255 #define PL_TOOL_FACE_USED 0x70
1256 /*\}*/
1257 
1258 /* plGetGXMarkerInfo() return value bits */
1259 /*\{*/
1260 #define PL_MARKER_MISSING 0
1261 #define PL_MARKER_EXCEEDED_MAX_ANGLE 1
1262 #define PL_MARKER_EXCEEDED_MAX_ERROR 2
1263 #define PL_MARKER_USED 3
1264 /*\}*/
1265 
1266 /* plLED() states */
1267 /*\{*/
1268 #define PL_BLANK 'B' /* off */
1269 #define PL_FLASH 'F' /* flashing */
1270 #define PL_SOLID 'S' /* on */
1271 /*\}*/
1272 
1273 /* plPSTAT() reply mode bits */
1274 /*\{*/
1275 #define PL_BASIC 0x0001
1276 #define PL_TESTING 0x0002
1277 #define PL_PART_NUMBER 0x0004
1278 #define PL_ACCESSORIES 0x0008
1279 #define PL_MARKER_TYPE 0x0010
1280 /*\}*/
1281 
1282 /* plGetPSTATAccessories() return value bits */
1283 /*\{*/
1284 #define PL_TOOL_IN_PORT_SWITCH 0x01 /* tool has tool-in-port switch */
1285 #define PL_SWITCH_1 0x02 /* tool has button #1 */
1286 #define PL_SWITCH_2 0x04 /* tool has button #2 */
1287 #define PL_SWITCH_3 0x08 /* tool has button #3 */
1288 #define PL_TOOL_TRACKING_LED 0x10 /* tool has tracking LED */
1289 #define PL_LED_1 0x20 /* tool has LED #1 */
1290 #define PL_LED_2 0x40 /* tool has LED #2 */
1291 #define PL_LED_3 0x80 /* tool has LED #3 */
1292 /*\}*/
1293 
1294 /* plGetPSTATMarkerType() return value, the first 3 bits */
1295 /*\{*/
1296 #define PL_950NM 0x00
1297 #define PL_850NM 0x01
1298 /*\}*/
1299 
1300 /* plGetPSTATMarkerType() return value, the last 5 bits */
1301 /*\{*/
1302 #define PL_NDI_ACTIVE 0x08
1303 #define PL_NDI_CERAMIC 0x10
1304 #define PL_PASSIVE_ANY 0x20
1305 #define PL_PASSIVE_SPHERE 0x28
1306 #define PL_PASSIVE_DISC 0x30
1307 /*\}*/
1308 
1309 /* plSSTAT() reply format bits */
1310 /*\{*/
1311 #define PL_CONTROL 0x0001 /* control processor information */
1312 #define PL_SENSORS 0x0002 /* sensor processors */
1313 #define PL_TIU 0x0004 /* TIU processor */
1314 /*\}*/
1315 
1316 /* plGetSSTATControl() return value bits */
1317 /*\{*/
1318 #define PL_EPROM_CODE_CHECKSUM 0x01
1319 #define PL_EPROM_SYSTEM_CHECKSUM 0x02
1320 /*\}*/
1321 
1322 /* plGetSSTATSensor() return value bits */
1323 /*\{*/
1324 #define PL_LEFT_ROM_CHECKSUM 0x01
1325 #define PL_LEFT_SYNC_TYPE_1 0x02
1326 #define PL_LEFT_SYNC_TYPE_2 0x04
1327 #define PL_RIGHT_ROM_CHECKSUM 0x10
1328 #define PL_RIGHT_SYNC_TYPE_1 0x20
1329 #define PL_RIGHT_SYNC_TYPE_2 0x40
1330 /*\}*/
1331 
1332 /* plGetSSTATTIU() return value bits */
1333 /*\{*/
1334 #define PL_ROM_CHECKSUM 0x01
1335 #define PL_OPERATING_VOLTAGES 0x02
1336 #define PL_MARKER_SEQUENCING 0x04
1337 #define PL_SYNC 0x08
1338 #define PL_COOLING_FAN 0x10
1339 #define PL_INTERNAL_ERROR 0x20
1340 /*\}*/
1341 
1342 /* plIRCHK() reply mode bits */
1343 /*\{*/
1344 #define PL_DETECTED 0x0001 /* simple yes/no whether IR detected */
1345 #define PL_SOURCES 0x0002 /* locations of up to 20 sources per camera */
1346 /*\}*/
1347 
1348 /* plGetIRCHKNumberOfSources(), plGetIRCHKSourceXY() sensor arguments */
1349 /*\{*/
1350 #define PL_LEFT 0 /* left sensor */
1351 #define PL_RIGHT 1 /* right sensor */
1352 /*\}*/
1353 
1354 #ifdef __cplusplus
1355 }
1356 #endif
1357 
1358 #endif /* POLARIS_H */
1359 
void ndiSetThreadMode(ndicapi *pol, int mode)
static unsigned long plGetGXFrame(polaris *pol, int port)
Definition: polaris.h:760
static int plGetGXMarkerInfo(polaris *pol, int port, int marker)
Definition: polaris.h:725
unsigned long ndiHexToUnsignedLong(const char *cp, int n)
void(* NDIErrorCallback)(int errnum, char *description, void *userdata)
Definition: ndicapi.h:218
GLuint coord
Definition: glew.h:7061
static int plGetThreadMode(polaris *pol)
Definition: polaris.h:617
NDIErrorCallback PLErrorCallback
Definition: polaris.h:208
unsigned long ndiGetPSTATCurrentTest(ndicapi *pol, int port)
static char * plDeviceName(int i)
Definition: polaris.h:86
static int plGetPSTATMarkerType(polaris *pol, int port)
Definition: polaris.h:935
static void * plHexDecode(void *data, const char *cp, int n)
Definition: polaris.h:1099
char * ndiCommandVA(ndicapi *pol, const char *format, va_list ap)
static int plGetGXPortStatus(polaris *pol, int port)
Definition: polaris.h:670
char * ndiHexEncode(char *cp, const void *data, int n)
static int plGetIRCHKSourceXY(polaris *pol, int side, int i, double xy[2])
Definition: polaris.h:1036
static void plSetErrorCallback(polaris *pol, PLErrorCallback callback, void *userdata)
Definition: polaris.h:218
static char * plGetDeviceName(polaris *pol)
Definition: polaris.h:603
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
Definition: glew.h:1363
static int plGetPSTATPortStatus(polaris *pol, int port)
Definition: polaris.h:822
GLenum mode
Definition: glew.h:2404
void ndiClose(ndicapi *pol)
static int plGetPSTATPartNumber(polaris *pol, int port, char part[20])
Definition: polaris.h:881
int ndiGetPSTATToolInfo(ndicapi *pol, int port, char information[30])
static int plGetPSTATAccessories(polaris *pol, int port)
Definition: polaris.h:907
int ndiGetSSTATTIU(ndicapi *pol)
static char * plCommand(polaris *pol, const char *format,...)
Definition: polaris.h:193
GLuint GLenum GLenum transform
Definition: glew.h:12775
int ndiGetIRCHKNumberOfSources(ndicapi *pol, int side)
int ndiGetThreadMode(ndicapi *pol)
char * ndiGetDeviceName(ndicapi *pol)
static int plPVWRFromFile(polaris *pol, int port, char *filename)
Definition: polaris.h:542
NDIFileHandle ndiGetDeviceHandle(ndicapi *pol)
static unsigned long plHexToUnsignedLong(const char *cp, int n)
Definition: polaris.h:1061
GLenum GLvoid * addr
Definition: glew.h:10215
int ndiGetError(ndicapi *pol)
int ndiGetGXNumberOfPassiveStrays(ndicapi *pol)
int ndiGetGXSystemStatus(ndicapi *pol)
struct ndicapi ndicapi
Definition: ndicapi.h:65
NDIFileHandle PLFileHandle
Definition: polaris.h:605
int ndiProbe(const char *device)
static char * plErrorString(int errnum)
Definition: polaris.h:1051
static polaris * plOpen(const char *device)
Definition: polaris.h:120
int ndiGetGXPassiveStray(ndicapi *pol, int i, double coord[3])
static int plGetGXSystemStatus(polaris *pol)
Definition: polaris.h:686
int ndiGetGXToolInfo(ndicapi *pol, int port)
int ndiGetPSTATPartNumber(ndicapi *pol, int port, char part[20])
int ndiGetPSTATMarkerType(ndicapi *pol, int port)
char * ndiDeviceName(int i)
static int plGetGXToolInfo(polaris *pol, int port)
Definition: polaris.h:704
static void plClose(polaris *pol)
Definition: polaris.h:128
#define NDI_OKAY
No error.
Definition: ndicapi.h:1572
int ndiGetIRCHKDetected(ndicapi *pol)
static int plGetGXNumberOfPassiveStrays(polaris *pol)
Definition: polaris.h:776
void * ndiHexDecode(void *data, const char *cp, int n)
int ndiGetSSTATControl(ndicapi *pol)
static int plGetError(polaris *pol)
Definition: polaris.h:598
GLuint buffer
Definition: glew.h:1664
int ndiGetPSTATPortStatus(ndicapi *pol, int port)
static char * plCommandVA(polaris *pol, const char *format, va_list ap)
Definition: polaris.h:202
const GLchar * marker
Definition: glew.h:7764
int ndiGetGXSingleStray(ndicapi *pol, int port, double coord[3])
static long plSignedToLong(const char *cp, int n)
Definition: polaris.h:1072
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glew.h:1238
unsigned long ndiGetGXFrame(ndicapi *pol, int port)
static int plProbe(const char *device)
Definition: polaris.h:109
static PLFileHandle plGetDeviceHandle(polaris *pol)
Definition: polaris.h:612
int ndiGetIRCHKSourceXY(ndicapi *pol, int side, int i, double xy[2])
static int plGetGXSingleStray(polaris *pol, int port, double coord[3])
Definition: polaris.h:745
static int plGetSSTATControl(polaris *pol)
Definition: polaris.h:950
#define plPVWR(p, port, a, x)
Definition: polaris.h:274
int ndiGetSSTATSensors(ndicapi *pol)
struct ndicapi polaris
Definition: polaris.h:67
static int plGetIRCHKNumberOfSources(polaris *pol, int side)
Definition: polaris.h:1016
GLclampd n
Definition: glew.h:6789
void ndiSetErrorCallback(ndicapi *pol, NDIErrorCallback callback, void *userdata)
static void plSetThreadMode(polaris *pol, int mode)
Definition: polaris.h:155
static unsigned long plGetPSTATCurrentTest(polaris *pol, int port)
Definition: polaris.h:860
int ndiGetGXTransform(ndicapi *pol, int port, double transform[8])
static char * plHexEncode(char *cp, const void *data, int n)
Definition: polaris.h:1087
ndicapi * ndiOpen(const char *device)
static int plGetPSTATToolInfo(polaris *pol, int port, char information[30])
Definition: polaris.h:845
static int plGetGXPassiveStray(polaris *pol, int i, double coord[3])
Definition: polaris.h:799
char * ndiErrorString(int errnum)
int ndiGetGXPortStatus(ndicapi *pol, int port)
int ndiGetGXMarkerInfo(ndicapi *pol, int port, int marker)
long ndiSignedToLong(const char *cp, int n)
static int plGetGXTransform(polaris *pol, int port, double transform[8])
Definition: polaris.h:648
static int plGetIRCHKDetected(polaris *pol)
Definition: polaris.h:1001
static int plGetSSTATSensors(polaris *pol)
Definition: polaris.h:969
static int plGetSSTATTIU(polaris *pol)
Definition: polaris.h:988