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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMSculpt.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_SCULPT_H__
 
11
#define __MayaDM_SCULPT_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMGeometryFilter.h"
 
15
namespace MayaDM
 
16
{
 
17
class Sculpt : public GeometryFilter
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        Sculpt():GeometryFilter(){}
 
23
        Sculpt(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :GeometryFilter(file, name, parent, "sculpt", shared, create){}
 
25
        virtual ~Sculpt(){}
 
26
 
 
27
        void setSculptObjectMatrix(const matrix& sm)
 
28
        {
 
29
                if(sm == identity) return;
 
30
                fprintf(mFile,"\tsetAttr \".sm\" -type \"matrix\" ");
 
31
                sm.write(mFile);
 
32
                fprintf(mFile,";\n");
 
33
        }
 
34
        void setMode(unsigned int mo)
 
35
        {
 
36
                if(mo == 2) return;
 
37
                fprintf(mFile,"\tsetAttr \".mo\" %i;\n", mo);
 
38
        }
 
39
        void setInsideMode(unsigned int im)
 
40
        {
 
41
                if(im == 1) return;
 
42
                fprintf(mFile,"\tsetAttr \".im\" %i;\n", im);
 
43
        }
 
44
        void setMaximumDisplacement(double md)
 
45
        {
 
46
                if(md == 1) return;
 
47
                fprintf(mFile,"\tsetAttr \".md\" %f;\n", md);
 
48
        }
 
49
        void setDropoffDistance(double dd)
 
50
        {
 
51
                if(dd == 1) return;
 
52
                fprintf(mFile,"\tsetAttr \".dd\" %f;\n", dd);
 
53
        }
 
54
        void setDropoffType(unsigned int dt)
 
55
        {
 
56
                if(dt == 1) return;
 
57
                fprintf(mFile,"\tsetAttr \".dt\" %i;\n", dt);
 
58
        }
 
59
        void setStartPosition(const float3& sp)
 
60
        {
 
61
                fprintf(mFile,"\tsetAttr \".sp\" -type \"float3\" ");
 
62
                sp.write(mFile);
 
63
                fprintf(mFile,";\n");
 
64
        }
 
65
        void setStartPosX(float sx)
 
66
        {
 
67
                if(sx == 0) return;
 
68
                fprintf(mFile,"\tsetAttr \".sp.sx\" %f;\n", sx);
 
69
        }
 
70
        void setStartPosY(float sy)
 
71
        {
 
72
                if(sy == 0) return;
 
73
                fprintf(mFile,"\tsetAttr \".sp.sy\" %f;\n", sy);
 
74
        }
 
75
        void setStartPosZ(float sz)
 
76
        {
 
77
                if(sz == 0) return;
 
78
                fprintf(mFile,"\tsetAttr \".sp.sz\" %f;\n", sz);
 
79
        }
 
80
        void setExtendedEnd(bool exd)
 
81
        {
 
82
                if(exd == false) return;
 
83
                fprintf(mFile,"\tsetAttr \".exd\" %i;\n", exd);
 
84
        }
 
85
        void getSculptObjectMatrix()const
 
86
        {
 
87
                fprintf(mFile,"\"%s.sm\"",mName.c_str());
 
88
        }
 
89
        void getSculptObjectGeometry()const
 
90
        {
 
91
                fprintf(mFile,"\"%s.sg\"",mName.c_str());
 
92
        }
 
93
        void getMode()const
 
94
        {
 
95
                fprintf(mFile,"\"%s.mo\"",mName.c_str());
 
96
        }
 
97
        void getInsideMode()const
 
98
        {
 
99
                fprintf(mFile,"\"%s.im\"",mName.c_str());
 
100
        }
 
101
        void getMaximumDisplacement()const
 
102
        {
 
103
                fprintf(mFile,"\"%s.md\"",mName.c_str());
 
104
        }
 
105
        void getDropoffDistance()const
 
106
        {
 
107
                fprintf(mFile,"\"%s.dd\"",mName.c_str());
 
108
        }
 
109
        void getDropoffType()const
 
110
        {
 
111
                fprintf(mFile,"\"%s.dt\"",mName.c_str());
 
112
        }
 
113
        void getStartPosition()const
 
114
        {
 
115
                fprintf(mFile,"\"%s.sp\"",mName.c_str());
 
116
        }
 
117
        void getStartPosX()const
 
118
        {
 
119
                fprintf(mFile,"\"%s.sp.sx\"",mName.c_str());
 
120
        }
 
121
        void getStartPosY()const
 
122
        {
 
123
                fprintf(mFile,"\"%s.sp.sy\"",mName.c_str());
 
124
        }
 
125
        void getStartPosZ()const
 
126
        {
 
127
                fprintf(mFile,"\"%s.sp.sz\"",mName.c_str());
 
128
        }
 
129
        void getExtendedEnd()const
 
130
        {
 
131
                fprintf(mFile,"\"%s.exd\"",mName.c_str());
 
132
        }
 
133
protected:
 
134
        Sculpt(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
135
                :GeometryFilter(file, name, parent, nodeType, shared, create) {}
 
136
 
 
137
};
 
138
}//namespace MayaDM
 
139
#endif//__MayaDM_SCULPT_H__