osg::GeoPumpFactory Class Reference

Selects a pump function for drawing the given geometry.

#include <OSGGeoPumpFactory.h>

List of all members.

OpenGL Extension handling



static InitFuncWrapper _glextInitFuncWrapper
static bool glextInitFunction (void)

Public Types

typedef UInt32 Index
Pump Types


typedef void(* GeoPump )(Window *win, Geometry *geo)
typedef void(* PartialGeoPump )(Window *win, Geometry *geo, UInt32 primtype, UInt32 firstvert, UInt32 nvert)
typedef void(* InterfacePump )(Window *win, GeoPositionsInterface *pos, GeoNormalsInterface *norm, GeoColorsInterface *col, GeoColorsInterface *seccol, GeoTexCoordsInterface *texcoords, GeoTexCoordsInterface *texcoords1, GeoTexCoordsInterface *texcoords2, GeoTexCoordsInterface *texcoords3, GeoPTypesInterface *type, GeoPLengthsInterface *len, GeoIndicesInterface *ind, UInt16 *map, UInt16 nmap)
typedef void(* PartialInterfacePump )(Window *win, GeoPositionsInterface *pos, GeoNormalsInterface *norm, GeoColorsInterface *col, GeoColorsInterface *seccol, GeoTexCoordsInterface *texcoords, GeoTexCoordsInterface *texcoords1, GeoTexCoordsInterface *texcoords2, GeoTexCoordsInterface *texcoords3, GeoPTypesInterface *type, GeoPLengthsInterface *len, GeoIndicesInterface *ind, UInt16 *map, UInt16 nmap, UInt32 primtype, UInt32 firstvert, UInt32 nvert)

Public Member Functions

Destructors


virtual ~GeoPumpFactory (void)
Get


Index getIndex (Geometry *geo)
GeoPump getGeoPump (Window *win, Index index)
PartialGeoPump getPartialGeoPump (Window *win, Index index)
InterfacePump getInterfacePump (Window *win, Index index)
PartialInterfacePump getPartialInterfacePump (Window *win, Index index)

Static Public Member Functions

Class Get


static const char * getClassname (void)
Access


static GeoPumpFactorythe (void)

Static Public Attributes

OpenGL Extension handling


static UInt32 _extSecondaryColor
static UInt32 _extMultitexture
static UInt32 _extCompiledVertexArray
static UInt32 _extDrawRangeElements
static UInt32 _arbVBO
static UInt32 _funcglSecondaryColorPointer
static UInt32 _funcglClientActiveTextureARB
static UInt32 _funcglLockArraysEXT
static UInt32 _funcglUnlockArraysEXT
static UInt32 _funcglDrawRangeElementsEXT
static UInt32 _funcglGenBuffersARB
static UInt32 _funcglDeleteBuffersARB
static UInt32 _funcglBindBufferARB
static UInt32 _funcglBufferDataARB
static UInt32 _funcglBufferSubDataARB
static UInt32 _funcglGenBuffers
static UInt32 _funcglDeleteBuffers
static UInt32 _funcglBindBuffer
static UInt32 _funcglBufferData
static UInt32 _funcglBufferSubData

Protected Member Functions

virtual Index numIndices (void)
Constructors


 GeoPumpFactory (void)

Private Member Functions

void operator= (const GeoPumpFactory &source)
Constructors


 GeoPumpFactory (const GeoPumpFactory &source)

Static Private Member Functions

The Pumps


static void masterGeoPump (Window *win, Geometry *geo)
static void masterPartialGeoPump (Window *win, Geometry *geo, UInt32 primtype, UInt32 firstvert, UInt32 nvert)
static void masterInterfacePump (Window *win, GeoPositionsInterface *pos, GeoNormalsInterface *norm, GeoColorsInterface *col, GeoColorsInterface *seccol, GeoTexCoordsInterface *texcoords, GeoTexCoordsInterface *texcoords2, GeoTexCoordsInterface *texcoords3, GeoTexCoordsInterface *texcoords4, GeoPTypesInterface *type, GeoPLengthsInterface *len, GeoIndicesInterface *ind, UInt16 *map, UInt16 nmap)
static void masterPartialInterfacePump (Window *win, GeoPositionsInterface *pos, GeoNormalsInterface *norm, GeoColorsInterface *col, GeoColorsInterface *seccol, GeoTexCoordsInterface *texcoords, GeoTexCoordsInterface *texcoords2, GeoTexCoordsInterface *texcoords3, GeoTexCoordsInterface *texcoords4, GeoPTypesInterface *type, GeoPLengthsInterface *len, GeoIndicesInterface *ind, UInt16 *map, UInt16 nmap, UInt32 primtype, UInt32 firstvert, UInt32 nvert)

Static Private Attributes

static char cvsid []
static GeoPumpFactory_the = NULL
static GeoPump GeoPumps [131]


Detailed Description

Definition at line 67 of file OSGGeoPumpFactory.h.


Member Typedef Documentation

Definition at line 72 of file OSGGeoPumpFactory.h.

typedef void(* osg::GeoPumpFactory::GeoPump)(Window *win, Geometry *geo)

typedef void(* osg::GeoPumpFactory::PartialGeoPump)(Window *win, Geometry *geo, UInt32 primtype, UInt32 firstvert, UInt32 nvert)


Constructor & Destructor Documentation

