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

« back to all changes in this revision

Viewing changes to COLLADAFramework/include/COLLADAFWInstanceBase.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 COLLADAFramework.
 
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
 
 
11
#ifndef __COLLADAFW_INSTANCEBASE_H__
 
12
#define __COLLADAFW_INSTANCEBASE_H__
 
13
 
 
14
#include "COLLADAFWPrerequisites.h"
 
15
#include "COLLADAFWObject.h"
 
16
 
 
17
 
 
18
namespace COLLADAFW
 
19
{
 
20
 
 
21
    /** Base class for the instance classes. */
 
22
    template<ClassId classId>
 
23
        class InstanceBase : public ObjectTemplate<classId>
 
24
    {
 
25
        private:
 
26
        
 
27
        /**
 
28
        * The name attribute is the text string name of this element. 
 
29
        * Optional attribute.
 
30
        */
 
31
        String mName;
 
32
 
 
33
        /** The unique id of the instantiated object.*/
 
34
        UniqueId mInstanciatedObjectId;
 
35
 
 
36
        public:
 
37
 
 
38
        /** Constructor. Creates an instance of an object with UniqueId @a instanciatedObjectId.
 
39
        @param instanciatedObjectId The UniqueId of the object instantiated.*/ 
 
40
        InstanceBase ( const UniqueId& uniqueId, const UniqueId& instanciatedObjectId )
 
41
            : ObjectTemplate<classId>(uniqueId)
 
42
            , mInstanciatedObjectId (instanciatedObjectId ) 
 
43
        {}
 
44
 
 
45
        /** Destructor. */
 
46
        virtual ~InstanceBase() {}
 
47
 
 
48
        /** Returns the name of the node*/
 
49
        const String& getName () const { return mName; }
 
50
 
 
51
        /** Sets the name of the node*/
 
52
        void setName ( const String& name ) { mName = name; }
 
53
 
 
54
        /** Returns the unique id of the instantiated object.*/
 
55
        const UniqueId& getInstanciatedObjectId() const { return mInstanciatedObjectId; }
 
56
 
 
57
        /** Sets the unique id of the instantiated object.*/
 
58
        void setInstanciatedObjectId ( const UniqueId& instanciatedObjectId ) { mInstanciatedObjectId = instanciatedObjectId; }
 
59
 
 
60
        virtual InstanceBase* clone() const { return new InstanceBase(*this); }
 
61
        };
 
62
 
 
63
} // namespace COLLADAFW
 
64
 
 
65
#endif // __COLLADAFW_INSTANCEBASE_H__