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

SoMultiTextureCoordinateElement.h
00001 #ifndef COIN_SOMULTITEXTURECOORDINATEELEMENT_H
00002 #define COIN_SOMULTITEXTURECOORDINATEELEMENT_H
00003 
00004 /**************************************************************************\
00005  *
00006  *  This file is part of the Coin 3D visualization library.
00007  *  Copyright (C) by Kongsberg Oil & Gas Technologies.
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 Kongsberg Oil & Gas Technologies
00018  *  about acquiring a Coin Professional Edition License.
00019  *
00020  *  See http://www.coin3d.org/ for more information.
00021  *
00022  *  Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
00023  *  http://www.sim.no/  sales@sim.no  coin-support@coin3d.org
00024  *
00025 \**************************************************************************/
00026 
00027 #include <Inventor/elements/SoTextureCoordinateElement.h>
00028 #include <Inventor/elements/SoSubElement.h>
00029 #include <Inventor/SbVec2f.h>
00030 #include <Inventor/SbVec3f.h>
00031 #include <Inventor/SbVec4f.h>
00032 
00033 class SoMultiTextureCoordinateElementP;
00034 
00035 class COIN_DLL_API SoMultiTextureCoordinateElement : public SoElement {
00036   typedef SoElement inherited;
00037 
00038   SO_ELEMENT_HEADER(SoMultiTextureCoordinateElement);
00039 public:
00040   static void initClass(void);
00041 protected:
00042   virtual ~SoMultiTextureCoordinateElement();
00043 
00044 public:
00045 
00046   virtual void init(SoState * state);
00047 
00048   static void setDefault(SoState * const state, SoNode * const node, const int unit);
00049   static void setFunction(SoState * const state, SoNode * const node,
00050                           const int unit,
00051                           SoTextureCoordinateFunctionCB * const func,
00052                           void * const userdata);
00053 
00054   static void set2(SoState * const state, SoNode * const node,
00055                    const int unit,
00056                    const int32_t numCoords, const SbVec2f * const coords);
00057   static void set3(SoState * const state, SoNode * const node,
00058                    const int unit,
00059                    const int32_t numCoords, const SbVec3f * const coords);
00060   static void set4(SoState * const state, SoNode * const node,
00061                    const int unit,
00062                    const int32_t numCoords, const SbVec4f * const coords);
00063 
00064   static SoTextureCoordinateElement::CoordType getType(SoState * const state, const int unit);
00065   virtual SoTextureCoordinateElement::CoordType getType(const int unit) const;
00066 
00067   static const SoMultiTextureCoordinateElement * getInstance(SoState * const state);
00068 
00069   const SbVec4f & get(const int unit,
00070                       const SbVec3f & point,
00071                       const SbVec3f & normal) const;
00072 
00073   int32_t getNum(const int unit) const;
00074   SbBool is2D(const int unit) const;
00075   int32_t getDimension(const int unit) const;
00076 
00077   const SbVec2f & get2(const int unit, const int index) const;
00078   const SbVec3f & get3(const int unit, const int index) const;
00079   const SbVec4f & get4(const int unit, const int index) const;
00080 
00081   const SbVec2f * getArrayPtr2(const int unit) const;
00082   const SbVec3f * getArrayPtr3(const int unit) const;
00083   const SbVec4f * getArrayPtr4(const int unit) const;
00084 
00085   class UnitData {
00086   public:
00087     uint32_t nodeid;
00088     SoTextureCoordinateElement::CoordType whatKind;
00089     SoTextureCoordinateFunctionCB * funcCB;
00090     void * funcCBData;
00091     int32_t numCoords;
00092     const SbVec2f * coords2;
00093     const SbVec3f * coords3;
00094     const SbVec4f * coords4;
00095     int coordsDimension;
00096   };
00097 
00098   virtual void push(SoState * state);
00099   virtual SbBool matches(const SoElement * elem) const;
00100   SoElement * copyMatchInfo(void) const;
00101 
00102 protected:
00103   UnitData & getUnitData(const int unit);
00104   const UnitData & getUnitData(const int unit) const;
00105   SbVec2f convert2;
00106   SbVec3f convert3;
00107   SbVec4f convert4;
00108 
00109 private:
00110   SoMultiTextureCoordinateElementP * pimpl;
00111 };
00112 
00113 #endif // !COIN_SOMULTITEXTURECOORDINATEELEMENT_H

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Fri Dec 11 2015 03:24:54 for Coin by Doxygen 1.7.6.1.