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

« back to all changes in this revision

Viewing changes to COLLADAStreamWriter/include/COLLADASWLibraryControllers.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 COLLADAStreamWriter.
 
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 __COLLADASTREAMWRITER_LIBRARY_CONTROLLERS_H__
 
12
#define __COLLADASTREAMWRITER_LIBRARY_CONTROLLERS_H__
 
13
 
 
14
#include "COLLADASWPrerequisites.h"
 
15
#include "COLLADASWLibrary.h"
 
16
#include "COLLADASWInputList.h"
 
17
 
 
18
namespace COLLADASW
 
19
{
 
20
 
 
21
    /** Class to simply the creation of @a \<library_controllers\> and @a \<controller\>'s*/
 
22
    class LibraryControllers : public Library
 
23
    {
 
24
 
 
25
    public:
 
26
 
 
27
        static const String ARRAY_ID_SUFFIX;
 
28
        static const String BIND_POSES_SOURCE_ID_SUFFIX;
 
29
        static const String MORPH_CONTROLLER_ID_SUFFIX;
 
30
        static const String MORPH_WEIGHTS_SOURCE_ID_SUFFIX;
 
31
        static const String JOINTS_SOURCE_ID_SUFFIX;
 
32
        static const String SKIN_CONTROLLER_ID_SUFFIX;
 
33
        static const String TARGETS_SOURCE_ID_SUFFIX;
 
34
        static const String WEIGHTS_SOURCE_ID_SUFFIX;
 
35
 
 
36
        static const String ATTRIBUTE_METHOD_NORMALIZED;
 
37
        static const String ATTRIBUTE_METHOD_RELATIVE;
 
38
 
 
39
    private:
 
40
 
 
41
        /** Used to close the current controller element */
 
42
        TagCloser mControllerCloser;  
 
43
 
 
44
        /** Used to close the current skin element */
 
45
        TagCloser mSkinCloser;
 
46
 
 
47
        /** Used to close the current morph element */
 
48
        TagCloser mMorphCloser;
 
49
 
 
50
    public:
 
51
 
 
52
        /** 
 
53
         * Constructor
 
54
         * @param streamWriter The stream.
 
55
        */
 
56
        LibraryControllers ( StreamWriter * streamWriter );
 
57
 
 
58
        virtual ~LibraryControllers() {}
 
59
 
 
60
        /** 
 
61
         * Writes the opening \<controller\> and \<skin\> tags 
 
62
         * and, if necessary the opening @a \<library_controllers\> tag.
 
63
         * closeSkin() must be use to close the opened tags.
 
64
         * @param controllerId The id of the controller
 
65
         * @param controllerName The Name of the geometry
 
66
         * @param skinSource The target of the skin (the id of the geometry)
 
67
         */
 
68
        void openSkin ( 
 
69
            const String& controllerId, 
 
70
            const String& controllerName, 
 
71
            const URI& skinTarget );
 
72
 
 
73
        /** 
 
74
        * Writes the opening \<controller\> and \<skin\> tags 
 
75
        * and, if necessary the opening @a \<library_controllers\> tag.
 
76
        * closeSkin() must be use to close the opened tags.
 
77
        * @param controllerId The id of the controller
 
78
        * @param skinSource The target of the skin (the id of the geometry)
 
79
        */
 
80
        void openSkin ( 
 
81
            const String& controllerId, 
 
82
            const URI& skinSource )
 
83
        {
 
84
            openSkin( controllerId, EMPTY_STRING, skinSource );
 
85
        }
 
86
 
 
87
        /** Closes the tag opened by openSkin(). */
 
88
        void closeSkin();
 
89
 
 
90
        /** 
 
91
        * Writes the opening \<controller\> and \<morph\> tags 
 
92
        * and, if necessary the opening @a \<library_controllers\> tag.
 
93
        * closeMorph() must be use to close the opened tags.
 
94
        * @param controllerId The id of the controller
 
95
        * @param controllerName The Name of the geometry
 
96
        * @param morphTarget The target of the morph (the id of the geometry)
 
97
        */
 
98
        void openMorph ( 
 
99
            const String& controllerId, 
 
100
            const String& controllerName, 
 
101
            const URI& morphSource, 
 
102
            const String& morphMethod = ATTRIBUTE_METHOD_NORMALIZED );
 
103
 
 
104
        /** Closes the tag opened by openMorph(). */
 
105
        void closeMorph();
 
106
 
 
107
        /** 
 
108
         * Writes the opening \<controller\> tag 
 
109
         * and, if necessary the opening \<library_controllers\> tag.
 
110
         * closeController() must be use to close the opened tags.
 
111
         * @param controllerId The id of the controller.
 
112
         * @param controllerName The name of the controller.
 
113
         */
 
114
        void openController ( const String& controllerId, const String& controllerName = EMPTY_STRING );
 
115
 
 
116
        /** Closes the tag open by openController()*/
 
117
        void closeController();
 
118
 
 
119
        /**
 
120
         * Adds the given matrix to the bind_shape_matrix element.
 
121
         * @param matrix[][4] The bind_shape_matrix.
 
122
         */
 
123
        void addBindShapeTransform ( const double matrix[][4] ) const;
 
124
 
 
125
    };
 
126
 
 
127
} //namespace COLLADASW
 
128
 
 
129
#endif //__COLLADASTREAMWRITER_LIBRARY_CONTROLLERS_H__