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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMNurbsToSubdivProc.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_NURBSTOSUBDIVPROC_H__
 
11
#define __MayaDM_NURBSTOSUBDIVPROC_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMNurbsToSubdiv.h"
 
15
namespace MayaDM
 
16
{
 
17
class NurbsToSubdivProc : public NurbsToSubdiv
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        NurbsToSubdivProc():NurbsToSubdiv(){}
 
23
        NurbsToSubdivProc(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :NurbsToSubdiv(file, name, parent, "nurbsToSubdivProc", shared, create){}
 
25
        virtual ~NurbsToSubdivProc(){}
 
26
 
 
27
        void setSolidType(unsigned int st)
 
28
        {
 
29
                if(st == 2) return;
 
30
                fprintf(mFile,"\tsetAttr \".st\" %i;\n", st);
 
31
        }
 
32
        void setCapType(unsigned int ct)
 
33
        {
 
34
                if(ct == 0) return;
 
35
                fprintf(mFile,"\tsetAttr \".ct\" %i;\n", ct);
 
36
        }
 
37
        void setTransform(const matrix& t)
 
38
        {
 
39
                if(t == identity) return;
 
40
                fprintf(mFile,"\tsetAttr \".t\" -type \"matrix\" ");
 
41
                t.write(mFile);
 
42
                fprintf(mFile,";\n");
 
43
        }
 
44
        void setOffset(double o)
 
45
        {
 
46
                if(o == 1) return;
 
47
                fprintf(mFile,"\tsetAttr \".o\" %f;\n", o);
 
48
        }
 
49
        void setBridge(unsigned int br)
 
50
        {
 
51
                if(br == 0) return;
 
52
                fprintf(mFile,"\tsetAttr \".br\" %i;\n", br);
 
53
        }
 
54
        void getSolidType()const
 
55
        {
 
56
                fprintf(mFile,"\"%s.st\"",mName.c_str());
 
57
        }
 
58
        void getCapType()const
 
59
        {
 
60
                fprintf(mFile,"\"%s.ct\"",mName.c_str());
 
61
        }
 
62
        void getTransform()const
 
63
        {
 
64
                fprintf(mFile,"\"%s.t\"",mName.c_str());
 
65
        }
 
66
        void getOffset()const
 
67
        {
 
68
                fprintf(mFile,"\"%s.o\"",mName.c_str());
 
69
        }
 
70
        void getBridge()const
 
71
        {
 
72
                fprintf(mFile,"\"%s.br\"",mName.c_str());
 
73
        }
 
74
        void getBridgeInU()const
 
75
        {
 
76
                fprintf(mFile,"\"%s.biu\"",mName.c_str());
 
77
        }
 
78
        void getBridgeInV()const
 
79
        {
 
80
                fprintf(mFile,"\"%s.biv\"",mName.c_str());
 
81
        }
 
82
protected:
 
83
        NurbsToSubdivProc(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
84
                :NurbsToSubdiv(file, name, parent, nodeType, shared, create) {}
 
85
 
 
86
};
 
87
}//namespace MayaDM
 
88
#endif//__MayaDM_NURBSTOSUBDIVPROC_H__