.TH "SoCullElement" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoCullElement \- .PP The \fBSoCullElement\fP class is used internally for render and pick culling\&. .PP The element holds all planes the geometry should be inside, and keeps a bitflag to signal which planes need to be tested\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoElement\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual void \fBinit\fP (\fBSoState\fP *state)" .br .ti -1c .RI "virtual void \fBpush\fP (\fBSoState\fP *state)" .br .ti -1c .RI "virtual SbBool \fBmatches\fP (const \fBSoElement\fP *elt) const " .br .ti -1c .RI "virtual \fBSoElement\fP * \fBcopyMatchInfo\fP (void) const " .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static int \fBgetClassStackIndex\fP (void)" .br .ti -1c .RI "static void * \fBcreateInstance\fP (void)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .ti -1c .RI "static void \fBsetViewVolume\fP (\fBSoState\fP *state, const \fBSbViewVolume\fP &vv)" .br .ti -1c .RI "static void \fBaddPlane\fP (\fBSoState\fP *state, const \fBSbPlane\fP &newplane)" .br .ti -1c .RI "static SbBool \fBcullBox\fP (\fBSoState\fP *state, const \fBSbBox3f\fP &box, const SbBool transform=TRUE)" .br .ti -1c .RI "static SbBool \fBcullTest\fP (\fBSoState\fP *state, const \fBSbBox3f\fP &box, const SbBool transform=TRUE)" .br .ti -1c .RI "static SbBool \fBcompletelyInside\fP (\fBSoState\fP *state)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual \fB~SoCullElement\fP ()" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBSoCullElement\fP class is used internally for render and pick culling\&. .PP The element holds all planes the geometry should be inside, and keeps a bitflag to signal which planes need to be tested\&. This element is an extension for Coin, and is not available in the original Open Inventor\&. .PP The maximum number of planes in this element is 32, which should be more than enough, since the view frustum is represented by 6 planes, and the maximum number of OpenGL clipping planes is typically 6 or 8\&. .PP This element is designed for fast culling, and will not do optimal view frustum culling; a box might not be culled even though it is outside the view frustum\&. The assumption is that the view frustum is small compared to the world model\&. The element simply records all planes to be culled against, and the graph is not culled until it is completely outside one of the planes\&. .PP \fBSoCullElement\fP is not active for other actions than \fBSoGLRenderAction\fP\&. It's possible to enable it for \fBSoCallbackAction\fP by updating it in a post camera callback though\&. Do something like this: .PP .PP .nf static SoCallbackAction::Response camera_cb(void * data, SoCallbackAction * action, const SoNode * node) { SoState * state = action->getState(); SoCullElement::setViewVolume(state, SoViewVolumeElement::get(state)); return SoCallbackAction::CONTINUE; } [...] SoCallbackAction cba(myviewport); cba.addPostCallback(SoCamera::getClassTypeId(), camera_cb, NULL);.fi .PP .PP When the view volume is set in \fBSoCullElement\fP in the post camera callback, \fBSoCallbackAction\fP will perform culling on Separators and other nodes in the same way as \fBSoGLRenderAction\fP\&. .SH "Constructor & Destructor Documentation" .PP .SS "SoCullElement::~SoCullElement ()\fC [protected]\fP, \fC [virtual]\fP" The destructor\&. .SH "Member Function Documentation" .PP .SS "void * SoCullElement::createInstance (void)\fC [static]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .SS "void SoCullElement::init (\fBSoState\fP *state)\fC [virtual]\fP" This function initializes the element type in the given \fBSoState\fP\&. It is called for the first element of each enabled element type in \fBSoState\fP objects\&. .PP Reimplemented from \fBSoElement\fP\&. .SS "void SoCullElement::push (\fBSoState\fP *state)\fC [virtual]\fP" This method is called every time a new element is required in one of the stacks\&. This happens when a writable element is requested, using \fBSoState::getElement()\fP or indirectly \fBSoElement::getElement()\fP, and the depth of the current element is less than the state depth\&. .PP Override this method if your element needs to copy data from the previous top of stack\&. The \fBpush()\fP method is called on the new element, and the previous element can be found using \fBSoElement::getNextInStack()\fP\&. .PP Reimplemented from \fBSoElement\fP\&. .SS "void SoCullElement::setViewVolume (\fBSoState\fP *state, const \fBSbViewVolume\fP &vv)\fC [static]\fP" Sets the current view volume\&. In effect, this adds six planes to the list of culling planes\&. If a view volume has already been set, the old view volume planes are overwritten by the new ones\&. The view volume must be in the world coordinate systems\&. .SS "void SoCullElement::addPlane (\fBSoState\fP *state, const \fBSbPlane\fP &newplane)\fC [static]\fP" Add plane geometry must be inside\&. The plane must be in the world coordinate system\&. .SS "SbBool SoCullElement::cullBox (\fBSoState\fP *state, const \fBSbBox3f\fP &box, const SbBooltransform = \fCTRUE\fP)\fC [static]\fP" Cull against \fIbox\fP\&. If \fItransform\fP is \fCTRUE\fP, the box is assumed to be in object space, and will be transformed into world space using the model matrix\&. Returns \fCTRUE\fP if box is outside one of the planes, and updates the element to detect when geometry is completely inside all planes\&. .SS "SbBool SoCullElement::cullTest (\fBSoState\fP *state, const \fBSbBox3f\fP &box, const SbBooltransform = \fCTRUE\fP)\fC [static]\fP" Cull against \fIbox\fP\&. If \fItransform\fP is \fCTRUE\fP, the box is assumed to be in object space, and will be transformed into world space using the model matrix\&. Returns \fCTRUE\fP if box is outside one of the planes\&. This method will not update the element state, just perform a cull test against active planes\&. .SS "SbBool SoCullElement::completelyInside (\fBSoState\fP *state)\fC [static]\fP" Returns \fCTRUE\fP if the current geometry is completely inside all planes\&. There is no need to do a cull test if this is the case\&. .SS "SbBool SoCullElement::matches (const \fBSoElement\fP *element) const\fC [virtual]\fP" This function returns \fCTRUE\fP is the element matches another element (of the same class), with respect to cache validity\&. .PP If the application programmer's extension element has a \fBmatches()\fP function, it should also have a \fBcopyMatchInfo()\fP function\&. .PP Implements \fBSoElement\fP\&. .SS "\fBSoElement\fP * SoCullElement::copyMatchInfo (void) const\fC [virtual]\fP" This function creates a copy of the element that contains enough information to enable the \fBmatches()\fP function to work\&. .PP Used to help with scenegraph traversal caching operations\&. .PP Implements \fBSoElement\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.