1/****************************************************************************************
2
3 Copyright (C) 2015 Autodesk, Inc.
4 All rights reserved.
5
6 Use of this software is subject to the terms of the Autodesk license agreement
7 provided at the time of installation or download, or which otherwise accompanies
8 this software in either electronic or hard copy form.
9
10****************************************************************************************/
11
12//! \file fbxcachedeffect.h
13#ifndef _FBXSDK_SCENE_GEOMETRY_CACHED_EFFECT_H_
14#define _FBXSDK_SCENE_GEOMETRY_CACHED_EFFECT_H_
15
16#include <fbxsdk/fbxsdk_def.h>
17
18#include <fbxsdk/scene/geometry/fbxnodeattribute.h>
19#include <fbxsdk/scene/geometry/fbxcache.h>
20
21#include <fbxsdk/fbxsdk_nsbegin.h>
22
23/** A cached effect is a type of node attribute to represent certain type of effect
24 * by an cache object. Categories are particle cache, fluid cache, hair cache and general cache.
25 * \see ECategory for the effect types that are supported.
26 * \nosubgrouping
27 */
28class FBXSDK_DLL FbxCachedEffect : public FbxNodeAttribute
29{
30 FBXSDK_OBJECT_DECLARE(FbxCachedEffect, FbxNodeAttribute);
31
32public:
33 //! Returns the FbxNodeAttribute::EType::eCachedEffect attribute type.
34 virtual FbxNodeAttribute::EType GetAttributeType() const;
35
36 /** Effect attribute category. This is for identification purpose and has
37 * no influence inside the FBX SDK. However, applications may use this to filter FbxCachedEffect
38 * objects.
39 * \remarks Vertex caches for deforming geometries are not handled by the FbxCachedEffect object. These
40 * caches are connected with the FbxVertexCacheDeformer object.
41 * \remarks If an object of this class is used as the default NodeAttribute for a FbxNode and the scene is
42 * saved to an FBX v6 and earlier versions, the CachedEffect attribute is not saved and the FbxNode will
43 * be processed as a FbxNull node with default values for the attribute.
44 */
45 enum ECategory
46 {
47 eParticles, //!< This effect handles a particle cache.
48 eFluids, //!< This effect handles a fluid cache.
49 eHair, //!< This effect handles an hair cache.
50 eGeneric //!< This effect handles a cache other than particles, fluids or hair.
51 };
52
53 //! Return the specialization category of this effect attribute.
54 ECategory GetCategory() const;
55
56 /** Assign a cache object to be used by this attribute.
57 * \param pCache The cache object.
58 * \param pCategory The type of this cached effect.
59 * \remarks The cache referenced by the \b pCache pointer can be freely shared among
60 * multiple FbxCachedEffect (and even the FbxVertexCacheDeformer) therefore
61 * \b pCategory identifier should really only used as a hint of what this FbxCachedEffect
62 * represents but it should not be taken for granted that the content of the cache really
63 * matches the category. Applications should always check the cache files to ensure that
64 * they are manipulating the desired information.
65 *
66 */
67 void SetCache( FbxCache* pCache, ECategory pCategory = eGeneric);
68
69 /** Get the cache object used by this node attribute.
70 * \return A pointer to the cache object used by this node attribute, or \c NULL if no cache object is assigned.
71 */
72 FbxCache* GetCache() const;
73
74protected:
75
76
77/*****************************************************************************************************************************
78** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
79*****************************************************************************************************************************/
80#ifndef DOXYGEN_SHOULD_SKIP_THIS
81 virtual FbxObject& Copy(const FbxObject& pObject);
82
83protected:
84 virtual void ConstructProperties(bool pForceSet);
85
86public:
87 virtual const char* GetTypeName() const;
88 virtual FbxStringList GetTypeFlags() const;
89
90private:
91 void ClearCacheConnections();
92 FbxPropertyT<ECategory> Category;
93#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
94};
95
96inline EFbxType FbxTypeOf(const FbxCachedEffect::ECategory&){ return eFbxEnum; }
97
98#include <fbxsdk/fbxsdk_nsend.h>
99
100#endif /* _FBXSDK_SCENE_GEOMETRY_CACHED_EFFECT_H_ */
101