Panda3D
|
Encapsulates a single tree model in the SpeedTree library, as loaded from an SRT file. More...
#include "stTree.h"
Public Member Functions | |
STTree (const Filename &fullpath) | |
The constructor reads the indicated SRT file immediately. | |
virtual TypeHandle | force_init_type () |
const Filename & | get_fullpath () const |
Returns the full pathname to the SRT file that was loaded for this tree, as passed to the constructor. | |
const SpeedTree::CTreeRender * | get_tree () const |
Returns a const pointer to the internal SpeedTree object. | |
virtual TypeHandle | get_type () const |
bool | is_valid () const |
Returns true if the tree was successfully loaded and is ready to be used, false otherwise. | |
SpeedTree::CTreeRender * | modify_tree () |
Returns a modifiable pointer to the internal SpeedTree object. | |
virtual void | output (ostream &out) const |
Outputs the Namable. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Encapsulates a single tree model in the SpeedTree library, as loaded from an SRT file.
STTree::STTree | ( | const Filename & | fullpath | ) |
The constructor reads the indicated SRT file immediately.
Check is_valid() to determine whether the read was successful or not. Note that the filename must be a fully-qualified pathname; the STTree constructor does not search the model-path.
Definition at line 30 of file stTree.cxx.
References SpeedTreeNode::authorize(), and SpeedTreeNode::write_error().
const Filename & STTree::get_fullpath | ( | ) | const [inline] |
Returns the full pathname to the SRT file that was loaded for this tree, as passed to the constructor.
Definition at line 23 of file stTree.I.
Referenced by SpeedTreeNode::add_tree(), SpeedTreeNode::remove_all_trees(), and SpeedTreeNode::remove_tree().
const SpeedTree::CTreeRender * STTree::get_tree | ( | ) | const [inline] |
Returns a const pointer to the internal SpeedTree object.
Definition at line 45 of file stTree.I.
Referenced by SpeedTreeNode::add_tree(), SpeedTreeNode::compute_internal_bounds(), SpeedTreeNode::remove_all_trees(), and SpeedTreeNode::remove_tree().
bool STTree::is_valid | ( | ) | const [inline] |
Returns true if the tree was successfully loaded and is ready to be used, false otherwise.
Definition at line 34 of file stTree.I.
Referenced by SpeedTreeNode::add_tree(), and output().
SpeedTree::CTreeRender * STTree::modify_tree | ( | ) | [inline] |
void STTree::output | ( | ostream & | out | ) | const [virtual] |
Outputs the Namable.
This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.
Reimplemented from Namable.
Definition at line 85 of file stTree.cxx.
References is_valid().