Panda3D
Public Member Functions | Static Public Member Functions

STTree Class Reference

Encapsulates a single tree model in the SpeedTree library, as loaded from an SRT file. More...

#include "stTree.h"

Inheritance diagram for STTree:
TypedReferenceCount Namable TypedObject ReferenceCount MemoryBase MemoryBase MemoryBase

List of all members.

Public Member Functions

 STTree (const Filename &fullpath)
 The constructor reads the indicated SRT file immediately.
virtual TypeHandle force_init_type ()
const Filenameget_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 ()

Detailed Description

Encapsulates a single tree model in the SpeedTree library, as loaded from an SRT file.

Definition at line 30 of file stTree.h.


Constructor & Destructor Documentation

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().


Member Function Documentation

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]

Returns a modifiable pointer to the internal SpeedTree object.

Definition at line 56 of file stTree.I.

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().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations