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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMGammaCorrect.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_GAMMACORRECT_H__
 
11
#define __MayaDM_GAMMACORRECT_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMDependNode.h"
 
15
namespace MayaDM
 
16
{
 
17
class GammaCorrect : public DependNode
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        GammaCorrect():DependNode(){}
 
23
        GammaCorrect(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :DependNode(file, name, parent, "gammaCorrect", shared, create){}
 
25
        virtual ~GammaCorrect(){}
 
26
 
 
27
        void setValue(const float3& v)
 
28
        {
 
29
                if(v == float3(0.0f,0.0f,0.0f)) return;
 
30
                fprintf(mFile,"\tsetAttr \".v\" -type \"float3\" ");
 
31
                v.write(mFile);
 
32
                fprintf(mFile,";\n");
 
33
        }
 
34
        void setValueX(float vx)
 
35
        {
 
36
                if(vx == 0.0) return;
 
37
                fprintf(mFile,"\tsetAttr \".v.vx\" %f;\n", vx);
 
38
        }
 
39
        void setValueY(float vy)
 
40
        {
 
41
                if(vy == 0.0) return;
 
42
                fprintf(mFile,"\tsetAttr \".v.vy\" %f;\n", vy);
 
43
        }
 
44
        void setValueZ(float vz)
 
45
        {
 
46
                if(vz == 0.0) return;
 
47
                fprintf(mFile,"\tsetAttr \".v.vz\" %f;\n", vz);
 
48
        }
 
49
        void setGamma(const float3& g)
 
50
        {
 
51
                if(g == float3(1.0f,1.0f,1.0f)) return;
 
52
                fprintf(mFile,"\tsetAttr \".g\" -type \"float3\" ");
 
53
                g.write(mFile);
 
54
                fprintf(mFile,";\n");
 
55
        }
 
56
        void setGammaX(float gx)
 
57
        {
 
58
                if(gx == 0.0) return;
 
59
                fprintf(mFile,"\tsetAttr \".g.gx\" %f;\n", gx);
 
60
        }
 
61
        void setGammaY(float gy)
 
62
        {
 
63
                if(gy == 0.0) return;
 
64
                fprintf(mFile,"\tsetAttr \".g.gy\" %f;\n", gy);
 
65
        }
 
66
        void setGammaZ(float gz)
 
67
        {
 
68
                if(gz == 0.0) return;
 
69
                fprintf(mFile,"\tsetAttr \".g.gz\" %f;\n", gz);
 
70
        }
 
71
        void getValue()const
 
72
        {
 
73
                fprintf(mFile,"\"%s.v\"",mName.c_str());
 
74
        }
 
75
        void getValueX()const
 
76
        {
 
77
                fprintf(mFile,"\"%s.v.vx\"",mName.c_str());
 
78
        }
 
79
        void getValueY()const
 
80
        {
 
81
                fprintf(mFile,"\"%s.v.vy\"",mName.c_str());
 
82
        }
 
83
        void getValueZ()const
 
84
        {
 
85
                fprintf(mFile,"\"%s.v.vz\"",mName.c_str());
 
86
        }
 
87
        void getGamma()const
 
88
        {
 
89
                fprintf(mFile,"\"%s.g\"",mName.c_str());
 
90
        }
 
91
        void getGammaX()const
 
92
        {
 
93
                fprintf(mFile,"\"%s.g.gx\"",mName.c_str());
 
94
        }
 
95
        void getGammaY()const
 
96
        {
 
97
                fprintf(mFile,"\"%s.g.gy\"",mName.c_str());
 
98
        }
 
99
        void getGammaZ()const
 
100
        {
 
101
                fprintf(mFile,"\"%s.g.gz\"",mName.c_str());
 
102
        }
 
103
        void getOutValue()const
 
104
        {
 
105
                fprintf(mFile,"\"%s.o\"",mName.c_str());
 
106
        }
 
107
        void getOutValueX()const
 
108
        {
 
109
                fprintf(mFile,"\"%s.o.ox\"",mName.c_str());
 
110
        }
 
111
        void getOutValueY()const
 
112
        {
 
113
                fprintf(mFile,"\"%s.o.oy\"",mName.c_str());
 
114
        }
 
115
        void getOutValueZ()const
 
116
        {
 
117
                fprintf(mFile,"\"%s.o.oz\"",mName.c_str());
 
118
        }
 
119
protected:
 
120
        GammaCorrect(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
121
                :DependNode(file, name, parent, nodeType, shared, create) {}
 
122
 
 
123
};
 
124
}//namespace MayaDM
 
125
#endif//__MayaDM_GAMMACORRECT_H__