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

« back to all changes in this revision

Viewing changes to COLLADAStreamWriter/src/COLLADASWLibraryNodes.cpp

  • 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) 2011 Cooperative Studio Lumikuu
 
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
#include "COLLADASWStreamWriter.h"
 
12
#include "COLLADASWLibraryNodes.h"
 
13
#include "COLLADASWConstants.h"
 
14
#include "COLLADABUUtils.h"
 
15
 
 
16
namespace COLLADASW
 
17
{
 
18
        LibraryNodes::LibraryNodes ( COLLADASW::StreamWriter *streamWriter )
 
19
                : Library ( streamWriter, CSWC::CSW_ELEMENT_LIBRARY_NODES )
 
20
        {}
 
21
 
 
22
        void LibraryNodes::openNode ( const String &nodeId, const String &nodeName )
 
23
        {
 
24
                // opening library here. TBH this looks weird and should
 
25
                // just be an explicit client call.
 
26
                openLibrary();
 
27
                
 
28
                // create tag closer
 
29
                mCurrentNodeCloser = mSW->openElement ( CSWC::CSW_ELEMENT_NODE );
 
30
 
 
31
                if ( !nodeId.empty() )
 
32
                        mSW->appendAttribute ( CSWC::CSW_ATTRIBUTE_ID, nodeId );
 
33
 
 
34
                if ( !nodeName.empty() )
 
35
                        mSW->appendAttribute ( CSWC::CSW_ATTRIBUTE_NAME, nodeName );
 
36
        }
 
37
 
 
38
        void LibraryNodes::closeNode()
 
39
        {
 
40
                mCurrentNodeCloser.close();
 
41
        }
 
42
 
 
43
}