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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMVolumeShader.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_VOLUMESHADER_H__
 
11
#define __MayaDM_VOLUMESHADER_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMDependNode.h"
 
15
namespace MayaDM
 
16
{
 
17
class VolumeShader : public DependNode
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        VolumeShader():DependNode(){}
 
23
        VolumeShader(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :DependNode(file, name, parent, "volumeShader", shared, create){}
 
25
        virtual ~VolumeShader(){}
 
26
 
 
27
        void setOutColor(const float3& oc)
 
28
        {
 
29
                if(oc == float3(0.0f,0.0f,0.0f)) return;
 
30
                fprintf(mFile,"\tsetAttr \".oc\" -type \"float3\" ");
 
31
                oc.write(mFile);
 
32
                fprintf(mFile,";\n");
 
33
        }
 
34
        void setOutColorR(float ocr)
 
35
        {
 
36
                if(ocr == 0.0) return;
 
37
                fprintf(mFile,"\tsetAttr \".oc.ocr\" %f;\n", ocr);
 
38
        }
 
39
        void setOutColorG(float ocg)
 
40
        {
 
41
                if(ocg == 0.0) return;
 
42
                fprintf(mFile,"\tsetAttr \".oc.ocg\" %f;\n", ocg);
 
43
        }
 
44
        void setOutColorB(float ocb)
 
45
        {
 
46
                if(ocb == 0.0) return;
 
47
                fprintf(mFile,"\tsetAttr \".oc.ocb\" %f;\n", ocb);
 
48
        }
 
49
        void setOutTransparency(const float3& ot)
 
50
        {
 
51
                if(ot == float3(0.0f,0.0f,0.0f)) return;
 
52
                fprintf(mFile,"\tsetAttr \".ot\" -type \"float3\" ");
 
53
                ot.write(mFile);
 
54
                fprintf(mFile,";\n");
 
55
        }
 
56
        void setOutTransparencyR(float otr)
 
57
        {
 
58
                if(otr == 0.0) return;
 
59
                fprintf(mFile,"\tsetAttr \".ot.otr\" %f;\n", otr);
 
60
        }
 
61
        void setOutTransparencyG(float otg)
 
62
        {
 
63
                if(otg == 0.0) return;
 
64
                fprintf(mFile,"\tsetAttr \".ot.otg\" %f;\n", otg);
 
65
        }
 
66
        void setOutTransparencyB(float otb)
 
67
        {
 
68
                if(otb == 0.0) return;
 
69
                fprintf(mFile,"\tsetAttr \".ot.otb\" %f;\n", otb);
 
70
        }
 
71
        void setOutMatteOpacity(const float3& omo)
 
72
        {
 
73
                if(omo == float3(1.0f,1.0f,1.0f)) return;
 
74
                fprintf(mFile,"\tsetAttr \".omo\" -type \"float3\" ");
 
75
                omo.write(mFile);
 
76
                fprintf(mFile,";\n");
 
77
        }
 
78
        void setOutMatteOpacityR(float omor)
 
79
        {
 
80
                if(omor == 0.0) return;
 
81
                fprintf(mFile,"\tsetAttr \".omo.omor\" %f;\n", omor);
 
82
        }
 
83
        void setOutMatteOpacityG(float omog)
 
84
        {
 
85
                if(omog == 0.0) return;
 
86
                fprintf(mFile,"\tsetAttr \".omo.omog\" %f;\n", omog);
 
87
        }
 
88
        void setOutMatteOpacityB(float omob)
 
89
        {
 
90
                if(omob == 0.0) return;
 
91
                fprintf(mFile,"\tsetAttr \".omo.omob\" %f;\n", omob);
 
92
        }
 
93
        void getOutColor()const
 
94
        {
 
95
                fprintf(mFile,"\"%s.oc\"",mName.c_str());
 
96
        }
 
97
        void getOutColorR()const
 
98
        {
 
99
                fprintf(mFile,"\"%s.oc.ocr\"",mName.c_str());
 
100
        }
 
101
        void getOutColorG()const
 
102
        {
 
103
                fprintf(mFile,"\"%s.oc.ocg\"",mName.c_str());
 
104
        }
 
105
        void getOutColorB()const
 
106
        {
 
107
                fprintf(mFile,"\"%s.oc.ocb\"",mName.c_str());
 
108
        }
 
109
        void getOutTransparency()const
 
110
        {
 
111
                fprintf(mFile,"\"%s.ot\"",mName.c_str());
 
112
        }
 
113
        void getOutTransparencyR()const
 
114
        {
 
115
                fprintf(mFile,"\"%s.ot.otr\"",mName.c_str());
 
116
        }
 
117
        void getOutTransparencyG()const
 
118
        {
 
119
                fprintf(mFile,"\"%s.ot.otg\"",mName.c_str());
 
120
        }
 
121
        void getOutTransparencyB()const
 
122
        {
 
123
                fprintf(mFile,"\"%s.ot.otb\"",mName.c_str());
 
124
        }
 
125
        void getOutMatteOpacity()const
 
126
        {
 
127
                fprintf(mFile,"\"%s.omo\"",mName.c_str());
 
128
        }
 
129
        void getOutMatteOpacityR()const
 
130
        {
 
131
                fprintf(mFile,"\"%s.omo.omor\"",mName.c_str());
 
132
        }
 
133
        void getOutMatteOpacityG()const
 
134
        {
 
135
                fprintf(mFile,"\"%s.omo.omog\"",mName.c_str());
 
136
        }
 
137
        void getOutMatteOpacityB()const
 
138
        {
 
139
                fprintf(mFile,"\"%s.omo.omob\"",mName.c_str());
 
140
        }
 
141
protected:
 
142
        VolumeShader(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
143
                :DependNode(file, name, parent, nodeType, shared, create) {}
 
144
 
 
145
};
 
146
}//namespace MayaDM
 
147
#endif//__MayaDM_VOLUMESHADER_H__