GeoPumpFactory::~GeoPumpFactory ( void   )  [virtual]

Definition at line 140 of file OSGGeoPumpFactory.cpp.

00141 {
00142 }

GeoPumpFactory::GeoPumpFactory ( void   )  [protected]

Definition at line 136 of file OSGGeoPumpFactory.cpp.

Referenced by the().

00137 {
00138 }

osg::GeoPumpFactory::GeoPumpFactory ( const GeoPumpFactory source  )  [private]


Member Function Documentation

static const char* osg::GeoPumpFactory::getClassname ( void   )  [inline, static]

Definition at line 109 of file OSGGeoPumpFactory.h.

00109 { return "GeoPumpFactory"; }

GeoPumpFactory::Index GeoPumpFactory::getIndex ( Geometry geo  ) 

Access the index of the given Geometry. Needed to access the Pump.

Definition at line 155 of file OSGGeoPumpFactory.cpp.

References osg::GeometryBase::getColors(), osg::GeometryBase::getIndexMapping(), osg::GeometryBase::getIndices(), osg::GeometryBase::getLengths(), osg::GeometryBase::getNormals(), osg::GeometryBase::getPositions(), osg::GeometryBase::getSecondaryColors(), osg::GeometryBase::getTexCoords(), osg::GeometryBase::getTexCoords1(), osg::GeometryBase::getTexCoords2(), osg::GeometryBase::getTexCoords3(), osg::GeometryBase::getTexCoords4(), osg::GeometryBase::getTexCoords5(), osg::GeometryBase::getTexCoords6(), osg::GeometryBase::getTexCoords7(), osg::GeometryBase::getTypes(), osg::Geometry::MapColor, osg::Geometry::MapNormal, osg::Geometry::MapSecondaryColor, osg::Geometry::MapTexCoords, osg::Geometry::MapTexCoords1, osg::Geometry::MapTexCoords2, osg::Geometry::MapTexCoords3, osg::Geometry::MapTexCoords4, osg::Geometry::MapTexCoords5, osg::Geometry::MapTexCoords6, osg::Geometry::MapTexCoords7, and osg::NullFC.

Referenced by osg::Geometry::drawPrimitives(), and osg::Geometry::handleGL().

00156 {
00157     if (geo->getPositions() == NullFC ||
00158        !geo->getPositions()->getData() ) return 0; //INVALID
00159 
00160     if (geo->getTypes() == NullFC || !geo->getTypes()->getData() ||
00161         geo->getTypes()->getSize() == 0) return 0; //INVALID
00162 
00163     if (geo->getIndices() == NullFC) return 128; //NON_INDEXED
00164     if (geo->getIndexMapping().size() < 2) return 129; //SINGLE_INDEXED
00165 
00166     if ((geo->getIndices() != NullFC && 
00167          geo->getIndices()->getFormatSize() != 4) ||
00168         (geo->getLengths() != NullFC && 
00169          geo->getLengths()->getFormatSize() != 4)
00170         )
00171         return 130; // Needd to use the master pump
00172     
00173     UInt32 uiIndexMask = 0;
00174 
00175     for(UInt32 i = 0; i < geo->getIndexMapping().size(); ++i)
00176     {
00177         uiIndexMask |= geo->getIndexMapping()[i];
00178     }
00179 
00180     // ok the multi index table supports only 4 texcoord units!
00181     if((uiIndexMask & Geometry::MapTexCoords4 &&
00182        geo->getTexCoords4() != NullFC         &&
00183        geo->getTexCoords4()->getData()          ) ||
00184        (uiIndexMask & Geometry::MapTexCoords5 &&
00185        geo->getTexCoords5() != NullFC         &&
00186        geo->getTexCoords5()->getData()          ) ||
00187        (uiIndexMask & Geometry::MapTexCoords6 &&
00188        geo->getTexCoords6() != NullFC         &&
00189        geo->getTexCoords6()->getData()          ) ||
00190        (uiIndexMask & Geometry::MapTexCoords7 &&
00191        geo->getTexCoords7() != NullFC         &&
00192        geo->getTexCoords7()->getData()          ))
00193     {
00194         return 130; // Needd to use the master pump
00195     }
00196 
00197     int a[7];
00198 
00199     if(uiIndexMask & Geometry::MapColor &&
00200        geo->getColors() != NullFC       &&
00201        geo->getColors()->getData()        ) 
00202     {
00203         a[0]=1;
00204     } 
00205     else 
00206     {
00207         a[0] = 0;
00208     }
00209     
00210     if(uiIndexMask & Geometry::MapSecondaryColor &&
00211        geo->getSecondaryColors() != NullFC       &&
00212        geo->getSecondaryColors()->getData()       ) 
00213     {
00214         a[1]=1;
00215     }
00216     else 
00217     {
00218         a[1]=0;
00219     }
00220 
00221     if(uiIndexMask & Geometry::MapNormal &&
00222        geo->getNormals() != NullFC       &&
00223        geo->getNormals()->getData()        ) 
00224     {
00225         a[2]=1;
00226     }
00227     else
00228     {
00229         a[2]=0;
00230     }
00231 
00232     if(uiIndexMask & Geometry::MapTexCoords &&
00233        geo->getTexCoords() != NullFC        &&
00234        geo->getTexCoords()->getData()        ) 
00235     {
00236         a[3]=1; 
00237     }
00238     else
00239     {
00240         a[3]=0;
00241     }
00242 
00243     if(uiIndexMask & Geometry::MapTexCoords1 &&
00244        geo->getTexCoords1() != NullFC        &&
00245        geo->getTexCoords1()->getData()        ) 
00246     {
00247         a[4]=1; 
00248     }
00249     else
00250     {
00251         a[4]=0;
00252     }
00253 
00254     if(uiIndexMask & Geometry::MapTexCoords2 &&
00255        geo->getTexCoords2() != NullFC        &&
00256        geo->getTexCoords2()->getData()        ) 
00257     {
00258         a[5]=1;
00259     }
00260     else 
00261     {
00262         a[5]=0;
00263     }
00264 
00265     if(uiIndexMask & Geometry::MapTexCoords3 &&
00266        geo->getTexCoords3() != NullFC        &&
00267        geo->getTexCoords3()->getData()        ) 
00268     {
00269         a[6]=1;
00270     }
00271     else
00272     {
00273         a[6]=0;
00274     }
00275 
00276     int index=0;
00277 
00278     for (int i=0; i<7; i++)
00279         if (a[i]) index=index|(1<<i);
00280 
00281     /* if the geometry was detected as multi-indexed,but
00282        there was no index data, then index will be 0, which
00283        corresponds to invalid geometry.
00284      */
00285 
00286     return index;
00287 }

