SbBool
SoXipOverlayManipulatedElement::get( SoState* state )
{
	const SoXipOverlayManipulatedElement* elt = (const SoXipOverlayManipulatedElement*)
		getConstElement( state, classStackIndex );
	
	return elt ? elt->mIsManipulated : FALSE;
}
Ejemplo n.º 2
0
const SoClipPlaneElement *
SoClipPlaneElement::getInstance(SoState *state)
//
////////////////////////////////////////////////////////////////////////
{
    return (const SoClipPlaneElement *)
	getConstElement(state, classStackIndex);
}
Ejemplo n.º 3
0
const SoNodeList &
SoProfileElement::get(SoState *state)
//
////////////////////////////////////////////////////////////////////////
{
    const SoProfileElement *elt;
    elt = (const SoProfileElement *)
	getConstElement(state, classStackIndex);

    return elt->profiles;
}
/*!
  Returns TRUE if any of the images have at least one transparent pixel.
  
  \since Coin 3.1
*/
SbBool 
SoGLMultiTextureImageElement::hasTransparency(SoState * state)
{
  const SoGLMultiTextureImageElement * elem = (const SoGLMultiTextureImageElement*)
    getConstElement(state, classStackIndex);
  
  for (int i = 0; i <= PRIVATE(elem)->unitdata.getLength(); i++) {
    if (elem->hasTransparency(i)) return TRUE;
  }
  return FALSE;
}
Ejemplo n.º 5
0
const SbMatrix &
SoModelMatrixElement::get(SoState *state)
//
////////////////////////////////////////////////////////////////////////
{
    const SoModelMatrixElement *elt;

    elt = (const SoModelMatrixElement *)
          getConstElement(state, classStackIndex);

    return elt->modelMatrix;
}
int
SoGLCacheContextElement::get(SoState *state)
//
////////////////////////////////////////////////////////////////////////
{
    const SoGLCacheContextElement	*elt;

    elt = (const SoGLCacheContextElement *)
	getConstElement(state, classStackIndex);

    return elt->context;
}
const SbVec3f &
SoLightAttenuationElement::get(SoState *state)
//
////////////////////////////////////////////////////////////////////////
{
    const SoLightAttenuationElement *elt;

    elt = (const SoLightAttenuationElement *)
	getConstElement(state, classStackIndex);

    return elt->attenuation;
}
const SbMatrix &
SoProjectionMatrixElement::get(SoState *state)
//
////////////////////////////////////////////////////////////////////////
{
    const SoProjectionMatrixElement *elt;

    elt = (const SoProjectionMatrixElement *)
	getConstElement(state, classStackIndex);

    return elt->projectionMatrix;
}
SbBool
SoTextureImageElement::containsTransparency(SoState *state)
//
////////////////////////////////////////////////////////////////////////
{
    const SoTextureImageElement *elt;

    elt = (const SoTextureImageElement *)
	getConstElement(state, classStackIndex);

    return (elt->numComponents == 2 || elt->numComponents == 4);
}
Ejemplo n.º 10
0
int
SoGLRenderPassElement::get(SoState *state)
//
////////////////////////////////////////////////////////////////////////
{
    const SoGLRenderPassElement *elt;

    elt = (const SoGLRenderPassElement *)
	getConstElement(state, classStackIndex);

    return elt->GLRenderPass;
}
Ejemplo n.º 11
0
SoSFInt32*  
SoXipMprActiveElement::getMprFieldIndex(SoState *state) 
{
	const SoXipMprActiveElement *elt;
    elt = (const SoXipMprActiveElement *)getConstElement(state, classStackIndex);
	
	if ( (elt != NULL) )
		return elt->mprIdField;
	else
		return NULL;

}
void
SoGLStencilBitsElement::clear(SoState *state, uint32_t mask, int32_t value)
{
   if(mask == 0x0)
      return;
   
   value <<= getNumBitPositionsToShift(mask);
   
   const SoGLStencilBitsElement *elt = (SoGLStencilBitsElement *)getConstElement(state, classStackIndex);
   
   // If no other node has stencil bits in use, then
   if((mask & (uint32_t)elt->data) == (uint32_t)elt->data) {
      glClearStencil((GLint)value);
      glClear(GL_STENCIL_BUFFER_BIT);
   }
   else {
      const SbViewportRegion &vp = SoViewportRegionElement::get(state);
      SbVec2s vpSize = vp.getViewportSizePixels();

      glPushAttrib(GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

      glEnable(GL_STENCIL_TEST);
      
      glStencilFunc(GL_ALWAYS, (GLint)value, mask);
      glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);

      glDisable(GL_DEPTH_TEST);
      glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);

      glMatrixMode(GL_PROJECTION);
      glPushMatrix();
      glLoadIdentity();
      glOrtho(0, vpSize[0], 0, vpSize[1], -1, 1);
      glMatrixMode(GL_MODELVIEW);
      glPushMatrix();
      glLoadIdentity();

      glBegin(GL_QUADS);
      glVertex2i(0, 0);
      glVertex2i(vpSize[0], 0);
      glVertex2i(vpSize[0], vpSize[1]);
      glVertex2i(0, vpSize[1]);
      glEnd();

      glMatrixMode(GL_PROJECTION);
      glPopMatrix();
      glMatrixMode(GL_MODELVIEW);
      glPopMatrix();

      glPopAttrib();
   }
}
Ejemplo n.º 13
0
const SbMatrix &
SoModelMatrixElement::getCombinedCullMatrix(SoState *state)
//
////////////////////////////////////////////////////////////////////////
{
    const SoModelMatrixElement	*elt;

    elt = (const SoModelMatrixElement *) getConstElement(state,
            classStackIndex);
    if (!elt->flags.haveModelCull) {
        // Cast const away:
        SoModelMatrixElement *m_elt = (SoModelMatrixElement *)elt;

        if (!elt->flags.haveCullMatrix) {
            // Grab cull matrix from one of our parent elements:
            const SoModelMatrixElement *parent =
                (const SoModelMatrixElement *)elt->getNextInStack();

            while (parent && !parent->flags.haveCullMatrix)
                parent =
                    (const SoModelMatrixElement *)parent->getNextInStack();

            if (parent) {
                m_elt->cullMatrix = parent->cullMatrix;
                m_elt->flags.haveCullMatrix = TRUE;
            }
            else {
                // Uh-oh, no cull matrix.
#ifdef DEBUG
                SoDebugError::post("SoModelMatrixElement::getCombinedCullMatrix",
                                   "No cull matrix set (culling Separator "
                                   "traversed before camera)");
#endif
                m_elt->cullMatrix = SbMatrix::identity();
            }
        }
#ifdef DEBUG
        if (SoDebug::GetEnv("IV_DEBUG_MATRIX_CULL"))
            SoDebug::RTPrintf("  M*VP calculated\n");
#endif

        m_elt->modelCullMatrix = elt->modelMatrix*elt->cullMatrix;
        m_elt->flags.haveModelCull = TRUE;
    }
#ifdef DEBUG
    else if (SoDebug::GetEnv("IV_DEBUG_MATRIX_CULL"))
        SoDebug::RTPrintf("  MVP valid\n");
#endif

    return elt->modelCullMatrix;
}
Ejemplo n.º 14
0
const int32_t
SoXipMprActiveElement::getMprIndex(SoState *state) 

