19inline void ViewLODList::Dump(
void (*pTracer)(
const char*, ...))
const
21 pTracer(
" ViewLODList<0x%x>: Capacity=%d, Size=%d, RefCount=%d\n",
this,
Capacity(),
Size(), m_refCount);
23 for (
int i = 0; i < (int)
Size(); i++) {
25 pTracer(
" [%d]: ViewLOD<0x%x>: Vertices=%d\n", i, lod, lod->
NVerts());
41 ViewLODListMap::iterator iterator;
44 for (iterator = m_map.begin(); !(iterator == m_map.end()); ++iterator) {
45 const ROIName& rROIName = (*iterator).first;
49 while (pLODList->
Size() > 0) {
55 delete[]
const_cast<char*
>(rROIName);
59 m_map.erase(m_map.begin(), m_map.end());
61 assert(m_map.begin() == m_map.end());
79 refCount = pLODList->
AddRef();
80 assert(refCount == 1);
87 sprintf(num,
"%d", g_ROINameUID);
88 pROIName =
new char[strlen(rROIName) + strlen(num) + 1];
89 strcpy(pROIName, rROIName);
90 strcat(pROIName, num);
94 pROIName =
new char[strlen(rROIName) + 1];
95 strcpy(pROIName, rROIName);
98 m_map[pROIName] = pLODList;
101 assert((
Lookup(pROIName) == pLODList) && (pLODList->
Release() == 1));
113 ViewLODListMap::const_iterator iterator = m_map.find(p_roiName);
116 if (!(iterator == m_map.end())) {
117 pLODList = (*iterator).second;
130 ViewLODListMap::iterator iterator;
131 char deleted =
FALSE;
133 for (iterator = m_map.begin(); !(iterator == m_map.end()); ++iterator) {
134 const ROIName& rROIName = (*iterator).first;
137 if (lodList == pLODList) {
138 while (pLODList->
Size() > 0) {
143 delete[]
const_cast<char*
>(rROIName);
144 m_map.erase(iterator);
[AI] Abstract base class for an ordered list of LODObject pointers, where each entry represents an in...
size_t Size() const
[AI] Returns the current number of LODObject pointers contained.
size_t Capacity() const
[AI] Returns the maximum number of LODObject pointers the list can hold.
[AI] Type-safe extension of LODListBase, templated for any LODObject-derived type.
const T * PopBack()
[AI] Typed remove.
const ViewLOD * operator[](int) const
[AI] Typed access to the LODObject at position i.
[AI] Manages the lifecycle, lookup, and sharing of ViewLODList instances for different ROI names.
ViewLODList * Create(const ROIName &rROIName, int lodCount)
[AI] Creates and registers a new ViewLODList for a named ROI, with space for the specified number of ...
ViewLODListManager()
[AI] Constructs a ViewLODListManager; initializes internal structures.
virtual ~ViewLODListManager()
[AI] Destroys the manager and all ViewLODLists it owns, ensuring proper cleanup of all managed instan...
ViewLODList * Lookup(const ROIName &) const
[AI] Looks up an existing ViewLODList by ROI name, incrementing its reference count.
unsigned char Destroy(ViewLODList *lodList)
[AI] Destroys (removes and deletes) the given ViewLODList from the manager.
[AI] Reference-counted list of Level-of-Detail (LOD) objects associated with a single ROI (Realtime O...
int Release()
[AI] Decrements the reference count.
int AddRef()
[AI] Increments the reference count.
[AI] Represents a Level of Detail (LOD) object for rendering, implemented with a mesh builder and sup...
int NVerts() const override
[AI] Returns the estimated number of vertices in this LOD.
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define list
[AI] Macro alias for List<T>, replacing std::list<T>.
const char * ROIName
[AI] String type used as a key to identify uniquely-named ROI (Realtime Object Instance) classes.