GeoPumpFactory::GeoPump GeoPumpFactory::getGeoPump ( Window win,
GeoPumpFactory::Index  index 
)

Get the full Geometry pump for the given index.

Definition at line 292 of file OSGGeoPumpFactory.cpp.

References GeoPumps.

Referenced by osg::Geometry::drawPrimitives(), and osg::Geometry::handleGL().

00295 {
00296     //FWARNING(("GeoPump%d used\n",index));
00297     return GeoPumps[index]; //crashed windows while testing, watch it.
00298     //return &masterGeoPump;
00299 }

GeoPumpFactory::PartialGeoPump GeoPumpFactory::getPartialGeoPump ( Window win,
GeoPumpFactory::Index  index 
)

Access the index of the given Geometry. Needed to access the Pump.

Definition at line 301 of file OSGGeoPumpFactory.cpp.

References FWARNING.

00304 {
00305     FWARNING(("GeoPumpFactory::getPartialGeoPump: not implemented yet!\n"));
00306     return NULL;
00307 }

GeoPumpFactory::InterfacePump GeoPumpFactory::getInterfacePump ( Window win,
GeoPumpFactory::Index  index 
)

Access the index of the given Geometry. Needed to access the Pump.

Definition at line 309 of file OSGGeoPumpFactory.cpp.

References FWARNING.

00312 {
00313     FWARNING(("GeoPumpFactory::getInterfacePump: not implemented yet!\n"));
00314     return NULL;
00315 }

GeoPumpFactory::PartialInterfacePump GeoPumpFactory::getPartialInterfacePump ( Window win,
GeoPumpFactory::Index  index 
)

Access the index of the given Geometry. Needed to access the Pump.

Definition at line 317 of file OSGGeoPumpFactory.cpp.

References FWARNING.

00320 {
00321     FWARNING(("GeoPumpFactory::getPartialInterfacePump: not "
00322                 "implemented yet!\n"));
00323     return NULL;
00324 }

GeoPumpFactory * osg::GeoPumpFactory::the ( void   )  [inline, static]

Access the GeoPumpFactory Singleton.

Definition at line 54 of file OSGGeoPumpFactory.inl.

References _the, and GeoPumpFactory().

Referenced by osg::Geometry::drawPrimitives(), and osg::Geometry::handleGL().

00055 {
00056     if(_the == NULL)
00057     {
00058         _the = new GeoPumpFactory();
00059     }
00060 
00061     return _the;
00062 }

GeoPumpFactory::Index GeoPumpFactory::numIndices ( void   )  [protected, virtual]

Definition at line 331 of file OSGGeoPumpFactory.cpp.

00332 {
00333     return 131;
00334 }

bool GeoPumpFactory::glextInitFunction ( void   )  [static, private]

Definition at line 2116 of file OSGGeoPumpFactory.cpp.

References _arbVBO, _extCompiledVertexArray, _extDrawRangeElements, _extMultitexture, _extSecondaryColor, _funcglBindBuffer, _funcglBindBufferARB, _funcglBufferData, _funcglBufferDataARB, _funcglBufferSubData, _funcglBufferSubDataARB, _funcglClientActiveTextureARB, _funcglDeleteBuffers, _funcglDeleteBuffersARB, _funcglDrawRangeElementsEXT, _funcglGenBuffers, _funcglGenBuffersARB, _funcglLockArraysEXT, _funcglSecondaryColorPointer, _funcglUnlockArraysEXT, init(), osg::Window::invalidFunctionID, OSG_DLSYM_UNDERSCORE, osg::Window::registerExtension(), and osg::Window::registerFunction().

