- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# FCDocument/FCDSceneNodeIterator.h

Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2005-2007 Feeling Software Inc.
    00003     Portions of the code are:
    00004     Copyright (C) 2005-2007 Sony Computer Entertainment America
    00005
    00006     MIT License: http://www.opensource.org/licenses/mit-license.php
    00007 */
    00014 #ifndef _FCD_SCENE_NODE_ITERATOR_H_
    00015 #define _FCD_SCENE_NODE_ITERATOR_H_
    00016
    00017 class FCDSceneNode;
    00018
    00029 template <class _NODE>
    00030 class FCOLLADA_EXPORT FCDSceneNodeIteratorT
    00031 {
    00032 private:
    00033     fm::pvector<_NODE> queue;
    00034     size_t iterator;
    00035
    00036 public:
    00038     enum SearchType
    00039     {
    00043         BREADTH_FIRST,
    00044
    00048         DEPTH_FIRST_PREORDER,
    00049
    00053         DEPTH_FIRST_POSTORDER,
    00054     };
    00055
    00061     FCDSceneNodeIteratorT(_NODE* root, SearchType searchType=BREADTH_FIRST, bool pureChildOnly=false);
    00062
    00064     ~FCDSceneNodeIteratorT();
    00065
    00068     _NODE* GetNode();
    00069
    00072     _NODE* Next();
    00073
    00075     inline bool IsDone() { return iterator >= queue.size(); }
    00076
    00079     inline FCDSceneNodeIteratorT& operator++() { Next(); return (*this); }
    00080
    00083     inline _NODE* operator*() { return GetNode(); }
    00084 };
    00085
    00086 typedef FCDSceneNodeIteratorT<FCDSceneNode> FCDSceneNodeIterator;
    00087 typedef FCDSceneNodeIteratorT<const FCDSceneNode> FCDSceneNodeConstIterator;
    00089 #endif // _FCD_SCENE_NODE_ITERATOR_H_