ColTraitParticle Struct Reference

Inheritance diagram for ColTraitParticle:

ColTraitBase ParticleTraits

List of all members.

Public Types

enum  { numFormats = GL_DOUBLE - GL_BYTE + 1 }
typedef void(OSG_APIENTRY * pumpFunc )(GLubyte *data)

Static Public Member Functions

static void init (Particles *part, DrawActionBase *, dataType &data)
static bool particle (dataType &data, UInt32 particle)
static void vertex (dataType &, UInt32, UInt32)

Static Public Attributes

Drawing Pumps


static const int formatBase = GL_BYTE
static char * formatNames []
static pumpFunc ColorFuncs [numFormats][4]

Classes

struct  dataType


Detailed Description

Definition at line 570 of file OSGParticles.cpp.


Member Typedef Documentation

typedef void(OSG_APIENTRY * ColTraitBase::pumpFunc)(GLubyte *data) [inherited]


Member Enumeration Documentation

anonymous enum [inherited]

Enumerator:
numFormats 

Definition at line 468 of file OSGParticles.cpp.

00468 { numFormats = GL_DOUBLE - GL_BYTE + 1 };


Member Function Documentation

static void ColTraitParticle::init ( Particles part,
DrawActionBase ,
dataType data 
) [inline, static]

Definition at line 580 of file OSGParticles.cpp.

References ColorFuncs, ColTraitParticle::dataType::data, formatBase, formatNames, ColTraitParticle::dataType::func, osg::ParticlesBase::getColors(), ColTraitParticle::dataType::stride, and SWARNING.

00581     {
00582         GeoColorsPtr col = part->getColors();
00583 
00584         data.data = col->getData();
00585         if((data.stride = col->getStride()) == 0)
00586             data.stride = col->getFormatSize() * col->getDimension();
00587         
00588         data.func = ColorFuncs[ col->getFormat() - formatBase ]
00589                               [ col->getDimension() - 1 ];
00590                              
00591         if(data.func == NULL)
00592         {
00593             SWARNING << "Particles " << part << "have illegal "
00594                      << "colors: " << col->getDimension()
00595                      << "D " << formatNames[ col->getFormat() - formatBase ]
00596                      << "!" << std::endl;
00597             return;
00598         }
00599     }

static bool ColTraitParticle::particle ( dataType data,
UInt32  particle 
) [inline, static]

Definition at line 601 of file OSGParticles.cpp.

References ColTraitParticle::dataType::data, ColTraitParticle::dataType::func, and ColTraitParticle::dataType::stride.

00602     {   
00603         data.func((GLubyte*)(data.data + particle * data.stride));
00604         return false;
00605     }

static void ColTraitParticle::vertex ( dataType ,
UInt32  ,
UInt32   
) [inline, static]

Definition at line 607 of file OSGParticles.cpp.

00608     {
00609     }


Member Data Documentation

const int ColTraitBase::formatBase = GL_BYTE [static, inherited]

The smallest enum for data types, used as a base for the formatNames map.

Definition at line 467 of file OSGParticles.cpp.

char * ColTraitBase::formatNames [static, inherited]

Initial value:

 
{   "GL_BYTE", "GL_UNSIGNED_BYTE", "GL_SHORT", "GL_UNSIGNED_SHORT", 
    "GL_INT", "GL_UNSIGNED_INT", "GL_FLOAT", "GL_2_BYTES", 
    "GL_3_BYTES", "GL_4_BYTES", "GL_DOUBLE"
}
A map from the OpenGL data type to the corresponding name

Definition at line 470 of file OSGParticles.cpp.

Initial value:

 {
    { NULL, NULL, 
      (pumpFunc)glColor3bv, (pumpFunc)glColor4bv },   
    { NULL, NULL, 
      (pumpFunc)glColor3ubv,(pumpFunc)glColor4ubv },  
    { NULL, NULL, 
      (pumpFunc)glColor3sv, (pumpFunc)glColor4sv },   
    { NULL, NULL,  
      (pumpFunc)glColor3usv,(pumpFunc)glColor4usv },  
    { NULL, NULL,  
      (pumpFunc)glColor3iv, (pumpFunc)glColor4iv },   
    { NULL, NULL,  
      (pumpFunc)glColor3uiv,(pumpFunc)glColor4uiv },  
    { NULL, NULL,  
      (pumpFunc)glColor3fv, (pumpFunc)glColor4fv },   
    { NULL, NULL, NULL, NULL },                       
    { NULL, NULL, NULL, NULL },                       
    { NULL, NULL, NULL, NULL },                       
    { NULL, NULL,  
      (pumpFunc)glColor3dv, (pumpFunc)glColor4dv },   
}
The pump functions for colors, indexed by data type and dimensionality

Definition at line 472 of file OSGParticles.cpp.


The documentation for this struct was generated from the following file:

Generated on Mon Mar 17 12:02:58 2008 for OpenSG by  doxygen 1.5.5