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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMFilterEuler.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_FILTEREULER_H__
 
11
#define __MayaDM_FILTEREULER_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMFilter.h"
 
15
namespace MayaDM
 
16
{
 
17
class FilterEuler : public Filter
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        FilterEuler():Filter(){}
 
23
        FilterEuler(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :Filter(file, name, parent, "filterEuler", shared, create){}
 
25
        virtual ~FilterEuler(){}
 
26
 
 
27
        void setSmooth(unsigned int s)
 
28
        {
 
29
                if(s == 3) return;
 
30
                fprintf(mFile,"\tsetAttr \".s\" %i;\n", s);
 
31
        }
 
32
        void setNearestTo(unsigned int nt)
 
33
        {
 
34
                if(nt == 2) return;
 
35
                fprintf(mFile,"\tsetAttr \".nt\" %i;\n", nt);
 
36
        }
 
37
        void setWeight(const double3& w)
 
38
        {
 
39
                if(w == double3(1.0, 1.0, 1.0)) return;
 
40
                fprintf(mFile,"\tsetAttr \".w\" -type \"double3\" ");
 
41
                w.write(mFile);
 
42
                fprintf(mFile,";\n");
 
43
        }
 
44
        void setWeightX(double wx)
 
45
        {
 
46
                if(wx == 1.0) return;
 
47
                fprintf(mFile,"\tsetAttr \".w.wx\" %f;\n", wx);
 
48
        }
 
49
        void setWeightY(double wy)
 
50
        {
 
51
                if(wy == 1.0) return;
 
52
                fprintf(mFile,"\tsetAttr \".w.wy\" %f;\n", wy);
 
53
        }
 
54
        void setWeightZ(double wz)
 
55
        {
 
56
                if(wz == 1.0) return;
 
57
                fprintf(mFile,"\tsetAttr \".w.wz\" %f;\n", wz);
 
58
        }
 
59
        void setEnableInitialRotation(bool eir)
 
60
        {
 
61
                if(eir == false) return;
 
62
                fprintf(mFile,"\tsetAttr \".eir\" %i;\n", eir);
 
63
        }
 
64
        void setInitialRotation(const double3& ir)
 
65
        {
 
66
                if(ir == double3(0., 0., 0.)) return;
 
67
                fprintf(mFile,"\tsetAttr \".ir\" -type \"double3\" ");
 
68
                ir.write(mFile);
 
69
                fprintf(mFile,";\n");
 
70
        }
 
71
        void setInitialRotationX(double irx)
 
72
        {
 
73
                if(irx == 0) return;
 
74
                fprintf(mFile,"\tsetAttr \".ir.irx\" %f;\n", irx);
 
75
        }
 
76
        void setInitialRotationY(double iry)
 
77
        {
 
78
                if(iry == 0) return;
 
79
                fprintf(mFile,"\tsetAttr \".ir.iry\" %f;\n", iry);
 
80
        }
 
81
        void setInitialRotationZ(double irz)
 
82
        {
 
83
                if(irz == 0) return;
 
84
                fprintf(mFile,"\tsetAttr \".ir.irz\" %f;\n", irz);
 
85
        }
 
86
        void setOutputUsageOpt(unsigned int use)
 
87
        {
 
88
                if(use == 0) return;
 
89
                fprintf(mFile,"\tsetAttr \".use\" %i;\n", use);
 
90
        }
 
91
        void getSmooth()const
 
92
        {
 
93
                fprintf(mFile,"\"%s.s\"",mName.c_str());
 
94
        }
 
95
        void getNearestTo()const
 
96
        {
 
97
                fprintf(mFile,"\"%s.nt\"",mName.c_str());
 
98
        }
 
99
        void getWeight()const
 
100
        {
 
101
                fprintf(mFile,"\"%s.w\"",mName.c_str());
 
102
        }
 
103
        void getWeightX()const
 
104
        {
 
105
                fprintf(mFile,"\"%s.w.wx\"",mName.c_str());
 
106
        }
 
107
        void getWeightY()const
 
108
        {
 
109
                fprintf(mFile,"\"%s.w.wy\"",mName.c_str());
 
110
        }
 
111
        void getWeightZ()const
 
112
        {
 
113
                fprintf(mFile,"\"%s.w.wz\"",mName.c_str());
 
114
        }
 
115
        void getEnableInitialRotation()const
 
116
        {
 
117
                fprintf(mFile,"\"%s.eir\"",mName.c_str());
 
118
        }
 
119
        void getInitialRotation()const
 
120
        {
 
121
                fprintf(mFile,"\"%s.ir\"",mName.c_str());
 
122
        }
 
123
        void getInitialRotationX()const
 
124
        {
 
125
                fprintf(mFile,"\"%s.ir.irx\"",mName.c_str());
 
126
        }
 
127
        void getInitialRotationY()const
 
128
        {
 
129
                fprintf(mFile,"\"%s.ir.iry\"",mName.c_str());
 
130
        }
 
131
        void getInitialRotationZ()const
 
132
        {
 
133
                fprintf(mFile,"\"%s.ir.irz\"",mName.c_str());
 
134
        }
 
135
        void getOutputUsageOpt()const
 
136
        {
 
137
                fprintf(mFile,"\"%s.use\"",mName.c_str());
 
138
        }
 
139
protected:
 
140
        FilterEuler(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
141
                :Filter(file, name, parent, nodeType, shared, create) {}
 
142
 
 
143
};
 
144
}//namespace MayaDM
 
145
#endif//__MayaDM_FILTEREULER_H__