osgEarth 2.1.1
Public Member Functions | Public Attributes

seamless::Patch::Data Struct Reference

Inheritance diagram for seamless::Patch::Data:
Collaboration diagram for seamless::Patch::Data:

List of all members.

Public Member Functions

 Data ()
 Data (const Data &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 ~Data ()
 META_Object (seamless, Patch::Data)
void getGeometryAttributes (const osg::Geometry *geom)
void setGeometryAttributes (osg::Geometry *geom)

Public Attributes

osg::Geometry::ArrayData vertexData
osg::Geometry::ArrayData normalData
osg::Geometry::ArrayData colorData
osg::Geometry::ArrayData secondaryColorData
osg::Geometry::ArrayData fogCoordData
osg::Geometry::ArrayDataList texCoordList
osg::Geometry::ArrayDataList vertexAttribList

Detailed Description

Definition at line 51 of file Patch.


Constructor & Destructor Documentation

seamless::Patch::Data::Data ( )

Definition at line 67 of file Patch.cpp.

{
}
seamless::Patch::Data::Data ( const Data rhs,
const osg::CopyOp &  copyop = osg::CopyOp::SHALLOW_COPY 
)

Definition at line 71 of file Patch.cpp.

    : vertexData(rhs.vertexData, copyop), normalData(rhs.normalData, copyop),
      colorData(rhs.colorData, copyop),
      secondaryColorData(rhs.secondaryColorData, copyop),
      fogCoordData(rhs.fogCoordData, copyop)
{
    for (Geometry::ArrayDataList::const_iterator
             itr = rhs.texCoordList.begin(), end = rhs.texCoordList.end();
         itr !=end;
         ++itr)
        texCoordList.push_back(Geometry::ArrayData(*itr, copyop));
    for (Geometry::ArrayDataList::const_iterator
             itr = rhs.vertexAttribList.begin(),
             end = rhs.vertexAttribList.end();
         itr !=end;
         ++itr)
        vertexAttribList.push_back(Geometry::ArrayData(*itr, copyop));
}
seamless::Patch::Data::~Data ( ) [inline]

Definition at line 56 of file Patch.

{}

Member Function Documentation

void seamless::Patch::Data::getGeometryAttributes ( const osg::Geometry *  geom)

Definition at line 97 of file Patch.cpp.

{
    vertexData = geom->getVertexData();
    normalData = geom->getNormalData();
    colorData = geom->getColorData();
    secondaryColorData = geom->getSecondaryColorData();
    fogCoordData = geom->getFogCoordData();
    texCoordList.clear();
    const Geometry::ArrayDataList& texList = geom->getTexCoordArrayList();
    std::copy(texList.begin(), texList.end(), std::back_inserter(texCoordList));
    vertexAttribList.clear();
    const Geometry::ArrayDataList& vaList = geom->getVertexAttribArrayList();
    std::copy(vaList.begin(), vaList.end(),
              std::back_inserter(vertexAttribList));
}

Here is the call graph for this function:

seamless::Patch::Data::META_Object ( seamless  ,
Patch::Data   
)
void seamless::Patch::Data::setGeometryAttributes ( osg::Geometry *  geom)

Definition at line 113 of file Patch.cpp.

{
    geom->setVertexData(vertexData);
    geom->setNormalData(normalData);
    geom->setColorData(colorData);
    geom->setSecondaryColorData(secondaryColorData);
    geom->setFogCoordData(fogCoordData);
    const Geometry::ArrayData emptyData;
    unsigned numTexCoords = geom->getNumTexCoordArrays();
    for (unsigned i = 0; i < texCoordList.size(); ++i)
        geom->setTexCoordData(i, texCoordList[i]);
    for (unsigned i = texCoordList.size(); i < numTexCoords; ++i)
        geom->setTexCoordData(i, emptyData);
    unsigned numVertAttribs = geom->getNumVertexAttribArrays();
    for (unsigned i = vertexAttribList.size(); i < vertexAttribList.size(); ++i)
        geom->setVertexAttribData(i, vertexAttribList[i]);
    for (unsigned i = vertexAttribList.size(); i < numVertAttribs; ++i)
        geom->setVertexAttribData(i, emptyData);
}

Member Data Documentation

osg::Geometry::ArrayData seamless::Patch::Data::colorData

Definition at line 62 of file Patch.

osg::Geometry::ArrayData seamless::Patch::Data::fogCoordData

Definition at line 64 of file Patch.

osg::Geometry::ArrayData seamless::Patch::Data::normalData

Definition at line 61 of file Patch.

Definition at line 63 of file Patch.

osg::Geometry::ArrayDataList seamless::Patch::Data::texCoordList

Definition at line 65 of file Patch.

osg::Geometry::ArrayDataList seamless::Patch::Data::vertexAttribList

Definition at line 66 of file Patch.

osg::Geometry::ArrayData seamless::Patch::Data::vertexData

Definition at line 60 of file Patch.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines