PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusDeviceFactory.cxx
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2 Program: Plus
3 Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4 See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 // Local includes
8 #include "PlusConfigure.h"
9 #include "vtkPlusDevice.h"
10 #include "vtkPlusDeviceFactory.h"
11 
12 // VTK includes
13 #include <vtkObjectFactory.h>
14 
15 //----------------------------------------------------------------------------
16 // Virtual devices
17 #include "vtkPlusVirtualMixer.h"
18 #include "vtkPlusVirtualSwitcher.h"
19 #include "vtkPlusVirtualCapture.h"
24 #ifdef PLUS_USE_TextRecognizer
26 #endif
27 
28 //----------------------------------------------------------------------------
29 // Tracker devices
30 #include "vtkPlusDataSource.h"
31 #include "vtkPlusBuffer.h"
32 #ifdef PLUS_USE_OpenIGTLink
34 #endif
35 #ifdef PLUS_USE_NDI
36 #include "vtkPlusNDITracker.h"
37 #endif
38 #ifdef PLUS_USE_NDI_CERTUS
40 #endif
41 #ifdef PLUS_USE_MICRONTRACKER
42 #include "vtkPlusMicronTracker.h"
43 #endif
44 #ifdef PLUS_USE_WITMOTIONTRACKER
46 #endif
47 #ifdef PLUS_USE_INTELREALSENSE
48 #include "vtkPlusIntelRealSense.h"
49 #endif
50 #ifdef PLUS_USE_OPTICAL_MARKER_TRACKER
52 #endif
53 #ifdef PLUS_USE_ATRACSYS
54 #include "vtkPlusAtracsysTracker.h"
55 #endif
56 #ifdef PLUS_USE_STEALTHLINK
58 #endif
59 #ifdef PLUS_USE_BRACHY_TRACKER
60 #include "vtkPlusBrachyTracker.h"
61 #endif
62 #ifdef PLUS_USE_USDIGITALENCODERS_TRACKER
64 #endif
65 #ifdef PLUS_USE_Ascension3DG
67 #endif
68 #ifdef PLUS_USE_Ascension3DGm
69 #include "vtkAscension3DGmTracker.h"
70 #endif
71 #ifdef PLUS_USE_OPTIMET_CONOPROBE
73 #endif
74 #ifdef PLUS_USE_OPTITRACK
75 #include "vtkPlusOptiTrack.h"
76 #endif
77 #ifdef PLUS_USE_PHIDGET_SPATIAL_TRACKER
79 #endif
80 #include "vtkPlusFakeTracker.h"
83 #ifdef PLUS_USE_3dConnexion_TRACKER
84 // 3dConnexion tracker is supported on Windows only
86 #endif
87 #ifdef PLUS_USE_AGILENT
89 #endif
90 #ifdef PLUS_USE_LEAPMOTION
91 #include "vtkPlusLeapMotion.h"
92 #endif
93 #ifdef PLUS_USE_STEAMVR
94 #include "vtkPlusSteamVRTracker.h"
95 #endif
96 #ifdef PLUS_USE_PICOSCOPE
98 #endif
99 
100 //----------------------------------------------------------------------------
101 // Video sources
102 #include "vtkPlusSavedDataSource.h"
104 
105 #ifdef PLUS_USE_VFW_VIDEO
107 #endif
108 
109 #ifdef PLUS_USE_MMF_VIDEO
110 #include "vtkPlusMmfVideoSource.h"
111 #endif
112 
113 #ifdef PLUS_USE_ULTRASONIX_VIDEO
114 #include "vtkPlusSonixVideoSource.h"
116 #endif
117 
118 #ifdef PLUS_USE_BKPROFOCUS_VIDEO
120 #ifdef PLUS_USE_BKPROFOCUS_CAMERALINK
122 #endif
123 #endif
124 
125 #ifdef PLUS_USE_ICCAPTURING_VIDEO
127 #endif
128 
129 #ifdef PLUS_USE_INTERSON_VIDEO
131 #endif
132 
133 #ifdef PLUS_USE_INTERSONSDKCXX_VIDEO
135 #endif
136 
137 #ifdef PLUS_USE_INTERSONARRAYSDKCXX_VIDEO
139 #endif
140 
141 #ifdef PLUS_USE_TELEMED_VIDEO
143 #endif
144 
145 #ifdef PLUS_USE_SPINNAKER_VIDEO
147 #endif
148 
149 #ifdef PLUS_USE_BLACKMAGIC_DECKLINK
151 #endif
152 
153 #ifdef PLUS_USE_THORLABS_VIDEO
155 #endif
156 
157 #ifdef PLUS_USE_OpenIGTLink
159 #endif
160 
161 #ifdef PLUS_USE_EPIPHAN
163 #endif
164 
165 #ifdef PLUS_USE_IntuitiveDaVinci
167 #endif
168 
169 #ifdef PLUS_USE_PHILIPS_3D_ULTRASOUND
171 #endif
172 
173 #ifdef PLUS_USE_CAPISTRANO_VIDEO
175 #endif
176 
177 #ifdef PLUS_USE_WINPROBE_VIDEO
179 #endif
180 
181 #ifdef PLUS_USE_NVIDIA_DVP
182 #if WIN32
184 #elif __linux__
186 #else
187 // TODO : add mac support
188 #endif
189 #endif
190 
191 #ifdef PLUS_USE_OvrvisionPro
193 #endif
194 
195 #ifdef PLUS_USE_OpenCV_VIDEO
197 #endif
198 
199 #ifdef PLUS_USE_OPENHAPTICS
201 #endif
202 
203 #ifdef PLUS_USE_V4L2
204 #include "vtkPlusV4L2VideoSource.h"
205 #endif
206 
207 #ifdef PLUS_USE_INFRARED_SEEK_CAM
208 #include "vtkInfraredSeekCam.h"
209 #endif
210 
211 #ifdef PLUS_USE_ANDOR_CAMERA
212 #include "vtkPlusAndorVideoSource.h"
213 #endif
214 
215 #ifdef PLUS_USE_INFRARED_TEQ1_CAM
216 #include "vtkInfraredTEQ1Cam.h"
217 #endif
218 
219 #ifdef PLUS_USE_INFRARED_TEEV2_CAM
220 #include "vtkPlusInfraredTEEV2Cam.h"
221 #endif
222 
223 #ifdef PLUS_USE_ULTRAVIOLET_PCOUV_CAM
225 #endif
226 
227 #ifdef PLUS_USE_DAQVIDEOSOURCE
228 #include "vtkPlusDAQVideoSource.h"
229 #endif
230 
231 #ifdef PLUS_USE_GENERIC_SENSOR_TRACKER
232 #if WIN32
234 #endif
235 #endif
236 
237 #ifdef PLUS_USE_AZUREKINECT
238 #include "vtkPlusAzureKinect.h"
239 #endif
240 
241 #ifdef PLUS_USE_REVOPOINT3DCAMERA
243 #endif
244 
245 #ifdef PLUS_USE_CLARIUS
246 #include "vtkPlusClarius.h"
247 #endif
248 
249 #ifdef PLUS_USE_CLARIUS_OEM
250 #include "vtkPlusClariusOEM.h"
251 #endif
252 
253 //----------------------------------------------------------------------------
254 
256 
257 //----------------------------------------------------------------------------
259 {
260  RegisterDevice("FakeTracker", "vtkPlusFakeTracker", (PointerToDevice)&vtkPlusFakeTracker::New);
261  RegisterDevice("ChRobotics", "vtkPlusChRoboticsTracker", (PointerToDevice)&vtkPlusChRoboticsTracker::New);
262  RegisterDevice("Microchip", "vtkPlusMicrochipTracker", (PointerToDevice)&vtkPlusMicrochipTracker::New);
263 
264 #ifdef PLUS_USE_3dConnexion_TRACKER
265  // 3dConnexion tracker is supported on Windows only
266  RegisterDevice("3dConnexion", "vtkPlus3dConnexionTracker", (PointerToDevice)&vtkPlus3dConnexionTracker::New);
267 #endif
268 #ifdef PLUS_USE_OpenIGTLink
269  RegisterDevice("OpenIGTLinkTracker", "vtkPlusOpenIGTLinkTracker", (PointerToDevice)&vtkPlusOpenIGTLinkTracker::New);
270 #endif
271 #ifdef PLUS_USE_BRACHY_TRACKER
272  RegisterDevice("BrachyTracker", "vtkPlusBrachyTracker", (PointerToDevice)&vtkPlusBrachyTracker::New);
273 #endif
274 #ifdef PLUS_USE_USDIGITALENCODERS_TRACKER
275  RegisterDevice("USDigitalEncodersTracker", "vtkPlusUSDigitalEncodersTracker", (PointerToDevice)&vtkPlusUSDigitalEncodersTracker::New);
276 #endif
277 #ifdef PLUS_USE_NDI_CERTUS
278  RegisterDevice("CertusTracker", "vtkPlusNDICertusTracker", (PointerToDevice)&vtkPlusNDICertusTracker::New);
279 #endif
280 #ifdef PLUS_USE_NDI
281  RegisterDevice("NDITracker", "vtkPlusNDITracker", (PointerToDevice)&vtkPlusNDITracker::New);
282  RegisterDevice("PolarisTracker", "vtkPlusNDITracker", (PointerToDevice)&vtkPlusNDITracker::New);
283  RegisterDevice("AuroraTracker", "vtkPlusNDITracker", (PointerToDevice)&vtkPlusNDITracker::New);
284 #endif
285 #ifdef PLUS_USE_MICRONTRACKER
286  RegisterDevice("MicronTracker", "vtkPlusMicronTracker", (PointerToDevice)&vtkPlusMicronTracker::New);
287 #endif
288 #ifdef PLUS_USE_WITMOTIONTRACKER
289  RegisterDevice("WitMotionTracker", "vtkPlusWitMotionTracker", (PointerToDevice)&vtkPlusWitMotionTracker::New);
290 #endif
291 #ifdef PLUS_USE_INTELREALSENSE
292  RegisterDevice("IntelRealSense", "vtkPlusIntelRealSense", (PointerToDevice)&vtkPlusIntelRealSense::New);
293 #endif
294 
295 #ifdef PLUS_USE_OPTICAL_MARKER_TRACKER
296  RegisterDevice("OpticalMarkerTracker", "vtkPlusOpticalMarkerTracker", (PointerToDevice)&vtkPlusOpticalMarkerTracker::New);
297 #endif
298 #ifdef PLUS_USE_ATRACSYS
299  RegisterDevice("AtracsysTracker", "vtkPlusAtracsysTracker", (PointerToDevice)&vtkPlusAtracsysTracker::New);
300 #endif
301 #ifdef PLUS_USE_STEALTHLINK
302  RegisterDevice("StealthLinkTracker", "vtkPlusStealthLinkTracker", (PointerToDevice)&vtkPlusStealthLinkTracker::New);
303 #endif
304 #ifdef PLUS_USE_Ascension3DG
305  RegisterDevice("Ascension3DG", "vtkAscension3DGTracker", (PointerToDevice)&vtkAscension3DGTracker::New);
306 #endif
307 #ifdef PLUS_USE_Ascension3DGm
308  RegisterDevice("Ascension3DGm", "vtkAscension3DGmTracker", (PointerToDevice)&vtkAscension3DGmTracker::New);
309 #endif
310 #ifdef PLUS_USE_PHIDGET_SPATIAL_TRACKER
311  RegisterDevice("PhidgetSpatial", "vtkPlusPhidgetSpatialTracker", (PointerToDevice)&vtkPlusPhidgetSpatialTracker::New);
312 #endif
313 #ifdef PLUS_USE_LEAPMOTION
314  RegisterDevice("LeapMotion", "vtkPlusLeapMotion", (PointerToDevice)&vtkPlusLeapMotion::New);
315 #endif
316 
317  RegisterDevice("SavedDataSource", "vtkPlusSavedDataSource", (PointerToDevice)&vtkPlusSavedDataSource::New);
318  RegisterDevice("UsSimulator", "vtkPlusUsSimulatorVideoSource", (PointerToDevice)&vtkPlusUsSimulatorVideoSource::New);
319  RegisterDevice("ImageProcessor", "vtkPlusImageProcessorVideoSource", (PointerToDevice)&vtkPlusImageProcessorVideoSource::New);
320  RegisterDevice("GenericSerialDevice", "vtkPlusGenericSerialDevice", (PointerToDevice)&vtkPlusGenericSerialDevice::New);
321  RegisterDevice("NoiseVideo", "vtkPlusDevice", (PointerToDevice)&vtkPlusDevice::New);
322 #ifdef PLUS_USE_OpenIGTLink
323  RegisterDevice("OpenIGTLinkVideo", "vtkPlusOpenIGTLinkVideoSource", (PointerToDevice)&vtkPlusOpenIGTLinkVideoSource::New);
324 #endif
325 #ifdef PLUS_USE_OPTIMET_CONOPROBE
326  RegisterDevice("OptimetConoProbe", "vtkPlusOptimetConoProbeMeasurer", (PointerToDevice)&vtkPlusOptimetConoProbeMeasurer::New);
327 #endif
328 #ifdef PLUS_USE_OPTITRACK
329  RegisterDevice("OptiTrack", "vtkPlusOptiTrack", (PointerToDevice)&vtkPlusOptiTrack::New);
330 #endif
331 #ifdef PLUS_USE_ULTRASONIX_VIDEO
332  RegisterDevice("SonixVideo", "vtkPlusSonixVideoSource", (PointerToDevice)&vtkPlusSonixVideoSource::New);
333  RegisterDevice("SonixPortaVideo", "vtkPlusSonixPortaVideoSource", (PointerToDevice)&vtkPlusSonixPortaVideoSource::New);
334 #endif
335 #ifdef PLUS_USE_BKPROFOCUS_VIDEO
336  RegisterDevice("BkProFocusOem", "vtkPlusBkProFocusOemVideoSource", (PointerToDevice)&vtkPlusBkProFocusOemVideoSource::New);
337 #ifdef PLUS_USE_BKPROFOCUS_CAMERALINK
338  RegisterDevice("BkProFocusCameraLink", "vtkPlusBkProFocusCameraLinkVideoSource", (PointerToDevice)&vtkPlusBkProFocusCameraLinkVideoSource::New);
339  RegisterDevice("BkProFocus", "vtkPlusBkProFocusCameraLinkVideoSource", (PointerToDevice)&vtkPlusBkProFocusCameraLinkVideoSource::New);
340 #endif
341 #endif
342 #ifdef PLUS_USE_VFW_VIDEO
343  RegisterDevice("VFWVideo", "vtkPlusWin32VideoSource2", (PointerToDevice)&vtkPlusWin32VideoSource2::New);
344 #endif
345 #ifdef PLUS_USE_MMF_VIDEO
346  RegisterDevice("MmfVideo", "vtkPlusMmfVideoSource", (PointerToDevice)&vtkPlusMmfVideoSource::New);
347 #endif
348 #ifdef PLUS_USE_ICCAPTURING_VIDEO
349  RegisterDevice("ICCapturing", "vtkPlusICCapturingSource", (PointerToDevice)&vtkPlusICCapturingSource::New);
350 #endif
351 #ifdef PLUS_USE_INTERSON_VIDEO
352  RegisterDevice("IntersonVideo", "vtkPlusIntersonVideoSource", (PointerToDevice)&vtkPlusIntersonVideoSource::New);
353 #endif
354 #ifdef PLUS_USE_INTERSONSDKCXX_VIDEO
355  RegisterDevice("IntersonSDKCxxVideo", "vtkPlusIntersonSDKCxxVideoSource", (PointerToDevice)&vtkPlusIntersonSDKCxxVideoSource::New);
356 #endif
357 #ifdef PLUS_USE_INTERSONARRAYSDKCXX_VIDEO
358  RegisterDevice("IntersonArraySDKCxxVideo", "vtkPlusIntersonArraySDKCxxVideoSource", (PointerToDevice)&vtkPlusIntersonArraySDKCxxVideoSource::New);
359 #endif
360 #ifdef PLUS_USE_TELEMED_VIDEO
361  RegisterDevice("TelemedVideo", "vtkPlusTelemedVideoSource", (PointerToDevice)&vtkPlusTelemedVideoSource::New);
362 #endif
363 #ifdef PLUS_USE_SPINNAKER_VIDEO
364  RegisterDevice("SpinnakerVideo", "vtkPlusSpinnakerVideoSource", (PointerToDevice)&vtkPlusSpinnakerVideoSource::New);
365 #endif
366 #ifdef PLUS_USE_BLACKMAGIC_DECKLINK
367  RegisterDevice("DeckLinkVideo", "vtkPlusDeckLinkVideoSource", (PointerToDevice)&vtkPlusDeckLinkVideoSource::New);
368 #endif
369 #ifdef PLUS_USE_THORLABS_VIDEO
370  RegisterDevice("ThorLabsVideo", "vtkPlusThorLabsVideoSource", (PointerToDevice)&vtkPlusThorLabsVideoSource::New);
371 #endif
372 #ifdef PLUS_USE_EPIPHAN
373  RegisterDevice("Epiphan", "vtkPlusEpiphanVideoSource", (PointerToDevice)&vtkPlusEpiphanVideoSource::New);
374 #endif
375 
376 #ifdef PLUS_USE_IntuitiveDaVinci
377  RegisterDevice("IntuitiveDaVinci", "vtkPlusIntuitiveDaVinciTracker", (PointerToDevice)&vtkPlusIntuitiveDaVinciTracker::New);
378 #endif
379 
380 #ifdef PLUS_USE_PHILIPS_3D_ULTRASOUND
381  RegisterDevice("iE33Video", "vtkPlusPhilips3DProbeVideoSource", (PointerToDevice)&vtkPlusPhilips3DProbeVideoSource::New);
382 #endif
383 
384 #ifdef PLUS_USE_CAPISTRANO_VIDEO
385  RegisterDevice("CapistranoVideo", "vtkPlusCapistranoVideoSource", (PointerToDevice)&vtkPlusCapistranoVideoSource::New);
386 #endif
387 
388 #ifdef PLUS_USE_WINPROBE_VIDEO
389  RegisterDevice("WinProbeVideo", "vtkPlusWinProbeVideoSource", (PointerToDevice)&vtkPlusWinProbeVideoSource::New);
390 #endif
391 
392 #ifdef PLUS_USE_TextRecognizer
393  RegisterDevice("VirtualTextRecognizer", "vtkPlusVirtualTextRecognizer", (PointerToDevice)&vtkPlusVirtualTextRecognizer::New);
394 #endif
395 #ifdef PLUS_USE_NVIDIA_DVP
396  RegisterDevice("NVidiaDVP", "vtkPlusNvidiaDVPVideoSource", (PointerToDevice)&vtkPlusNvidiaDVPVideoSource::New);
397 #endif
398 
399 #ifdef PLUS_USE_OvrvisionPro
400  RegisterDevice("OvrvisionPro", "vtkPlusOvrvisionProVideoSource", (PointerToDevice)&vtkPlusOvrvisionProVideoSource::New);
401 #endif
402 #ifdef PLUS_USE_AGILENT
403  RegisterDevice("AgilentScope", "vtkPlusAgilentScopeTracker", (PointerToDevice)&vtkPlusAgilentScopeTracker::New);
404 #endif
405 #ifdef PLUS_USE_PICOSCOPE
406  RegisterDevice("PicoScope", "vtkPlusPicoScopeDataSource", (PointerToDevice)&vtkPlusPicoScopeDataSource::New);
407 #endif
408 #ifdef PLUS_USE_OpenCV_VIDEO
409  RegisterDevice("OpenCVVideo", "vtkPlusOpenCVCaptureVideoSource", (PointerToDevice)&vtkPlusOpenCVCaptureVideoSource::New);
410 #endif
411 
412 #ifdef PLUS_USE_V4L2
413  RegisterDevice("V4L2Video", "vtkPlusV4L2VideoSource", (PointerToDevice)&vtkPlusV4L2VideoSource::New);
414 #endif
415 
416 #ifdef PLUS_USE_OPENHAPTICS
417  RegisterDevice("OpenHaptics", "vtkPlusOpenHapticsDevice", (PointerToDevice)&vtkPlusOpenHapticsDevice::New);
418 #endif
419 
420 #ifdef PLUS_USE_INFRARED_SEEK_CAM
421  RegisterDevice("InfraredSeekCam", "vtkInfraredSeekCam", (PointerToDevice)&vtkInfraredSeekCam::New);
422 #endif
423 
424 #ifdef PLUS_USE_ANDOR_CAMERA
425  RegisterDevice("AndorCamera", "vtkPlusAndorVideoSource", (PointerToDevice)&vtkPlusAndorVideoSource::New);
426 #endif
427 
428 #ifdef PLUS_USE_INFRARED_TEQ1_CAM
429  RegisterDevice("InfraredTEQ1Cam", "vtkInfraredTEQ1Cam", (PointerToDevice)&vtkInfraredTEQ1Cam::New);
430 #endif
431 
432 #ifdef PLUS_USE_INFRARED_TEEV2_CAM
433  RegisterDevice("InfraredTEEV2Cam", "vtkPlusInfraredTEEV2Cam", (PointerToDevice)&vtkPlusInfraredTEEV2Cam::New);
434 #endif
435 
436 #ifdef PLUS_USE_ULTRAVIOLET_PCOUV_CAM
437  RegisterDevice("UltravioletPCOUVCam", "vtkPlusUltravioletPCOUVCam", (PointerToDevice)&vtkPlusUltravioletPCOUVCam::New);
438 #endif
439 
440 #ifdef PLUS_USE_DAQVIDEOSOURCE
441  RegisterDevice("DAQVideoSource", "vtkPlusDAQVideoSource", (PointerToDevice)&vtkPlusDAQVideoSource::New);
442 #endif
443 
444 
445 #ifdef PLUS_USE_CLARIUS
446  RegisterDevice("Clarius", "vtkPlusClarius", (PointerToDevice)&vtkPlusClarius::New);
447 #endif
448 
449 #ifdef PLUS_USE_CLARIUS_OEM
450  RegisterDevice("ClariusOEM", "vtkPlusClariusOEM", (PointerToDevice)&vtkPlusClariusOEM::New);
451 #endif
452 
453 #ifdef PLUS_USE_STEAMVR
454  RegisterDevice("SteamVRTracker", "vtkPlusSteamVRTracker", (PointerToDevice)& vtkPlusSteamVRTracker::New);
455 #endif
456 
457 #ifdef PLUS_USE_GENERIC_SENSOR_TRACKER
458 #if WIN32
459 RegisterDevice("GenericSensor", "vtkPlusGenericSensorTracker", (PointerToDevice)& vtkPlusGenericSensorTracker::New);
460 #endif
461 #endif
462 
463 #ifdef PLUS_USE_AZUREKINECT
464  RegisterDevice("AzureKinect", "vtkPlusAzureKinect", (PointerToDevice)& vtkPlusAzureKinect::New);
465 #endif
466 
467 #ifdef PLUS_USE_REVOPOINT3DCAMERA
468  RegisterDevice("Revopoint3DCamera", "vtkPlusRevopoint3DCamera", (PointerToDevice)& vtkPlusRevopoint3DCamera::New);
469 #endif
470 
471  // Virtual Devices
472  RegisterDevice("VirtualMixer", "vtkPlusVirtualMixer", (PointerToDevice)&vtkPlusVirtualMixer::New);
473  RegisterDevice("VirtualSwitcher", "vtkPlusVirtualSwitcher", (PointerToDevice)&vtkPlusVirtualSwitcher::New);
474  RegisterDevice("VirtualCapture", "vtkPlusVirtualCapture", (PointerToDevice)&vtkPlusVirtualCapture::New);
475  RegisterDevice("VirtualDiscCapture", "vtkPlusVirtualCapture", (PointerToDevice)&vtkPlusVirtualCapture::New); // for backward compatibility
476  RegisterDevice("VirtualBufferedCapture", "vtkPlusVirtualCapture", (PointerToDevice)&vtkPlusVirtualCapture::New); // for backward compatibility
477  RegisterDevice("VirtualVolumeReconstructor", "vtkPlusVirtualVolumeReconstructor", (PointerToDevice)&vtkPlusVirtualVolumeReconstructor::New);
478  RegisterDevice("VirtualDeinterlacer", "vtkPlusVirtualDeinterlacer", (PointerToDevice)&vtkPlusVirtualDeinterlacer::New);
479 }
480 
481 //----------------------------------------------------------------------------
483 {
484 }
485 
486 //----------------------------------------------------------------------------
487 void vtkPlusDeviceFactory::PrintSelf(ostream& os, vtkIndent indent)
488 {
489  this->Superclass::PrintSelf(os, indent);
490  this->PrintAvailableDevices(os, indent);
491 }
492 
493 //----------------------------------------------------------------------------
494 void vtkPlusDeviceFactory::PrintAvailableDevices(ostream& os, vtkIndent indent)
495 {
496  os << indent << "Supported devices: " << std::endl;
497  std::map<std::string, PointerToDevice>::iterator it;
498  for (it = DeviceTypes.begin(); it != DeviceTypes.end(); ++it)
499  {
500  if (it->second != NULL)
501  {
502  vtkPlusDevice* device = (*it->second)();
503  os << indent.GetNextIndent() << "- " << it->first << " (ver: " << device->GetSdkVersion() << ")" << std::endl;
504  device->Delete();
505  device = NULL;
506  }
507  }
508 }
509 
510 //----------------------------------------------------------------------------
511 PlusStatus vtkPlusDeviceFactory::CreateInstance(const char* aDeviceType, vtkPlusDevice*& aDevice, const std::string& aDeviceId)
512 {
513  if (aDevice != NULL)
514  {
515  aDevice->Delete();
516  aDevice = NULL;
517  }
518 
519  if (aDeviceType == NULL)
520  {
521  LOG_ERROR("Device type is undefined");
522  return PLUS_FAIL;
523  }
524 
525  if (DeviceTypes.find(aDeviceType) == DeviceTypes.end())
526  {
527  std::string listOfSupportedDevices;
528  std::map<std::string, PointerToDevice>::iterator it;
529  for (it = DeviceTypes.begin(); it != DeviceTypes.end(); ++it)
530  {
531  if (it->second != NULL)
532  {
533  vtkPlusDevice* device = (*it->second)();
534  if (!listOfSupportedDevices.empty())
535  {
536  listOfSupportedDevices.append(", ");
537  }
538  listOfSupportedDevices.append(it->first);
539  device->Delete();
540  device = NULL;
541  }
542  }
543  LOG_ERROR("Unknown device type: " << aDeviceType << ". Supported devices: " << listOfSupportedDevices);
544  return PLUS_FAIL;
545  }
546 
547  if (DeviceTypes[aDeviceType] == NULL)
548  {
549  LOG_ERROR("Invalid factory method for device type: " << aDeviceType);
550  return PLUS_FAIL;
551  }
552 
553  // Call device New() function
554  aDevice = (*DeviceTypes[aDeviceType])();
555  if (aDevice == NULL)
556  {
557  LOG_ERROR("Invalid device created for device type: " << aDeviceType);
558  return PLUS_FAIL;
559  }
560 
561  aDevice->SetDeviceId(aDeviceId.c_str());
562 
563  return PLUS_SUCCESS;
564 }
565 
566 //----------------------------------------------------------------------------
567 PlusStatus vtkPlusDeviceFactory::GetDeviceClassName(const std::string& deviceTypeName, std::string& classNameOut) const
568 {
569  std::map<std::string, std::string>::const_iterator it = DeviceTypeClassNames.find(deviceTypeName);
570  if (it != DeviceTypeClassNames.end())
571  {
572  classNameOut = it->second;
573  return PLUS_SUCCESS;
574  }
575 
576  return PLUS_FAIL;
577 }
578 
579 //----------------------------------------------------------------------------
580 PlusStatus vtkPlusDeviceFactory::GetDeviceTypeName(const std::string& deviceClassName, std::string& typeNameOut) const
581 {
582  for (std::map<std::string, std::string>::const_iterator it = DeviceTypeClassNames.begin(); it != DeviceTypeClassNames.end(); ++it)
583  {
584  if (it->second == deviceClassName)
585  {
586  typeNameOut = it->first;
587  return PLUS_SUCCESS;
588  }
589  }
590 
591  return PLUS_FAIL;
592 }
593 
594 //----------------------------------------------------------------------------
595 void vtkPlusDeviceFactory::RegisterDevice(const std::string& deviceTypeName, const std::string& deviceClassName, vtkPlusDeviceFactory::PointerToDevice constructionMethod)
596 {
597  vtkPlusDeviceFactory::DeviceTypes[deviceTypeName] = constructionMethod;
599 }
virtual void PrintAvailableDevices(ostream &os, vtkIndent indent)
static vtkPlusThorLabsVideoSource * New()
static vtkPlusVirtualTextRecognizer * New()
static vtkPlusBkProFocusCameraLinkVideoSource * New()
void RegisterDevice(const std::string &deviceTypeName, const std::string &deviceClassName, PointerToDevice constructionMethod)
Abstract interface for tracker and video devices.
Definition: vtkPlusDevice.h:60
static vtkPlusAtracsysTracker * New()
static vtkPlusGenericSensorTracker * New()
static vtkPlusImageProcessorVideoSource * New()
static vtkPlusOptiTrack * New()
static vtkPlusLeapMotion * New()
static vtkPlusSpinnakerVideoSource * New()
static vtkPlusMicrochipTracker * New()
igsioStatus PlusStatus
Definition: PlusCommon.h:40
static vtkPlusClarius * New()
static vtkPlusSteamVRTracker * New()
static vtkPlusAndorVideoSource * New()
static vtkPlusSonixVideoSource * New()
static vtkPlusUSDigitalEncodersTracker * New()
static vtkPlusWin32VideoSource2 * New()
static vtkPlusIntuitiveDaVinciTracker * New()
static vtkPlusOvrvisionProVideoSource * New()
static vtkPlusAgilentScopeTracker * New()
static vtkPlusMmfVideoSource * New()
#define PLUS_FAIL
Definition: PlusCommon.h:43
virtual PlusStatus GetDeviceTypeName(const std::string &deviceClassName, std::string &typeNameOut) const
static vtkPlus3dConnexionTracker * New()
virtual std::string GetSdkVersion()
static vtkPlusClariusOEM * New()
static vtkPlusIntelRealSense * New()
static vtkPlusOpenIGTLinkVideoSource * New()
static vtkPlusVirtualCapture * New()
static vtkPlusUsSimulatorVideoSource * New()
static vtkPlusVirtualVolumeReconstructor * New()
PlusStatus CreateInstance(const char *aDeviceType, vtkPlusDevice *&aDevice, const std::string &aDeviceId)
vtkStandardNewMacro(vtkPlusDeviceFactory)
static vtkPlusDeckLinkVideoSource * New()
static vtkPlusChRoboticsTracker * New()
#define PLUS_SUCCESS
Definition: PlusCommon.h:44
static vtkPlusOpenHapticsDevice * New()
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
static vtkPlusInfraredTEEV2Cam * New()
static vtkPlusOpenCVCaptureVideoSource * New()
static vtkPlusVirtualMixer * New()
static vtkPlusV4L2VideoSource * New()
virtual PlusStatus GetDeviceClassName(const std::string &deviceTypeName, std::string &classNameOut) const
static vtkPlusPhilips3DProbeVideoSource * New()
static vtkPlusFakeTracker * New()
static vtkPlusNvidiaDVPVideoSource * New()
static vtkPlusOpenIGTLinkTracker * New()
static vtkPlusRevopoint3DCamera * New()
static vtkPlusEpiphanVideoSource * New()
static vtkInfraredSeekCam * New()
static vtkPlusPicoScopeDataSource * New()
static vtkPlusICCapturingSource * New()
static vtkPlusVirtualSwitcher * New()
std::map< std::string, std::string > DeviceTypeClassNames
Factory class of supported devices.
static vtkPlusDAQVideoSource * New()
static vtkPlusBrachyTracker * New()
static vtkPlusMicronTracker * New()
static vtkPlusStealthLinkTracker * New()
static vtkPlusNDICertusTracker * New()
static vtkPlusPhidgetSpatialTracker * New()
static vtkInfraredTEQ1Cam * New()
static vtkPlusUltravioletPCOUVCam * New()
static vtkPlusVirtualDeinterlacer * New()
static vtkPlusOpticalMarkerTracker * New()
vtkPlusDevice *(* PointerToDevice)()
static vtkPlusBkProFocusOemVideoSource * New()
static vtkPlusAzureKinect * New()
static vtkPlusIntersonArraySDKCxxVideoSource * New()
static vtkPlusTelemedVideoSource * New()
static vtkPlusSavedDataSource * New()
static vtkPlusGenericSerialDevice * New()
static vtkPlusCapistranoVideoSource * New()
static vtkPlusWinProbeVideoSource * New()
static vtkPlusOptimetConoProbeMeasurer * New()
static vtkPlusIntersonSDKCxxVideoSource * New()
static vtkPlusIntersonVideoSource * New()
std::map< std::string, PointerToDevice > DeviceTypes
static vtkPlusWitMotionTracker * New()
const char ** deviceClassName
Definition: phidget22.h:1312
static vtkPlusDevice * New()
void SetDeviceId(const std::string &id)
static vtkPlusNDITracker * New()