Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::OSGWriter::FCInfoHelper Struct Reference

#include <OSGOSGWriter.h>

List of all members.

Public Member Functions

void setName (const FieldContainerPtr pFC)
 FCInfoHelper (void)

Public Attributes

bool written
bool hasName
std::string containerName


Detailed Description

Definition at line 98 of file OSGOSGWriter.h.


Constructor & Destructor Documentation

OSGWriter::FCInfoHelper::FCInfoHelper void   ) 
 

Constructor. Set members to initial values.

Definition at line 66 of file OSGOSGWriter.cpp.

00066                                         :
00067     written      (false),
00068     hasName      (false),
00069     containerName(     )
00070 {
00071 }


Member Function Documentation

void OSGWriter::FCInfoHelper::setName const FieldContainerPtr  pFC  ) 
 

Set the name by which this FieldContainer is referenced. If available a NameAttachment is used, otherwise the name is constructed from the type name and the container id.

Definition at line 138 of file OSGOSGWriter.cpp.

References containerName, osg::FCPtr< BasePtrTypeT, FieldContainerTypeT >::dcast(), osg::AttachmentContainerPtr::dcast(), osg::SimpleAttachment< NameAttachmentDesc >::getClassType(), osg::AttachmentContainer::getClassType(), osg::FieldContainerPtrBase::getFieldContainerId(), osg::FieldContainerType::getGroupId(), osg::FieldContainerType::isDerivedFrom(), and osg::NullFC.

00139 {
00140     const FieldContainerType& fcType = pFC->getType();
00141     AttachmentContainerPtr pAttCon;
00142     NamePtr                pNameAtt;
00143 
00144     if(fcType.isDerivedFrom(AttachmentContainer::getClassType()))
00145     {
00146         pAttCon = AttachmentContainerPtr::dcast(pFC);
00147         if(pAttCon != NullFC)
00148         {
00149             pNameAtt = NamePtr::dcast(pAttCon->findAttachment(
00150                 Name::getClassType().getGroupId()));
00151 
00152             if(pNameAtt != NullFC)
00153             {
00154                 containerName = pNameAtt->getFieldPtr()->getValue().c_str();
00155                 return;
00156             }
00157         }
00158     }
00159 
00160     //no NameAttachment. Build name from Type and Id
00161     containerName = pFC->getTypeName() +
00162         TypeTraits<UInt32>::putToString(pFC.getFieldContainerId());
00163 }


Member Data Documentation

bool osg::OSGWriter::FCInfoHelper::written
 

Definition at line 100 of file OSGOSGWriter.h.

bool osg::OSGWriter::FCInfoHelper::hasName
 

Definition at line 101 of file OSGOSGWriter.h.

std::string osg::OSGWriter::FCInfoHelper::containerName
 

Definition at line 102 of file OSGOSGWriter.h.

Referenced by setName().


The documentation for this struct was generated from the following files:
Generated on Thu Aug 25 04:13:53 2005 for OpenSG by  doxygen 1.4.3