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_CLUSTER_H__
11
#define __MayaDM_CLUSTER_H__
12
#include "MayaDMTypes.h"
13
#include "MayaDMConnectables.h"
14
#include "MayaDMWeightGeometryFilter.h"
17
class Cluster : public WeightGeometryFilter
21
void write(FILE* file) const
27
Cluster():WeightGeometryFilter(){}
28
Cluster(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
29
:WeightGeometryFilter(file, name, parent, "cluster", shared, create){}
32
void setPercentResolution(float ptr)
35
fprintf(mFile,"\tsetAttr \".ptr\" %f;\n", ptr);
37
void setUsePartialResolution(unsigned int upr)
40
fprintf(mFile,"\tsetAttr \".upr\" %i;\n", upr);
42
void setRelative(bool rel)
44
if(rel == false) return;
45
fprintf(mFile,"\tsetAttr \".rel\" %i;\n", rel);
47
void setWeightedCompensationMatrix(const matrix& wcm)
49
if(wcm == identity) return;
50
fprintf(mFile,"\tsetAttr \".wcm\" -type \"matrix\" ");
54
void setGeomMatrix(size_t gm_i,const matrix& gm)
56
if(gm == identity) return;
57
fprintf(mFile,"\tsetAttr \".gm[%i]\" -type \"matrix\" ",gm_i);
61
void setGeomMatrix(size_t gm_start,size_t gm_end,matrix* gm)
63
fprintf(mFile,"\tsetAttr \".gm[%i:%i]\" ", gm_start,gm_end);
64
size_t size = (gm_end-gm_start)*1+1;
65
for(size_t i=0;i<size;++i)
72
void startGeomMatrix(size_t gm_start,size_t gm_end)const
74
fprintf(mFile,"\tsetAttr \".gm[%i:%i]\"",gm_start,gm_end);
75
fprintf(mFile," -type \"matrix\" ");
77
void appendGeomMatrix(const matrix& gm)const
82
void endGeomMatrix()const
86
void setMatrix(const matrix& ma)
88
if(ma == identity) return;
89
fprintf(mFile,"\tsetAttr \".ma\" -type \"matrix\" ");
93
void setBindPreMatrix(const matrix& pm)
95
if(pm == identity) return;
96
fprintf(mFile,"\tsetAttr \".pm\" -type \"matrix\" ");
100
void setAngleInterpolation(unsigned int ait)
103
fprintf(mFile,"\tsetAttr \".ait\" %i;\n", ait);
105
void getUsePartialResolution()const
107
fprintf(mFile,"\"%s.upr\"",mName.c_str());
109
void getRelative()const
111
fprintf(mFile,"\"%s.rel\"",mName.c_str());
113
void getClusterXforms()const
115
fprintf(mFile,"\"%s.x\"",mName.c_str());
117
void getPreMatrix()const
119
fprintf(mFile,"\"%s.x.pre\"",mName.c_str());
121
void getWeightedMatrix()const
123
fprintf(mFile,"\"%s.x.wt\"",mName.c_str());
125
void getPostMatrix()const
127
fprintf(mFile,"\"%s.x.post\"",mName.c_str());
129
void getWeightedCompensationMatrix()const
131
fprintf(mFile,"\"%s.wcm\"",mName.c_str());
133
void getGeomMatrix(size_t gm_i)const
135
fprintf(mFile,"\"%s.gm[%i]\"",mName.c_str(),gm_i);
137
void getGeomMatrix()const
140
fprintf(mFile,"\"%s.gm\"",mName.c_str());
142
void getMatrix()const
144
fprintf(mFile,"\"%s.ma\"",mName.c_str());
146
void getBindPreMatrix()const
148
fprintf(mFile,"\"%s.pm\"",mName.c_str());
150
void getBindState()const
152
fprintf(mFile,"\"%s.bs\"",mName.c_str());
154
void getPostCompensationMatrix()const
156
fprintf(mFile,"\"%s.psc\"",mName.c_str());
158
void getPreCompensationMatrix()const
160
fprintf(mFile,"\"%s.prc\"",mName.c_str());
162
void getAngleInterpolation()const
164
fprintf(mFile,"\"%s.ait\"",mName.c_str());
167
Cluster(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
168
:WeightGeometryFilter(file, name, parent, nodeType, shared, create) {}
172
#endif//__MayaDM_CLUSTER_H__