Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends

mitk::NDIPassiveTool Class Reference

Implementation of a passive NDI optical tool. More...

#include <mitkNDIPassiveTool.h>

Inheritance diagram for mitk::NDIPassiveTool:
Inheritance graph
[legend]
Collaboration diagram for mitk::NDIPassiveTool:
Collaboration graph
[legend]

List of all members.

Public Types

enum  TrackingPriority { Static = 'S', Dynamic = 'D', ButtonBox = 'B' }
 

tracking priority for NDI tracking devices

More...
typedef NDIPassiveTool Self
typedef InternalTrackingTool Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
virtual bool LoadSROMFile (const char *filename)
 load a srom tool description file
virtual const unsigned char * GetSROMData () const
 get loaded srom file as unsigned char array
virtual unsigned int GetSROMDataLength () const
 get length of SROMData char array
virtual void SetPortHandle (const char *_arg)
virtual const char * GetPortHandle () const
 get port handle under which the tool is registered in the tracking device
virtual void SetTrackingPriority (TrackingPriority _arg)
 set port handle under which the tool is registered in the tracking device
virtual TrackingPriority GetTrackingPriority () const
 set tracking priority that the ndi tracking device should use
virtual void SetSerialNumber (const char *_arg)
 get tracking priority that the ndi tracking device should use
virtual const char * GetSerialNumber () const
 set serial number of the tool
virtual const char * GetFile () const
 get serial number of the tool

Protected Member Functions

 NDIPassiveTool ()
virtual ~NDIPassiveTool ()

Static Protected Member Functions

static Pointer New ()
 get file from which this tool was loaded

Protected Attributes

unsigned char * m_SROMData
 content of the srom tool description file
unsigned int m_SROMDataLength
 length of the srom tool description file
TrackingPriority m_TrackingPriority
 priority for this tool
std::string m_PortHandle
 port handle for this tool
std::string m_SerialNumber
 serial number for this tool
std::string m_File
 the original file from which this tool was loaded

Friends

class NDITrackingDevice

Detailed Description

Implementation of a passive NDI optical tool.

Documentation implements the TrackingTool interface and has the ability to load an srom file that contains the marker configuration for that tool

Definition at line 36 of file mitkNDIPassiveTool.h.


Member Typedef Documentation

typedef itk::SmartPointer<const Self> mitk::NDIPassiveTool::ConstPointer

Reimplemented from mitk::InternalTrackingTool.

Reimplemented in NDIPassiveToolTestClass.

Definition at line 50 of file mitkNDIPassiveTool.h.

typedef itk::SmartPointer<Self> mitk::NDIPassiveTool::Pointer

Reimplemented from mitk::InternalTrackingTool.

Reimplemented in NDIPassiveToolTestClass.

Definition at line 50 of file mitkNDIPassiveTool.h.

Reimplemented from mitk::InternalTrackingTool.

Reimplemented in NDIPassiveToolTestClass.

Definition at line 50 of file mitkNDIPassiveTool.h.

Reimplemented from mitk::InternalTrackingTool.

Reimplemented in NDIPassiveToolTestClass.

Definition at line 50 of file mitkNDIPassiveTool.h.


Member Enumeration Documentation

tracking priority for NDI tracking devices

Enumerator:
Static 
Dynamic 
ButtonBox 

Definition at line 43 of file mitkNDIPassiveTool.h.

    {
      Static    = 'S',
      Dynamic   = 'D',
      ButtonBox = 'B'
    };

Constructor & Destructor Documentation

mitk::NDIPassiveTool::NDIPassiveTool (  ) [protected]
mitk::NDIPassiveTool::~NDIPassiveTool (  ) [protected, virtual]

Definition at line 33 of file mitkNDIPassiveTool.cpp.

{
  if (m_SROMData != NULL)
  {
    delete[] m_SROMData;
    m_SROMData = NULL;
  }
}

Member Function Documentation

virtual const char* mitk::NDIPassiveTool::GetClassName (  ) const [virtual]

Reimplemented from mitk::InternalTrackingTool.

Reimplemented in NDIPassiveToolTestClass.

virtual const char* mitk::NDIPassiveTool::GetFile (  ) const [virtual]

get serial number of the tool

virtual const char* mitk::NDIPassiveTool::GetPortHandle (  ) const [virtual]

get port handle under which the tool is registered in the tracking device

