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

VRML Texture Transform Desc. More...

#include <OSGVRMLNodeDescs.h>

Inheritance diagram for osg::VRMLTextureTransformDesc:

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


 VRMLTextureTransformDesc (void)
Destructor


virtual ~VRMLTextureTransformDesc (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)
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 void addFieldValue (Field *pField, const Char8 *szFieldVal)
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


SFVec2f _defaultCenter
SFReal32 _defaultRotation
SFVec2f _defaultScale
SFVec2f _defaultTranslation
SFVec2f _center
SFReal32 _rotation
SFVec2f _scale
SFVec2f _translation

Private Types

typedef VRMLNodeDesc Inherited

Private Member Functions

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


Detailed Description

VRML Texture Transform description

Definition at line 1016 of file OSGVRMLNodeDescs.h.


Member Typedef Documentation

Definition at line 1099 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

VRMLTextureTransformDesc::VRMLTextureTransformDesc ( void   ) 

Definition at line 3185 of file OSGVRMLNodeDescs.cpp.

03185                                                        :
03186     Inherited(),
03187     _defaultCenter(),
03188     _defaultRotation(),
03189     _defaultScale(),
03190     _defaultTranslation(),
03191 
03192     _center(),
03193     _rotation(),
03194     _scale(),
03195     _translation()
03196 {
03197 }

VRMLTextureTransformDesc::~VRMLTextureTransformDesc ( void   )  [virtual]

Definition at line 3202 of file OSGVRMLNodeDescs.cpp.

03203 {
03204 }

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


Member Function Documentation

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

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3209 of file OSGVRMLNodeDescs.cpp.

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

03210 {
03211 #ifdef OSG_DEBUG_VRML
03212     indentLog(getIndent(), PINFO);
03213     PINFO << "TextureTransformDesc::init : " << szName << std::endl;
03214 #endif
03215 }

