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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMPointMatrixMult.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_POINTMATRIXMULT_H__
 
11
#define __MayaDM_POINTMATRIXMULT_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMDependNode.h"
 
15
namespace MayaDM
 
16
{
 
17
class PointMatrixMult : public DependNode
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        PointMatrixMult():DependNode(){}
 
23
        PointMatrixMult(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :DependNode(file, name, parent, "pointMatrixMult", shared, create){}
 
25
        virtual ~PointMatrixMult(){}
 
26
 
 
27
        void setInPoint(const double3& ip)
 
28
        {
 
29
                fprintf(mFile,"\tsetAttr \".ip\" -type \"double3\" ");
 
30
                ip.write(mFile);
 
31
                fprintf(mFile,";\n");
 
32
        }
 
33
        void setInPointX(double ipx)
 
34
        {
 
35
                if(ipx == 0) return;
 
36
                fprintf(mFile,"\tsetAttr \".ip.ipx\" %f;\n", ipx);
 
37
        }
 
38
        void setInPointY(double ipy)
 
39
        {
 
40
                if(ipy == 0) return;
 
41
                fprintf(mFile,"\tsetAttr \".ip.ipy\" %f;\n", ipy);
 
42
        }
 
43
        void setInPointZ(double ipz)
 
44
        {
 
45
                if(ipz == 0) return;
 
46
                fprintf(mFile,"\tsetAttr \".ip.ipz\" %f;\n", ipz);
 
47
        }
 
48
        void setInMatrix(const matrix& im)
 
49
        {
 
50
                if(im == identity) return;
 
51
                fprintf(mFile,"\tsetAttr \".im\" -type \"matrix\" ");
 
52
                im.write(mFile);
 
53
                fprintf(mFile,";\n");
 
54
        }
 
55
        void setVectorMultiply(bool vm)
 
56
        {
 
57
                if(vm == false) return;
 
58
                fprintf(mFile,"\tsetAttr \".vm\" %i;\n", vm);
 
59
        }
 
60
        void getInPoint()const
 
61
        {
 
62
                fprintf(mFile,"\"%s.ip\"",mName.c_str());
 
63
        }
 
64
        void getInPointX()const
 
65
        {
 
66
                fprintf(mFile,"\"%s.ip.ipx\"",mName.c_str());
 
67
        }
 
68
        void getInPointY()const
 
69
        {
 
70
                fprintf(mFile,"\"%s.ip.ipy\"",mName.c_str());
 
71
        }
 
72
        void getInPointZ()const
 
73
        {
 
74
                fprintf(mFile,"\"%s.ip.ipz\"",mName.c_str());
 
75
        }
 
76
        void getInMatrix()const
 
77
        {
 
78
                fprintf(mFile,"\"%s.im\"",mName.c_str());
 
79
        }
 
80
        void getVectorMultiply()const
 
81
        {
 
82
                fprintf(mFile,"\"%s.vm\"",mName.c_str());
 
83
        }
 
84
        void getOutput()const
 
85
        {
 
86
                fprintf(mFile,"\"%s.o\"",mName.c_str());
 
87
        }
 
88
        void getOutputX()const
 
89
        {
 
90
                fprintf(mFile,"\"%s.o.ox\"",mName.c_str());
 
91
        }
 
92
        void getOutputY()const
 
93
        {
 
94
                fprintf(mFile,"\"%s.o.oy\"",mName.c_str());
 
95
        }
 
96
        void getOutputZ()const
 
97
        {
 
98
                fprintf(mFile,"\"%s.o.oz\"",mName.c_str());
 
99
        }
 
100
protected:
 
101
        PointMatrixMult(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
102
                :DependNode(file, name, parent, nodeType, shared, create) {}
 
103
 
 
104
};
 
105
}//namespace MayaDM
 
106
#endif//__MayaDM_POINTMATRIXMULT_H__