2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2011-03-23 14:25:35 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup collada
|
2011-03-23 14:25:35 +00:00
|
|
|
*/
|
|
|
|
|
|
2019-12-10 11:06:38 +11:00
|
|
|
#pragma once
|
|
|
|
|
|
2020-03-19 09:33:03 +01:00
|
|
|
#include <algorithm> /* sort() */
|
2011-03-23 14:25:35 +00:00
|
|
|
#include <map>
|
2020-03-19 09:33:03 +01:00
|
|
|
#include <string>
|
2011-03-23 14:25:35 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
2013-01-21 14:00:01 +00:00
|
|
|
#include "COLLADASWInstanceController.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "COLLADASaxFWLFilePartLoader.h"
|
|
|
|
|
#include "COLLADASaxFWLIExtraDataCallbackHandler.h"
|
2011-03-23 14:25:35 +00:00
|
|
|
|
2011-08-14 16:15:41 +00:00
|
|
|
#include "AnimationImporter.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "DocumentImporter.h"
|
2011-03-23 14:25:35 +00:00
|
|
|
|
2012-02-27 20:27:19 +00:00
|
|
|
/** \brief Handler class for \<extra\> data, through which different
|
2011-03-23 14:25:35 +00:00
|
|
|
* profiles can be handled
|
|
|
|
|
*/
|
|
|
|
|
class ExtraHandler : public COLLADASaxFWL::IExtraDataCallbackHandler {
|
|
|
|
|
public:
|
|
|
|
|
/** Constructor. */
|
2011-08-14 16:15:41 +00:00
|
|
|
ExtraHandler(DocumentImporter *dimp, AnimationImporter *aimp);
|
2011-03-23 14:25:35 +00:00
|
|
|
|
|
|
|
|
/** Handle the beginning of an element. */
|
|
|
|
|
bool elementBegin(const char *elementName, const char **attributes);
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2011-03-23 14:25:35 +00:00
|
|
|
/** Handle the end of an element. */
|
|
|
|
|
bool elementEnd(const char *elementName);
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2011-03-23 14:25:35 +00:00
|
|
|
/** Receive the data in text format. */
|
|
|
|
|
bool textData(const char *text, size_t textLength);
|
|
|
|
|
|
2019-04-30 13:41:21 +10:00
|
|
|
/** Method to ask, if the current callback handler want to read the data of the given extra
|
|
|
|
|
* element. */
|
2019-03-15 08:53:22 +11:00
|
|
|
bool parseElement(const char *profileName,
|
|
|
|
|
const unsigned long &elementHash,
|
|
|
|
|
const COLLADAFW::UniqueId &uniqueId,
|
|
|
|
|
COLLADAFW::Object *object);
|
2013-05-08 10:07:58 +00:00
|
|
|
|
|
|
|
|
/** For backwards compatibility with older OpenCollada, new version added object parameter */
|
2019-03-15 08:53:22 +11:00
|
|
|
bool parseElement(const char *profileName,
|
|
|
|
|
const unsigned long &elementHash,
|
|
|
|
|
const COLLADAFW::UniqueId &uniqueId);
|
2018-06-08 08:07:48 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
private:
|
2011-03-23 14:25:35 +00:00
|
|
|
/** Disable default copy constructor. */
|
2012-04-29 17:11:40 +00:00
|
|
|
ExtraHandler(const ExtraHandler &pre);
|
2011-03-23 14:25:35 +00:00
|
|
|
/** Disable default assignment operator. */
|
|
|
|
|
const ExtraHandler &operator=(const ExtraHandler &pre);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-03-25 09:52:36 +00:00
|
|
|
/** Handle to DocumentImporter for interface to extra element data saving. */
|
|
|
|
|
DocumentImporter *dimp;
|
2011-08-14 16:15:41 +00:00
|
|
|
AnimationImporter *aimp;
|
2011-03-25 09:52:36 +00:00
|
|
|
/** Holds Id of element for which <extra> XML elements are handled. */
|
|
|
|
|
COLLADAFW::UniqueId currentUid;
|
2011-03-25 11:07:57 +00:00
|
|
|
ExtraTags *currentExtraTags;
|
|
|
|
|
std::string currentElement;
|
2011-03-23 14:25:35 +00:00
|
|
|
};
|