Loading [MathJax]/extensions/tex2jax.js
Carna Registration API Version 1.16.0
D:/Documents/mediTEC Projects/CRA/master/include/CRA/LazyLocalizer.h
00001 /*
00002  *  Copyright (C) 2010 - 2013 Leonid Kostrykin
00003  *
00004  *  Chair of Medical Engineering (mediTEC)
00005  *  RWTH Aachen University
00006  *  Pauwelsstr. 20
00007  *  52074 Aachen
00008  *  Germany
00009  *
00010  */
00011 
00012 #ifndef LAZYLOCALIZER_H_2521354512
00013 #define LAZYLOCALIZER_H_2521354512
00014 
00015 #include "cra_global.h"
00016 #include "Localizer.h"
00017 #include <map>
00018 #include <QTime>
00019 
00020 namespace CRA
00021 {
00022 
00023 
00024 
00025 // ----------------------------------------------------------------------------------
00026 // LazyLocalizer
00027 // ----------------------------------------------------------------------------------
00028 
00039 class CRA_EXPORT LazyLocalizer : public Localizer
00040 {
00041 
00042 public:
00043 
00046     const static unsigned int defaultLazynessThreshold;
00047 
00048 
00051     LazyLocalizer( Localizer& service );
00052 
00053 
00054     virtual bool fetch( const std::string& port, Transformation& out );
00055 
00056 
00061     void setLazynessThreshold( unsigned int lazynessThreshold )
00062     {
00063         this->lazynessThreshold = lazynessThreshold;
00064     }
00065 
00066     
00071     unsigned int getLazynessThreshold() const
00072     {
00073         return lazynessThreshold;
00074     }
00075 
00076 
00077 private:
00078 
00079     Localizer& service;
00080 
00081 
00082     typedef std::map< std::string, QTime > StringToTime;
00083 
00084     typedef std::map< std::string, Transformation > StringToTransformation;
00085 
00086     typedef std::map< std::string, bool > StringToBoolean;
00087 
00088 
00089     StringToTime cacheCurrentness;
00090 
00091     StringToTransformation orientationCache;
00092 
00093     StringToBoolean visibilityCache;
00094 
00095 
00096     unsigned int lazynessThreshold;
00097 
00098 }; // LazyLocalizer
00099 
00100 
00101 
00102 }  // namespace CRA
00103 
00104 #endif // LAZYLOCALIZER_H_2521354512
All Classes Functions Variables Enumerations Enumerator