void VRMLTextureTransformDesc::reset ( void   )  [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3217 of file OSGVRMLNodeDescs.cpp.

03218 {
03219 }

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

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3224 of file OSGVRMLNodeDescs.cpp.

References _defaultCenter, _defaultRotation, _defaultScale, _defaultTranslation, osg::VRMLNodeDesc::_pCurrField, osg::VRMLNodeDesc::getIndent(), osg::indentLog(), PINFO, and osg::stringcasecmp().

03227 {
03228     bool bFound =false;
03229 
03230     _pCurrField = NULL;
03231 
03232     if(stringcasecmp("center", szFieldname) == 0)
03233     {
03234         _pCurrField = &_defaultCenter;
03235 
03236         bFound = true;
03237     }
03238     else if(stringcasecmp("rotation", szFieldname) == 0)
03239     {
03240         _pCurrField = &_defaultRotation;
03241 
03242         bFound = true;
03243     }
03244     else if(stringcasecmp("scale", szFieldname) == 0)
03245     {
03246         _pCurrField = &_defaultScale;
03247 
03248         bFound = true;
03249     }
03250     else if(stringcasecmp("translation", szFieldname) == 0)
03251     {
03252         _pCurrField = &_defaultTranslation;
03253 
03254         bFound = true;
03255     }
03256 
03257     if(bFound == true)
03258     {
03259 #ifdef OSG_DEBUG_VRML
03260         indentLog(getIndent(), PINFO);
03261         PINFO << "TextureTransformDesc::prototypeAddField : add part "
03262               << szFieldname
03263               << std::endl;
03264 #endif
03265 
03266         return true;
03267     }
03268     else
03269     {
03270         return false;
03271     }
03272 }

void VRMLTextureTransformDesc::endProtoInterface ( void   )  [virtual]

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3274 of file OSGVRMLNodeDescs.cpp.

03275 {
03276 }

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

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3278 of file OSGVRMLNodeDescs.cpp.

References _center, _rotation, _scale, _translation, and osg::stringcasecmp().

03283 {
03284     if(stringcasecmp("center", szFieldname) == 0)
03285     {
03286         pField = &_center;
03287     }
03288     else if(stringcasecmp("rotation", szFieldname) == 0)
03289     {
03290         pField = &_rotation;
03291     }
03292     else if(stringcasecmp("scale", szFieldname) == 0)
03293     {
03294         pField = &_scale;
03295     }
03296     else if(stringcasecmp("translation", szFieldname) == 0)
03297     {
03298         pField = &_translation;
03299     }
03300 
03301     pDesc = NULL;
03302 }

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

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3307 of file OSGVRMLNodeDescs.cpp.

References _center, _defaultCenter, _defaultRotation, _defaultScale, _defaultTranslation, _rotation, _scale, _translation, osg::TextureTransformChunkBase::create(), osg::VRMLNodeDesc::getIndent(), osg::VRMLNodeDesc::incIndent(), osg::indentLog(), and PINFO.

03311 {
03312     TextureTransformChunkPtr returnValue = TextureTransformChunk::create();
03313 
03314 #ifdef OSG_DEBUG_VRML
03315     indentLog(getIndent(), PINFO);
03316     PINFO << "Begin TextureTransform " << &(*returnValue) << std::endl;
03317 
03318     incIndent();
03319 #endif
03320 
03321     _center = _defaultCenter;
03322     _rotation = _defaultRotation;
03323     _scale = _defaultScale;
03324     _translation = _defaultTranslation;
03325 
03326     return returnValue;
03327 }

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

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3329 of file OSGVRMLNodeDescs.cpp.

References _center, _rotation, _scale, _translation, osg::beginEditCP(), osg::AttachmentPtr::dcast(), osg::VRMLNodeDesc::decIndent(), osg::endEditCP(), osg::VRMLNodeDesc::getIndent(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::QuaternionBase< ValueTypeT >::identity(), osg::indentLog(), osg::NullFC, PINFO, PWARNING, and osg::TransformationMatrix< ValueTypeT >::setTransform().

03330 {
03331     TextureTransformChunkPtr pTexTrans = NullFC;
03332 
03333     pTexTrans = TextureTransformChunkPtr::dcast(pFC);
03334 
03335     if(pTexTrans != NullFC)
03336     {
03337         Matrix     m;
03338 
03339         Vec3f center(_center.getValue()[0],
03340                      _center.getValue()[1], 0.0f);
03341 
03342         Quaternion rotation;
03343         rotation.setValueAsAxisRad(0.0f, 0.0f, 1.0f, _rotation.getValue());
03344 
03345         Vec3f scale(_scale.getValue()[0],
03346                     _scale.getValue()[1], 1.0f);
03347         
03348         Vec3f translation(_translation.getValue()[0],
03349                           _translation.getValue()[1], 0.0f);
03350 
03351         m.setTransform(translation,
03352                        rotation,
03353                        scale,
03354                        Quaternion::identity(),
03355                        center);
03356 
03357         beginEditCP(pTexTrans);
03358         {
03359             pTexTrans->setMatrix(m);
03360         }
03361         endEditCP  (pTexTrans);
03362     }
03363     else
03364     {
03365         PWARNING <<  "VRMLTextureTransformDesc::endNode : Invalid texture transform ptr"
03366                  << std::endl;
03367     }
03368 
03369 #ifdef OSG_DEBUG_VRML
03370     decIndent();
03371 
03372     indentLog(getIndent(), PINFO);
03373     PINFO << "End TextureTransform "
03374           << _center.getValue() << " "
03375           << _rotation.getValue()    << " "
03376           << _scale.getValue()    << " "
03377           << _translation.getValue()    << " "
03378           << &(*pFC) << std::endl;
03379 #endif
03380 }

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

Reimplemented from osg::VRMLNodeDesc.

Definition at line 3385 of file OSGVRMLNodeDescs.cpp.

03386 {
03387 }

void osg::VRMLTextureTransformDesc::operator= ( const VRMLTextureTransformDesc 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(), osg::VRMLPixelTextureDesc::beginNode(), osg::VRMLImageTextureDesc::beginNode(), 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(), osg::VRMLPixelTextureDesc::endNode(), osg::VRMLImageTextureDesc::endNode(), 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(), osg::VRMLPixelTextureDesc::init(), osg::VRMLImageTextureDesc::init(), init(), osg::VRMLMaterialDesc::init(), osg::VRMLAppearanceDesc::init(), osg::VRMLGeometryObjectDesc::init(), osg::VRMLGeometryPartDesc::init(), osg::VRMLGeometryPointSetDesc::init(), osg::VRMLGeometryDesc::init(), osg::VRMLShapeDesc::init(), osg::VRMLPixelTextureDesc::prototypeAddField(), osg::VRMLImageTextureDesc::prototypeAddField(), 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 }

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

Reimplemented in osg::VRMLGeometryDesc, osg::VRMLGeometryPointSetDesc, and osg::VRMLPixelTextureDesc.

Definition at line 551 of file OSGVRMLNodeDescs.cpp.

References osg::Field::pushValueByStr().

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

00553 {
00554     if(pField != NULL)
00555     {
00556         pField->pushValueByStr(szFieldVal);
00557     }
00558 }

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 1085 of file OSGVRMLNodeDescs.h.

Referenced by beginNode(), and prototypeAddField().

Definition at line 1086 of file OSGVRMLNodeDescs.h.

Referenced by beginNode(), and prototypeAddField().

Definition at line 1087 of file OSGVRMLNodeDescs.h.

Referenced by beginNode(), and prototypeAddField().

Definition at line 1088 of file OSGVRMLNodeDescs.h.

Referenced by beginNode(), and prototypeAddField().

Definition at line 1090 of file OSGVRMLNodeDescs.h.

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

Definition at line 1091 of file OSGVRMLNodeDescs.h.

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

Definition at line 1092 of file OSGVRMLNodeDescs.h.

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

Definition at line 1093 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:16 2008 for OpenSG by  doxygen 1.5.5