~ubuntu-branches/debian/experimental/openscenegraph/experimental

« back to all changes in this revision

Viewing changes to OpenSceneGraph/src/osgWrappers/deprecated-dotosg/osg/MatrixTransform.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Luaces
  • Date: 2011-01-29 11:36:29 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110129113629-qisrm2kdqlurc7t3
Tags: 2.9.11-1
* Removed bug-555869-ftbfs_with_binutils_gold.dpatch since upstream has
  already taken care of the issue.
* Removed bug-528229.dpatch since the pkgconfig files are now also split
  in upstream.
* Removed explicit dependency on GLU.
* Upstream no longer includes osgIntrospection (Closes: #592420).
* Disabled zip plugin as its implementation stores an embedded copy of
  zlib.
* Enabled Qt support. Thanks James Goppert.
* Enabled SVG and PDF plugins. Thanks James Goppert.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <osg/MatrixTransform>
 
2
 
 
3
#include <osgDB/Registry>
 
4
#include <osgDB/Input>
 
5
#include <osgDB/Output>
 
6
 
 
7
#include "Matrix.h"
 
8
 
 
9
using namespace osg;
 
10
using namespace osgDB;
 
11
 
 
12
// forward declare functions to use later.
 
13
bool MatrixTransform_readLocalData(Object& obj, Input& fr);
 
14
bool MatrixTransform_writeLocalData(const Object& obj, Output& fw);
 
15
 
 
16
// register the read and write functions with the osgDB::Registry.
 
17
REGISTER_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.
 
28
REGISTER_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
 
 
38
bool 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
 
 
72
bool 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
}