root/OpenSceneGraph/trunk/src/osgWrappers/deprecated-dotosg/osg/MatrixTransform.cpp @ 13041

Revision 13041, 1.8 kB (checked in by robert, 3 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1#include <osg/MatrixTransform>
2
3#include <osgDB/Registry>
4#include <osgDB/Input>
5#include <osgDB/Output>
6
7#include "Matrix.h"
8
9using namespace osg;
10using namespace osgDB;
11
12// forward declare functions to use later.
13bool MatrixTransform_readLocalData(Object& obj, Input& fr);
14bool MatrixTransform_writeLocalData(const Object& obj, Output& fw);
15
16// register the read and write functions with the osgDB::Registry.
17REGISTER_DOTOSGWRAPPER(MatrixTransform)
18(
19    new osg::MatrixTransform,
20    "MatrixTransform",
21    "Object Node Transform MatrixTransform Group",
22    &MatrixTransform_readLocalData,
23    &MatrixTransform_writeLocalData,
24    DotOsgWrapper::READ_AND_WRITE
25);
26
27// register old style 'DCS' read and write functions with the osgDB::Registry.
28REGISTER_DOTOSGWRAPPER(DCS)
29(
30    new osg::MatrixTransform,
31    "DCS",
32    "Object Node Group DCS",
33    &MatrixTransform_readLocalData,
34    NULL,
35    DotOsgWrapper::READ_ONLY
36);
37
38bool MatrixTransform_readLocalData(Object& obj, Input& fr)
39{
40    bool iteratorAdvanced = false;
41
42    MatrixTransform& transform = static_cast<MatrixTransform&>(obj);
43
44    if (fr[0].matchWord("Type"))
45    {
46        if (fr[1].matchWord("DYNAMIC"))
47        {
48            transform.setDataVariance(osg::Object::DYNAMIC);
49            fr +=2 ;
50            iteratorAdvanced = true;
51        }
52        else if (fr[1].matchWord("STATIC"))
53        {
54            transform.setDataVariance(osg::Object::STATIC);
55            fr +=2 ;
56            iteratorAdvanced = true;
57        }
58
59    }
60
61    Matrix matrix;
62    if (readMatrix(matrix,fr))
63    {
64        transform.setMatrix(matrix);
65        iteratorAdvanced = true;
66    }
67
68    return iteratorAdvanced;
69}
70
71
72bool MatrixTransform_writeLocalData(const Object& obj, Output& fw)
73{
74    const MatrixTransform& transform = static_cast<const MatrixTransform&>(obj);
75
76    writeMatrix(transform.getMatrix(),fw);
77
78    return true;
79}
Note: See TracBrowser for help on using the browser.