02117 {
02118     _extSecondaryColor      = 
02119         Window::registerExtension("GL_EXT_secondary_color");
02120     _extMultitexture        = 
02121         Window::registerExtension("GL_ARB_multitexture");
02122     _extCompiledVertexArray = 
02123         Window::registerExtension("GL_EXT_compiled_vertex_array");
02124     _extDrawRangeElements   = 
02125         Window::registerExtension("GL_EXT_draw_range_elements");
02126     _arbVBO =
02127         Window::registerExtension("GL_ARB_vertex_buffer_object");
02128 
02129     UInt16 i,j;
02130     for(i = 0; i < numFormats; i++)
02131     {
02132         for(j = 0; j < 4; j++)
02133         {
02134             SecColorIDs  [i][j] = Window::invalidFunctionID;
02135             TexCoords1IDs[i][j] = Window::invalidFunctionID;
02136         }
02137     }
02138 
02139     for(i = 0; i < 8; i++)
02140         secondaryColorInitFuncs[i].init(SecColorIDs, _extSecondaryColor);
02141 
02142     for(i = 0; i < 16; i++)
02143         multiTexCoordsInitFuncs[i].init(TexCoords1IDs, _extMultitexture);
02144 
02145     _funcglSecondaryColorPointer  = Window::registerFunction(
02146                             OSG_DLSYM_UNDERSCORE"glSecondaryColorPointerEXT",
02147                             _extSecondaryColor);
02148     _funcglClientActiveTextureARB = Window::registerFunction(
02149                             OSG_DLSYM_UNDERSCORE"glClientActiveTextureARB",
02150                             _extMultitexture);
02151     _funcglLockArraysEXT          = Window::registerFunction(
02152                                 OSG_DLSYM_UNDERSCORE"glLockArraysEXT",
02153                                 _extCompiledVertexArray);
02154     _funcglUnlockArraysEXT        = Window::registerFunction(
02155                                 OSG_DLSYM_UNDERSCORE"glUnlockArraysEXT",
02156                                 _extCompiledVertexArray);
02157     _funcglDrawRangeElementsEXT   = Window::registerFunction(
02158                                 OSG_DLSYM_UNDERSCORE"glDrawRangeElementsEXT",
02159                                 _extDrawRangeElements);
02160 
02161     _funcglGenBuffers           = Window::registerFunction(
02162                                 OSG_DLSYM_UNDERSCORE"glGenBuffers",
02163                                 _arbVBO);
02164     _funcglDeleteBuffers         = Window::registerFunction(
02165                                 OSG_DLSYM_UNDERSCORE"glDeleteBuffers",
02166                                 _arbVBO);
02167     _funcglBindBuffer           = Window::registerFunction(
02168                                 OSG_DLSYM_UNDERSCORE"glBindBuffer",
02169                                 _arbVBO);
02170     _funcglBufferData           = Window::registerFunction(
02171                                 OSG_DLSYM_UNDERSCORE"glBufferData",
02172                                 _arbVBO);
02173     _funcglBufferSubData         = Window::registerFunction(
02174                                 OSG_DLSYM_UNDERSCORE"glBufferSubData",
02175                                 _arbVBO);
02176 
02177     _funcglGenBuffersARB        = Window::registerFunction(
02178                                 OSG_DLSYM_UNDERSCORE"glGenBuffersARB",
02179                                 _arbVBO);
02180     _funcglDeleteBuffersARB     = Window::registerFunction(
02181                                 OSG_DLSYM_UNDERSCORE"glDeleteBuffersARB",
02182                                 _arbVBO);
02183     _funcglBindBufferARB        = Window::registerFunction(
02184                                 OSG_DLSYM_UNDERSCORE"glBindBufferARB",
02185                                 _arbVBO);
02186     _funcglBufferDataARB        = Window::registerFunction(
02187                                 OSG_DLSYM_UNDERSCORE"glBufferDataARB",
02188                                 _arbVBO);
02189     _funcglBufferSubDataARB     = Window::registerFunction(
02190                                 OSG_DLSYM_UNDERSCORE"glBufferSubDataARB",
02191                                 _arbVBO);
02192 
02193     return true;
02194 }

void GeoPumpFactory::masterGeoPump ( Window win,
Geometry geo 
) [static, private]

Definition at line 1677 of file OSGGeoPumpFactory.cpp.

References osg::Geometry::calcMappingIndex(), osg::GeometryBase::getIndexMapping(), GL_TEXTURE1_ARB, GL_TEXTURE2_ARB, GL_TEXTURE3_ARB, GL_TEXTURE4_ARB, GL_TEXTURE5_ARB, GL_TEXTURE6_ARB, GL_TEXTURE7_ARB, osg::Geometry::MapColor, osg::Geometry::MapNormal, osg::Geometry::MapPosition, osg::Geometry::MapSecondaryColor, osg::Geometry::MapTexCoords, osg::Geometry::MapTexCoords1, osg::Geometry::MapTexCoords2, osg::Geometry::MapTexCoords3, osg::Geometry::MapTexCoords4, osg::Geometry::MapTexCoords5, osg::Geometry::MapTexCoords6, osg::Geometry::MapTexCoords7, osg::NullFC, pumpGLExtSetup, pumpGLSetup, pumpInternalSetup, pumpMultiGLExtSetup, and SWARNING.

Referenced by defMultiGeoPump().

