#ifndef COIN_SOLAZYELEMENT_H #define COIN_SOLAZYELEMENT_H /**************************************************************************\ * * This file is part of the Coin 3D visualization library. * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. * See the file LICENSE.GPL at the root directory of this source * distribution for additional information about the GNU GPL. * * For using Coin with software that can not be combined with the GNU * GPL, and for taking advantage of the additional benefits of our * support services, please contact Systems in Motion about acquiring * a Coin Professional Edition License. * * See http://www.coin3d.org/ for more information. * * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY. * http://www.sim.no/ sales@sim.no coin-support@coin3d.org * \**************************************************************************/ #include #include #include class SoMFFloat; class SoMFColor; class SoColorPacker; class SoLazyElementP; class SoGLImage; #define SO_LAZY_SHINY_THRESHOLD 0.005f class COIN_DLL_API SoLazyElement : public SoElement { typedef SoElement inherited; SO_ELEMENT_HEADER(SoLazyElement); public: static void initClass(); protected: ~SoLazyElement(); public: enum cases { LIGHT_MODEL_CASE = 0, COLOR_MATERIAL_CASE, DIFFUSE_CASE, AMBIENT_CASE, EMISSIVE_CASE, SPECULAR_CASE, SHININESS_CASE, BLENDING_CASE, TRANSPARENCY_CASE, VERTEXORDERING_CASE, TWOSIDE_CASE, CULLING_CASE, SHADE_MODEL_CASE, GLIMAGE_CASE, ALPHATEST_CASE, LAZYCASES_LAST // must be last }; enum masks{ LIGHT_MODEL_MASK = 1 << LIGHT_MODEL_CASE, // 0x0001 COLOR_MATERIAL_MASK = 1 << COLOR_MATERIAL_CASE, // 0x0002 DIFFUSE_MASK = 1 << DIFFUSE_CASE, // 0x0004 AMBIENT_MASK = 1 << AMBIENT_CASE, // 0x0008 EMISSIVE_MASK = 1<array; } SbBool diffuseMatch(const uint32_t nodeid) const { return nodeid == this->diffuseid; } SbBool transpMatch(const uint32_t nodeid) const { return nodeid == this->transpid; } void setNodeIds(const uint32_t diffuse, const uint32_t transp) { this->diffuseid = diffuse; this->transpid = transp; } int32_t getSize(void) const { return this->arraysize; } void reallocate(const int32_t size); #ifdef COIN_NEXT_MINOR uint32_t getDiffuseId(void) const { return this->diffuseid; } uint32_t getTranspId(void) const { return this->transpid; } #endif // COIN_NEXT_MINOR private: uint32_t transpid; uint32_t diffuseid; uint32_t * array; int32_t arraysize; }; #endif // !COIN_SOLAZYELEMENT_H