<commit_before>/*===================================================================

The Medical Imaging Interaction Toolkit (MITK)

Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.

This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.

See LICENSE.txt or http://www.mitk.org for details.

===================================================================*/

#ifndef OptiTrackTrackingTool_H_HEADER_INCLUDED_
#define OptiTrackTrackingTool_H_HEADER_INCLUDED_

#include <MitkIGTExports.h>
#include <itkMultiThreader.h>
#include "itkFastMutexLock.h"
#include "mitkTrackingDevice.h"
#include "mitkTrackingTool.h"
#include "mitkIGTTimeStamp.h"
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <itksys/SystemTools.hxx>
#include <itkMutexLockHolder.h>
#include "mitkCommon.h"
#include <mitkInternalTrackingTool.h>
#include <mitkVector.h>
#include <itkFastMutexLock.h>
#include "mitkIGTException.h"



/**
* \brief Function to get the Error messages from API
*/
#include <mitkOptitrackErrorMessages.h>


namespace mitk
{

  //class OptitrackTragkingDevice;

  /** Documentation:
  *   \brief An object of this class represents the a Tool tracked by Optitrack System. You can define
  *  the tool by the a definition file like in the example in ****. Remember that it will be necessary to
  *  to have a license for using the Optitrack System.
  *  See  http://www.naturalpoint.com/ for details.
  *   \author <NAME> (<EMAIL>) Instituto de Investigacin Sanitaria Gregorio Maran, Madrid, Spain. & M. Noll (<EMAIL>) Cognitive Computing & Medical Imaging | Fraunhofer IGD
  *   \ingroup IGT
  */
  class MITKIGT_EXPORT OptitrackTrackingTool : public InternalTrackingTool
  {
  public:
    friend class OptitrackTrackingDevice;
    mitkClassMacro(mitk::OptitrackTrackingTool, mitk::InternalTrackingTool);
    itkNewMacro(Self);



    /**
    * \brief Define the tool by a calibration File.
    * The file must to have the next structure. Makers locations must to have "%fe %fe %fe\n" format and in (mm). See http://www.cplusplus.com/reference/cstdio/fscanf/
    *    ToolName
    *    #NumberOfMarkers
    *    X Y Z - for the first marker
    *    X Y Z - for the second marker
    *    ...
    *    X Y Z - for the last marker, the number #NumberOfMarkers
    *    X Y Z - for the PIVOT point
    * \return Returns true if the tool was set correctly
    * @throw mitk::IGTException Throws an exception if there exist any problem during the configuration file reading.
    */
    bool SetToolByFileName(std::string nameFile);

    /**
    * \brief Ask API the next number of defined tool
    * \return Returns the next ID (int) for a new tool in the device list for API
    * @throw mitk::IGTException Throws an exception if get_IDnext failed
    */
    int get_IDnext();

    /**
    * \brief Delete the tool from the list of tools inside API Optitrack
    * \return Returns true if the deletion was correct
    * @throw mitk::IGTException Throws an exception if
    */
    bool DeleteTrackable();

    /**
    * \brief Set the position to a given one
    * @throw mitk::IGTException Throws an exception if
    */
    void SetPosition(mitk::Point3D position, ScalarType eps=0.0);

    /**
    * \brief Set the orientation to a given one using a quaternion nomenclature
    * @throw mitk::IGTException Throws an exception if
    */
    void SetOrientation(mitk::Quaternion orientation, ScalarType eps=0.0);

    /**
    * \brief Get the position of the tool<commit_msg>Fixed warnings in IGT module<commit_after>/*===================================================================

The Medical Imaging Interaction Toolkit (MITK)

Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.

This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.

See LICENSE.txt or http://www.mitk.org for details.

===================================================================*/

#ifndef OptiTrackTrackingTool_H_HEADER_INCLUDED_
#define OptiTrackTrackingTool_H_HEADER_INCLUDED_

#include <MitkIGTExports.h>
#include <itkMultiThreader.h>
#include "itkFastMutexLock.h"
#include "mitkTrackingDevice.h"
#include "mitkTrackingTool.h"
#include "mitkIGTTimeStamp.h"
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <itksys/SystemTools.hxx>
#include <itkMutexLockHolder.h>
#include "mitkCommon.h"
#include <mitkInternalTrackingTool.h>
#include <mitkVector.h>
#include <itkFastMutexLock.h>
#include "mitkIGTException.h"



/**
* \brief Function to get the Error messages from API
*/
#include <mitkOptitrackErrorMessages.h>


namespace mitk
{

  //class OptitrackTragkingDevice;

  /** Documentation:
  *   \brief An object of this class represents the a Tool tracked by Optitrack System. You can define
  *  the tool by the a definition file like in the example in ****. Remember that it will be necessary to
  *  to have a license for using the Optitrack System.
  *  See  http://www.naturalpoint.com/ for details.
  *   \author <NAME> (<EMAIL>) Instituto de Investigacin Sanitaria Gregorio Maran, Madrid, Spain. & <NAME> (<EMAIL>) Cognitive Computing & Medical Imaging | Fraunhofer IGD
  *   \ingroup IGT
  */
  class MITKIGT_EXPORT OptitrackTrackingTool : public InternalTrackingTool
  {
  public:
    friend class OptitrackTrackingDevice;
    mitkClassMacro(mitk::OptitrackTrackingTool, mitk::InternalTrackingTool);
    itkNewMacro(Self);



    /**
    * \brief Define the tool by a calibration File.
    * The file must to have the next structure. Makers locations must to have "%fe %fe %fe\n" format and in (mm). See http://www.cplusplus.com/reference/cstdio/fscanf/
    *    ToolName
    *    #NumberOfMarkers
    *    X Y Z - for the first marker
    *    X Y Z - for the second marker
    *    ...
    *    X Y Z - for the last marker, the number #NumberOfMarkers
    *    X Y Z - for the PIVOT point
    * \return Returns true if the tool was set correctly
    * @throw mitk::IGTException Throws an exception if there exist any problem during the configuration file reading.
    */
    bool SetToolByFileName(std::string nameFile);

    /**
    * \brief Ask API the next number of defined tool
    * \return Returns the next ID (int) for a new tool in the device list for API
    * @throw mitk::IGTException Throws an exception if get_IDnext failed
    */
    int get_IDnext();

    /**
    * \brief Delete the tool from the list of tools inside API Optitrack
    * \return Returns true if the deletion was correct
    * @throw mitk::IGTException Throws an exception if
    */
    bool DeleteTrackable();

    /**
    * \brief Set the position to a given one
    * @throw mitk::IGTException Throws an exception if
    */
    using Superclass::SetPosition;
    void SetPosition(mitk::Point3D position, ScalarType eps=0.0);

    /**
    * \brief Set the orientation to a given one using a quaternion nomenclature
    * @throw mitk::IGTException Throws an exception if
    */
    using Superclass::SetOrientation;
    void SetOrientation(mitk::Quaternion orientation, ScalarType eps=0.0);

    /**
    * \brief Get the position of the tool
{'fraction_non_alphanumeric': 0.11909622975364094, 'fraction_numerical': 0.0013610997686130393, 'mean_word_length': 3.7012156110044785, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '369251', 'n_tokens_mistral': 2240, 'n_tokens_neox': 2156, 'n_words': 776}