{
    const SoXipMprActiveElement *elt;
    elt = (const SoXipMprActiveElement *)getConstElement(state, classStackIndex);
    
	if ( (elt != NULL) )
		return elt->mprId;
	else
		return 0;


}
const SbViewportRegion &
SoViewportRegionElement::get(SoState *state)
//
////////////////////////////////////////////////////////////////////////
{
    const SoViewportRegionElement *elt;

    elt = (const SoViewportRegionElement *)
	getConstElement(state, classStackIndex);
    if (elt != NULL )
	return elt->viewportRegion;
    else
	return *emptyViewportRegion;
}
Ejemplo n.º 16
0
const SbMatrix &
SoModelMatrixElement::get(SoState *state, SbBool &isIdent)
//
////////////////////////////////////////////////////////////////////////
{
    const SoModelMatrixElement *elt;

    elt = (const SoModelMatrixElement *)
          getConstElement(state, classStackIndex);

    isIdent = elt->flags.isModelIdentity;

    return elt->modelMatrix;
}
Ejemplo n.º 17
0
SbBool
SoGLUpdateAreaElement::get(SoState *state, SbVec2f &origin, SbVec2f &size)
//
////////////////////////////////////////////////////////////////////////
{
    const SoGLUpdateAreaElement *elt;

    elt = (const SoGLUpdateAreaElement *)
	getConstElement(state, classStackIndex);

    origin = elt->origin;
    size   = elt->size;

    return (origin == getDefaultOrigin() && size == getDefaultSize());
}
Ejemplo n.º 18
0
void
SoShapeHintsElement::get(SoState *state,
			   VertexOrdering &vertexOrdering,
			   ShapeType &shapeType, FaceType &faceType)
//
////////////////////////////////////////////////////////////////////////
{
    const SoShapeHintsElement *elt;

    elt = (const SoShapeHintsElement *)
	getConstElement(state, classStackIndex);

    vertexOrdering	= elt->vertexOrdering;
    shapeType		= elt->shapeType;
    faceType		= elt->faceType;
}
Ejemplo n.º 19
0
SoGLImage *
SoGLMultiTextureImageElement::get(SoState * state,
                                  const int unit,
                                  Model & model,
                                  SbColor & blendcolor)
{
  const SoGLMultiTextureImageElement * elem = (const SoGLMultiTextureImageElement*)
    getConstElement(state, classStackIndex);

  if (unit < elem->getNumUnits()) {
    const UnitData & ud = elem->getUnitData(unit);
    model = ud.model;
    blendcolor = ud.blendColor;
    return PRIVATE(elem)->unitdata[unit].glimage;
  }
  return NULL;
}
Ejemplo n.º 20
0
const unsigned char *
SoTextureImageElement::get(SoState *state, SbVec2s &_size, 
			   int &_numComponents, int &_wrapS, int &_wrapT,
			   int &_model, SbColor &_blendColor)
//
////////////////////////////////////////////////////////////////////////
{
    const SoTextureImageElement *elt;

    elt = (const SoTextureImageElement *)
	getConstElement(state, classStackIndex);

    _size = elt->size;
    _numComponents = elt->numComponents;
    _wrapS = elt->wrapS;
    _wrapT = elt->wrapT;
    _model = elt->model;
    _blendColor = elt->blendColor;

    return elt->bytes;
}
Ejemplo n.º 21
0
/*!
  Returns the current transparency type.

  \COIN_FUNCTION_EXTENSION

  \since Coin 2.0
*/
int
SoShapeStyleElement::getTransparencyType(SoState * const state)
{
  const SoShapeStyleElement * elem = getConstElement(state);
  return static_cast<int>(elem->flags & TRANSPTYPE_MASK);
}
Ejemplo n.º 22
0
SbBool
SoShapeStyleElement::isScreenDoor(SoState * const state)
{
  const SoShapeStyleElement * elem = getConstElement(state);
  return ((elem->flags & TRANSPTYPE_MASK) == SoGLRenderAction::SCREEN_DOOR);
}
SoXipImageTextColorElement* 
SoXipImageTextColorElement::getInstance( SoState* state )
{
	return (SoXipImageTextColorElement *) getConstElement(state, classStackIndex);
}
Ejemplo n.º 24
0
/*! \fn SoXipVolDataElement::get(SoState *state)
* Returns the current volume data from the state
* \return SoXipData * pointer 
*/
SoXipData *SoXipVolDataElement::get(SoState *state)
{
	SoXipVolDataElement * elt = (SoXipVolDataElement*) getConstElement(state, classStackIndex);

	return elt->mData;
}
/*! \fn SoXipTransparentGeometryGroupElement::getInstance(SoState *state)
 * Returns the first (top) instance of the element in the state.
 * \param state - the current state pointer
 * \return pointer to element instance
 */
SoXipTransparentGeometryGroupElement* SoXipTransparentGeometryGroupElement::getInstance(SoState *state)
{
	return (SoXipTransparentGeometryGroupElement *) getConstElement(state, classStackIndex);
}