26 #include <QCoreApplication> 40 EmbreeTargetManager *EmbreeTargetManager::m_maker = 0;
47 EmbreeTargetManager::EmbreeTargetManager()
48 : m_maxCacheSize(10) {
60 for (
int i = 0; i < targetFiles.size(); i++) {
161 QString msg =
"Failed creating EmbreeTargetShape for [" + fullPath
162 +
"] Too many EmbreeTargetShapes are already open.";
196 QString msg =
"Cannot free EmbreeTargetShape for file [" 197 + fullPath +
"] because it is not stored in the cache.";
205 int newCount = --(
m_targeCache[fullPath].m_referenceCount);
208 if ( newCount < 1 ) {
233 QString msg =
"Cannot free EmbreeTargetShape for file [" 234 + fullPath +
"] because it is not stored in the cache.";
File name manipulation and expansion.
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.
Namespace for the standard library.
QString fullFilePath(const QString &filePath) const
Helper function that takes a file path and returns the full file path.
This error is for when a programmer made an API call that was illegal.
void removeTargetShape(const QString &shapeFile)
Method for removing an EmbreeTargetShape from the internal cache.
int m_referenceCount
!< The EmbreeTargetShape.
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.
#define _FILEINFO_
Macro for the filename and line number.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
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.
void setMaxCacheSize(const int &numShapes)
Set the maximum number of stored EmbreeTargetShapes.
EmbreeTargetShape * create(const QString &shapeFile)
Get a pointer to an EmbreeTargetShape containing the information from a shape file.