Isis 3 Programmer Reference
EmbreeTargetManager.h
Go to the documentation of this file.
1 #ifndef EmbreeTargetManager_h
2 #define EmbreeTargetManager_h
3 
26 #include <QMap>
27 
28 #include "EmbreeTargetShape.h"
29 
30 namespace Isis {
31 
54  public:
56 
57  EmbreeTargetShape *create(const QString &shapeFile);
58  void free(const QString &shapeFile);
59 
60  int currentCacheSize() const;
61  int maxCacheSize() const;
62  bool inCache(const QString &shapeFile) const;
63  void setMaxCacheSize(const int &numShapes);
64 
65  private:
66  // This factory is a singleton, so the constructor and destructor are private.
67  // To get an instance of this class use the static getInstance() method.
70 
71  // This method deletes the singleton factory when QT exits
72  static void DieAtExit();
73 
86  : m_fullFilePath(""),
87  m_targetShape(0),
88  m_referenceCount(0) { }
89 
96  EmbreeTargetShapeContainer(const QString &fullPath,
97  EmbreeTargetShape *targetShape)
98  : m_fullFilePath(fullPath),
99  m_targetShape(targetShape),
100  m_referenceCount(0) { }
101 
102  QString m_fullFilePath;
107  };
108 
109  QString fullFilePath(const QString &filePath) const;
110  void removeTargetShape(const QString &shapeFile);
111 
116  };
117 
118 };
119 
120 #endif
void free(const QString &shapeFile)
Notify the manager that an EmbreeTargetShape is no longer in use.
QMap< QString, EmbreeTargetShapeContainer > m_targeCache
!< Pointer to the singleton factory.
Reference counting container for EmbreeTargetShapes.
QString fullFilePath(const QString &filePath) const
Helper function that takes a file path and returns the full file path.
void removeTargetShape(const QString &shapeFile)
Method for removing an EmbreeTargetShape from the internal cache.
Class for managing the construction and destruction of EmbreeTargetShapes.
bool inCache(const QString &shapeFile) const
Check if there is an already created EmbreeTargetShape for a file.
static EmbreeTargetManager * getInstance()
Retrieve reference to Singleton instance of this object.
int m_maxCacheSize
!< The cache of created target shapes.
EmbreeTargetShape * m_targetShape
!< The full path to the file used to construct the EmbreeTargetShape.
Embree Target Shape for planetary bodies.
int maxCacheSize() const
Return the maximum number of stored EmbreeTargetShapes.
static void DieAtExit()
Exit termination routine.
~EmbreeTargetManager()
Destructor that frees all of the EmbreeTargetShapes managed by this object.
int currentCacheSize() const
Return the number of currently stored EmbreeTargetShapes.
static EmbreeTargetManager * m_maker
Initialize the singleton factory pointer.
EmbreeTargetManager()
This constructor will initialize the EmbreeTargetManager object to default values.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void setMaxCacheSize(const int &numShapes)
Set the maximum number of stored EmbreeTargetShapes.
EmbreeTargetShapeContainer(const QString &fullPath, EmbreeTargetShape *targetShape)
Constructs a container for a target shape and path.
EmbreeTargetShape * create(const QString &shapeFile)
Get a pointer to an EmbreeTargetShape containing the information from a shape file.