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

« back to all changes in this revision

Viewing changes to Externals/MayaDataModel/include/MayaDMParticleTranspMapper.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_PARTICLETRANSPMAPPER_H__
 
11
#define __MayaDM_PARTICLETRANSPMAPPER_H__
 
12
#include "MayaDMTypes.h"
 
13
#include "MayaDMConnectables.h"
 
14
#include "MayaDMDependNode.h"
 
15
namespace MayaDM
 
16
{
 
17
class ParticleTranspMapper : public DependNode
 
18
{
 
19
public:
 
20
public:
 
21
 
 
22
        ParticleTranspMapper():DependNode(){}
 
23
        ParticleTranspMapper(FILE* file,const std::string& name,const std::string& parent="",bool shared=false,bool create=true)
 
24
                :DependNode(file, name, parent, "particleTranspMapper", shared, create){}
 
25
        virtual ~ParticleTranspMapper(){}
 
26
 
 
27
        void setParticleTransparency(const float3& pt)
 
28
        {
 
29
                fprintf(mFile,"\tsetAttr \".pt\" -type \"float3\" ");
 
30
                pt.write(mFile);
 
31
                fprintf(mFile,";\n");
 
32
        }
 
33
        void setParticleTransparencyR(float ptr)
 
34
        {
 
35
                if(ptr == 0.0) return;
 
36
                fprintf(mFile,"\tsetAttr \".pt.ptr\" %f;\n", ptr);
 
37
        }
 
38
        void setParticleTransparencyG(float ptg)
 
39
        {
 
40
                if(ptg == 0.0) return;
 
41
                fprintf(mFile,"\tsetAttr \".pt.ptg\" %f;\n", ptg);
 
42
        }
 
43
        void setParticleTransparencyB(float ptb)
 
44
        {
 
45
                if(ptb == 0.0) return;
 
46
                fprintf(mFile,"\tsetAttr \".pt.ptb\" %f;\n", ptb);
 
47
        }
 
48
        void getParticleTransparency()const
 
49
        {
 
50
                fprintf(mFile,"\"%s.pt\"",mName.c_str());
 
51
        }
 
52
        void getParticleTransparencyR()const
 
53
        {
 
54
                fprintf(mFile,"\"%s.pt.ptr\"",mName.c_str());
 
55
        }
 
56
        void getParticleTransparencyG()const
 
57
        {
 
58
                fprintf(mFile,"\"%s.pt.ptg\"",mName.c_str());
 
59
        }
 
60
        void getParticleTransparencyB()const
 
61
        {
 
62
                fprintf(mFile,"\"%s.pt.ptb\"",mName.c_str());
 
63
        }
 
64
protected:
 
65
        ParticleTranspMapper(FILE* file,const std::string& name,const std::string& parent,const std::string& nodeType,bool shared=false,bool create=true)
 
66
                :DependNode(file, name, parent, nodeType, shared, create) {}
 
67
 
 
68
};
 
69
}//namespace MayaDM
 
70
#endif//__MayaDM_PARTICLETRANSPMAPPER_H__