2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of COLLADASaxFrameworkLoader.
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 __COLLADASAXFWL_INTERMEDIATETARGETABLE_H__
12
#define __COLLADASAXFWL_INTERMEDIATETARGETABLE_H__
14
#include "COLLADASaxFWLPrerequisites.h"
17
namespace COLLADASaxFWL
20
typedef size_t ClassId;
22
namespace INTERMEDIATETARGETABLE_TYPE
26
KINEMATICS_INSTANCE = 1,
27
KINEMATICATTACHMENT = 2,
30
KINEMATICCONTROLLER = 5,
35
/** Use this as base class for all classes that can appear in the sid tree and that are not derived from
36
framework Animatable, Object or Targetable. It should only be used for Loader specific classes that store
38
class IntermediateTargetable
41
virtual ~IntermediateTargetable(){};
43
/** Returns the class id of the targetable.*/
44
virtual ClassId getClassId() const =0;
48
/** Base class of all classes that can be referenced in the model.*/
49
template<ClassId classId>
50
class IntermediateTargetableTemplate : public IntermediateTargetable
53
IntermediateTargetableTemplate() {}
54
virtual ~IntermediateTargetableTemplate(){};
56
/** Returns the class id of the targetable.*/
57
static ClassId ID() { return classId; }
59
/** Returns the class id of the targetable.*/
60
ClassId getClassId() const { return ID(); }
63
template<class IntermediateTargetableType>
64
IntermediateTargetableType* intermediateTargetableSafeCast(IntermediateTargetable* targetable)
69
if ( targetable->getClassId() == IntermediateTargetableType::ID() )
70
return (IntermediateTargetableType*)targetable;
75
template<class IntermediateTargetableType>
76
const IntermediateTargetableType* intermediateTargetableSafeCast( const IntermediateTargetable* targetable)
81
if ( targetable->getClassId() == IntermediateTargetableType::ID() )
82
return (IntermediateTargetableType*)targetable;
87
} // namespace COLLADASAXFWL
89
#endif // __COLLADASAXFWL_INTERMEDIATETARGETABLE_H__