01679 {
01680     // Setup: get all the data
01681 
01682     pumpInternalSetup( Type, GeoPTypesPtr, getTypes, true );
01683     pumpInternalSetup( Length, GeoPLengthsPtr, getLengths, false );
01684     pumpInternalSetup( Index, GeoIndicesPtr, getIndices, false );
01685 
01686     pumpGLSetup        ( Position,   GeoPositionsPtr, getPositions      );
01687     pumpGLSetup        ( Color,      GeoColorsPtr,    getColors         );
01688     pumpGLExtSetup     ( SecColor,   GeoColorsPtr,    getSecondaryColors);
01689     pumpGLSetup        ( Normal,     GeoNormalsPtr,   getNormals        );
01690     pumpGLSetup        ( TexCoords,  GeoTexCoordsPtr, getTexCoords      );
01691     pumpMultiGLExtSetup( TexCoords1, GeoTexCoordsPtr, getTexCoords1     );
01692     pumpMultiGLExtSetup( TexCoords2, GeoTexCoordsPtr, getTexCoords2     );
01693     pumpMultiGLExtSetup( TexCoords3, GeoTexCoordsPtr, getTexCoords3     );
01694     pumpMultiGLExtSetup( TexCoords4, GeoTexCoordsPtr, getTexCoords4     );
01695     pumpMultiGLExtSetup( TexCoords5, GeoTexCoordsPtr, getTexCoords5     );
01696     pumpMultiGLExtSetup( TexCoords6, GeoTexCoordsPtr, getTexCoords6     );
01697     pumpMultiGLExtSetup( TexCoords7, GeoTexCoordsPtr, getTexCoords7     );
01698 
01699     // check if the node is empty
01700     if(! TypeData || TypePtr->getSize() == 0)
01701         return;
01702 
01703     // if it's not empty we need positions
01704     if(! PositionData)
01705     {
01706         SWARNING << "masterPump: Geometry " << geo << " has no positions!?!"
01707                  << std::endl;
01708         return;
01709     }
01710 
01711     // find the mapping indices
01712     UInt16 nmappings = geo->getIndexMapping().size();
01713     Int16 PositionIndex   = -1,
01714           NormalIndex     = -1,
01715           ColorIndex      = -1,
01716           SecColorIndex   = -1,
01717           TexCoordsIndex  = -1,
01718           TexCoords1Index = -1,
01719           TexCoords2Index = -1,
01720           TexCoords3Index = -1,
01721           TexCoords4Index = -1,
01722           TexCoords5Index = -1,
01723           TexCoords6Index = -1,
01724           TexCoords7Index = -1;
01725 
01726     if(nmappings)
01727     {
01728         PositionIndex   = geo->calcMappingIndex(Geometry::MapPosition      );
01729         NormalIndex     = geo->calcMappingIndex(Geometry::MapNormal        );
01730         ColorIndex      = geo->calcMappingIndex(Geometry::MapColor         );
01731         SecColorIndex   = geo->calcMappingIndex(Geometry::MapSecondaryColor);
01732         TexCoordsIndex  = geo->calcMappingIndex(Geometry::MapTexCoords     );
01733         TexCoords1Index = geo->calcMappingIndex(Geometry::MapTexCoords1    );
01734         TexCoords2Index = geo->calcMappingIndex(Geometry::MapTexCoords2    );
01735         TexCoords3Index = geo->calcMappingIndex(Geometry::MapTexCoords3    );
01736         TexCoords4Index = geo->calcMappingIndex(Geometry::MapTexCoords4    );
01737         TexCoords5Index = geo->calcMappingIndex(Geometry::MapTexCoords5    );
01738         TexCoords6Index = geo->calcMappingIndex(Geometry::MapTexCoords6    );
01739         TexCoords7Index = geo->calcMappingIndex(Geometry::MapTexCoords7    );
01740 
01741         if(! PositionData)
01742         {
01743             SWARNING << "masterPump: Geometry " 
01744                      << geo 
01745                      << "has no position index!?!"
01746                      << std::endl;
01747             return;
01748         }
01749 
01750     }
01751     else if(IndexData)
01752     {
01753         nmappings = 1;
01754         PositionIndex =
01755         NormalIndex =
01756         ColorIndex =
01757         SecColorIndex =
01758         TexCoordsIndex =
01759         TexCoords1Index =
01760         TexCoords2Index =
01761         TexCoords3Index = 
01762         TexCoords4Index =
01763         TexCoords5Index =
01764         TexCoords6Index =
01765         TexCoords7Index = 0;
01766     }
01767 
01768     // overall color?
01769     if(ColorData && ColorPtr->getSize() == 1)
01770         ColorFunc(ColorData);
01771 
01772     // Length handling. Special case: no length given
01773 
01774     UInt32 lendummy;
01775     UInt32 LengthSize;
01776     bool len16 = false;
01777     
01778     // no lengths? use all available data for the first type
01779     if(! LengthData)
01780     {
01781         LengthSize = 1;
01782         LengthData = (UChar8*) &lendummy;
01783         if(IndexData)
01784         {
01785             lendummy = IndexPtr->getSize() / nmappings;
01786         }
01787         else
01788         {
01789             lendummy = PositionPtr->getSize();
01790         }
01791     }
01792     else
01793     {
01794         LengthSize = LengthPtr->getSize();
01795         len16 = (LengthPtr->getFormatSize() == 2);
01796     }
01797 
01798     bool ind16 = false;
01799     ind16 = (IndexPtr != NullFC && IndexPtr->getFormatSize() == 2);
01800     
01801     UInt32 l;
01802     
01803     for(LengthInd = 0; LengthInd < LengthSize; LengthInd++)
01804     {
01805         glBegin(*(TypeData + TypeInd++ * TypeStride));
01806 
01807         if(len16)
01808         {
01809             l = *(UInt16*)(LengthData + LengthInd * LengthStride);
01810         }
01811         else
01812         {
01813             l = *(UInt32*)(LengthData + LengthInd * LengthStride);
01814         }
01815         
01816         for( ; l > 0; l--)
01817         {
01818             if(IndexData && !ind16)
01819             {
01820                 UInt32 * vind;
01821 
01822                 vind = (UInt32*)(IndexData + IndexStride * IndexInd);
01823                 IndexInd += nmappings;
01824 
01825                 if(ColorData && ColorIndex >= 0)
01826                 {
01827                     ColorFunc(ColorData + ColorStride * vind[ColorIndex]);
01828                 }
01829 
01830                 if(SecColorData && SecColorIndex >= 0)
01831                 {
01832                     SecColorFunc(SecColorData + SecColorStride *
01833                                     vind[SecColorIndex]);
01834                 }
01835 
01836                 if(NormalData && NormalIndex >= 0)
01837                 {
01838                     NormalFunc(NormalData + NormalStride * vind[NormalIndex]);
01839                 }
01840 
01841                 if(TexCoordsData && TexCoordsIndex >= 0)
01842                 {
01843                     TexCoordsFunc(TexCoordsData + TexCoordsStride *
01844                                     vind[TexCoordsIndex]);
01845                 }
01846 
01847                 if(TexCoords1Data && TexCoords1Index >= 0)
01848                 {
01849                     TexCoords1Func(GL_TEXTURE1_ARB,
01850                                    TexCoords1Data + TexCoords1Stride *
01851                                    vind[TexCoords1Index]);
01852                 }
01853 
01854                 if(TexCoords2Data && TexCoords2Index >= 0)
01855                 {
01856                     TexCoords2Func(GL_TEXTURE2_ARB,
01857                                      TexCoords2Data + TexCoords2Stride *
01858                                      vind[TexCoords2Index]);
01859                 }
01860 
01861                 if(TexCoords3Data && TexCoords3Index >= 0)
01862                 {
01863                     TexCoords3Func(GL_TEXTURE3_ARB,
01864                                      TexCoords3Data + TexCoords3Stride *
01865                                      vind[TexCoords3Index]);
01866                 }
01867 
01868                 if(TexCoords4Data && TexCoords4Index >= 0)
01869                 {
01870                     TexCoords4Func(GL_TEXTURE4_ARB,
01871                                      TexCoords4Data + TexCoords4Stride *
01872                                      vind[TexCoords4Index]);
01873                 }
01874 
01875                 if(TexCoords5Data && TexCoords5Index >= 0)
01876                 {
01877                     TexCoords5Func(GL_TEXTURE5_ARB,
01878                                      TexCoords5Data + TexCoords5Stride *
01879                                      vind[TexCoords5Index]);
01880                 }
01881 
01882                 if(TexCoords6Data && TexCoords6Index >= 0)
01883                 {
01884                     TexCoords6Func(GL_TEXTURE6_ARB,
01885                                      TexCoords6Data + TexCoords6Stride *
01886                                      vind[TexCoords6Index]);
01887                 }
01888 
01889                 if(TexCoords7Data && TexCoords7Index >= 0)
01890                 {
01891                     TexCoords7Func(GL_TEXTURE7_ARB,
01892                                      TexCoords7Data + TexCoords7Stride *
01893                                      vind[TexCoords7Index]);
01894                 }
01895 
01896                 PositionFunc(PositionData + PositionStride * vind[PositionIndex]);
01897             }
01898             else if(IndexData && ind16)
01899             {
01900                 UInt16 * vind;
01901 
01902                 vind = (UInt16*)(IndexData + IndexStride * IndexInd);
01903                 IndexInd += nmappings;
01904 
01905                 if(ColorData && ColorIndex >= 0)
01906                 {
01907                     ColorFunc(ColorData + ColorStride * vind[ColorIndex]);
01908                 }
01909 
01910                 if(SecColorData && SecColorIndex >= 0)
01911                 {
01912                     SecColorFunc(SecColorData + SecColorStride *
01913                                     vind[SecColorIndex]);
01914                 }
01915 
01916                 if(NormalData && NormalIndex >= 0)
01917                 {
01918                     NormalFunc(NormalData + NormalStride * vind[NormalIndex]);
01919                 }
01920 
01921                 if(TexCoordsData && TexCoordsIndex >= 0)
01922                 {
01923                     TexCoordsFunc(TexCoordsData + TexCoordsStride *
01924                                     vind[TexCoordsIndex]);
01925                 }
01926 
01927                 if(TexCoords1Data && TexCoords1Index >= 0)
01928                 {
01929                     TexCoords1Func(GL_TEXTURE1_ARB,
01930                                    TexCoords1Data + TexCoords1Stride *
01931                                    vind[TexCoords1Index]);
01932                 }
01933 
01934                 if(TexCoords2Data && TexCoords2Index >= 0)
01935                 {
01936                     TexCoords2Func(GL_TEXTURE2_ARB,
01937                                      TexCoords2Data + TexCoords2Stride *
01938                                      vind[TexCoords2Index]);
01939                 }
01940 
01941                 if(TexCoords3Data && TexCoords3Index >= 0)
01942                 {
01943                     TexCoords3Func(GL_TEXTURE3_ARB,
01944                                      TexCoords3Data + TexCoords3Stride *
01945                                      vind[TexCoords3Index]);
01946                 }
01947 
01948                 if(TexCoords4Data && TexCoords4Index >= 0)
01949                 {
01950                     TexCoords4Func(GL_TEXTURE4_ARB,
01951                                      TexCoords4Data + TexCoords4Stride *
01952                                      vind[TexCoords4Index]);
01953                 }
01954 
01955                 if(TexCoords5Data && TexCoords5Index >= 0)
01956                 {
01957                     TexCoords5Func(GL_TEXTURE5_ARB,
01958                                      TexCoords5Data + TexCoords5Stride *
01959                                      vind[TexCoords5Index]);
01960                 }
01961 
01962                 if(TexCoords6Data && TexCoords6Index >= 0)
01963                 {
01964                     TexCoords6Func(GL_TEXTURE6_ARB,
01965                                      TexCoords6Data + TexCoords6Stride *
01966                                      vind[TexCoords6Index]);
01967                 }
01968 
01969                 if(TexCoords7Data && TexCoords7Index >= 0)
01970                 {
01971                     TexCoords7Func(GL_TEXTURE7_ARB,
01972                                      TexCoords7Data + TexCoords7Stride *
01973                                      vind[TexCoords7Index]);
01974                 }
01975 
01976                 PositionFunc(PositionData + PositionStride * vind[PositionIndex]);
01977             }
01978             else
01979             {
01980                 if(ColorData)
01981                 {
01982                     ColorFunc(ColorData + ColorStride * PositionInd);
01983                 }
01984 
01985                 if(SecColorData)
01986                 {
01987                     SecColorFunc(SecColorData + SecColorStride * PositionInd);
01988                 }
01989 
01990                 if(NormalData)
01991                 {
01992                     NormalFunc(NormalData + NormalStride * PositionInd);
01993                 }
01994 
01995                 if(TexCoordsData)
01996                 {
01997                     TexCoordsFunc(TexCoordsData + TexCoordsStride *
01998                                                     PositionInd);
01999                 }
02000 
02001                 if(TexCoords1Data)
02002                 {
02003                     TexCoords1Func(GL_TEXTURE1_ARB,
02004                                    TexCoords1Data + TexCoords1Stride *
02005                                                     PositionInd);
02006                 }
02007 
02008                 if(TexCoords2Data)
02009                 {
02010                     TexCoords2Func(GL_TEXTURE2_ARB,
02011                                    TexCoords2Data + TexCoords2Stride *
02012                                                     PositionInd);
02013                 }
02014 
02015                 if(TexCoords3Data)
02016                 {
02017                     TexCoords3Func(GL_TEXTURE3_ARB,
02018                                    TexCoords3Data + TexCoords3Stride *
02019                                                     PositionInd);
02020                 }
02021 
02022                 if(TexCoords4Data)
02023                 {
02024                     TexCoords4Func(GL_TEXTURE4_ARB,
02025                                    TexCoords4Data + TexCoords4Stride *
02026                                                     PositionInd);
02027                 }
02028 
02029                 if(TexCoords5Data)
02030                 {
02031                     TexCoords5Func(GL_TEXTURE5_ARB,
02032                                    TexCoords5Data + TexCoords5Stride *
02033                                                     PositionInd);
02034                 }
02035 
02036                 if(TexCoords6Data)
02037                 {
02038                     TexCoords6Func(GL_TEXTURE6_ARB,
02039                                    TexCoords6Data + TexCoords6Stride *
02040                                                     PositionInd);
02041                 }
02042 
02043                 if(TexCoords7Data)
02044                 {
02045                     TexCoords7Func(GL_TEXTURE7_ARB,
02046                                    TexCoords7Data + TexCoords7Stride *
02047                                                     PositionInd);
02048                 }
02049 
02050                 PositionFunc(PositionData + PositionStride * PositionInd);
02051 
02052                 PositionInd++;
02053             }
02054         }
02055 
02056         glEnd();
02057     }
02058 }

