addModel static void ModelPool::add_model(string const &filename, ModelRoot *model); Description: Adds the indicated already-loaded model to the pool. The model will always replace any previously-loaded model in the pool that had the same filename. This two-parameter version of this method is deprecated; use the one-parameter add_model(model) instead. |
garbageCollect static int ModelPool::garbage_collect(void); Description: Releases only those models in the pool that have a reference count of exactly 1; i.e. only those models that are not being used outside of the pool. Returns the number of models released. |
hasModel static bool ModelPool::has_model(string const &filename); Filename: modelPool.I Created by: drose (12Mar02) PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. All rights reserved. All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE." Description: Returns true if the model has ever been loaded, false otherwise. |
listContents static void ModelPool::list_contents(ostream &out); Description: Lists the contents of the model pool to the indicated output stream. Description: Lists the contents of the model pool to cout. |
loadModel static ModelRoot *ModelPool::load_model(string const &filename, LoaderOptions const &options = ((()))); Description: Loads the given filename up as a model, if it has not already been loaded, and returns the new model. If a model with the same filename was previously loaded, returns that one instead. If the model file cannot be found, returns NULL. |
releaseAllModels static void ModelPool::release_all_models(void); Description: Releases all models in the pool and restores the pool to the empty state. |
releaseModel static void ModelPool::release_model(string const &filename); Description: Removes the indicated model from the pool, indicating it will never be loaded again; the model may then be freed. If this function is never called, a reference count will be maintained on every model every loaded, and models will never be freed. This version of this method is deprecated; use release_model(model) instead. The model's get_fullpath() value should not have been changed during its lifetime, or this function may fail to locate it in the pool. |
verifyModel static bool ModelPool::verify_model(string const &filename); Description: Loads the given filename up as a model, if it has not already been loaded, and returns true to indicate success, or false to indicate failure. If this returns true, it is guaranteed that a subsequent call to load_model() with the same model name will return a valid Node pointer. |
write static void ModelPool::write(ostream &out); Description: Lists the contents of the model pool to the indicated output stream. Helps with debugging. |