2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of MayaDataModel.
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
10
#ifndef __MayaDM_FRACTAL_H__
11
#define __MayaDM_FRACTAL_H__
12
#include "MayaDMTypes.h"
13
#include "MayaDMConnectables.h"
14
#include "MayaDMTexture2d.h"
17
class Fractal : public Texture2d
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){}
27
void setAmplitude(float a)
30
fprintf(mFile,"\tsetAttr \".a\" %f;\n", a);
32
void setRatio(float ra)
34
if(ra == 0.707) return;
35
fprintf(mFile,"\tsetAttr \".ra\" %f;\n", ra);
37
void setThreshold(float th)
40
fprintf(mFile,"\tsetAttr \".th\" %f;\n", th);
42
void setLevelMin(float lmn)
44
if(lmn == 0.0) return;
45
fprintf(mFile,"\tsetAttr \".lmn\" %f;\n", lmn);
47
void setLevelMax(float lmx)
49
if(lmx == 9.0) return;
50
fprintf(mFile,"\tsetAttr \".lmx\" %f;\n", lmx);
52
void setFrequencyRatio(float fr)
55
fprintf(mFile,"\tsetAttr \".fr\" %f;\n", fr);
57
void setBias(float bs)
60
fprintf(mFile,"\tsetAttr \".bs\" %f;\n", bs);
62
void setInflection(bool in)
64
if(in == false) return;
65
fprintf(mFile,"\tsetAttr \".in\" %i;\n", in);
67
void setAnimated(bool an)
69
if(an == false) return;
70
fprintf(mFile,"\tsetAttr \".an\" %i;\n", an);
72
void setTimeRatio(float tr)
75
fprintf(mFile,"\tsetAttr \".tr\" %f;\n", tr);
77
void setTime(float ti)
80
fprintf(mFile,"\tsetAttr \".ti\" %f;\n", ti);
82
void getAmplitude()const
84
fprintf(mFile,"\"%s.a\"",mName.c_str());
88
fprintf(mFile,"\"%s.ra\"",mName.c_str());
90
void getThreshold()const
92
fprintf(mFile,"\"%s.th\"",mName.c_str());
94
void getLevelMin()const
96
fprintf(mFile,"\"%s.lmn\"",mName.c_str());
98
void getLevelMax()const
100
fprintf(mFile,"\"%s.lmx\"",mName.c_str());
102
void getFrequencyRatio()const
104
fprintf(mFile,"\"%s.fr\"",mName.c_str());
108
fprintf(mFile,"\"%s.bs\"",mName.c_str());
110
void getInflection()const
112
fprintf(mFile,"\"%s.in\"",mName.c_str());
114
void getAnimated()const
116
fprintf(mFile,"\"%s.an\"",mName.c_str());
118
void getTimeRatio()const
120
fprintf(mFile,"\"%s.tr\"",mName.c_str());
124
fprintf(mFile,"\"%s.ti\"",mName.c_str());
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) {}
132
#endif//__MayaDM_FRACTAL_H__