Isis 3 Developer 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 
81  struct EmbreeTargetShapeContainer {
85  EmbreeTargetShapeContainer()
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;
104  EmbreeTargetShape *m_targetShape;
105  int m_referenceCount;
107  };
108 
109  QString fullFilePath(const QString &filePath) const;
110  void removeTargetShape(const QString &shapeFile);
111 
112  static EmbreeTargetManager *m_maker;
115  int m_maxCacheSize;
116  };
117 
118 };
119 
120 #endif
void free(const QString &shapeFile)
Notify the manager that an EmbreeTargetShape is no longer in use.
Definition: EmbreeTargetManager.cpp:190
Class for managing the construction and destruction of EmbreeTargetShapes.
Definition: EmbreeTargetManager.h:53
bool inCache(const QString &shapeFile) const
Check if there is an already created EmbreeTargetShape for a file.
Definition: EmbreeTargetManager.cpp:283
static EmbreeTargetManager * getInstance()
Retrieve reference to Singleton instance of this object.
Definition: EmbreeTargetManager.cpp:94
Embree Target Shape for planetary bodies.
Definition: EmbreeTargetShape.h:155
int maxCacheSize() const
Return the maximum number of stored EmbreeTargetShapes.
Definition: EmbreeTargetManager.cpp:260
int currentCacheSize() const
Return the number of currently stored EmbreeTargetShapes.
Definition: EmbreeTargetManager.cpp:250
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void setMaxCacheSize(const int &numShapes)
Set the maximum number of stored EmbreeTargetShapes.
Definition: EmbreeTargetManager.cpp:273
EmbreeTargetShape * create(const QString &shapeFile)
Get a pointer to an EmbreeTargetShape containing the information from a shape file.
Definition: EmbreeTargetManager.cpp:146