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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMInstancer.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_INSTANCER_H__
 
11
#define __MayaDM_INSTANCER_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMTransform.h"
 
15
namespace MayaDM
 
16
{
 
17
class Instancer : public Transform
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        Instancer():Transform(){}
 
23
        Instancer(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :Transform(file, name, parent, "instancer", shared, create){}
 
25
        virtual ~Instancer(){}
 
26
 
 
27
        void setRotationOrder(unsigned int ror)
 
28
        {
 
29
                if(ror == 0) return;
 
30
                fprintf(mFile,"\tsetAttr \".ror\" %i;\n", ror);
 
31
        }
 
32
        void setRotationAngleUnits(unsigned int rau)
 
33
        {
 
34
                if(rau == 0) return;
 
35
                fprintf(mFile,"\tsetAttr \".rau\" %i;\n", rau);
 
36
        }
 
37
        void setCycle(unsigned int cyc)
 
38
        {
 
39
                if(cyc == 0) return;
 
40
                fprintf(mFile,"\tsetAttr \".cyc\" %i;\n", cyc);
 
41
        }
 
42
        void setCycleStep(double cs)
 
43
        {
 
44
                if(cs == 1.0) return;
 
45
                fprintf(mFile,"\tsetAttr \".cs\" %f;\n", cs);
 
46
        }
 
47
        void setCycleStepUnit(unsigned int csu)
 
48
        {
 
49
                if(csu == 0) return;
 
50
                fprintf(mFile,"\tsetAttr \".csu\" %i;\n", csu);
 
51
        }
 
52
        void setLevelOfDetail(unsigned int lod)
 
53
        {
 
54
                if(lod == 0) return;
 
55
                fprintf(mFile,"\tsetAttr \".lod\" %i;\n", lod);
 
56
        }
 
57
        void getInputPoints()const
 
58
        {
 
59
                fprintf(mFile,"\"%s.inp\"",mName.c_str());
 
60
        }
 
61
        void getInputHierarchy(size_t inh_i)const
 
62
        {
 
63
                fprintf(mFile,"\"%s.inh[%i]\"",mName.c_str(),inh_i);
 
64
        }
 
65
        void getInputHierarchy()const
 
66
        {
 
67
 
 
68
                fprintf(mFile,"\"%s.inh\"",mName.c_str());
 
69
        }
 
70
        void getRotationOrder()const
 
71
        {
 
72
                fprintf(mFile,"\"%s.ror\"",mName.c_str());
 
73
        }
 
74
        void getRotationAngleUnits()const
 
75
        {
 
76
                fprintf(mFile,"\"%s.rau\"",mName.c_str());
 
77
        }
 
78
        void getCycle()const
 
79
        {
 
80
                fprintf(mFile,"\"%s.cyc\"",mName.c_str());
 
81
        }
 
82
        void getCycleStep()const
 
83
        {
 
84
                fprintf(mFile,"\"%s.cs\"",mName.c_str());
 
85
        }
 
86
        void getCycleStepUnit()const
 
87
        {
 
88
                fprintf(mFile,"\"%s.csu\"",mName.c_str());
 
89
        }
 
90
        void getLevelOfDetail()const
 
91
        {
 
92
                fprintf(mFile,"\"%s.lod\"",mName.c_str());
 
93
        }
 
94
        void getInstanceCount()const
 
95
        {
 
96
                fprintf(mFile,"\"%s.ic\"",mName.c_str());
 
97
        }
 
98
        void getHierarchyCount()const
 
99
        {
 
100
                fprintf(mFile,"\"%s.hc\"",mName.c_str());
 
101
        }
 
102
protected:
 
103
        Instancer(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
104
                :Transform(file, name, parent, nodeType, shared, create) {}
 
105
 
 
106
};
 
107
}//namespace MayaDM
 
108
#endif//__MayaDM_INSTANCER_H__