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.

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)

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)

Detailed Description

VRML Pixel Texture description

Definition at line 1227 of file OSGVRMLNodeDescs.h.


Member Typedef Documentation

Definition at line 1316 of file OSGVRMLNodeDescs.h.

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

Definition at line 300 of file OSGVRMLNodeDescs.h.


Constructor & Destructor Documentation

VRMLPixelTextureDesc::VRMLPixelTextureDesc ( void   ) 

Definition at line 3734 of file OSGVRMLNodeDescs.cpp.

03734                                                :
03735     Inherited(),
03736 
03737     _defaultImage  (),
03738     _defaultRepeatS(),
03739     _defaultRepeatT(),
03740 
03741     _image         (),
03742     _repeatS       (),
03743     _repeatT       ()
03744 {
03745 }

VRMLPixelTextureDesc::~VRMLPixelTextureDesc ( void   )  [virtual]

Definition at line 3750 of file OSGVRMLNodeDescs.cpp.

03751 {
03752 }

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

Member Function Documentation

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

Reimplemented from osg::VRMLNodeDesc.

void VRMLPixelTextureDesc::reset ( void   )  [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3765 of file OSGVRMLNodeDescs.cpp.

03766 {
03767 }

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

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3772 of file OSGVRMLNodeDescs.cpp.

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

03775 {
03776     bool bFound = false;
03777 
03778     _pCurrField = NULL;
03779 
03780     if(stringcasecmp("image", szFieldname) == 0)
03781     {
03782         _pCurrField = &_defaultImage;
03783 
03784         bFound = true;
03785     }
03786     else if(stringcasecmp("repeatS", szFieldname) == 0)
03787     {
03788         _pCurrField = &_defaultRepeatS;
03789 
03790         bFound = true;
03791     }
03792     else if(stringcasecmp("repeatT", szFieldname) == 0)
03793     {
03794         _pCurrField = &_defaultRepeatT;
03795 
03796         bFound = true;
03797     }
03798 
03799     if(bFound == true)
03800     {
03801 #ifdef OSG_DEBUG_VRML
03802         indentLog(getIndent(), PINFO);
03803         PINFO << "PixelTextureDesc::prototypeAddField : add part "
03804               << szFieldname
03805               << std::endl;
03806 #endif
03807 
03808         return true;
03809     }
03810     else
03811     {
03812         return false;
03813     }
03814 }

void VRMLPixelTextureDesc::endProtoInterface ( void   )  [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3816 of file OSGVRMLNodeDescs.cpp.

03817 {
03818 }

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

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3820 of file OSGVRMLNodeDescs.cpp.

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

03825 {
03826     if(stringcasecmp("image", szFieldname) == 0)
03827     {
03828         pField = &_image;
03829     }
03830     else if(stringcasecmp("repeatS", szFieldname) == 0)
03831     {
03832         pField = &_repeatS;
03833     }
03834     else if(stringcasecmp("repeatT", szFieldname) == 0)
03835     {
03836         pField = &_repeatT;
03837     }
03838 
03839     pDesc = NULL;
03840 }

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

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3845 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().

03849 {
03850     TextureChunkPtr returnValue = TextureChunk::create();
03851 
03852     ImagePtr iPtr=Image::create();
03853     _image.setValue(iPtr);
03854 
03855     _repeatS = _defaultRepeatS;
03856     _repeatT = _defaultRepeatT;
03857 
03858 #ifdef OSG_DEBUG_VRML
03859     indentLog(getIndent(), PINFO);
03860     PINFO << "Begin PixelTexture " << &(*returnValue) << std::endl;
03861 
03862     incIndent();
03863 #endif
03864 
03865     return returnValue;
03866 }

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

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3868 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.

03869 {
03870     TextureChunkPtr  pTexture = NullFC;
03871 
03872     pTexture = TextureChunkPtr::dcast(pFC);
03873 
03874     if(pTexture != NullFC)
03875     {
03876         if(_image.getValue() != NullFC)
03877         {
03878             pTexture->setImage(_image.getValue());
03879 
03880             if(_repeatS.getValue() == true)
03881             {
03882                 pTexture->setWrapS(GL_REPEAT);
03883             }
03884             else
03885             {
03886                 pTexture->setWrapS(GL_CLAMP);
03887             }
03888 
03889             if(_repeatT.getValue() == true)
03890             {
03891                 pTexture->setWrapT(GL_REPEAT);
03892             }
03893             else
03894             {
03895                 pTexture->setWrapT(GL_CLAMP);
03896             }
03897         }
03898     }
03899     else
03900     {
03901         PWARNING <<  "VRMLPixelTextureDesc::endNode : Invalid texture ptr"
03902                  << std::endl;
03903     }
03904 
03905 #ifdef OSG_DEBUG_VRML
03906     decIndent();
03907 
03908     indentLog(getIndent(), PINFO);
03909     PINFO << "End PixelTexture "
03910           << _repeatS.getValue()    << " "
03911           << _repeatT.getValue()    << " "
03912           << &(*pFC) << std::endl;
03913 #endif
03914 }

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

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3919 of file OSGVRMLNodeDescs.cpp.

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

03921 {
03922     if(pField != NULL)
03923     {
03924         if( (pField == &_image) && (_image.getValue() != NullFC) )
03925         {
03926             _image.getValue()->addValue(szFieldVal);
03927         }
03928         else
03929         {
03930             pField->pushValueByStr(szFieldVal);
03931         }
03932     }
03933 }

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

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3938 of file OSGVRMLNodeDescs.cpp.

03939 {
03940 }

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

Reimplemented from osg::VRMLNodeDesc.

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

Definition at line 118 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::VRMLInlineDesc::endNode(), osg::VRMLExtrusionDesc::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(), prototypeAddField(), osg::VRMLImageTextureDesc::prototypeAddField(), osg::VRMLTextureTransformDesc::prototypeAddField(), osg::VRMLMaterialDesc::prototypeAddField(), osg::VRMLGeometryPartDesc::prototypeAddField(), osg::VRMLGeometryPointSetDesc::prototypeAddField(), osg::VRMLGeometryDesc::prototypeAddField(), osg::VRMLShapeDesc::prototypeAddField(), osg::VRMLFile::setContainerFieldValue(), and osg::VRMLFile::use().

00119 {
00120     return _uiIndent;
00121 }

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 203 of file OSGVRMLNodeDescs.cpp.

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

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

00204 {
00205     _szCurrentName = szName; // does that make a copy? I expect it to...
00206     _bSaveOnEnd = true;
00207 }

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

Definition at line 209 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_bSaveOnEnd.

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

00210 {
00211     _bSaveOnEnd = false;
00212 }

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

Definition at line 214 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_bSaveOnEnd.

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

00215 {
00216     return _bSaveOnEnd;
00217 }

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

Definition at line 219 of file OSGVRMLNodeDescs.cpp.

References osg::VRMLNodeDesc::_szCurrentName.

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

00220 {
00221     return _szCurrentName.c_str();
00222 }

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

Reimplemented in osg::VRMLAppearanceDesc.

Definition at line 224 of file OSGVRMLNodeDescs.cpp.

References osg::NullFC.

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

00225 {
00226     return NullFC;
00227 }

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 604 of file OSGVRMLNodeDescs.cpp.

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

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

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

Definition at line 472 of file OSGVRMLNodeDescs.cpp.

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

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

00473 {
00474     if(_pCurrField       != NULL)
00475     {
00476         _pCurrField->pushValueByStr(szFieldVal);
00477     }
00478 }

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

Reimplemented in osg::VRMLAppearanceDesc.

Definition at line 555 of file OSGVRMLNodeDescs.cpp.

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

00556 {
00557     return false;
00558 }


Member Data Documentation

Definition at line 1304 of file OSGVRMLNodeDescs.h.

Referenced by prototypeAddField().

Definition at line 1305 of file OSGVRMLNodeDescs.h.

Referenced by beginNode(), and prototypeAddField().

Definition at line 1306 of file OSGVRMLNodeDescs.h.

Referenced by beginNode(), and prototypeAddField().

Definition at line 1308 of file OSGVRMLNodeDescs.h.

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

Definition at line 1309 of file OSGVRMLNodeDescs.h.

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

Definition at line 1310 of file OSGVRMLNodeDescs.h.

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

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

Definition at line 309 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 8 Feb 2010 for OpenSG by  doxygen 1.6.1