Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGChildrenList.inl

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 OSG_BEGIN_NAMESPACE
00040 
00041 /*-------------------------------------------------------------------------*/
00042 /* NOTE                                                                    */
00043 /*                                                                         */
00044 /* ChildrenList::ChildrenListEntry must be defined first, because          */
00045 /* the rest depends on the definition for inlining.                        */
00046 /*-------------------------------------------------------------------------*/
00047 
00048 /*-------------------------------------------------------------------------*/
00049 /*    PRIVATE Types                                                        */
00050 
00051 inline
00052 ChildrenList::ChildrenListEntry::ChildrenListEntry(void)
00053     : _active  (true                                ),
00054       _priority(PriorityTypeTraits::getZeroElement())
00055 {
00056 }
00057 
00058 inline
00059 ChildrenList::ChildrenListEntry::ChildrenListEntry(bool         active,
00060                                                    PriorityType prio   )
00061     : _active  (active),
00062       _priority(prio  )
00063 {
00064 }
00065 
00066 inline bool
00067 ChildrenList::ChildrenListEntry::getActive(void) const
00068 {
00069     return _active;
00070 }
00071 
00072 inline void
00073 ChildrenList::ChildrenListEntry::setActive(bool active)
00074 {
00075     _active = active;
00076 }
00077 
00078 inline ChildrenList::PriorityType
00079 ChildrenList::ChildrenListEntry::getPriority(void) const
00080 {
00081     return _priority;
00082 }
00083 
00084 inline void
00085 ChildrenList::ChildrenListEntry::setPriority(PriorityType prio)
00086 {
00087     _priority = prio;
00088 }
00089 
00090 /*-------------------------------------------------------------------------*/
00091 /*    Constructors                                                         */
00092 
00093 inline
00094 ChildrenList::ChildrenList(void)
00095     : _pParentNode(NullFC),
00096       _childrenList(      )
00097 {
00098 }
00099 
00100 /*-------------------------------------------------------------------------*/
00101 /*    Destructor                                                           */
00102 
00103 inline
00104 ChildrenList::~ChildrenList(void)
00105 {
00106 }
00107 
00108 /*-------------------------------------------------------------------------*/
00109 /*    Parent                                                               */
00110 
00111 inline void
00112 ChildrenList::reset(void)
00113 {
00114     _childrenList.assign(_pParentNode->getNChildren(), ChildrenListEntry());
00115 }
00116 
00117 inline NodePtr
00118 ChildrenList::getParentNode(void) const
00119 {
00120     return _pParentNode;
00121 }
00122 
00123 inline void
00124 ChildrenList::setParentNode(const NodePtr &pParentNode)
00125 {
00126     _pParentNode = pParentNode;
00127 }
00128 
00129 /*-------------------------------------------------------------------------*/
00130 /*    Child                                                                */
00131 
00132 inline NodePtr
00133 ChildrenList::getChild(UInt32 childIndex) const
00134 {
00135     return _pParentNode->getChild(childIndex);
00136 }
00137 
00138 /*-------------------------------------------------------------------------*/
00139 /*    Active                                                               */
00140 
00141 inline bool
00142 ChildrenList::getActive(UInt32 childIndex) const
00143 {
00144     return _childrenList[childIndex].getActive();
00145 }
00146 
00147 inline void
00148 ChildrenList::setActive(UInt32 childIndex, bool active)
00149 {
00150     _childrenList[childIndex].setActive(active);
00151 }
00152 
00153 /*-------------------------------------------------------------------------*/
00154 /*    Priority                                                             */
00155 
00156 inline ChildrenList::PriorityType
00157 ChildrenList::getPriority(UInt32 childIndex) const
00158 {
00159     return _childrenList[childIndex].getPriority();
00160 }
00161 
00162 inline void
00163 ChildrenList::setPriority(UInt32 childIndex, PriorityType prio)
00164 {
00165     _childrenList[childIndex].setPriority(prio);
00166 }
00167 
00168 /*-------------------------------------------------------------------------*/
00169 /*    Misc                                                                 */
00170 
00171 inline UInt32
00172 ChildrenList::getSize(void) const
00173 {
00174     //return _childrenList.size();
00175     return _pParentNode->getNChildren();
00176 }
00177 
00178 OSG_END_NAMESPACE
00179 
00180 #define OSGCHILDRENLIST_INLINE_CVSID "@(#)$Id: OSGChildrenList.inl,v 1.2 2004/09/17 14:09:42 neumannc Exp $"

Generated on Thu Aug 25 04:01:40 2005 for OpenSG by  doxygen 1.4.3