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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMPolyMoveEdge.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_POLYMOVEEDGE_H__
 
11
#define __MayaDM_POLYMOVEEDGE_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMPolyMoveVertex.h"
 
15
namespace MayaDM
 
16
{
 
17
class PolyMoveEdge : public PolyMoveVertex
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        PolyMoveEdge():PolyMoveVertex(){}
 
23
        PolyMoveEdge(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :PolyMoveVertex(file, name, parent, "polyMoveEdge", shared, create){}
 
25
        virtual ~PolyMoveEdge(){}
 
26
 
 
27
        void setLocalRotate(const double3& lr)
 
28
        {
 
29
                if(lr == double3(0.0, 0.0, 0.0)) return;
 
30
                fprintf(mFile,"\tsetAttr \".lr\" -type \"double3\" ");
 
31
                lr.write(mFile);
 
32
                fprintf(mFile,";\n");
 
33
        }
 
34
        void setLocalRotateX(double lrx)
 
35
        {
 
36
                if(lrx == 0) return;
 
37
                fprintf(mFile,"\tsetAttr \".lr.lrx\" %f;\n", lrx);
 
38
        }
 
39
        void setLocalRotateY(double lry)
 
40
        {
 
41
                if(lry == 0) return;
 
42
                fprintf(mFile,"\tsetAttr \".lr.lry\" %f;\n", lry);
 
43
        }
 
44
        void setLocalRotateZ(double lrz)
 
45
        {
 
46
                if(lrz == 0) return;
 
47
                fprintf(mFile,"\tsetAttr \".lr.lrz\" %f;\n", lrz);
 
48
        }
 
49
        void setLocalScale(const double3& ls)
 
50
        {
 
51
                if(ls == double3(1.0, 1.0, 1.0)) return;
 
52
                fprintf(mFile,"\tsetAttr \".ls\" -type \"double3\" ");
 
53
                ls.write(mFile);
 
54
                fprintf(mFile,";\n");
 
55
        }
 
56
        void setLocalScaleX(double lsx)
 
57
        {
 
58
                if(lsx == 0.0) return;
 
59
                fprintf(mFile,"\tsetAttr \".ls.lsx\" %f;\n", lsx);
 
60
        }
 
61
        void setLocalScaleY(double lsy)
 
62
        {
 
63
                if(lsy == 0.0) return;
 
64
                fprintf(mFile,"\tsetAttr \".ls.lsy\" %f;\n", lsy);
 
65
        }
 
66
        void setLocalScaleZ(double lsz)
 
67
        {
 
68
                if(lsz == 0.0) return;
 
69
                fprintf(mFile,"\tsetAttr \".ls.lsz\" %f;\n", lsz);
 
70
        }
 
71
        void setLocalCenter(unsigned int lc)
 
72
        {
 
73
                if(lc == 0) return;
 
74
                fprintf(mFile,"\tsetAttr \".lc\" %i;\n", lc);
 
75
        }
 
76
        void getLocalRotate()const
 
77
        {
 
78
                fprintf(mFile,"\"%s.lr\"",mName.c_str());
 
79
        }
 
80
        void getLocalRotateX()const
 
81
        {
 
82
                fprintf(mFile,"\"%s.lr.lrx\"",mName.c_str());
 
83
        }
 
84
        void getLocalRotateY()const
 
85
        {
 
86
                fprintf(mFile,"\"%s.lr.lry\"",mName.c_str());
 
87
        }
 
88
        void getLocalRotateZ()const
 
89
        {
 
90
                fprintf(mFile,"\"%s.lr.lrz\"",mName.c_str());
 
91
        }
 
92
        void getLocalScale()const
 
93
        {
 
94
                fprintf(mFile,"\"%s.ls\"",mName.c_str());
 
95
        }
 
96
        void getLocalScaleX()const
 
97
        {
 
98
                fprintf(mFile,"\"%s.ls.lsx\"",mName.c_str());
 
99
        }
 
100
        void getLocalScaleY()const
 
101
        {
 
102
                fprintf(mFile,"\"%s.ls.lsy\"",mName.c_str());
 
103
        }
 
104
        void getLocalScaleZ()const
 
105
        {
 
106
                fprintf(mFile,"\"%s.ls.lsz\"",mName.c_str());
 
107
        }
 
108
        void getLocalCenter()const
 
109
        {
 
110
                fprintf(mFile,"\"%s.lc\"",mName.c_str());
 
111
        }
 
112
protected:
 
113
        PolyMoveEdge(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
114
                :PolyMoveVertex(file, name, parent, nodeType, shared, create) {}
 
115
 
 
116
};
 
117
}//namespace MayaDM
 
118
#endif//__MayaDM_POLYMOVEEDGE_H__