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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMPolyCone.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_POLYCONE_H__
 
11
#define __MayaDM_POLYCONE_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMPolyPrimitive.h"
 
15
namespace MayaDM
 
16
{
 
17
class PolyCone : public PolyPrimitive
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        PolyCone():PolyPrimitive(){}
 
23
        PolyCone(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :PolyPrimitive(file, name, parent, "polyCone", shared, create){}
 
25
        virtual ~PolyCone(){}
 
26
 
 
27
        void setRadius(double r)
 
28
        {
 
29
                if(r == 1) return;
 
30
                fprintf(mFile,"\tsetAttr \".r\" %f;\n", r);
 
31
        }
 
32
        void setHeight(double h)
 
33
        {
 
34
                if(h == 2) return;
 
35
                fprintf(mFile,"\tsetAttr \".h\" %f;\n", h);
 
36
        }
 
37
        void setSubdivisionsAxis(int sa)
 
38
        {
 
39
                if(sa == 20) return;
 
40
                fprintf(mFile,"\tsetAttr \".sa\" %i;\n", sa);
 
41
        }
 
42
        void setSubdivisionsHeight(int sh)
 
43
        {
 
44
                if(sh == 1) return;
 
45
                fprintf(mFile,"\tsetAttr \".sh\" %i;\n", sh);
 
46
        }
 
47
        void setSubdivisionsCap(int sc)
 
48
        {
 
49
                if(sc == 0) return;
 
50
                fprintf(mFile,"\tsetAttr \".sc\" %i;\n", sc);
 
51
        }
 
52
        void setTexture(bool tx)
 
53
        {
 
54
                if(tx == true) return;
 
55
                fprintf(mFile,"\tsetAttr \".tx\" %i;\n", tx);
 
56
        }
 
57
        void setCreateUVs(unsigned int cuv)
 
58
        {
 
59
                if(cuv == 2) return;
 
60
                fprintf(mFile,"\tsetAttr \".cuv\" %i;\n", cuv);
 
61
        }
 
62
        void setRoundCap(bool rcp)
 
63
        {
 
64
                if(rcp == false) return;
 
65
                fprintf(mFile,"\tsetAttr \".rcp\" %i;\n", rcp);
 
66
        }
 
67
        void getRadius()const
 
68
        {
 
69
                fprintf(mFile,"\"%s.r\"",mName.c_str());
 
70
        }
 
71
        void getHeight()const
 
72
        {
 
73
                fprintf(mFile,"\"%s.h\"",mName.c_str());
 
74
        }
 
75
        void getSubdivisionsAxis()const
 
76
        {
 
77
                fprintf(mFile,"\"%s.sa\"",mName.c_str());
 
78
        }
 
79
        void getSubdivisionsHeight()const
 
80
        {
 
81
                fprintf(mFile,"\"%s.sh\"",mName.c_str());
 
82
        }
 
83
        void getSubdivisionsCap()const
 
84
        {
 
85
                fprintf(mFile,"\"%s.sc\"",mName.c_str());
 
86
        }
 
87
        void getTexture()const
 
88
        {
 
89
                fprintf(mFile,"\"%s.tx\"",mName.c_str());
 
90
        }
 
91
        void getCreateUVs()const
 
92
        {
 
93
                fprintf(mFile,"\"%s.cuv\"",mName.c_str());
 
94
        }
 
95
        void getRoundCap()const
 
96
        {
 
97
                fprintf(mFile,"\"%s.rcp\"",mName.c_str());
 
98
        }
 
99
protected:
 
100
        PolyCone(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
101
                :PolyPrimitive(file, name, parent, nodeType, shared, create) {}
 
102
 
 
103
};
 
104
}//namespace MayaDM
 
105
#endif//__MayaDM_POLYCONE_H__