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_TURBULENCEFIELD_H__
11
#define __MayaDM_TURBULENCEFIELD_H__
12
#include "MayaDMTypes.h"
13
#include "MayaDMConnectables.h"
14
#include "MayaDMField.h"
17
class TurbulenceField : public Field
22
TurbulenceField():Field(){}
23
TurbulenceField(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
24
:Field(file, name, parent, "turbulenceField", shared, create){}
25
virtual ~TurbulenceField(){}
27
void setFrequency(double frq)
29
if(frq == 1.0) return;
30
fprintf(mFile,"\tsetAttr \".frq\" %f;\n", frq);
32
void setPhaseX(double phx)
34
if(phx == 0.0) return;
35
fprintf(mFile,"\tsetAttr \".phx\" %f;\n", phx);
37
void setPhaseY(double phy)
39
if(phy == 0.0) return;
40
fprintf(mFile,"\tsetAttr \".phy\" %f;\n", phy);
42
void setPhaseZ(double phz)
44
if(phz == 0.0) return;
45
fprintf(mFile,"\tsetAttr \".phz\" %f;\n", phz);
47
void setNoiseLevel(int nslv)
50
fprintf(mFile,"\tsetAttr \".nslv\" %i;\n", nslv);
52
void setNoiseRatio(double nsrt)
54
if(nsrt == 0.707) return;
55
fprintf(mFile,"\tsetAttr \".nsrt\" %f;\n", nsrt);
57
void setInterpolationType(unsigned int intr)
60
fprintf(mFile,"\tsetAttr \".intr\" %i;\n", intr);
62
void getFrequency()const
64
fprintf(mFile,"\"%s.frq\"",mName.c_str());
68
fprintf(mFile,"\"%s.phx\"",mName.c_str());
72
fprintf(mFile,"\"%s.phy\"",mName.c_str());
76
fprintf(mFile,"\"%s.phz\"",mName.c_str());
78
void getNoiseLevel()const
80
fprintf(mFile,"\"%s.nslv\"",mName.c_str());
82
void getNoiseRatio()const
84
fprintf(mFile,"\"%s.nsrt\"",mName.c_str());
86
void getInterpolationType()const
88
fprintf(mFile,"\"%s.intr\"",mName.c_str());
91
TurbulenceField(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
92
:Field(file, name, parent, nodeType, shared, create) {}
96
#endif//__MayaDM_TURBULENCEFIELD_H__