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_DRAGFIELD_H__
11
#define __MayaDM_DRAGFIELD_H__
12
#include "MayaDMTypes.h"
13
#include "MayaDMConnectables.h"
14
#include "MayaDMField.h"
17
class DragField : public Field
24
void write(FILE* file) const
26
fprintf(file,"%f ", directionX);
27
fprintf(file,"%f ", directionY);
28
fprintf(file,"%f", directionZ);
34
DragField(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
35
:Field(file, name, parent, "dragField", shared, create){}
36
virtual ~DragField(){}
38
void setDirection(const Direction& d)
40
fprintf(mFile,"\tsetAttr \".d\" ");
44
void setDirectionX(double dx)
47
fprintf(mFile,"\tsetAttr \".d.dx\" %f;\n", dx);
49
void setDirectionY(double dy)
52
fprintf(mFile,"\tsetAttr \".d.dy\" %f;\n", dy);
54
void setDirectionZ(double dz)
57
fprintf(mFile,"\tsetAttr \".d.dz\" %f;\n", dz);
59
void setUseDirection(bool ud)
61
if(ud == false) return;
62
fprintf(mFile,"\tsetAttr \".ud\" %i;\n", ud);
64
void setInheritVelocity(double iv)
67
fprintf(mFile,"\tsetAttr \".iv\" %f;\n", iv);
69
void setMotionAttenuation(double mna)
71
if(mna == 0.0) return;
72
fprintf(mFile,"\tsetAttr \".mna\" %f;\n", mna);
74
void setSpeedAttenuation(double spa)
76
if(spa == 0.0) return;
77
fprintf(mFile,"\tsetAttr \".spa\" %f;\n", spa);
79
void getDirection()const
81
fprintf(mFile,"\"%s.d\"",mName.c_str());
83
void getDirectionX()const
85
fprintf(mFile,"\"%s.d.dx\"",mName.c_str());
87
void getDirectionY()const
89
fprintf(mFile,"\"%s.d.dy\"",mName.c_str());
91
void getDirectionZ()const
93
fprintf(mFile,"\"%s.d.dz\"",mName.c_str());
95
void getUseDirection()const
97
fprintf(mFile,"\"%s.ud\"",mName.c_str());
99
void getInheritVelocity()const
101
fprintf(mFile,"\"%s.iv\"",mName.c_str());
103
void getMotionAttenuation()const
105
fprintf(mFile,"\"%s.mna\"",mName.c_str());
107
void getSpeedAttenuation()const
109
fprintf(mFile,"\"%s.spa\"",mName.c_str());
111
void getCurrentTime()const
113
fprintf(mFile,"\"%s.cti\"",mName.c_str());
116
DragField(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
117
:Field(file, name, parent, nodeType, shared, create) {}
121
#endif//__MayaDM_DRAGFIELD_H__