2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of DAE2MA.
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
11
#ifndef __DAE2MA_EXTRADATACALLBACKHANDLER_H__
12
#define __DAE2MA_EXTRADATACALLBACKHANDLER_H__
14
#include "DAE2MAPrerequisites.h"
16
#include "COLLADASaxFWLIExtraDataCallbackHandler.h"
26
/** The hash value of the currently parsed extra data element. */
27
StringHash mElementHash;
29
/** The uniqueId of the currently parsed extra data element. */
30
COLLADAFW::UniqueId mUniqueId;
32
/** The text value of the current original maya id. */
33
String mOriginalMayaId;
41
virtual ~ExtraInfo () {}
43
/** The hash value of the currently parsed extra data element. */
44
const StringHash& getElementHash () const { return mElementHash; }
45
void setElementHash ( const StringHash& val ) { mElementHash = val; }
47
/** The uniqueId of the currently parsed extra data element. */
48
const COLLADAFW::UniqueId& getUniqueId () const { return mUniqueId; }
49
void setUniqueId ( const COLLADAFW::UniqueId& val ) { mUniqueId = val; }
51
/** The text value of the current original maya id. */
52
const String& getOriginalMayaId () const { return mOriginalMayaId; }
53
void setOriginalMayaId ( const String& val ) { mOriginalMayaId = val; }
54
void setOriginalMayaId ( const GeneratedSaxParser::ParserChar* text, size_t textLength )
56
mOriginalMayaId.assign ( text, textLength );
61
/** Implementation of an extra data callback handler with the callback handler interface. */
62
class ExtraDataCallbackHandler : public COLLADASaxFWL::IExtraDataCallbackHandler
66
typedef std::map<COLLADAFW::UniqueId, std::vector<ExtraInfo> > ExtraInfosMap;
70
/** True, if the current text field is the original id field. */
71
bool mIsOriginalIdField;
73
ExtraInfo mCurrentExtraInfo;
75
ExtraInfosMap mExtraInfos;
80
ExtraDataCallbackHandler();
83
virtual ~ExtraDataCallbackHandler();
85
/** Returns the extra info with the searched id and hash string value. */
86
const ExtraInfo* findExtraInfo (
87
const COLLADAFW::UniqueId& uniqueId,
88
const StringHash& hashElement ) const;
90
/** Method to ask, if the current callback handler want to read the data of the given extra element. */
91
virtual bool parseElement (
92
const GeneratedSaxParser::ParserChar* profileName,
93
const StringHash& elementHash,
94
const COLLADAFW::UniqueId& uniqueId,
95
COLLADAFW::Object* object);
97
/** The methods to get the extra data tags to the registered callback handlers. */
98
virtual bool elementBegin( const GeneratedSaxParser::ParserChar* elementName, const GeneratedSaxParser::xmlChar** attributes);
99
virtual bool elementEnd(const GeneratedSaxParser::ParserChar* elementName );
100
virtual bool textData(const GeneratedSaxParser::ParserChar* text, size_t textLength);
104
/** Disable default copy ctor. */
105
ExtraDataCallbackHandler( const ExtraDataCallbackHandler& pre );
107
/** Disable default assignment operator. */
108
const ExtraDataCallbackHandler& operator= ( const ExtraDataCallbackHandler& pre );
112
} // namespace DAE2MA
114
#endif // __DAE2MA_EXTRADATACALLBACKHANDLER_H__