~ubuntu-branches/ubuntu/wily/opencollada/wily-proposed

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMMultMatrix.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2015-05-14 17:23:27 UTC
  • Revision ID: package-import@ubuntu.com-20150514172327-f862u8envms01fra
Tags: upstream-0.1.0~20140703.ddf8f47+dfsg1
ImportĀ upstreamĀ versionĀ 0.1.0~20140703.ddf8f47+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2008-2009 NetAllied Systems GmbH
 
3
 
 
4
    This file is part of MayaDataModel.
 
5
 
 
6
    Licensed under the MIT Open Source License,
 
7
    for details please see LICENSE file or the website
 
8
    http://www.opensource.org/licenses/mit-license.php
 
9
*/
 
10
#ifndef __MayaDM_MULTMATRIX_H__
 
11
#define __MayaDM_MULTMATRIX_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMDependNode.h"
 
15
namespace MayaDM
 
16
{
 
17
class MultMatrix : public DependNode
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        MultMatrix():DependNode(){}
 
23
        MultMatrix(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :DependNode(file, name, parent, "multMatrix", shared, create){}
 
25
        virtual ~MultMatrix(){}
 
26
 
 
27
        void setMatrixIn(size_t i_i,const matrix& i_)
 
28
        {
 
29
                if(i_ == identity) return;
 
30
                fprintf(mFile,"\tsetAttr \".i[%i]\" -type \"matrix\" ",i_i);
 
31
                i_.write(mFile);
 
32
                fprintf(mFile,";\n");
 
33
        }
 
34
        void setMatrixIn(size_t i_start,size_t i_end,matrix* i_)
 
35
        {
 
36
                fprintf(mFile,"\tsetAttr \".i[%i:%i]\" ", i_start,i_end);
 
37
                size_t size = (i_end-i_start)*1+1;
 
38
                for(size_t i=0;i<size;++i)
 
39
                {
 
40
                        i_[i].write(mFile);
 
41
                        fprintf(mFile,"\n");
 
42
                }
 
43
                fprintf(mFile,";\n");
 
44
        }
 
45
        void startMatrixIn(size_t i_start,size_t i_end)const
 
46
        {
 
47
                fprintf(mFile,"\tsetAttr \".i[%i:%i]\"",i_start,i_end);
 
48
                fprintf(mFile," -type \"matrix\" ");
 
49
        }
 
50
        void appendMatrixIn(const matrix& i)const
 
51
        {
 
52
                fprintf(mFile," ");
 
53
                i.write(mFile);
 
54
        }
 
55
        void endMatrixIn()const
 
56
        {
 
57
                fprintf(mFile,";\n");
 
58
        }
 
59
        void getMatrixIn(size_t i_i)const
 
60
        {
 
61
                fprintf(mFile,"\"%s.i[%i]\"",mName.c_str(),i_i);
 
62
        }
 
63
        void getMatrixIn()const
 
64
        {
 
65
 
 
66
                fprintf(mFile,"\"%s.i\"",mName.c_str());
 
67
        }
 
68
        void getMatrixSum()const
 
69
        {
 
70
                fprintf(mFile,"\"%s.o\"",mName.c_str());
 
71
        }
 
72
protected:
 
73
        MultMatrix(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
74
                :DependNode(file, name, parent, nodeType, shared, create) {}
 
75
 
 
76
};
 
77
}//namespace MayaDM
 
78
#endif//__MayaDM_MULTMATRIX_H__