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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMPolyPrism.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_POLYPRISM_H__
 
11
#define __MayaDM_POLYPRISM_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMPolyPrimitive.h"
 
15
namespace MayaDM
 
16
{
 
17
class PolyPrism : public PolyPrimitive
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        PolyPrism():PolyPrimitive(){}
 
23
        PolyPrism(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :PolyPrimitive(file, name, parent, "polyPrism", shared, create){}
 
25
        virtual ~PolyPrism(){}
 
26
 
 
27
        void setLength(double l)
 
28
        {
 
29
                if(l == 2) return;
 
30
                fprintf(mFile,"\tsetAttr \".l\" %f;\n", l);
 
31
        }
 
32
        void setSideLength(double w)
 
33
        {
 
34
                if(w == 1) return;
 
35
                fprintf(mFile,"\tsetAttr \".w\" %f;\n", w);
 
36
        }
 
37
        void setNumderOfSides(int ns)
 
38
        {
 
39
                if(ns == 3) return;
 
40
                fprintf(mFile,"\tsetAttr \".ns\" %i;\n", ns);
 
41
        }
 
42
        void setSubdivisionsHeight(int sh)
 
43
        {
 
44
                if(sh == 1) return;
 
45
                fprintf(mFile,"\tsetAttr \".sh\" %i;\n", sh);
 
46
        }
 
47
        void setSubdivisionsCaps(int sc)
 
48
        {
 
49
                if(sc == 0) return;
 
50
                fprintf(mFile,"\tsetAttr \".sc\" %i;\n", sc);
 
51
        }
 
52
        void setTexture(unsigned int tx)
 
53
        {
 
54
                if(tx == 2) 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 getLength()const
 
63
        {
 
64
                fprintf(mFile,"\"%s.l\"",mName.c_str());
 
65
        }
 
66
        void getSideLength()const
 
67
        {
 
68
                fprintf(mFile,"\"%s.w\"",mName.c_str());
 
69
        }
 
70
        void getNumderOfSides()const
 
71
        {
 
72
                fprintf(mFile,"\"%s.ns\"",mName.c_str());
 
73
        }
 
74
        void getSubdivisionsHeight()const
 
75
        {
 
76
                fprintf(mFile,"\"%s.sh\"",mName.c_str());
 
77
        }
 
78
        void getSubdivisionsCaps()const
 
79
        {
 
80
                fprintf(mFile,"\"%s.sc\"",mName.c_str());
 
81
        }
 
82
        void getTexture()const
 
83
        {
 
84
                fprintf(mFile,"\"%s.tx\"",mName.c_str());
 
85
        }
 
86
        void getCreateUVs()const
 
87
        {
 
88
                fprintf(mFile,"\"%s.cuv\"",mName.c_str());
 
89
        }
 
90
protected:
 
91
        PolyPrism(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
92
                :PolyPrimitive(file, name, parent, nodeType, shared, create) {}
 
93
 
 
94
};
 
95
}//namespace MayaDM
 
96
#endif//__MayaDM_POLYPRISM_H__