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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMCharacterMap.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_CHARACTERMAP_H__
 
11
#define __MayaDM_CHARACTERMAP_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMDependNode.h"
 
15
namespace MayaDM
 
16
{
 
17
class CharacterMap : public DependNode
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        CharacterMap():DependNode(){}
 
23
        CharacterMap(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :DependNode(file, name, parent, "characterMap", shared, create){}
 
25
        virtual ~CharacterMap(){}
 
26
 
 
27
        void setMemberIndex(size_t mi_i,const intArray& mi)
 
28
        {
 
29
                if(mi.size == 0) return;
 
30
                fprintf(mFile,"\tsetAttr \".mi[%i]\" -type \"intArray\" ",mi_i);
 
31
                mi.write(mFile);
 
32
                fprintf(mFile,";\n");
 
33
        }
 
34
        void setMemberIndex(size_t mi_start,size_t mi_end,intArray* mi)
 
35
        {
 
36
                fprintf(mFile,"\tsetAttr \".mi[%i:%i]\" ", mi_start,mi_end);
 
37
                size_t size = (mi_end-mi_start)*1+1;
 
38
                for(size_t i=0;i<size;++i)
 
39
                {
 
40
                        mi[i].write(mFile);
 
41
                        fprintf(mFile,"\n");
 
42
                }
 
43
                fprintf(mFile,";\n");
 
44
        }
 
45
        void startMemberIndex(size_t mi_start,size_t mi_end)const
 
46
        {
 
47
                fprintf(mFile,"\tsetAttr \".mi[%i:%i]\"",mi_start,mi_end);
 
48
                fprintf(mFile," -type \"intArray\" ");
 
49
        }
 
50
        void appendMemberIndex(const intArray& mi)const
 
51
        {
 
52
                fprintf(mFile," ");
 
53
                mi.write(mFile);
 
54
        }
 
55
        void endMemberIndex()const
 
56
        {
 
57
                fprintf(mFile,";\n");
 
58
        }
 
59
        void getMember(size_t m_i)const
 
60
        {
 
61
                fprintf(mFile,"\"%s.m[%i]\"",mName.c_str(),m_i);
 
62
        }
 
63
        void getMember()const
 
64
        {
 
65
 
 
66
                fprintf(mFile,"\"%s.m\"",mName.c_str());
 
67
        }
 
68
protected:
 
69
        CharacterMap(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
70
                :DependNode(file, name, parent, nodeType, shared, create) {}
 
71
 
 
72
};
 
73
}//namespace MayaDM
 
74
#endif//__MayaDM_CHARACTERMAP_H__