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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMTurbulenceField.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_TURBULENCEFIELD_H__
 
11
#define __MayaDM_TURBULENCEFIELD_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMField.h"
 
15
namespace MayaDM
 
16
{
 
17
class TurbulenceField : public Field
 
18
{
 
19
public:
 
20
public:
 
21
 
 
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(){}
 
26
 
 
27
        void setFrequency(double frq)
 
28
        {
 
29
                if(frq == 1.0) return;
 
30
                fprintf(mFile,"\tsetAttr \".frq\" %f;\n", frq);
 
31
        }
 
32
        void setPhaseX(double phx)
 
33
        {
 
34
                if(phx == 0.0) return;
 
35
                fprintf(mFile,"\tsetAttr \".phx\" %f;\n", phx);
 
36
        }
 
37
        void setPhaseY(double phy)
 
38
        {
 
39
                if(phy == 0.0) return;
 
40
                fprintf(mFile,"\tsetAttr \".phy\" %f;\n", phy);
 
41
        }
 
42
        void setPhaseZ(double phz)
 
43
        {
 
44
                if(phz == 0.0) return;
 
45
                fprintf(mFile,"\tsetAttr \".phz\" %f;\n", phz);
 
46
        }
 
47
        void setNoiseLevel(int nslv)
 
48
        {
 
49
                if(nslv == 0) return;
 
50
                fprintf(mFile,"\tsetAttr \".nslv\" %i;\n", nslv);
 
51
        }
 
52
        void setNoiseRatio(double nsrt)
 
53
        {
 
54
                if(nsrt == 0.707) return;
 
55
                fprintf(mFile,"\tsetAttr \".nsrt\" %f;\n", nsrt);
 
56
        }
 
57
        void setInterpolationType(unsigned int intr)
 
58
        {
 
59
                if(intr == 0) return;
 
60
                fprintf(mFile,"\tsetAttr \".intr\" %i;\n", intr);
 
61
        }
 
62
        void getFrequency()const
 
63
        {
 
64
                fprintf(mFile,"\"%s.frq\"",mName.c_str());
 
65
        }
 
66
        void getPhaseX()const
 
67
        {
 
68
                fprintf(mFile,"\"%s.phx\"",mName.c_str());
 
69
        }
 
70
        void getPhaseY()const
 
71
        {
 
72
                fprintf(mFile,"\"%s.phy\"",mName.c_str());
 
73
        }
 
74
        void getPhaseZ()const
 
75
        {
 
76
                fprintf(mFile,"\"%s.phz\"",mName.c_str());
 
77
        }
 
78
        void getNoiseLevel()const
 
79
        {
 
80
                fprintf(mFile,"\"%s.nslv\"",mName.c_str());
 
81
        }
 
82
        void getNoiseRatio()const
 
83
        {
 
84
                fprintf(mFile,"\"%s.nsrt\"",mName.c_str());
 
85
        }
 
86
        void getInterpolationType()const
 
87
        {
 
88
                fprintf(mFile,"\"%s.intr\"",mName.c_str());
 
89
        }
 
90
protected:
 
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) {}
 
93
 
 
94
};
 
95
}//namespace MayaDM
 
96
#endif//__MayaDM_TURBULENCEFIELD_H__