SoState - Online Linux Manual PageSection : 3
Updated : Mon Jan 25 2021
Source : Version 3.1.3
Note : Coin

NAMESoState − The SoState class manages the Coin scenegraph traversal state data​.

SYNOPSIS
#include <Inventor/misc/SoState​.h>

Public Member FunctionsSoState (SoAction *action, const SoTypeList &enabledelements)
~SoState (void)
SoAction * getAction (void) const
SoElement * getElement (const int stackindex)
const SoElement * getConstElement (const int stackindex) const
void push (void)
void pop (void)
void print (FILE *const file=stdout) const
SbBool isElementEnabled (const int stackindex) const
int getDepth (void) const
void setCacheOpen (const SbBool flag)
SbBool isCacheOpen (void) const
SoElement * getElementNoPush (const int stackindex) const

Detailed DescriptionThe SoState class manages the Coin scenegraph traversal state data​. The SoState class is used by actions derived from the SoAction class​. It manages the scenegraph state as stacks of elements (ie instances of classes derived from SoElement)​. For more information on the inner workings of traversal states in Coin, we recommend the book «The Inventor Toolmaker» (ISBN 0-201-62493-1), also available at SGI's online library​. Search for 'Toolmaker'​.

Constructor & Destructor Documentation

SoState::SoState (SoAction * theAction, const SoTypeList & enabledelements)The constructor​. The theAction argument is the action object the state is part of, and the enabledElements argument is an SoTypeList of the elements that are enabled for this action​. The constructor pushes a default element onto the indexes of all the enabled element stacks​. SoElement::push() is not called on the initial elements in the SoState stacks, but SoElement::init() is​.

SoState::~SoState (void)The destructor​. Note that when destruction happens, lagging events caused by lazy evaluation won't be performed​.

Member Function Documentation

SoAction * SoState::getAction (void) constThis method returns the pointer to the action instance given to the constructor​.

SoElement * SoState::getElement (const int stackindex)This method returns a modifyable instance of the element on the top of the stack with the given stackindex​. Because of lazy programming, this function may need to do some work, so SoState::getConstElement() should be used instead whenever possible​.

const SoElement * SoState::getConstElement (const int stackIndex) const [inline]This method returns a pointer to the top element of the given element stack​. The element is read-only and must not be changed under any circumstances or strange side-effect will occur​. Note that this function will assert if the element with the given stack identity value is not presently on the state stack​. To check whether or not an element is present in the stack, use SoState::isElementEnabled()​.

void SoState::push (void)This method pushes the state one level down​. This saves the state so it can be changed and later restored to this state by calling SoState::pop()​. The push and pop mechanism is performed lazily for efficiency reasons (avoids a lot of memory allocation and copying)​. Only when a state element is actually going to be changed, that element will be pushed for real​.

void SoState::pop (void)This method pops the state to restore it to a previous state​. Pops are performed eagerly but the code is very tight so there is no reason to worry about efficiency​.

void SoState::print (FILE *const file = stdout) constThis method is just for debugging purposes​.

SbBool SoState::isElementEnabled (const int stackindex) const [inline]This method returns TRUE if the element with the given element stack index is enabled, and FALSE otherwise​.

int SoState::getDepth (void) constThis method returns the current depth of the state stack​. The depth is 'virtual', not necessarily physical​.

void SoState::setCacheOpen (const SbBool open)Controls whether a cache is open​.

SbBool SoState::isCacheOpen (void) const [inline]Returns whether a cache is open​.

AuthorGenerated automatically by Doxygen for Coin from the source code​.
0
Johanes Gumabo
Data Size   :   17,407 byte
man-SoState.3coin3Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 182,978
Visitor ID   :     :  
Visitor IP   :   3.145.152.146   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.