osg::VRMLPixelTextureDesc Class Reference
[VRML-specific File Input/Output]

VRML Pixel Texture Desc. More...

#include <OSGVRMLNodeDescs.h>

Inheritance diagram for osg::VRMLPixelTextureDesc:

osg::VRMLNodeDesc

List of all members.

Member



FieldNameTypeHash _mFieldTypes
GenericAttPtr _pGenAtt
FieldContainerPtr _pNodeProto
FieldContainerPtr _pNodeCoreProto
Field_pCurrField
std::string _szCurrentName
bool _bSaveOnEnd
static UInt32 _uiIndent = 0
FieldgetField (FieldContainerPtr pFC1, FieldContainerPtr pFC2, GenericAttPtr pGenAtt, const Char8 *szFieldname)

Public Member Functions

Constructors


 VRMLPixelTextureDesc (void)
Destructor


virtual ~VRMLPixelTextureDesc (void)
Helper


virtual void init (const Char8 *szName)
virtual void reset (void)
Field


virtual bool prototypeAddField (const Char8 *szFieldType, const UInt32 uiFieldTypeId, const Char8 *szFieldName)
virtual void endProtoInterface (void)
virtual void getFieldAndDesc (FieldContainerPtr pFC, const Char8 *szFieldname, Field *&pField, const FieldDescription *&pDesc)
Node


virtual FieldContainerPtr beginNode (const Char8 *szTypename, const Char8 *szName, FieldContainerPtr pCurrentFC)
virtual void endNode (FieldContainerPtr)
Field Value


virtual void addFieldValue (Field *pField, const Char8 *szFieldVal)
Dump


virtual void dump (const Char8 *szNodeName)
Helper


virtual void setOnEndSave (const Char8 *szName)
virtual void clearOnEndSave (void)
virtual bool getOnEndSave (void)
virtual const Char8getSavename (void)
virtual FieldContainerPtr getSaveFieldContainer (void)
Field


virtual FieldgetField (const Char8 *szFieldname)
Prototypes


virtual void prototypeAddFieldValue (const Char8 *szFieldVal)
FieldValue


virtual bool use (FieldContainerPtr)

Static Public Member Functions

Class Get


static UInt32 getIndent (void)
static void incIndent (void)
static void decIndent (void)
static void resetIndent (void)

Protected Types

typedef std::map< const Char8
*, UInt32, LTString
FieldNameTypeHash

Protected Attributes

Member


SFImagePtr _defaultImage
SFBool _defaultRepeatS
SFBool _defaultRepeatT
SFImagePtr _image
SFBool _repeatS
SFBool _repeatT

Private Types

typedef VRMLNodeDesc Inherited

Private Member Functions

 VRMLPixelTextureDesc (const VRMLPixelTextureDesc &source)
 prohibit default function (move to 'public' if needed)
void operator= (const VRMLPixelTextureDesc &source)
 prohibit default function (move to 'public' if needed)


Detailed Description

VRML Pixel Texture description

Definition at line 1210 of file OSGVRMLNodeDescs.h.


Member Typedef Documentation

Definition at line 1299 of file OSGVRMLNodeDescs.h.

typedef std::map< const Char8 *, UInt32, LTString> osg::VRMLNodeDesc::FieldNameTypeHash [protected, inherited]

Definition at line 298 of file OSGVRMLNodeDescs.h.


Constructor & Destructor Documentation

VRMLPixelTextureDesc::VRMLPixelTextureDesc ( void   ) 

Definition at line 3627 of file OSGVRMLNodeDescs.cpp.

03627                                                :
03628     Inherited(),
03629 
03630     _defaultImage  (),
03631     _defaultRepeatS(),
03632     _defaultRepeatT(),
03633 
03634     _image         (),
03635     _repeatS       (),
03636     _repeatT       ()
03637 {
03638 }

VRMLPixelTextureDesc::~VRMLPixelTextureDesc ( void   )  [virtual]

Definition at line 3643 of file OSGVRMLNodeDescs.cpp.

03644 {
03645 }

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


Member Function Documentation

void VRMLPixelTextureDesc::init ( const Char8 szName  )  [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3650 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::getIndent(), osg::indentLog(), and PINFO.

03651 {
03652 #ifdef OSG_DEBUG_VRML
03653     indentLog(getIndent(), PINFO);
03654     PINFO << "PixelTextureDesc::init : " << szName << std::endl;
03655 #endif
03656 }

void VRMLPixelTextureDesc::reset ( void   )  [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3658 of file OSGVRMLNodeDescs.cpp.

03659 {
03660 }

bool VRMLPixelTextureDesc::prototypeAddField ( const Char8 szFieldType,
const UInt32  uiFieldTypeId,
const Char8 szFieldName 
) [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3665 of file OSGVRMLNodeDescs.cpp.

References _defaultImage, _defaultRepeatS, _defaultRepeatT, osg::VRMLNodeDesc::_pCurrField, osg::VRMLNodeDesc::getIndent(), osg::indentLog(), PINFO, and osg::stringcasecmp().

03668 {
03669     bool bFound = false;
03670 
03671     _pCurrField = NULL;
03672 
03673     if(stringcasecmp("image", szFieldname) == 0)
03674     {
03675         _pCurrField = &_defaultImage;
03676 
03677         bFound = true;
03678     }
03679     else if(stringcasecmp("repeatS", szFieldname) == 0)
03680     {
03681         _pCurrField = &_defaultRepeatS;
03682 
03683         bFound = true;
03684     }
03685     else if(stringcasecmp("repeatT", szFieldname) == 0)
03686     {
03687         _pCurrField = &_defaultRepeatT;
03688 
03689         bFound = true;
03690     }
03691 
03692     if(bFound == true)
03693     {
03694 #ifdef OSG_DEBUG_VRML
03695         indentLog(getIndent(), PINFO);
03696         PINFO << "PixelTextureDesc::prototypeAddField : add part "
03697               << szFieldname
03698               << std::endl;
03699 #endif
03700 
03701         return true;
03702     }
03703     else
03704     {
03705         return false;
03706     }
03707 }

void VRMLPixelTextureDesc::endProtoInterface ( void   )  [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3709 of file OSGVRMLNodeDescs.cpp.

03710 {
03711 }

void VRMLPixelTextureDesc::getFieldAndDesc ( FieldContainerPtr  pFC,
const Char8 szFieldname,
Field *&  pField,
const FieldDescription *&  pDesc 
) [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3713 of file OSGVRMLNodeDescs.cpp.

References _image, _repeatS, _repeatT, and osg::stringcasecmp().

03718 {
03719     if(stringcasecmp("image", szFieldname) == 0)
03720     {
03721         pField = &_image;
03722     }
03723     else if(stringcasecmp("repeatS", szFieldname) == 0)
03724     {
03725         pField = &_repeatS;
03726     }
03727     else if(stringcasecmp("repeatT", szFieldname) == 0)
03728     {
03729         pField = &_repeatT;
03730     }
03731 
03732     pDesc = NULL;
03733 }

FieldContainerPtr VRMLPixelTextureDesc::beginNode ( const Char8 szTypename,
const Char8 szName,
FieldContainerPtr  pCurrentFC 
) [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3738 of file OSGVRMLNodeDescs.cpp.

References _defaultRepeatS, _defaultRepeatT, _image, _repeatS, _repeatT, osg::ImageBase::create(), osg::TextureChunkBase::create(), osg::VRMLNodeDesc::getIndent(), osg::VRMLNodeDesc::incIndent(), osg::indentLog(), PINFO, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

03742 {
03743     TextureChunkPtr returnValue = TextureChunk::create();
03744 
03745     ImagePtr iPtr=Image::create();
03746     _image.setValue(iPtr);
03747 
03748     _repeatS = _defaultRepeatS;
03749     _repeatT = _defaultRepeatT;
03750 
03751 #ifdef OSG_DEBUG_VRML
03752     indentLog(getIndent(), PINFO);
03753     PINFO << "Begin PixelTexture " << &(*returnValue) << std::endl;
03754 
03755     incIndent();
03756 #endif
03757 
03758     return returnValue;
03759 }

void VRMLPixelTextureDesc::endNode ( FieldContainerPtr  pFC  )  [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3761 of file OSGVRMLNodeDescs.cpp.

References _image, _repeatS, _repeatT, osg::AttachmentPtr::dcast(), osg::VRMLNodeDesc::decIndent(), osg::VRMLNodeDesc::getIndent(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::indentLog(), osg::NullFC, PINFO, and PWARNING.

03762 {
03763     TextureChunkPtr  pTexture = NullFC;
03764 
03765     pTexture = TextureChunkPtr::dcast(pFC);
03766 
03767     if(pTexture != NullFC)
03768     {
03769         if(_image.getValue() != NullFC)
03770         {
03771             pTexture->setImage(_image.getValue());
03772 
03773             if(_repeatS.getValue() == true)
03774             {
03775                 pTexture->setWrapS(GL_REPEAT);
03776             }
03777             else
03778             {
03779                 pTexture->setWrapS(GL_CLAMP);
03780             }
03781 
03782             if(_repeatT.getValue() == true)
03783             {
03784                 pTexture->setWrapT(GL_REPEAT);
03785             }
03786             else
03787             {
03788                 pTexture->setWrapT(GL_CLAMP);
03789             }
03790         }
03791     }
03792     else
03793     {
03794         PWARNING <<  "VRMLPixelTextureDesc::endNode : Invalid texture ptr"
03795                  << std::endl;
03796     }
03797 
03798 #ifdef OSG_DEBUG_VRML
03799     decIndent();
03800 
03801     indentLog(getIndent(), PINFO);
03802     PINFO << "End PixelTexture "
03803           << _repeatS.getValue()    << " "
03804           << _repeatT.getValue()    << " "
03805           << &(*pFC) << std::endl;
03806 #endif
03807 }

void VRMLPixelTextureDesc::addFieldValue ( Field pField,
const Char8 szFieldVal 
) [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3812 of file OSGVRMLNodeDescs.cpp.

References _image, osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, and osg::Field::pushValueByStr().

03814 {
03815     if(pField != NULL)
03816     {
03817         if( (pField == &_image) && (_image.getValue() != NullFC) )
03818         {
03819             _image.getValue()->addValue(szFieldVal);
03820         }
03821         else
03822         {
03823             pField->pushValueByStr(szFieldVal);
03824         }
03825     }
03826 }

void VRMLPixelTextureDesc::dump ( const Char8 szNodeName  )  [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3831 of file OSGVRMLNodeDescs.cpp.

03832 {
03833 }

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

UInt32 VRMLNodeDesc::getIndent ( void   )  [static, inherited]

Definition at line 128 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_uiIndent.

Referenced by osg::VRMLNodeFactory< BaseT >::addFieldValue(), osg::VRMLNodeFactory< BaseT >::beginEventInDecl(), osg::VRMLNodeFactory< BaseT >::beginEventOutDecl(), osg::VRMLViewpointDesc::beginNode(), osg::VRMLInlineDesc::beginNode(), osg::VRMLGroupDesc::beginNode(), osg::VRMLSwitchDesc::beginNode(), osg::VRMLLODDesc::beginNode(), beginNode(), osg::VRMLImageTextureDesc::beginNode(), osg::VRMLTextureTransformDesc::beginNode(), osg::VRMLAppearanceDesc::beginNode(), osg::VRMLGeometryPointSetDesc::beginNode(), osg::VRMLGeometryDesc::beginNode(), osg::VRMLShapeDesc::beginNode(), osg::VRMLFile::beginNode(), osg::VRMLNodeFactory< BaseT >::beginProto(), osg::VRMLFile::endField(), osg::VRMLViewpointDesc::endNode(), osg::VRMLInlineDesc::endNode(), osg::VRMLExtrusionDesc::endNode(), osg::VRMLGroupDesc::endNode(), osg::VRMLSwitchDesc::endNode(), osg::VRMLLODDesc::endNode(), endNode(), osg::VRMLImageTextureDesc::endNode(), osg::VRMLTextureTransformDesc::endNode(), osg::VRMLAppearanceDesc::endNode(), osg::VRMLGeometryObjectDesc::endNode(), osg::VRMLGeometryPointSetDesc::endNode(), osg::VRMLGeometryDesc::endNode(), osg::VRMLShapeDesc::endNode(), osg::VRMLFile::endNode(), osg::VRMLNodeFactory< BaseT >::findNodeDesc(), osg::VRMLNodeDesc::getField(), osg::VRMLViewpointDesc::getFieldAndDesc(), osg::VRMLInlineDesc::getFieldAndDesc(), osg::VRMLExtrusionDesc::getFieldAndDesc(), osg::VRMLGroupDesc::getFieldAndDesc(), osg::VRMLSwitchDesc::getFieldAndDesc(), osg::VRMLLODDesc::getFieldAndDesc(), osg::VRMLAppearanceDesc::getFieldAndDesc(), osg::VRMLGeometryObjectDesc::getFieldAndDesc(), osg::VRMLGeometryPartDesc::getFieldAndDesc(), osg::VRMLGeometryPointSetDesc::getFieldAndDesc(), osg::VRMLGeometryDesc::getFieldAndDesc(), osg::VRMLShapeDesc::getFieldAndDesc(), osg::VRMLNodeDesc::getFieldAndDesc(), osg::VRMLFile::getFieldType(), osg::VRMLInlineDesc::init(), osg::VRMLExtrusionDesc::init(), osg::VRMLGroupDesc::init(), osg::VRMLSwitchDesc::init(), osg::VRMLLODDesc::init(), init(), osg::VRMLImageTextureDesc::init(), osg::VRMLTextureTransformDesc::init(), osg::VRMLMaterialDesc::init(), osg::VRMLAppearanceDesc::init(), osg::VRMLGeometryObjectDesc::init(), osg::VRMLGeometryPartDesc::init(), osg::VRMLGeometryPointSetDesc::init(), osg::VRMLGeometryDesc::init(), osg::VRMLShapeDesc::init(), prototypeAddField(), osg::VRMLImageTextureDesc::prototypeAddField(), osg::VRMLTextureTransformDesc::prototypeAddField(), osg::VRMLMaterialDesc::prototypeAddField(), osg::VRMLGeometryPartDesc::prototypeAddField(), osg::VRMLGeometryPointSetDesc::prototypeAddField(), osg::VRMLGeometryDesc::prototypeAddField(), osg::VRMLShapeDesc::prototypeAddField(), osg::VRMLNodeDesc::prototypeAddField(), osg::VRMLFile::setContainerFieldValue(), and osg::VRMLFile::use().

00129 {
00130     return _uiIndent;
00131 }

void VRMLNodeDesc::incIndent ( void   )  [static, inherited]

void VRMLNodeDesc::decIndent ( void   )  [static, inherited]

void VRMLNodeDesc::resetIndent ( void   )  [static, inherited]

void VRMLNodeDesc::setOnEndSave ( const Char8 szName  )  [virtual, inherited]

Definition at line 209 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_bSaveOnEnd, and osg::VRMLNodeDesc::_szCurrentName.

Referenced by osg::VRMLFile::beginNode().

00210 {
00211     _szCurrentName = szName; // does that make a copy? I expect it to...
00212     _bSaveOnEnd = true;
00213 }

void VRMLNodeDesc::clearOnEndSave ( void   )  [virtual, inherited]

Definition at line 215 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_bSaveOnEnd.

Referenced by osg::VRMLFile::endNode().

00216 {
00217     _bSaveOnEnd = false;
00218 }

bool VRMLNodeDesc::getOnEndSave ( void   )  [virtual, inherited]

Definition at line 220 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_bSaveOnEnd.

Referenced by osg::VRMLFile::endNode().

00221 {
00222     return _bSaveOnEnd;
00223 }

const Char8 * VRMLNodeDesc::getSavename ( void   )  [virtual, inherited]

Definition at line 225 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_szCurrentName.

Referenced by osg::VRMLFile::endNode().

00226 {
00227     return _szCurrentName.c_str();
00228 }

FieldContainerPtr VRMLNodeDesc::getSaveFieldContainer ( void   )  [virtual, inherited]

Reimplemented in osg::VRMLAppearanceDesc.

Definition at line 230 of file OSGVRMLNodeDescs.cpp.

References osg::NullFC.

Referenced by osg::VRMLFile::endNode().

00231 {
00232     return NullFC;
00233 }

Field * VRMLNodeDesc::getField ( const Char8 szFieldname  )  [virtual, inherited]

Field * VRMLNodeDesc::getField ( FieldContainerPtr  pFC1,
FieldContainerPtr  pFC2,
GenericAttPtr  pGenAtt,
const Char8 szFieldname 
) [protected, inherited]

Definition at line 607 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::decIndent(), osg::VRMLNodeDesc::getIndent(), osg::VRMLNodeDesc::incIndent(), osg::indentLog(), osg::NullFC, and PINFO.

00611 {
00612     Field *returnValue = NULL;
00613 
00614     if(szFieldname == NULL)
00615     {
00616         return returnValue;
00617     }
00618 
00619 #ifdef OSG_DEBUG_VRML
00620     indentLog(getIndent(), PINFO);
00621     PINFO << "VRMLNodeDesc::getField " << std::endl;
00622 
00623     incIndent();
00624 
00625     indentLog(getIndent(), PINFO);
00626     PINFO << "Trying to find field : " << szFieldname << std::endl;
00627 #endif
00628 
00629     if(pFC1 != NullFC)
00630     {
00631         returnValue = pFC1->getField(szFieldname);
00632     }
00633 
00634 #ifdef OSG_DEBUG_VRML
00635     incIndent();
00636 
00637     indentLog(getIndent(), PINFO);
00638     PINFO << "Got this from node : " << returnValue << std::endl;
00639 #endif
00640 
00641     if(returnValue != NULL)
00642         return returnValue;
00643 
00644     if(pFC2 != NullFC)
00645     {
00646         returnValue = pFC2->getField(szFieldname);
00647 
00648 #ifdef OSG_DEBUG_VRML
00649         indentLog(getIndent(), PINFO);
00650         PINFO << "Got this from nodecore : " << returnValue << std::endl;
00651 #endif
00652     }
00653     else
00654     {
00655 #ifdef OSG_DEBUG_VRML
00656         indentLog(getIndent(), PINFO);
00657         PINFO << "No core to check" << std::endl;
00658 #endif
00659     }
00660 
00661 
00662     if(returnValue != NULL)
00663         return returnValue;
00664 
00665     if(pGenAtt != NullFC)
00666     {
00667         returnValue = pGenAtt->getField(szFieldname);
00668     }
00669 
00670 #ifdef OSG_DEBUG_VRML
00671     indentLog(getIndent(), PINFO);
00672     PINFO << "Got this from attachment : " << returnValue << std::endl;
00673 
00674     decIndent();
00675     decIndent();
00676 #endif
00677 
00678     return returnValue;
00679 }

void VRMLNodeDesc::prototypeAddFieldValue ( const Char8 szFieldVal  )  [virtual, inherited]

Definition at line 477 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_pCurrField, and osg::Field::pushValueByStr().

Referenced by osg::VRMLNodeFactory< BaseT >::addFieldValue().

00478 {
00479     if(_pCurrField       != NULL)
00480     {
00481         _pCurrField->pushValueByStr(szFieldVal);
00482     }
00483 }

bool VRMLNodeDesc::use ( FieldContainerPtr   )  [virtual, inherited]

Reimplemented in osg::VRMLAppearanceDesc.

Definition at line 560 of file OSGVRMLNodeDescs.cpp.

Referenced by osg::VRMLFile::use().

00561 {
00562     return false;
00563 }


Member Data Documentation

Definition at line 1287 of file OSGVRMLNodeDescs.h.

Referenced by prototypeAddField().

Definition at line 1288 of file OSGVRMLNodeDescs.h.

Referenced by beginNode(), and prototypeAddField().

Definition at line 1289 of file OSGVRMLNodeDescs.h.

Referenced by beginNode(), and prototypeAddField().

Definition at line 1291 of file OSGVRMLNodeDescs.h.

Referenced by addFieldValue(), beginNode(), endNode(), and getFieldAndDesc().

Definition at line 1292 of file OSGVRMLNodeDescs.h.

Referenced by beginNode(), endNode(), and getFieldAndDesc().

Definition at line 1293 of file OSGVRMLNodeDescs.h.

Referenced by beginNode(), endNode(), and getFieldAndDesc().

UInt32 VRMLNodeDesc::_uiIndent = 0 [static, protected, inherited]

Definition at line 307 of file OSGVRMLNodeDescs.h.

Field* osg::VRMLNodeDesc::_pCurrField [protected, inherited]

std::string osg::VRMLNodeDesc::_szCurrentName [protected, inherited]

bool osg::VRMLNodeDesc::_bSaveOnEnd [protected, inherited]


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

Generated on Mon Mar 17 11:12:18 2008 for OpenSG by  doxygen 1.5.5