Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ippKTool.h

Go to the documentation of this file.
00001 // 
00002 // DISCLAIMER: 
00003 //  This software was produced by the National Institute of Standards 
00004 //  and Technology (NIST), an agency of the U.S. government, and by statute is 
00005 //  not subject to copyright in the United States.  Recipients of this 
00006 //  software assume all responsibility associated with its operation,
00007 //  modification,maintenance, and subsequent redistribution. 
00008 //
00009 //  See NIST Administration Manual 4.09.07 b and Appendix I. 
00010 
00011 #pragma once 
00012 #include "ippdme/ippdme.h"
00013 #include "ippdme/Property/ippOnePropertyCollisionVolume.h"
00014 #include "ippdme/ippGoToPars.h"
00015 #include "ippdme/ippPtMeasPars.h"
00016 #include "ippdme/ippScanPars.h"
00017 #include <string>
00018 
00019 
00020 /* KTool class
00021 
00022 A Ktool (tool) is the combination of (1) a stylus, (2) a tool holder,
00023 and (3) a set of operational parameters.
00024 
00025 Each tool has a collisionVolume which is a ippOnePropertyCollisionVolume
00026 (defined in IppCmdRes.h). See pages 67-70 of the spec. In the tool
00027 model given in this file, the coordinate system in which this volume
00028 is defined has its origin at the center of the tip of the tool and its
00029 positive Z axis along the axis of the stylus. The X axis direction is
00030 a problem. We will assume here that each tool has an X axis marked on
00031 it perpendicular to the axis of the stylus. To use a tool's
00032 collision_volume for real collision detection, the location and
00033 orientation of the tool in the current coordinate system must be known
00034 and the collision_volume must be transformed to put it in the right
00035 place. For constructing a pro-forma response to a
00036 GetProp(Tool.CollisionVolume) command, the untransformed
00037 collisionVolume can be used. The spec seems to intend that there must
00038 be at least one Oriented Bounding Box in the collision volume of a
00039 tool, although it does not explicitly prohibit having no boxes.
00040 
00041 A tool has a radius, which is the radius of the ball at the end of the
00042 stylus.
00043 
00044 A tool has a length, which is the distance from the point on the tool
00045 that is at the mount point (the point that is controlled when there
00046 is no tool) to the center of the ball at the tip. This is a crude
00047 geometric item that can be used for calculating a response to
00048 GetChangeToolAction.
00049 
00050 A tool has zero to three rotary joints that may be adjusted indirectly
00051 (using an AlignTool command). The angles of these three joints are
00052 represented by angleA, angleB, and angleC.  The number of actual
00053 joints of a tool is not represented. If a tool does not have one of
00054 the joints, the angle for that joint is always zero. Here, the angles
00055 stay fixed (physically or logically) even when a tool is not being
00056 used, so the angles are properties of the tool, not of the tool
00057 changer.
00058 
00059 It is not clear whether the spec intends that the angles of a tool
00060 stay fixed between tool changes. If the same physical tool is two
00061 logical tools, and they have different angles, motion will be required
00062 when changing from one to the other. An alternative to having angles
00063 persist between tool changes would be for the logical tool to inherit
00064 its angles from the physical angles of the tool holder when it is
00065 changed in, so that no motion would be required.
00066 
00067 Currently, there is no geometric model of a tool, so the angles never
00068 change.
00069 
00070 A tool has a name and and id; both are strings. The spec says the id
00071 will eventually identify the manufacturer and other information.
00072 
00073 */
00074 
00075 //=============================================================================
00076 class IPPDME_EXT_CLASS ippKTool : public ippObject
00077 {
00078   friend class ippToolChanger;
00079 private:
00080   double _angleA;
00081   double _angleB;
00082   double _angleC;
00083 
00084   ippOnePropertyCollisionVolumePtr _collisionVolume;
00085   ippGoToParsPtr _goToPar;
00086   ippPtMeasParsPtr _ptMeasPar;
00087   ippScanParsPtr _scanPar;
00088 
00089   std::string _id;
00090   bool _isQualified;
00091   double _length;
00092 
00093   std::string _name;
00094   double _radius;
00095 
00096 public:
00097   ippKTool();
00098   ippKTool(
00099     const char * inName,
00100     const char * inId,
00101     ippGoToParsPtr inGoToPar,
00102           ippPtMeasParsPtr inPtMeasPar,
00103         ippScanParsPtr inScanPar,
00104     bool inIsQualified,
00105           ippOnePropertyCollisionVolumePtr inCollisionVolume,
00106           double inLength,
00107     double inRadius
00108   );
00109   
00110   virtual ~ippKTool();
00111 
00112   double getAngleA()const {return _angleA;}
00113   double getAngleB()const {return _angleB;}
00114   double getAngleC()const {return _angleC;}
00115 
00116   ippOnePropertyCollisionVolumePtr getCollisionVolume()const {return _collisionVolume; }
00117   
00118   ippGoToParsPtr getGoToPar() const  {return _goToPar;}
00119   ippPtMeasParsPtr getPtMeasPar()  const {return _ptMeasPar;}
00120   ippScanParsPtr getScanPar() const { return _scanPar; }
00121     
00122   const char * getId() const {return _id.c_str();}
00123   
00124   bool getIsQualified() const {return _isQualified;}
00125   double getLength() const  {return _length;}
00126   
00127   const char * getName()const  {return _name.c_str();}
00128   
00129   
00130   double getRadius() const {return _radius;}
00131 
00132   void setAngleA(double inAngleA)  {_angleA = inAngleA;}
00133   void setAngleB(double inAngleB)  {_angleB = inAngleB;}
00134   void setAngleC(double inAngleC)  {_angleC = inAngleC;}
00135 
00136   void setCollisionVolume(ippOnePropertyCollisionVolume* inCollisionVolume)
00137     {_collisionVolume = inCollisionVolume;}
00138 
00139   void setGoToPar(ippGoToPars* inGoToPar)
00140     {_goToPar = inGoToPar;}
00141   void setScanPar(ippScanPars* inScanPar)
00142     {_scanPar = inScanPar;}
00143 
00144   void setIsQualified(bool inIsQualified)
00145     {_isQualified = inIsQualified;}
00146 
00147   void setLength(double inLength)
00148     {_length = inLength;}
00149 
00150   void setName(const char * inName)
00151     {_name = inName;}
00152 
00153   void setPtMeasPar(ippPtMeasPars * inPtMeasPar)
00154     {_ptMeasPar = inPtMeasPar;}
00155 
00156   void setRadius(double inRadius)
00157     {_radius = inRadius;}
00158 
00159 private:
00160   ippKTool(const ippKTool&);
00161   void operator=(const ippKTool&);
00162 
00163 };
00164 IPP_DECLARE_SMARTPOINTER(ippKTool);

Generated on Wed Nov 8 00:19:58 2006 for IPPDME by  doxygen 1.4.1