Reflexxes Motion Libraries  Manual and Documentation (Type II, Version 1.2.6)
include/RMLVelocityOutputParameters.h
Go to the documentation of this file.
00001 //  ---------------------- Doxygen info ----------------------
00043 //  ----------------------------------------------------------
00044 //   For a convenient reading of this file's source code,
00045 //   please use a tab width of four characters.
00046 //  ----------------------------------------------------------
00047
00048
00049 #ifndef __RMLVelocityOutputParameters__
00050 #define __RMLVelocityOutputParameters__
00051 
00052
00053 #include <RMLOutputParameters.h>
00054
00055
00056 //  ---------------------- Doxygen info ----------------------
00072 //  ----------------------------------------------------------
00073 class RMLVelocityOutputParameters : public RMLOutputParameters
00074 {
00075
00076 public:
00077
00078 //  ---------------------- Doxygen info ----------------------
00090 //  ----------------------------------------------------------
00091     RMLVelocityOutputParameters(const unsigned int DegreesOfFreedom) : RMLOutputParameters(DegreesOfFreedom)
00092     {
00093         this->PositionValuesAtTargetVelocity    =   new RMLDoubleVector (DegreesOfFreedom)  ;
00094
00095         memset(this->PositionValuesAtTargetVelocity->VecData    ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00096     }
00097
00098
00099 //  ---------------------- Doxygen info ----------------------
00111 //  ----------------------------------------------------------
00112     RMLVelocityOutputParameters(const RMLVelocityOutputParameters &OP) : RMLOutputParameters(OP)
00113     {
00114         this->PositionValuesAtTargetVelocity        =   new RMLDoubleVector ((OP.PositionValuesAtTargetVelocity)->GetVecDim())  ;
00115
00116         *(this->PositionValuesAtTargetVelocity)     =   *(OP.PositionValuesAtTargetVelocity)                                    ;
00117     }
00118
00119
00120 //  ---------------------- Doxygen info ----------------------
00125 //  ----------------------------------------------------------
00126     ~RMLVelocityOutputParameters(void)
00127     {
00128         delete  this->PositionValuesAtTargetVelocity        ;
00129
00130         this->PositionValuesAtTargetVelocity    =   NULL    ;
00131     }
00132
00133
00134 //  ---------------------- Doxygen info ----------------------
00142 //  ----------------------------------------------------------
00143     RMLVelocityOutputParameters &operator = (const RMLVelocityOutputParameters &OP)
00144     {
00145         RMLOutputParameters::operator=(OP);
00146
00147         *(this->PositionValuesAtTargetVelocity) =   *(OP.PositionValuesAtTargetVelocity);
00148
00149         return(*this);
00150     }
00151
00152
00153 // #############################################################################
00154
00155
00156 //  ---------------------- Doxygen info ----------------------
00171 //  ----------------------------------------------------------
00172     inline void GetPositionValuesAtTargetVelocity(RMLDoubleVector *OutputVector) const
00173     {
00174         *OutputVector   =   *(this->PositionValuesAtTargetVelocity);
00175     }
00176
00177
00178 //  ---------------------- Doxygen info ----------------------
00201 //  ----------------------------------------------------------
00202     inline void GetPositionValuesAtTargetVelocity(      double              *OutputVector
00203                                                     ,   const unsigned int  &SizeInBytes) const
00204     {
00205         memcpy(     (void*)OutputVector
00206                 ,   (void*)this->PositionValuesAtTargetVelocity->VecData
00207                 ,   SizeInBytes );
00208     }
00209
00210
00211 //  ---------------------- Doxygen info ----------------------
00232 //  ----------------------------------------------------------
00233     inline void GetPositionValuesAtTargetVelocityElement(       double              *OutputValue
00234                                                             ,   const unsigned int  &Index) const
00235     {
00236         if ( ( Index + 1 ) > ((unsigned int) this->PositionValuesAtTargetVelocity->GetVecDim() ) )
00237         {
00238             *OutputValue    =   0.0;
00239         }
00240         else
00241         {
00242             *OutputValue    =   (*this->PositionValuesAtTargetVelocity)[Index];
00243         }
00244     }
00245
00246
00247 //  ---------------------- Doxygen info ----------------------
00262 //  ----------------------------------------------------------
00263     inline double GetPositionValuesAtTargetVelocityElement(const unsigned int &Index) const
00264     {
00265         if ( ( Index + 1 ) > ((unsigned int) this->PositionValuesAtTargetVelocity->GetVecDim() ) )
00266         {
00267             return(0.0);
00268         }
00269         else
00270         {
00271             return( (*this->PositionValuesAtTargetVelocity)[Index] );
00272         }
00273     }
00274
00275
00276 //  ---------------------- Doxygen info ----------------------
00284 //  ----------------------------------------------------------
00285     void Echo(FILE* FileHandler = stdout) const
00286     {
00287         unsigned int        i   =   0;
00288
00289         if (FileHandler == NULL)
00290         {
00291             return;
00292         }
00293
00294         RMLOutputParameters::Echo(FileHandler);
00295
00296         fprintf(FileHandler, "Position vector at trgt. vel.  : ");
00297         for (i = 0; i < this->NumberOfDOFs; i++)
00298         {
00299             fprintf(FileHandler, " %.20le ", this->PositionValuesAtTargetVelocity->VecData[i]);
00300         }
00301         fprintf(FileHandler, "\n");
00302
00303         return;
00304     }
00305
00306
00307 //  ---------------------- Doxygen info ----------------------
00321 //  ----------------------------------------------------------
00322     RMLDoubleVector         *PositionValuesAtTargetVelocity;
00323
00324
00325 };// class RMLVelocityOutputParameters
00326
00327
00328
00329 #endif
00330 
00331
User documentation of the Reflexxes Motion Libraries by Reflexxes GmbH (Company Information, Impressum). This document was generated with Doxygen on Mon Jul 7 2014 13:21:08. Copyright 2010–2014.