Referenced by mitk::NDIProtocol::POS3D(), mitk::NDITrackingDevice::RemoveTool(), and mitk::NDITrackingDevice::UpdateTool().

virtual const char* mitk::NDIPassiveTool::GetSerialNumber (  ) const [virtual]

set serial number of the tool

const unsigned char * mitk::NDIPassiveTool::GetSROMData (  ) const [virtual]

get loaded srom file as unsigned char array

Definition at line 76 of file mitkNDIPassiveTool.cpp.

Referenced by mitk::NDITrackingDevice::InitializeWiredTools(), and mitk::NDITrackingDevice::UpdateTool().

{
  return m_SROMData;
}
unsigned int mitk::NDIPassiveTool::GetSROMDataLength (  ) const [virtual]

get length of SROMData char array

Definition at line 82 of file mitkNDIPassiveTool.cpp.

Referenced by mitk::NDITrackingDevice::InitializeWiredTools(), and mitk::NDITrackingDevice::UpdateTool().

{
  return m_SROMDataLength;
}
virtual TrackingPriority mitk::NDIPassiveTool::GetTrackingPriority (  ) const [virtual]

set tracking priority that the ndi tracking device should use

Referenced by mitk::NDITrackingDevice::InitializeWiredTools(), and mitk::NDITrackingDevice::UpdateTool().

bool mitk::NDIPassiveTool::LoadSROMFile ( const char *  filename ) [virtual]

load a srom tool description file

Definition at line 43 of file mitkNDIPassiveTool.cpp.

Referenced by QmitkNDIConfigurationWidget::UpdateTrackerFromToolTable().

{
  if (filename == NULL)
    return false;
  if (filename[0] == '\0')
    return false;
  
  m_File = filename;
  std::basic_ifstream<char> file;
  file.open(filename, std::ios::in | std::ios::binary); // open the file
  if (file.is_open() == false)
    return false;

  file.seekg (0, std::ios::end);                // get the length of the file
  unsigned int newLength = file.tellg();
  file.seekg (0, std::ios::beg);
  char* newData = new char [newLength];         // create a buffer to store the srom file
  file.read(newData, newLength);                // read the file into the buffer
  file.close();
  if (file.fail() == true)                      // reading of data unsuccessful?
  {
    delete[] newData;
    return false;
  }
  if (m_SROMData != NULL)                       // reading was successful, delete old data
    delete[] m_SROMData;
  m_SROMDataLength = newLength;                 // set member variables to new values
  m_SROMData = (unsigned char*) newData;
  this->Modified();
  return true;
}
static Pointer mitk::NDIPassiveTool::New (  ) [static, protected]

get file from which this tool was loaded

Reimplemented from mitk::InternalTrackingTool.

Reimplemented in NDIPassiveToolTestClass.

Referenced by mitk::NDITrackingDevice::AddTool(), and mitk::NDITrackingDevice::DiscoverWiredTools().

virtual void mitk::NDIPassiveTool::SetPortHandle ( const char *  _arg ) [virtual]
virtual void mitk::NDIPassiveTool::SetSerialNumber ( const char *  _arg ) [virtual]

get tracking priority that the ndi tracking device should use

virtual void mitk::NDIPassiveTool::SetTrackingPriority ( TrackingPriority  _arg ) [virtual]

set port handle under which the tool is registered in the tracking device


Friends And Related Function Documentation

friend class NDITrackingDevice [friend]

Definition at line 39 of file mitkNDIPassiveTool.h.


Member Data Documentation

std::string mitk::NDIPassiveTool::m_File [protected]

the original file from which this tool was loaded

Definition at line 75 of file mitkNDIPassiveTool.h.

std::string mitk::NDIPassiveTool::m_PortHandle [protected]

port handle for this tool

Definition at line 73 of file mitkNDIPassiveTool.h.

std::string mitk::NDIPassiveTool::m_SerialNumber [protected]

serial number for this tool

Definition at line 74 of file mitkNDIPassiveTool.h.

unsigned char* mitk::NDIPassiveTool::m_SROMData [protected]

content of the srom tool description file

Definition at line 70 of file mitkNDIPassiveTool.h.

unsigned int mitk::NDIPassiveTool::m_SROMDataLength [protected]

length of the srom tool description file

Definition at line 71 of file mitkNDIPassiveTool.h.

priority for this tool

Definition at line 72 of file mitkNDIPassiveTool.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines