Isis 3 Programmer Reference
EmbreeTargetManager.h
1 #ifndef EmbreeTargetManager_h
2 #define EmbreeTargetManager_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 #include <QMap>
11 
12 #include "EmbreeTargetShape.h"
13 
14 namespace Isis {
15 
38  public:
40 
41  EmbreeTargetShape *create(const QString &shapeFile);
42  void free(const QString &shapeFile);
43 
44  int currentCacheSize() const;
45  int maxCacheSize() const;
46  bool inCache(const QString &shapeFile) const;
47  void setMaxCacheSize(const int &numShapes);
48 
49  private:
50  // This factory is a singleton, so the constructor and destructor are private.
51  // To get an instance of this class use the static getInstance() method.
54 
55  // This method deletes the singleton factory when QT exits
56  static void DieAtExit();
57 
70  : m_fullFilePath(""),
71  m_targetShape(0),
72  m_referenceCount(0) { }
73 
80  EmbreeTargetShapeContainer(const QString &fullPath,
81  EmbreeTargetShape *targetShape)
82  : m_fullFilePath(fullPath),
83  m_targetShape(targetShape),
84  m_referenceCount(0) { }
85 
86  QString m_fullFilePath;
91  };
92 
93  QString fullFilePath(const QString &filePath) const;
94  void removeTargetShape(const QString &shapeFile);
95 
100  };
101 
102 };
103 
104 #endif
Isis::EmbreeTargetManager::m_maker
static EmbreeTargetManager * m_maker
Initialize the singleton factory pointer.
Definition: EmbreeTargetManager.h:96
Isis::EmbreeTargetManager::fullFilePath
QString fullFilePath(const QString &filePath) const
Helper function that takes a file path and returns the full file path.
Definition: EmbreeTargetManager.cpp:94
Isis::EmbreeTargetManager::maxCacheSize
int maxCacheSize() const
Return the maximum number of stored EmbreeTargetShapes.
Definition: EmbreeTargetManager.cpp:243
Isis::EmbreeTargetManager::EmbreeTargetShapeContainer
Reference counting container for EmbreeTargetShapes.
Definition: EmbreeTargetManager.h:65
Isis::EmbreeTargetManager::EmbreeTargetShapeContainer::m_targetShape
EmbreeTargetShape * m_targetShape
!< The full path to the file used to construct the EmbreeTargetShape.
Definition: EmbreeTargetManager.h:88
Isis::EmbreeTargetManager::removeTargetShape
void removeTargetShape(const QString &shapeFile)
Method for removing an EmbreeTargetShape from the internal cache.
Definition: EmbreeTargetManager.cpp:210
Isis::EmbreeTargetManager::EmbreeTargetShapeContainer::EmbreeTargetShapeContainer
EmbreeTargetShapeContainer(const QString &fullPath, EmbreeTargetShape *targetShape)
Constructs a container for a target shape and path.
Definition: EmbreeTargetManager.h:80
Isis::EmbreeTargetManager::DieAtExit
static void DieAtExit()
Exit termination routine.
Definition: EmbreeTargetManager.cpp:60
Isis::EmbreeTargetManager::inCache
bool inCache(const QString &shapeFile) const
Check if there is an already created EmbreeTargetShape for a file.
Definition: EmbreeTargetManager.cpp:266
Isis::EmbreeTargetManager::currentCacheSize
int currentCacheSize() const
Return the number of currently stored EmbreeTargetShapes.
Definition: EmbreeTargetManager.cpp:233
Isis::EmbreeTargetManager::EmbreeTargetShapeContainer::EmbreeTargetShapeContainer
EmbreeTargetShapeContainer()
Default constructor.
Definition: EmbreeTargetManager.h:69
Isis::EmbreeTargetManager::EmbreeTargetShapeContainer::m_referenceCount
int m_referenceCount
!< The EmbreeTargetShape.
Definition: EmbreeTargetManager.h:89
Isis::EmbreeTargetManager
Class for managing the construction and destruction of EmbreeTargetShapes.
Definition: EmbreeTargetManager.h:37
Isis::EmbreeTargetManager::getInstance
static EmbreeTargetManager * getInstance()
Retrieve reference to Singleton instance of this object.
Definition: EmbreeTargetManager.cpp:77
Isis::EmbreeTargetManager::EmbreeTargetManager
EmbreeTargetManager()
This constructor will initialize the EmbreeTargetManager object to default values.
Definition: EmbreeTargetManager.cpp:30
Isis::EmbreeTargetManager::create
EmbreeTargetShape * create(const QString &shapeFile)
Get a pointer to an EmbreeTargetShape containing the information from a shape file.
Definition: EmbreeTargetManager.cpp:129
Isis::EmbreeTargetManager::~EmbreeTargetManager
~EmbreeTargetManager()
Destructor that frees all of the EmbreeTargetShapes managed by this object.
Definition: EmbreeTargetManager.cpp:41
Isis::EmbreeTargetManager::m_maxCacheSize
int m_maxCacheSize
!< The cache of created target shapes.
Definition: EmbreeTargetManager.h:99
Isis::EmbreeTargetShape
Embree Target Shape for planetary bodies.
Definition: EmbreeTargetShape.h:139
Isis::EmbreeTargetManager::setMaxCacheSize
void setMaxCacheSize(const int &numShapes)
Set the maximum number of stored EmbreeTargetShapes.
Definition: EmbreeTargetManager.cpp:256
Isis::EmbreeTargetManager::m_targeCache
QMap< QString, EmbreeTargetShapeContainer > m_targeCache
!< Pointer to the singleton factory.
Definition: EmbreeTargetManager.h:97
Isis::EmbreeTargetManager::free
void free(const QString &shapeFile)
Notify the manager that an EmbreeTargetShape is no longer in use.
Definition: EmbreeTargetManager.cpp:173
QMap
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:22
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16