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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMRock.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_ROCK_H__
 
11
#define __MayaDM_ROCK_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMTexture3d.h"
 
15
namespace MayaDM
 
16
{
 
17
class Rock : public Texture3d
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        Rock():Texture3d(){}
 
23
        Rock(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :Texture3d(file, name, parent, "rock", shared, create){}
 
25
        virtual ~Rock(){}
 
26
 
 
27
        void setColor1(const float3& c1)
 
28
        {
 
29
                if(c1 == float3(0.235f,0.0f,0.0f)) return;
 
30
                fprintf(mFile,"\tsetAttr \".c1\" -type \"float3\" ");
 
31
                c1.write(mFile);
 
32
                fprintf(mFile,";\n");
 
33
        }
 
34
        void setColor1R(float c1r)
 
35
        {
 
36
                if(c1r == 0.0) return;
 
37
                fprintf(mFile,"\tsetAttr \".c1.c1r\" %f;\n", c1r);
 
38
        }
 
39
        void setColor1G(float c1g)
 
40
        {
 
41
                if(c1g == 0.0) return;
 
42
                fprintf(mFile,"\tsetAttr \".c1.c1g\" %f;\n", c1g);
 
43
        }
 
44
        void setColor1B(float c1b)
 
45
        {
 
46
                if(c1b == 0.0) return;
 
47
                fprintf(mFile,"\tsetAttr \".c1.c1b\" %f;\n", c1b);
 
48
        }
 
49
        void setColor2(const float3& c2)
 
50
        {
 
51
                if(c2 == float3(1.0f,1.0f,1.0f)) return;
 
52
                fprintf(mFile,"\tsetAttr \".c2\" -type \"float3\" ");
 
53
                c2.write(mFile);
 
54
                fprintf(mFile,";\n");
 
55
        }
 
56
        void setColor2R(float c2r)
 
57
        {
 
58
                if(c2r == 0.0) return;
 
59
                fprintf(mFile,"\tsetAttr \".c2.c2r\" %f;\n", c2r);
 
60
        }
 
61
        void setColor2G(float c2g)
 
62
        {
 
63
                if(c2g == 0.0) return;
 
64
                fprintf(mFile,"\tsetAttr \".c2.c2g\" %f;\n", c2g);
 
65
        }
 
66
        void setColor2B(float c2b)
 
67
        {
 
68
                if(c2b == 0.0) return;
 
69
                fprintf(mFile,"\tsetAttr \".c2.c2b\" %f;\n", c2b);
 
70
        }
 
71
        void setGrainSize(float gs)
 
72
        {
 
73
                if(gs == 0.01) return;
 
74
                fprintf(mFile,"\tsetAttr \".gs\" %f;\n", gs);
 
75
        }
 
76
        void setDiffusion(float di)
 
77
        {
 
78
                if(di == 1.0) return;
 
79
                fprintf(mFile,"\tsetAttr \".di\" %f;\n", di);
 
80
        }
 
81
        void setMixRatio(float mr)
 
82
        {
 
83
                if(mr == 0.5) return;
 
84
                fprintf(mFile,"\tsetAttr \".mr\" %f;\n", mr);
 
85
        }
 
86
        void getRefPointObj()const
 
87
        {
 
88
                fprintf(mFile,"\"%s.rpo\"",mName.c_str());
 
89
        }
 
90
        void getRefPointObjX()const
 
91
        {
 
92
                fprintf(mFile,"\"%s.rpo.rox\"",mName.c_str());
 
93
        }
 
94
        void getRefPointObjY()const
 
95
        {
 
96
                fprintf(mFile,"\"%s.rpo.roy\"",mName.c_str());
 
97
        }
 
98
        void getRefPointObjZ()const
 
99
        {
 
100
                fprintf(mFile,"\"%s.rpo.roz\"",mName.c_str());
 
101
        }
 
102
        void getRefPointCamera()const
 
103
        {
 
104
                fprintf(mFile,"\"%s.rpc\"",mName.c_str());
 
105
        }
 
106
        void getRefPointCameraX()const
 
107
        {
 
108
                fprintf(mFile,"\"%s.rpc.rcx\"",mName.c_str());
 
109
        }
 
110
        void getRefPointCameraY()const
 
111
        {
 
112
                fprintf(mFile,"\"%s.rpc.rcy\"",mName.c_str());
 
113
        }
 
114
        void getRefPointCameraZ()const
 
115
        {
 
116
                fprintf(mFile,"\"%s.rpc.rcz\"",mName.c_str());
 
117
        }
 
118
        void getColor1()const
 
119
        {
 
120
                fprintf(mFile,"\"%s.c1\"",mName.c_str());
 
121
        }
 
122
        void getColor1R()const
 
123
        {
 
124
                fprintf(mFile,"\"%s.c1.c1r\"",mName.c_str());
 
125
        }
 
126
        void getColor1G()const
 
127
        {
 
128
                fprintf(mFile,"\"%s.c1.c1g\"",mName.c_str());
 
129
        }
 
130
        void getColor1B()const
 
131
        {
 
132
                fprintf(mFile,"\"%s.c1.c1b\"",mName.c_str());
 
133
        }
 
134
        void getColor2()const
 
135
        {
 
136
                fprintf(mFile,"\"%s.c2\"",mName.c_str());
 
137
        }
 
138
        void getColor2R()const
 
139
        {
 
140
                fprintf(mFile,"\"%s.c2.c2r\"",mName.c_str());
 
141
        }
 
142
        void getColor2G()const
 
143
        {
 
144
                fprintf(mFile,"\"%s.c2.c2g\"",mName.c_str());
 
145
        }
 
146
        void getColor2B()const
 
147
        {
 
148
                fprintf(mFile,"\"%s.c2.c2b\"",mName.c_str());
 
149
        }
 
150
        void getGrainSize()const
 
151
        {
 
152
                fprintf(mFile,"\"%s.gs\"",mName.c_str());
 
153
        }
 
154
        void getDiffusion()const
 
155
        {
 
156
                fprintf(mFile,"\"%s.di\"",mName.c_str());
 
157
        }
 
158
        void getMixRatio()const
 
159
        {
 
160
                fprintf(mFile,"\"%s.mr\"",mName.c_str());
 
161
        }
 
162
protected:
 
163
        Rock(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
164
                :Texture3d(file, name, parent, nodeType, shared, create) {}
 
165
 
 
166
};
 
167
}//namespace MayaDM
 
168
#endif//__MayaDM_ROCK_H__