void GeoPumpFactory::masterPartialGeoPump ( Window win,
Geometry geo,
UInt32  primtype,
UInt32  firstvert,
UInt32  nvert 
) [static, private]

Definition at line 2061 of file OSGGeoPumpFactory.cpp.

References FWARNING.

02066 {
02067     FWARNING(("GeoPumpFactory::masterPartialGeoPump: not implemented yet!\n"));
02068 }

void GeoPumpFactory::masterInterfacePump ( Window win,
GeoPositionsInterface pos,
GeoNormalsInterface norm,
GeoColorsInterface col,
GeoColorsInterface seccol,
GeoTexCoordsInterface texcoords,
GeoTexCoordsInterface texcoords2,
GeoTexCoordsInterface texcoords3,
GeoTexCoordsInterface texcoords4,
GeoPTypesInterface type,
GeoPLengthsInterface len,
GeoIndicesInterface ind,
UInt16 map,
UInt16  nmap 
) [static, private]

Definition at line 2070 of file OSGGeoPumpFactory.cpp.

References FWARNING.

02085 {
02086     FWARNING(("GeoPumpFactory::masterInterfacePump: not implemented yet!\n"));
02087 }

void GeoPumpFactory::masterPartialInterfacePump ( Window win,
GeoPositionsInterface pos,
GeoNormalsInterface norm,
GeoColorsInterface col,
GeoColorsInterface seccol,
GeoTexCoordsInterface texcoords,
GeoTexCoordsInterface texcoords2,
GeoTexCoordsInterface texcoords3,
GeoTexCoordsInterface texcoords4,
GeoPTypesInterface type,
GeoPLengthsInterface len,
GeoIndicesInterface ind,
UInt16 map,
UInt16  nmap,
UInt32  primtype,
UInt32  firstvert,
UInt32  nvert 
) [static, private]

