#include <OSGGeoPumpFactory.h>
Definition at line 67 of file OSGGeoPumpFactory.h.
|
|
Definition at line 72 of file OSGGeoPumpFactory.h. |
|
|
Definition at line 80 of file OSGGeoPumpFactory.h. |
|
|
Definition at line 83 of file OSGGeoPumpFactory.h. |
|
|
Definition at line 93 of file OSGGeoPumpFactory.h. |
|
|
Definition at line 125 of file OSGGeoPumpFactory.cpp.
|
|
|
Definition at line 121 of file OSGGeoPumpFactory.cpp. Referenced by the().
|
|
|
|
|
|
Definition at line 109 of file OSGGeoPumpFactory.h.
|
|
|
Access the index of the given Geometry. Needed to access the Pump. Dev: The index is organised as follows:
Definition at line 140 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::getTypes(), osg::Geometry::MapColor, osg::Geometry::MapNormal, osg::Geometry::MapSecondaryColor, osg::Geometry::MapTexCoords, osg::Geometry::MapTexCoords1, osg::Geometry::MapTexCoords2, osg::Geometry::MapTexCoords3, and osg::NullFC. Referenced by osg::Geometry::drawPrimitives(), and osg::Geometry::handleGL(). 00141 { 00142 if (geo->getPositions() == NullFC || 00143 !geo->getPositions()->getData() ) return 0; //INVALID 00144 00145 if (geo->getTypes() == NullFC || !geo->getTypes()->getData() || 00146 geo->getTypes()->getSize() == 0) return 0; //INVALID 00147 00148 if (geo->getIndices() == NullFC) return 128; //NON_INDEXED 00149 if (geo->getIndexMapping().size() < 2) return 129; //SINGLE_INDEXED 00150 00151 if ((geo->getIndices() != NullFC && 00152 geo->getIndices()->getFormatSize() != 4) || 00153 (geo->getLengths() != NullFC && 00154 geo->getLengths()->getFormatSize() != 4) 00155 ) 00156 return 130; // Needd to use the master pump 00157 00158 UInt32 uiIndexMask = 0; 00159 00160 for(UInt32 i = 0; i < geo->getIndexMapping().size(); ++i) 00161 { 00162 uiIndexMask |= geo->getIndexMapping()[i]; 00163 } 00164 00165 int a[7]; 00166 00167 if(uiIndexMask & Geometry::MapColor && 00168 geo->getColors() != NullFC && 00169 geo->getColors()->getData() ) 00170 { 00171 a[0]=1; 00172 } 00173 else 00174 { 00175 a[0] = 0; 00176 } 00177 00178 if(uiIndexMask & Geometry::MapSecondaryColor && 00179 geo->getSecondaryColors() != NullFC && 00180 geo->getSecondaryColors()->getData() ) 00181 { 00182 a[1]=1; 00183 } 00184 else 00185 { 00186 a[1]=0; 00187 } 00188 00189 if(uiIndexMask & Geometry::MapNormal && 00190 geo->getNormals() != NullFC && 00191 geo->getNormals()->getData() ) 00192 { 00193 a[2]=1; 00194 } 00195 else 00196 { 00197 a[2]=0; 00198 } 00199 00200 if(uiIndexMask & Geometry::MapTexCoords && 00201 geo->getTexCoords() != NullFC && 00202 geo->getTexCoords()->getData() ) 00203 { 00204 a[3]=1; 00205 } 00206 else 00207 { 00208 a[3]=0; 00209 } 00210 00211 if(uiIndexMask & Geometry::MapTexCoords1 && 00212 geo->getTexCoords1() != NullFC && 00213 geo->getTexCoords1()->getData() ) 00214 { 00215 a[4]=1; 00216 } 00217 else 00218 { 00219 a[4]=0; 00220 } 00221 00222 if(uiIndexMask & Geometry::MapTexCoords2 && 00223 geo->getTexCoords2() != NullFC && 00224 geo->getTexCoords2()->getData() ) 00225 { 00226 a[5]=1; 00227 } 00228 else 00229 { 00230 a[5]=0; 00231 } 00232 00233 if(uiIndexMask & Geometry::MapTexCoords3 && 00234 geo->getTexCoords3() != NullFC && 00235 geo->getTexCoords3()->getData() ) 00236 { 00237 a[6]=1; 00238 } 00239 else 00240 { 00241 a[6]=0; 00242 } 00243 00244 int index=0; 00245 00246 for (int i=0; i<7; i++) 00247 if (a[i]) index=index|(1<<i); 00248 00249 /* if the geometry was detected as multi-indexed,but 00250 there was no index data, then index will be 0, which 00251 corresponds to invalid geometry. 00252 */ 00253 00254 return index; 00255 }
|
|
||||||||||||
|
Get the full Geometry pump for the given index. Definition at line 260 of file OSGGeoPumpFactory.cpp. References GeoPumps. Referenced by osg::Geometry::drawPrimitives(), and osg::Geometry::handleGL(). 00263 { 00264 //FWARNING(("GeoPump%d used\n",index)); 00265 return GeoPumps[index]; //crashed windows while testing, watch it. 00266 //return &masterGeoPump; 00267 }
|
|
||||||||||||
|
Access the index of the given Geometry. Needed to access the Pump. Dev: The index is organised as follows:
Definition at line 269 of file OSGGeoPumpFactory.cpp. References FWARNING. 00272 { 00273 FWARNING(("GeoPumpFactory::getPartialGeoPump: not implemented yet!\n")); 00274 return NULL; 00275 }
|
|
||||||||||||
|
Access the index of the given Geometry. Needed to access the Pump. Dev: The index is organised as follows:
Definition at line 277 of file OSGGeoPumpFactory.cpp. References FWARNING. 00280 { 00281 FWARNING(("GeoPumpFactory::getInterfacePump: not implemented yet!\n")); 00282 return NULL; 00283 }
|
|
||||||||||||
|
Access the index of the given Geometry. Needed to access the Pump. Dev: The index is organised as follows:
Definition at line 285 of file OSGGeoPumpFactory.cpp. References FWARNING. 00288 { 00289 FWARNING(("GeoPumpFactory::getPartialInterfacePump: not " 00290 "implemented yet!\n")); 00291 return NULL; 00292 }
|
|
|
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 }
|
|
|
Definition at line 299 of file OSGGeoPumpFactory.cpp.
|
|
|
||||||||||||
|
Definition at line 1441 of file OSGGeoPumpFactory.cpp. References osg::Geometry::calcMappingIndex(), osg::GeometryBase::getIndexMapping(), GL_TEXTURE1_ARB, GL_TEXTURE2_ARB, GL_TEXTURE3_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::NullFC, pumpGLExtSetup, pumpGLSetup, pumpInternalSetup, pumpMultiGLExtSetup, and SWARNING. Referenced by defMultiGeoPump(). 01443 { 01444 // Setup: get all the data 01445 01446 pumpInternalSetup( Type, GeoPTypesPtr, getTypes, true ); 01447 pumpInternalSetup( Length, GeoPLengthsPtr, getLengths, false ); 01448 pumpInternalSetup( Index, GeoIndicesPtr, getIndices, false ); 01449 01450 pumpGLSetup ( Position, GeoPositionsPtr, getPositions ); 01451 pumpGLSetup ( Color, GeoColorsPtr, getColors ); 01452 pumpGLExtSetup ( SecColor, GeoColorsPtr, getSecondaryColors); 01453 pumpGLSetup ( Normal, GeoNormalsPtr, getNormals ); 01454 pumpGLSetup ( TexCoords, GeoTexCoordsPtr, getTexCoords ); 01455 pumpMultiGLExtSetup( TexCoords1, GeoTexCoordsPtr, getTexCoords1 ); 01456 pumpMultiGLExtSetup( TexCoords2, GeoTexCoordsPtr, getTexCoords2 ); 01457 pumpMultiGLExtSetup( TexCoords3, GeoTexCoordsPtr, getTexCoords3 ); 01458 01459 // check if the node is empty 01460 if(! TypeData || TypePtr->getSize() == 0) 01461 return; 01462 01463 // if it's not empty we need positions 01464 if(! PositionData) 01465 { 01466 SWARNING << "masterPump: Geometry " << geo << " has no positions!?!" 01467 << std::endl; 01468 return; 01469 } 01470 01471 // find the mapping indices 01472 UInt16 nmappings = geo->getIndexMapping().size(); 01473 Int16 PositionIndex = -1, 01474 NormalIndex = -1, 01475 ColorIndex = -1, 01476 SecColorIndex = -1, 01477 TexCoordsIndex = -1, 01478 TexCoords1Index = -1, 01479 TexCoords2Index = -1, 01480 TexCoords3Index = -1; 01481 01482 if(nmappings) 01483 { 01484 PositionIndex = geo->calcMappingIndex(Geometry::MapPosition ); 01485 NormalIndex = geo->calcMappingIndex(Geometry::MapNormal ); 01486 ColorIndex = geo->calcMappingIndex(Geometry::MapColor ); 01487 SecColorIndex = geo->calcMappingIndex(Geometry::MapSecondaryColor); 01488 TexCoordsIndex = geo->calcMappingIndex(Geometry::MapTexCoords ); 01489 TexCoords1Index = geo->calcMappingIndex(Geometry::MapTexCoords1 ); 01490 TexCoords2Index = geo->calcMappingIndex(Geometry::MapTexCoords2 ); 01491 TexCoords3Index = geo->calcMappingIndex(Geometry::MapTexCoords3 ); 01492 01493 if(! PositionData) 01494 { 01495 SWARNING << "masterPump: Geometry " 01496 << geo 01497 << "has no position index!?!" 01498 << std::endl; 01499 return; 01500 } 01501 01502 } 01503 else if(IndexData) 01504 { 01505 nmappings = 1; 01506 PositionIndex = 01507 NormalIndex = 01508 ColorIndex = 01509 SecColorIndex = 01510 TexCoordsIndex = 01511 TexCoords1Index = 01512 TexCoords2Index = 01513 TexCoords3Index = 0; 01514 } 01515 01516 // overall color? 01517 if(ColorData && ColorPtr->getSize() == 1) 01518 ColorFunc(ColorData); 01519 01520 // Length handling. Special case: no length given 01521 01522 UInt32 lendummy; 01523 UInt32 LengthSize; 01524 bool len16 = false; 01525 01526 // no lengths? use all available data for the first type 01527 if(! LengthData) 01528 { 01529 LengthSize = 1; 01530 LengthData = (UChar8*) &lendummy; 01531 if(IndexData) 01532 { 01533 lendummy = IndexPtr->getSize() / nmappings; 01534 } 01535 else 01536 { 01537 lendummy = PositionPtr->getSize(); 01538 } 01539 } 01540 else 01541 { 01542 LengthSize = LengthPtr->getSize(); 01543 len16 = (LengthPtr->getFormatSize() == 2); 01544 } 01545 01546 bool ind16 = false; 01547 ind16 = (IndexPtr != NullFC && IndexPtr->getFormatSize() == 2); 01548 01549 UInt32 l; 01550 01551 for(LengthInd = 0; LengthInd < LengthSize; LengthInd++) 01552 { 01553 glBegin(*(TypeData + TypeInd++ * TypeStride)); 01554 01555 if(len16) 01556 { 01557 l = *(UInt16*)(LengthData + LengthInd * LengthStride); 01558 } 01559 else 01560 { 01561 l = *(UInt32*)(LengthData + LengthInd * LengthStride); 01562 } 01563 01564 for( ; l > 0; l--) 01565 { 01566 if(IndexData && !ind16) 01567 { 01568 UInt32 * vind; 01569 01570 vind = (UInt32*)(IndexData + IndexStride * IndexInd); 01571 IndexInd += nmappings; 01572 01573 if(ColorData && ColorIndex >= 0) 01574 { 01575 ColorFunc(ColorData + ColorStride * vind[ColorIndex]); 01576 } 01577 01578 if(SecColorData && SecColorIndex >= 0) 01579 { 01580 SecColorFunc(SecColorData + SecColorStride * 01581 vind[SecColorIndex]); 01582 } 01583 01584 if(NormalData && NormalIndex >= 0) 01585 { 01586 NormalFunc(NormalData + NormalStride * vind[NormalIndex]); 01587 } 01588 01589 if(TexCoordsData && TexCoordsIndex >= 0) 01590 { 01591 TexCoordsFunc(TexCoordsData + TexCoordsStride * 01592 vind[TexCoordsIndex]); 01593 } 01594 01595 if(TexCoords1Data && TexCoords1Index >= 0) 01596 { 01597 TexCoords1Func(GL_TEXTURE1_ARB, 01598 TexCoords1Data + TexCoords1Stride * 01599 vind[TexCoords1Index]); 01600 } 01601 01602 if(TexCoords2Data && TexCoords2Index >= 0) 01603 { 01604 TexCoords2Func(GL_TEXTURE2_ARB, 01605 TexCoords2Data + TexCoords2Stride * 01606 vind[TexCoords2Index]); 01607 } 01608 01609 if(TexCoords3Data && TexCoords3Index >= 0) 01610 { 01611 TexCoords3Func(GL_TEXTURE3_ARB, 01612 TexCoords3Data + TexCoords3Stride * 01613 vind[TexCoords3Index]); 01614 } 01615 01616 PositionFunc(PositionData + PositionStride * vind[PositionIndex]); 01617 } 01618 else if(IndexData && ind16) 01619 { 01620 UInt16 * vind; 01621 01622 vind = (UInt16*)(IndexData + IndexStride * IndexInd); 01623 IndexInd += nmappings; 01624 01625 if(ColorData && ColorIndex >= 0) 01626 { 01627 ColorFunc(ColorData + ColorStride * vind[ColorIndex]); 01628 } 01629 01630 if(SecColorData && SecColorIndex >= 0) 01631 { 01632 SecColorFunc(SecColorData + SecColorStride * 01633 vind[SecColorIndex]); 01634 } 01635 01636 if(NormalData && NormalIndex >= 0) 01637 { 01638 NormalFunc(NormalData + NormalStride * vind[NormalIndex]); 01639 } 01640 01641 if(TexCoordsData && TexCoordsIndex >= 0) 01642 { 01643 TexCoordsFunc(TexCoordsData + TexCoordsStride * 01644 vind[TexCoordsIndex]); 01645 } 01646 01647 if(TexCoords1Data && TexCoords1Index >= 0) 01648 { 01649 TexCoords1Func(GL_TEXTURE1_ARB, 01650 TexCoords1Data + TexCoords1Stride * 01651 vind[TexCoords1Index]); 01652 } 01653 01654 if(TexCoords2Data && TexCoords2Index >= 0) 01655 { 01656 TexCoords2Func(GL_TEXTURE2_ARB, 01657 TexCoords2Data + TexCoords2Stride * 01658 vind[TexCoords2Index]); 01659 } 01660 01661 if(TexCoords3Data && TexCoords3Index >= 0) 01662 { 01663 TexCoords3Func(GL_TEXTURE3_ARB, 01664 TexCoords3Data + TexCoords3Stride * 01665 vind[TexCoords3Index]); 01666 } 01667 01668 PositionFunc(PositionData + PositionStride * vind[PositionIndex]); 01669 } 01670 else 01671 { 01672 if(ColorData) 01673 { 01674 ColorFunc(ColorData + ColorStride * PositionInd); 01675 } 01676 01677 if(SecColorData) 01678 { 01679 SecColorFunc(SecColorData + SecColorStride * PositionInd); 01680 } 01681 01682 if(NormalData) 01683 { 01684 NormalFunc(NormalData + NormalStride * PositionInd); 01685 } 01686 01687 if(TexCoordsData) 01688 { 01689 TexCoordsFunc(TexCoordsData + TexCoordsStride * 01690 PositionInd); 01691 } 01692 01693 if(TexCoords1Data) 01694 { 01695 TexCoords1Func(GL_TEXTURE1_ARB, 01696 TexCoords1Data + TexCoords1Stride * 01697 PositionInd); 01698 } 01699 01700 if(TexCoords2Data) 01701 { 01702 TexCoords2Func(GL_TEXTURE2_ARB, 01703 TexCoords2Data + TexCoords2Stride * 01704 PositionInd); 01705 } 01706 01707 if(TexCoords3Data) 01708 { 01709 TexCoords3Func(GL_TEXTURE3_ARB, 01710 TexCoords3Data + TexCoords3Stride * 01711 PositionInd); 01712 } 01713 01714 PositionFunc(PositionData + PositionStride * PositionInd); 01715 01716 PositionInd++; 01717 } 01718 } 01719 01720 glEnd(); 01721 } 01722 }
|
|
||||||||||||||||||||||||
|
Definition at line 1725 of file OSGGeoPumpFactory.cpp. References FWARNING. 01730 { 01731 FWARNING(("GeoPumpFactory::masterPartialGeoPump: not implemented yet!\n")); 01732 }
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Definition at line 1734 of file OSGGeoPumpFactory.cpp. References FWARNING. 01749 { 01750 FWARNING(("GeoPumpFactory::masterInterfacePump: not implemented yet!\n")); 01751 }
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Definition at line 1753 of file OSGGeoPumpFactory.cpp. References FWARNING. 01771 { 01772 FWARNING( 01773 ("GeoPumpFactory::masterPartialInterfacePump not implemented yet!\n")); 01774 }
|
|
|
|
|
|
Referenced by osg::Geometry::drawPrimitives(), and osg::Geometry::handleGL(). |
|
|
OpenGL extension indices. Definition at line 102 of file OSGGeoPumpFactory.cpp. Referenced by GeoPump128(), GeoPump129(), and glextInitFunction(). |
|
|
OpenGL extension indices. Definition at line 103 of file OSGGeoPumpFactory.cpp. Referenced by GeoPump128(), GeoPump129(), and glextInitFunction(). |
|
|
OpenGL extension indices. Definition at line 104 of file OSGGeoPumpFactory.cpp. Referenced by GeoPump129(), and glextInitFunction(). |
|
|
OpenGL extension indices. Definition at line 105 of file OSGGeoPumpFactory.cpp. Referenced by GeoPump129(), and glextInitFunction(). |
|
|
OpenGL extension function indices. Definition at line 109 of file OSGGeoPumpFactory.cpp. Referenced by GeoPump128(), GeoPump129(), and glextInitFunction(). |
|
|
OpenGL extension indices. Definition at line 110 of file OSGGeoPumpFactory.cpp. Referenced by GeoPump128(), GeoPump129(), and glextInitFunction(). |
|
|
OpenGL extension indices. Definition at line 111 of file OSGGeoPumpFactory.cpp. Referenced by GeoPump129(), and glextInitFunction(). |
|
|
OpenGL extension indices. Definition at line 112 of file OSGGeoPumpFactory.cpp. Referenced by GeoPump129(), and glextInitFunction(). |
|
|
OpenGL extension indices. Definition at line 113 of file OSGGeoPumpFactory.cpp. Referenced by GeoPump129(), and glextInitFunction(). |
|
|
Definition at line 173 of file OSGGeoPumpFactory.h. |
|
|
The Singleton instance of the GeoPumpFactory. Definition at line 93 of file OSGGeoPumpFactory.cpp. Referenced by the(). |
|
|
Definition at line 176 of file OSGGeoPumpFactory.h. Referenced by getGeoPump(). |
|
|
An InitFuncWrapper to initialize the GeoPumpFactory. |
1.4.3