1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 //---------------------------------------------------------------------------
41 //---------------------------------------------------------------------------
46 Node *Action::getActNode(void)
53 void Action::setActNode(Node * const node)
59 FieldContainer *Action::getActParent(void)
66 void Action::setActParent(FieldContainer * const parent)
72 Node *Action::getNode(UInt32 index)
76 return _actNode->getChild(index);
80 return (*_actList)[index];
85 void Action::addNode(Node * const node)
87 _newList.push_back(node);
91 void Action::useNodeList(bool bVal)
97 UInt32 Action::getNNodes(void) const
101 return _actNode->getNChildren();
105 return UInt32((*_actList).size());
111 UInt32 Action::getTravMask(void) const
117 void Action::setTravMask(UInt32 val)
123 void Action::andTravMask(UInt32 val)
129 void Action::orTravMask(UInt32 val)
135 void Action::pushTravMask(void)
137 _sTravMask.push(_travMask);
141 void Action::popTravMask(void)
143 _travMask = _sTravMask.top();
148 /*-------------------------- your_category---------------------------------*/
150 // callEnter/callLeave: call the right functor. If the type is unknown and new
151 // (i.e. its index is larger than the vector) try to find the function in the
155 Action::ResultE Action::callEnter(NodeCore * const core)
159 UInt32 uiFunctorIndex = core->getType().getId();
161 if(uiFunctorIndex < _enterFunctors.size())
163 result = _enterFunctors[uiFunctorIndex](core, this);
165 else // unknown field container
167 result = _defaultEnterFunction(core, this);
174 Action::ResultE Action::callLeave(NodeCore * const core)
178 UInt32 uiFunctorIndex = core->getType().getId();
180 if(uiFunctorIndex < _leaveFunctors.size())
182 result = _leaveFunctors[uiFunctorIndex](core, this);
184 else // unknown field container
186 result = _defaultLeaveFunction(core, this);
192 /*-------------------------- assignment -----------------------------------*/
194 /** \brief assignment
198 /*-------------------------- comparison -----------------------------------*/
200 /** \brief assignment
213 /*-------------------------------------------------------------------------*\
215 \*-------------------------------------------------------------------------*/
219 /*-------------------------------------------------------------------------*\
221 \*-------------------------------------------------------------------------*/