Definition at line 2089 of file OSGGeoPumpFactory.cpp.

References FWARNING.

02107 {
02108     FWARNING(
02109         ("GeoPumpFactory::masterPartialInterfacePump not implemented yet!\n"));
02110 }

void osg::GeoPumpFactory::operator= ( const GeoPumpFactory source  )  [private]


Member Data Documentation

OpenGL extension indices.

Definition at line 146 of file OSGGeoPumpFactory.h.

Referenced by osg::GeoVBO::draw(), GeoPump128(), GeoPump129(), and glextInitFunction().

OpenGL extension indices.

Definition at line 147 of file OSGGeoPumpFactory.h.

Referenced by osg::GeoVBO::draw(), GeoPump128(), GeoPump129(), and glextInitFunction().

OpenGL extension indices.

Definition at line 148 of file OSGGeoPumpFactory.h.

Referenced by GeoPump129(), and glextInitFunction().

OpenGL extension indices.

Definition at line 149 of file OSGGeoPumpFactory.h.

Referenced by osg::GeoVBO::draw(), GeoPump129(), and glextInitFunction().

OpenGL extension indices.

Definition at line 150 of file OSGGeoPumpFactory.h.

Referenced by glextInitFunction(), and osg::Geometry::handleGL().

OpenGL extension function indices.

