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

mitk::ClaronTool Class Reference

An object of this class represents a MicronTracker 2 tool. A tool has to be added to a tracking device which will then continuously update the tool coordinates. More...

#include <mitkClaronTool.h>

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

List of all members.

Public Types

typedef ClaronTool Self
typedef InternalTrackingTool Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
bool LoadFile (const char *filename)
 Loads a tool calibration file. Without this file the tool can not be tracked!
bool LoadFile (std::string filename)
 Loads a tool calibration file. Without this file the tool can not be tracked!
std::string GetFile ()
void SetToolHandle (claronToolHandle handle)
 Sets the handle of the tool.
std::string GetCalibrationName ()
void SetCalibrationName (std::string name)
 Sets the calibration name of the tool. Be careful, only use this method if you know what you are doing. If you want to change the tool name use the method setToolName instead!
claronToolHandle GetToolHandle ()

Protected Member Functions

 ClaronTool ()
virtual ~ClaronTool ()

Static Protected Member Functions

static Pointer New ()

Protected Attributes

claronToolHandle m_ToolHandle
 Tool handle variable from tracking device.
std::string m_CalibrationName
 Variable which holds the Tool's calibration name.
std::string m_Filename
 Variable to check filename's format and to get back complete filename.

Friends

class ClaronTrackingDevice

Detailed Description

An object of this class represents a MicronTracker 2 tool. A tool has to be added to a tracking device which will then continuously update the tool coordinates.

Documentation:

Definition at line 34 of file mitkClaronTool.h.


Member Typedef Documentation

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

Reimplemented from mitk::InternalTrackingTool.

Reimplemented in ClaronToolTestClass.

Definition at line 38 of file mitkClaronTool.h.

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

Reimplemented from mitk::InternalTrackingTool.

Reimplemented in ClaronToolTestClass.

Definition at line 38 of file mitkClaronTool.h.

Reimplemented from mitk::InternalTrackingTool.

Reimplemented in ClaronToolTestClass.

Definition at line 38 of file mitkClaronTool.h.

Reimplemented from mitk::InternalTrackingTool.

Reimplemented in ClaronToolTestClass.

Definition at line 38 of file mitkClaronTool.h.


Constructor & Destructor Documentation

mitk::ClaronTool::ClaronTool (  ) [protected]

Definition at line 23 of file mitkClaronTool.cpp.

mitk::ClaronTool::~ClaronTool ( void   ) [protected, virtual]

Definition at line 27 of file mitkClaronTool.cpp.

{
}

Member Function Documentation

std::string mitk::ClaronTool::GetCalibrationName (  )
Returns:
Returns the calibration name which is used to identify the tool.

Definition at line 31 of file mitkClaronTool.cpp.

{
  return &m_CalibrationName[0];
}
virtual const char* mitk::ClaronTool::GetClassName (  ) const [virtual]

Reimplemented from mitk::InternalTrackingTool.

Reimplemented in ClaronToolTestClass.

std::string mitk::ClaronTool::GetFile (  )

Definition at line 92 of file mitkClaronTool.cpp.

{
  return m_Filename;
}
mitk::claronToolHandle mitk::ClaronTool::GetToolHandle (  )
Returns:
Returns the tool handle of the tool.

Definition at line 102 of file mitkClaronTool.cpp.

{
  return this->m_ToolHandle;
}
bool mitk::ClaronTool::LoadFile ( const char *  filename )

Loads a tool calibration file. Without this file the tool can not be tracked!

Definition at line 41 of file mitkClaronTool.cpp.

{
  if (filename==NULL)
  {
    return false;
  }
  else
  {
    return this->LoadFile(std::string(filename));
  }
}
bool mitk::ClaronTool::LoadFile ( std::string  filename )

Loads a tool calibration file. Without this file the tool can not be tracked!

Definition at line 53 of file mitkClaronTool.cpp.

{
  //This method is not really "loading" a file. It is saving the filename and
  //parsing the calibration name out of the filename. The calibration name is
  //later used by the tracking device to really load the file.

  if (filename.empty())
  {
    return false;
  }
  else
  {
    m_Filename = filename;

    int end = m_Filename.length();
    int start = end;

    //check whether the path is given in Windows format
    while( (start!=0) && (filename[start-1]!='\\') ) start--;

    //if not (start==0) perhaps it is given in Linux format
    if (start==0) 
    {
      start = end;
      while( (start!=0) && (filename[start-1]!='/') )
      {
        start--;
      }
    }

    //if there are no \ and no / in the string something must be wrong...
    if (start==0) return false;

    this->m_CalibrationName = m_Filename.substr(start,end);

    return true;
  }
}
static Pointer mitk::ClaronTool::New (  ) [static, protected]
void mitk::ClaronTool::SetCalibrationName ( std::string  name )

Sets the calibration name of the tool. Be careful, only use this method if you know what you are doing. If you want to change the tool name use the method setToolName instead!

Definition at line 36 of file mitkClaronTool.cpp.

{
  this->m_CalibrationName=name;
}
void mitk::ClaronTool::SetToolHandle ( mitk::claronToolHandle  handle )

Sets the handle of the tool.

Parameters:
handleThe new handle of the tool.

Definition at line 97 of file mitkClaronTool.cpp.

{
  this->m_ToolHandle = handle;
}

Friends And Related Function Documentation

friend class ClaronTrackingDevice [friend]

Definition at line 37 of file mitkClaronTool.h.


Member Data Documentation

std::string mitk::ClaronTool::m_CalibrationName [protected]

Variable which holds the Tool's calibration name.

Definition at line 81 of file mitkClaronTool.h.

std::string mitk::ClaronTool::m_Filename [protected]

Variable to check filename's format and to get back complete filename.

Definition at line 83 of file mitkClaronTool.h.

Tool handle variable from tracking device.

Definition at line 79 of file mitkClaronTool.h.


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