Panda3D
 All Classes Functions Variables Enumerations
stTree.h
00001 // Filename: stTree.h
00002 // Created by:  drose (06Oct10)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef STTREE_H
00016 #define STTREE_H
00017 
00018 #include "pandabase.h"
00019 #include "typedReferenceCount.h"
00020 #include "namable.h"
00021 #include "speedtree_api.h"
00022 
00023 class SpeedTreeNode;
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : STTree
00027 // Description : Encapsulates a single tree model in the SpeedTree
00028 //               library, as loaded from an SRT file.
00029 ////////////////////////////////////////////////////////////////////
00030 class EXPCL_PANDASPEEDTREE STTree : public TypedReferenceCount, public Namable {
00031 PUBLISHED:
00032   STTree(const Filename &fullpath);
00033 private:
00034   STTree(const STTree &copy);
00035 
00036 PUBLISHED:
00037   INLINE const Filename &get_fullpath() const;
00038 
00039   INLINE bool is_valid() const;
00040 
00041   virtual void output(ostream &out) const;
00042 
00043 public:
00044   INLINE const SpeedTree::CTreeRender *get_tree() const;
00045   INLINE SpeedTree::CTreeRender *modify_tree();
00046 
00047 private:
00048   Filename _fullpath;
00049   bool _is_valid;
00050   SpeedTree::CTreeRender _tree;
00051 
00052 public:
00053   static TypeHandle get_class_type() {
00054     return _type_handle;
00055   }
00056   static void init_type() {
00057     TypedReferenceCount::init_type();
00058     register_type(_type_handle, "STTree",
00059                   TypedReferenceCount::get_class_type());
00060   }
00061   virtual TypeHandle get_type() const {
00062     return get_class_type();
00063   }
00064   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00065 
00066 private:
00067   static TypeHandle _type_handle;
00068 };
00069 
00070 INLINE ostream &operator << (ostream &out, const STTree &tree) {
00071   tree.output(out);
00072   return out;
00073 }
00074 
00075 #include "stTree.I"
00076 
00077 #endif
 All Classes Functions Variables Enumerations