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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMFractal.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_FRACTAL_H__
 
11
#define __MayaDM_FRACTAL_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMTexture2d.h"
 
15
namespace MayaDM
 
16
{
 
17
class Fractal : public Texture2d
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        Fractal():Texture2d(){}
 
23
        Fractal(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :Texture2d(file, name, parent, "fractal", shared, create){}
 
25
        virtual ~Fractal(){}
 
26
 
 
27
        void setAmplitude(float a)
 
28
        {
 
29
                if(a == 1.0) return;
 
30
                fprintf(mFile,"\tsetAttr \".a\" %f;\n", a);
 
31
        }
 
32
        void setRatio(float ra)
 
33
        {
 
34
                if(ra == 0.707) return;
 
35
                fprintf(mFile,"\tsetAttr \".ra\" %f;\n", ra);
 
36
        }
 
37
        void setThreshold(float th)
 
38
        {
 
39
                if(th == 0.0) return;
 
40
                fprintf(mFile,"\tsetAttr \".th\" %f;\n", th);
 
41
        }
 
42
        void setLevelMin(float lmn)
 
43
        {
 
44
                if(lmn == 0.0) return;
 
45
                fprintf(mFile,"\tsetAttr \".lmn\" %f;\n", lmn);
 
46
        }
 
47
        void setLevelMax(float lmx)
 
48
        {
 
49
                if(lmx == 9.0) return;
 
50
                fprintf(mFile,"\tsetAttr \".lmx\" %f;\n", lmx);
 
51
        }
 
52
        void setFrequencyRatio(float fr)
 
53
        {
 
54
                if(fr == 2.0) return;
 
55
                fprintf(mFile,"\tsetAttr \".fr\" %f;\n", fr);
 
56
        }
 
57
        void setBias(float bs)
 
58
        {
 
59
                if(bs == 0.0) return;
 
60
                fprintf(mFile,"\tsetAttr \".bs\" %f;\n", bs);
 
61
        }
 
62
        void setInflection(bool in)
 
63
        {
 
64
                if(in == false) return;
 
65
                fprintf(mFile,"\tsetAttr \".in\" %i;\n", in);
 
66
        }
 
67
        void setAnimated(bool an)
 
68
        {
 
69
                if(an == false) return;
 
70
                fprintf(mFile,"\tsetAttr \".an\" %i;\n", an);
 
71
        }
 
72
        void setTimeRatio(float tr)
 
73
        {
 
74
                if(tr == 2.0) return;
 
75
                fprintf(mFile,"\tsetAttr \".tr\" %f;\n", tr);
 
76
        }
 
77
        void setTime(float ti)
 
78
        {
 
79
                if(ti == 0.0) return;
 
80
                fprintf(mFile,"\tsetAttr \".ti\" %f;\n", ti);
 
81
        }
 
82
        void getAmplitude()const
 
83
        {
 
84
                fprintf(mFile,"\"%s.a\"",mName.c_str());
 
85
        }
 
86
        void getRatio()const
 
87
        {
 
88
                fprintf(mFile,"\"%s.ra\"",mName.c_str());
 
89
        }
 
90
        void getThreshold()const
 
91
        {
 
92
                fprintf(mFile,"\"%s.th\"",mName.c_str());
 
93
        }
 
94
        void getLevelMin()const
 
95
        {
 
96
                fprintf(mFile,"\"%s.lmn\"",mName.c_str());
 
97
        }
 
98
        void getLevelMax()const
 
99
        {
 
100
                fprintf(mFile,"\"%s.lmx\"",mName.c_str());
 
101
        }
 
102
        void getFrequencyRatio()const
 
103
        {
 
104
                fprintf(mFile,"\"%s.fr\"",mName.c_str());
 
105
        }
 
106
        void getBias()const
 
107
        {
 
108
                fprintf(mFile,"\"%s.bs\"",mName.c_str());
 
109
        }
 
110
        void getInflection()const
 
111
        {
 
112
                fprintf(mFile,"\"%s.in\"",mName.c_str());
 
113
        }
 
114
        void getAnimated()const
 
115
        {
 
116
                fprintf(mFile,"\"%s.an\"",mName.c_str());
 
117
        }
 
118
        void getTimeRatio()const
 
119
        {
 
120
                fprintf(mFile,"\"%s.tr\"",mName.c_str());
 
121
        }
 
122
        void getTime()const
 
123
        {
 
124
                fprintf(mFile,"\"%s.ti\"",mName.c_str());
 
125
        }
 
126
protected:
 
127
        Fractal(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
128
                :Texture2d(file, name, parent, nodeType, shared, create) {}
 
129
 
 
130
};
 
131
}//namespace MayaDM
 
132
#endif//__MayaDM_FRACTAL_H__