Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
ToolInformation.h
Go to the documentation of this file.
1#pragma once
2#include <ktm/global.h>
3#include <math/Types.h>
5
6namespace sf
7{
8
13{
14 public:
19
24
28 void clear();
29
33 void assign(double x, double y, double z, double xa, double ya, double za, double len);
34
40
45
49 bool operator==(const ToolInformation& info) const;
50
54 bool operator!=(const ToolInformation& info) const;
55
62 bool read(const IniProfile& ini, const std::string& section = {});
63
69 void write(IniProfile& ini, const std::string& section = {});
70
71 //
72 // Displacement related items.
73 //
74
81 void setDisplacement(double angle_x, double angle_y, double beam_len);
82
87 void setDisplacement(Vector3D v);
88
92 double setDisplacementAngleX() const;
93
97 double setDisplacementAngleY() const;
98
102 double setDisplacementLength() const;
103
107 const Vector3D& getDisplacement() const;
108
109 //
110 // Beam related items.
111 //
112
120 void setBeam(double angle_x, double angle_y, double angle_z, double beam_len);
124 double getBeamAngleX() const;
128 double getBeamAngleY() const;
129
133 double getBeamAngleZ() const;
134
138 double getBeamLength() const;
139
143 const Matrix44& getBeamMatrix() const;
144
145 private:
146 // Displacement in 3D space of when attached to a manipulator.
147 Vector3D _displacement;
148 // Precalculated matrix for faster calculation.
149 Matrix44 _beam;
150 // Displacement angles.
151 double _displacementAngleX;
152 double _displacementAngleY;
153 double _displacementLength;
154 // Holds the deflection angle in around the X-axis of the beam.
155 double _beamAngleX;
156 // Holds the deflection angle in around the Y-axis of the beam.
157 double _beamAngleY;
158 // Holds the deflection angle in around the Z-axis of the beam.
159 double _beamAngleZ;
160 // Holds the length of beam inside the tool.
161 double _beamLength;
162};
163
172Vector3D _KTM_FUNC getToolBeamVector(const ToolInformation& tool, double beam_len, double a, double b);
173
182Vector3D _KTM_FUNC getBeamVector(const ToolInformation& tool, double beam_len, double a, double b);
183
184}// namespace sf
185
186#ifndef __JETBRAINS_IDE__
187 // Include all inlined functions and template implementations.
188 #include <ktm/ToolInformation.hpp>
189#endif
Class for reading and writing ini-profiles.
Definition IniProfile.h:17
Holds all the necessary information on a tool to make calculations.
Definition ToolInformation.h:13
bool read(const IniProfile &ini, const std::string &section={})
Reads the class data from an ini-profile.
bool operator!=(const ToolInformation &info) const
Compare non-equal operator.
double getBeamAngleX() const
Gets the rotation angle around the Y-axis of the beam when it leaves the tool.
ToolInformation & assign(const ToolInformation &info)
Assigns the values from the passed instance.
const Vector3D & getDisplacement() const
Gets the displacement 3D vector.
double getBeamAngleY() const
Gets the rotation angle around the Y-axis of the beam when it leaves the tool.
double setDisplacementAngleX() const
Gets the displacement angle around then X-axis when this tool is mounted.
void clear()
Clears all data members.
ToolInformation()
Default constructor.
void setDisplacement(double angle_x, double angle_y, double beam_len)
Sets the displacement using angles and length.
double setDisplacementAngleY() const
Gets the displacement angle around then Y-axis when this tool is mounted.
void assign(double x, double y, double z, double xa, double ya, double za, double len)
Assign all member at once.
ToolInformation & operator=(const ToolInformation &info)
Assignment operator.
void setBeam(double angle_x, double angle_y, double angle_z, double beam_len)
Sets the angles of rotation around the X- and Y-axis when it leaves the tool.
double getBeamLength() const
Gets the length of beam inside the tool.
const Matrix44 & getBeamMatrix() const
Gets the matrix for rotating a beam.
double getBeamAngleZ() const
Gets the rotation angle around the Z-axis of the beam when it leaves the tool.
double setDisplacementLength() const
Gets the displacement angle around then Z-axis when this tool is mounted.
bool operator==(const ToolInformation &info) const
Compare equal operator.
void setDisplacement(Vector3D v)
Sets the displacement using a vector.
ToolInformation(const ToolInformation &info)
Copy constructor.
void write(IniProfile &ini, const std::string &section={})
Writes the class data to an ini-profile.
#define _KTM_CLASS
Definition ktm/global.h:35
#define _KTM_FUNC
Definition ktm/global.h:34
Definition Application.h:10
Vector3D _KTM_FUNC getBeamVector(const ToolInformation &tool, double beam_len, double a, double b)
Not clear where it is used for.???
Vector3D _KTM_FUNC getToolBeamVector(const ToolInformation &tool, double beam_len, double a, double b)
Gets the vector which can be added to the xyz-axis position vector to get the focus position.