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 fbxobjectfilter.h |
13 | #ifndef _FBXSDK_SCENE_OBJECT_FILTER_H_ |
14 | #define _FBXSDK_SCENE_OBJECT_FILTER_H_ |
15 | |
16 | #include <fbxsdk/fbxsdk_def.h> |
17 | |
18 | #include <fbxsdk/core/fbxobject.h> |
19 | |
20 | #include <fbxsdk/fbxsdk_nsbegin.h> |
21 | |
22 | /** \brief This object represents a filter criteria on an object. |
23 | * \nosubgrouping |
24 | */ |
25 | class FBXSDK_DLL FbxObjectFilter |
26 | { |
27 | public: |
28 | //! Destructor. |
29 | virtual ~FbxObjectFilter() {} |
30 | |
31 | /** Tells if this filter match the given object |
32 | * \param pObjectPtr The given object. |
33 | */ |
34 | virtual bool Match(const FbxObject * pObjectPtr) const = 0; |
35 | |
36 | /** Tells if this filter does NOT match the given object |
37 | * \param pObjectPtr The given object. |
38 | */ |
39 | virtual bool NotMatch(const FbxObject * pObjectPtr) const { return !Match(pObjectPtr); }; |
40 | }; |
41 | |
42 | /**\brief This class represents a name filter on an object. |
43 | *\nosubgrouping |
44 | */ |
45 | class FBXSDK_DLL FbxNameFilter : public FbxObjectFilter |
46 | { |
47 | public: |
48 | /** |
49 | * \name Constructor and Destructor |
50 | */ |
51 | //@{ |
52 | /** Constructor |
53 | * \param pTargetName The target name. |
54 | */ |
55 | inline FbxNameFilter( const char* pTargetName ) : mTargetName( pTargetName ) {}; |
56 | |
57 | //! Destructor. |
58 | virtual ~FbxNameFilter() {} |
59 | //@} |
60 | |
61 | /** Tells if this filter match the given object |
62 | * \param pObjectPtr The given object. |
63 | */ |
64 | virtual bool Match(const FbxObject * pObjectPtr) const { return pObjectPtr ? mTargetName == pObjectPtr->GetName() : false; } |
65 | |
66 | /***************************************************************************************************************************** |
67 | ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! ** |
68 | *****************************************************************************************************************************/ |
69 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
70 | private: |
71 | FbxString mTargetName; |
72 | #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/ |
73 | }; |
74 | |
75 | #include <fbxsdk/fbxsdk_nsend.h> |
76 | |
77 | #endif /* _FBXSDK_SCENE_OBJECT_FILTER_H_ */ |
78 | |