Definition at line 152 of file OSGGeoPumpFactory.h.

Referenced by osg::GeoVBO::draw(), GeoPump128(), GeoPump129(), and glextInitFunction().

OpenGL extension indices.

Definition at line 153 of file OSGGeoPumpFactory.h.

Referenced by osg::GeoVBO::draw(), GeoPump128(), GeoPump129(), and glextInitFunction().

OpenGL extension indices.

Definition at line 154 of file OSGGeoPumpFactory.h.

Referenced by GeoPump129(), and glextInitFunction().

OpenGL extension indices.

Definition at line 155 of file OSGGeoPumpFactory.h.

Referenced by GeoPump129(), and glextInitFunction().

OpenGL extension indices.

Definition at line 156 of file OSGGeoPumpFactory.h.

Referenced by osg::GeoVBO::draw(), GeoPump129(), and glextInitFunction().

OpenGL extension indices.

Definition at line 158 of file OSGGeoPumpFactory.h.

Referenced by glextInitFunction(), and osg::GeoVBO::update().

OpenGL extension indices.

Definition at line 159 of file OSGGeoPumpFactory.h.

Referenced by glextInitFunction(), osg::GeoVBO::update(), and osg::GeoVBO::~GeoVBO().

OpenGL extension indices.

Definition at line 160 of file OSGGeoPumpFactory.h.

Referenced by osg::GeoVBO::draw(), glextInitFunction(), and osg::GeoVBO::update().

OpenGL extension indices.

Definition at line 161 of file OSGGeoPumpFactory.h.

Referenced by glextInitFunction(), and osg::GeoVBO::update().

OpenGL extension indices.

Definition at line 162 of file OSGGeoPumpFactory.h.

Referenced by glextInitFunction(), and osg::GeoVBO::update().

OpenGL extension indices.

Definition at line 164 of file OSGGeoPumpFactory.h.

Referenced by glextInitFunction(), and osg::GeoVBO::update().

OpenGL extension indices.

Definition at line 165 of file OSGGeoPumpFactory.h.

Referenced by glextInitFunction(), osg::GeoVBO::update(), and osg::GeoVBO::~GeoVBO().

OpenGL extension indices.

Definition at line 166 of file OSGGeoPumpFactory.h.

Referenced by osg::GeoVBO::draw(), glextInitFunction(), and osg::GeoVBO::update().

OpenGL extension indices.

Definition at line 167 of file OSGGeoPumpFactory.h.

Referenced by glextInitFunction(), and osg::GeoVBO::update().

OpenGL extension indices.

Definition at line 168 of file OSGGeoPumpFactory.h.

Referenced by glextInitFunction().

char osg::GeoPumpFactory::cvsid[] [static, private]

Definition at line 186 of file OSGGeoPumpFactory.h.

GeoPumpFactory * GeoPumpFactory::_the = NULL [static, private]

The Singleton instance of the GeoPumpFactory.

Definition at line 188 of file OSGGeoPumpFactory.h.

Referenced by the().

GeoPump osg::GeoPumpFactory::GeoPumps[131] [static, private]

Definition at line 189 of file OSGGeoPumpFactory.h.

Referenced by getGeoPump().

An InitFuncWrapper to initialize the GeoPumpFactory.

Definition at line 196 of file OSGGeoPumpFactory.h.


The documentation for this class was generated from the following files:

Generated on Mon Mar 17 11:13:48 2008 for OpenSG by  doxygen 1.5.5