Coin Logo http://www.sim.no
http://www.coin3d.org

SoOverrideElement.h

00001 #ifndef COIN_SOOVERRIDEELEMENT_H
00002 #define COIN_SOOVERRIDEELEMENT_H
00003 
00004 /**************************************************************************\
00005  *
00006  *  This file is part of the Coin 3D visualization library.
00007  *  Copyright (C) 1998-2007 by Systems in Motion.  All rights reserved.
00008  *
00009  *  This library is free software; you can redistribute it and/or
00010  *  modify it under the terms of the GNU General Public License
00011  *  ("GPL") version 2 as published by the Free Software Foundation.
00012  *  See the file LICENSE.GPL at the root directory of this source
00013  *  distribution for additional information about the GNU GPL.
00014  *
00015  *  For using Coin with software that can not be combined with the GNU
00016  *  GPL, and for taking advantage of the additional benefits of our
00017  *  support services, please contact Systems in Motion about acquiring
00018  *  a Coin Professional Edition License.
00019  *
00020  *  See http://www.coin3d.org/ for more information.
00021  *
00022  *  Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
00023  *  http://www.sim.no/  sales@sim.no  coin-support@coin3d.org
00024  *
00025 \**************************************************************************/
00026 
00027 #include <Inventor/elements/SoSubElement.h>
00028 #include <Inventor/system/inttypes.h>
00029 
00030 class SoType; // lame doxygen "fix"
00031 
00032 class COIN_DLL_API SoOverrideElement : public SoElement {
00033   typedef SoElement inherited;
00034 
00035   SO_ELEMENT_HEADER(SoOverrideElement);
00036 public:
00037   static void initClass(void);
00038 protected:
00039   virtual ~SoOverrideElement();
00040 
00041 public:
00042   enum FlagBits {
00043     AMBIENT_COLOR     = 0x00000001,
00044     COLOR_INDEX       = 0x00000002,
00045     COMPLEXITY        = 0x00000004,
00046     COMPLEXITY_TYPE   = 0x00000008,
00047     CREASE_ANGLE      = 0x00000010,
00048     DIFFUSE_COLOR     = 0x00000020,
00049     DRAW_STYLE        = 0x00000040,
00050     EMISSIVE_COLOR    = 0x00000080,
00051     FONT_NAME         = 0x00000100,
00052     FONT_SIZE         = 0x00000200,
00053     LIGHT_MODEL       = 0x00000400,
00054     LINE_PATTERN      = 0x00000800,
00055     LINE_WIDTH        = 0x00001000,
00056     MATERIAL_BINDING  = 0x00002000,
00057     POINT_SIZE        = 0x00004000,
00058     PICK_STYLE        = 0x00008000,
00059     SHAPE_HINTS       = 0x00010000,
00060     SHININESS         = 0x00020000,
00061     SPECULAR_COLOR    = 0x00040000,
00062     POLYGON_OFFSET    = 0x00080000,
00063     TRANSPARENCY      = 0x00100000,
00064     TRANSPARENCY_TYPE = 0x00200000, 
00065     NORMAL_VECTOR     = 0x00400000,
00066     NORMAL_BINDING    = 0x00800000
00067   };
00068   
00069   virtual void init(SoState * state);
00070 
00071   virtual void push(SoState * state);
00072 
00073   virtual SbBool matches(const SoElement * element) const;
00074   virtual SoElement * copyMatchInfo(void) const;
00075 
00076   static uint32_t getFlags(SoState * const state) {
00077     return ((SoOverrideElement*)getConstElement(state, classStackIndex))->flags;
00078   }
00079 
00080   static SbBool getAmbientColorOverride(SoState * const state);
00081   static SbBool getColorIndexOverride(SoState * const state);
00082   static SbBool getComplexityOverride(SoState * const state);
00083   static SbBool getComplexityTypeOverride(SoState * const state);
00084   static SbBool getCreaseAngleOverride(SoState * const state);
00085   static SbBool getDiffuseColorOverride(SoState * const state);
00086   static SbBool getDrawStyleOverride(SoState * const state);
00087   static SbBool getEmissiveColorOverride(SoState * const state);
00088   static SbBool getFontNameOverride(SoState * const state);
00089   static SbBool getFontSizeOverride(SoState * const state);
00090   static SbBool getLightModelOverride(SoState * const state);
00091   static SbBool getLinePatternOverride(SoState * const state);
00092   static SbBool getLineWidthOverride(SoState * const state);
00093   static SbBool getMaterialBindingOverride(SoState * const state);
00094   static SbBool getPickStyleOverride(SoState * const state);
00095   static SbBool getPointSizeOverride(SoState * const state);
00096   static SbBool getPolygonOffsetOverride(SoState * const state);
00097   static SbBool getShapeHintsOverride(SoState * const state);
00098   static SbBool getShininessOverride(SoState * const state);
00099   static SbBool getSpecularColorOverride(SoState * const state);
00100   static SbBool getTransparencyOverride(SoState * const state);
00101   static SbBool getTransparencyTypeOverride(SoState * const state);
00102   static SbBool getNormalVectorOverride(SoState * const state);
00103   static SbBool getNormalBindingOverride(SoState * const state);
00104 
00105   static void setAmbientColorOverride(SoState * const state,
00106                                       SoNode * const node,
00107                                       const SbBool override);
00108   static void setColorIndexOverride(SoState * const state,
00109                                     SoNode * const node,
00110                                     const SbBool override);
00111   static void setComplexityOverride(SoState * const state,
00112                                     SoNode * const node,
00113                                     const SbBool override);
00114   static void setComplexityTypeOverride(SoState * const state,
00115                                         SoNode * const node,
00116                                         const SbBool override);
00117   static void setCreaseAngleOverride(SoState * const state,
00118                                      SoNode * const node,
00119                                      const SbBool override);
00120   static void setDiffuseColorOverride(SoState * const state,
00121                                       SoNode * const node,
00122                                       const SbBool override);
00123   static void setDrawStyleOverride(SoState * const state,
00124                                    SoNode * const node,
00125                                    const SbBool override);
00126   static void setEmissiveColorOverride(SoState * const state,
00127                                        SoNode * const node,
00128                                        const SbBool override);
00129   static void setFontNameOverride(SoState * const state,
00130                                   SoNode * const node,
00131                                   const SbBool override);
00132   static void setFontSizeOverride(SoState * const state,
00133                                   SoNode * const node,
00134                                   const SbBool override);
00135   static void setLightModelOverride(SoState * const state,
00136                                     SoNode * const node,
00137                                     const SbBool override);
00138   static void setLinePatternOverride(SoState * const state,
00139                                      SoNode * const node,
00140                                      const SbBool override);
00141   static void setLineWidthOverride(SoState * const state,
00142                                    SoNode * const node,
00143                                    const SbBool override);
00144   static void setMaterialBindingOverride(SoState * const state,
00145                                          SoNode * const node,
00146                                          const SbBool override);
00147   static void setPickStyleOverride(SoState * const state,
00148                                    SoNode * const node,
00149                                    const SbBool override);
00150   static void setPointSizeOverride(SoState * const state,
00151                                    SoNode * const node,
00152                                    const SbBool override);
00153   static void setPolygonOffsetOverride(SoState * const state,
00154                                        SoNode * const node,
00155                                        const SbBool override);
00156   static void setShapeHintsOverride(SoState * const state,
00157                                     SoNode * const node,
00158                                     const SbBool override);
00159   static void setShininessOverride(SoState * const state,
00160                                    SoNode * const node,
00161                                    const SbBool override);
00162   static void setSpecularColorOverride(SoState * const state,
00163                                        SoNode * const node,
00164                                        const SbBool override);
00165   static void setTransparencyOverride(SoState * const state,
00166                                       SoNode * const node,
00167                                       const SbBool override);
00168   static void setTransparencyTypeOverride(SoState * const state,
00169                                           SoNode * const node,
00170                                           const SbBool override);
00171   static void setNormalVectorOverride(SoState * const state,
00172                                       SoNode * const node,
00173                                       const SbBool override);
00174   static void setNormalBindingOverride(SoState * const state,
00175                                        SoNode * const node,
00176                                        const SbBool override);
00177 
00178   virtual void print(FILE * file) const;
00179 
00180 private:
00181 
00182   uint32_t flags;
00183 };
00184 
00185 #endif // !COIN_SOOVERRIDEELEMENT_H

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Mon Feb 28 2011 10:11:57 for Coin by Doxygen. 1.7.3