FBX C++ API Reference
fbxquery.h
Go to the documentation of this file.
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 
13 #ifndef _FBXSDK_CORE_QUERY_H_
14 #define _FBXSDK_CORE_QUERY_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
18 #include <fbxsdk/core/fbxclassid.h>
22 
23 #include <fbxsdk/fbxsdk_nsbegin.h>
24 
25 #define FBXSDK_QUERY_UNIQUE_ID 0x14000000
26 
27 class FbxProperty;
28 
33 {
34 public:
36  virtual FbxInt GetUniqueId() const { return FBXSDK_QUERY_UNIQUE_ID; }
37 
41  virtual bool IsValid(const FbxProperty& pProperty) const;
42 
45  virtual bool IsEqual(FbxQuery* pOtherQuery) const;
46 
48  void Ref();
49 
51  void Unref();
52 
53 /*****************************************************************************************************************************
54 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
55 *****************************************************************************************************************************/
56 #ifndef DOXYGEN_SHOULD_SKIP_THIS
57 protected:
58  FbxQuery();
59  virtual ~FbxQuery();
60 
61 private:
62  class InternalFilter : public FbxConnectionPointFilter
63  {
64  public:
65  InternalFilter(FbxQuery* pQuery);
66  ~InternalFilter();
67 
68  public:
70  void Unref();
71  FbxInt GetUniqueId() const { return mQuery->GetUniqueId(); }
72  bool IsValid(FbxConnectionPoint* pConnect) const;
73  bool IsEqual(FbxConnectionPointFilter* pConnectFilter) const;
74 
75  FbxQuery* mQuery;
76  };
77 
78  InternalFilter mFilter;
79  int mRefCount;
80 
82  friend class FbxProperty;
83 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
84 };
85 
105 {
106 public:
110  static FbxCriteria ObjectType(const FbxClassId& pClassId);
111 
114  static FbxCriteria ObjectTypeStrict(const FbxClassId& pClassId);
115 
117  static FbxCriteria IsProperty();
118 
121  FbxCriteria operator&&(const FbxCriteria& pCriteria) const;
122 
125  FbxCriteria operator||(const FbxCriteria& pCriteria) const;
126 
128  FbxCriteria operator!() const;
129 
132  FbxQuery* GetQuery() const;
133 
134 /*****************************************************************************************************************************
135 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
136 *****************************************************************************************************************************/
137 #ifndef DOXYGEN_SHOULD_SKIP_THIS
138  FbxCriteria();
139  FbxCriteria(const FbxCriteria& pCriteria);
140  FbxCriteria(FbxQuery* pQuery);
141  ~FbxCriteria();
142 
143  FbxCriteria& operator=(const FbxCriteria& pCriteria);
144 
145 private:
146  FbxQuery* mQuery;
147 
148  static void FreeGlobalCache();
149 
151  friend class FbxManager;
152 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
153 };
154 
157 {
158  inline int operator()(const FbxCriteria& pKeyA, const FbxCriteria& pKeyB) const
159  {
160  const FbxQuery* lKeyA = pKeyA.GetQuery();
161  const FbxQuery* lKeyB = pKeyB.GetQuery();
162  return lKeyA < lKeyB ? -1 : (lKeyA > lKeyB ? 1 : 0);
163  }
164 };
165 
166 /*****************************************************************************************************************************
167 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
168 *****************************************************************************************************************************/
169 #ifndef DOXYGEN_SHOULD_SKIP_THIS
170 class FBXSDK_DLL FbxQueryOperator : public FbxQuery
171 {
172 public:
174 
175  enum EType {eAND, eOR};
176 
177  static FbxQueryOperator* Create(FbxQuery* pA, EType pOperator, FbxQuery* pB);
178  virtual FbxInt GetUniqueId() const { return FBXSDK_QUERY_UNIQUE_ID+1; }
179  virtual bool IsValid(const FbxProperty& pProperty) const;
180  virtual bool IsEqual(FbxQuery* pOtherQuery) const;
181 
182 protected:
183  FbxQueryOperator(FbxQuery* pA, EType pOperator, FbxQuery* pB);
184  virtual ~FbxQueryOperator();
185 
186 private:
187  FbxQuery *mA, *mB;
188  EType mOperator;
189 };
190 
191 class FBXSDK_DLL FbxQueryOperatorUnary : public FbxQuery
192 {
193 public:
195 
196  static FbxQueryOperatorUnary* Create(FbxQuery* pA);
197  virtual FbxInt GetUniqueId() const{ return FBXSDK_QUERY_UNIQUE_ID+2; }
198  virtual bool IsValid(const FbxProperty& pProperty) const;
199  virtual bool IsEqual(FbxQuery* pOtherQuery) const;
200 
201 protected:
202  FbxQueryOperatorUnary(FbxQuery* pA);
203  virtual ~FbxQueryOperatorUnary();
204 
205 private:
206  FbxQuery* mA;
207 };
208 
209 class FBXSDK_DLL FbxQueryClassId : public FbxQuery
210 {
211 public:
213 
214  static FbxQueryClassId* Create(const FbxClassId& pClassId);
215  virtual FbxInt GetUniqueId() const{ return FBXSDK_QUERY_UNIQUE_ID+3; }
216  virtual bool IsValid(const FbxProperty& pProperty) const;
217  virtual bool IsEqual(FbxQuery* pOtherQuery) const;
218 
219 protected:
220  FbxQueryClassId(const FbxClassId& pClassId);
221 
222 private:
223  FbxClassId mClassId;
224 };
225 
226 class FBXSDK_DLL FbxQueryIsA : public FbxQuery
227 {
228 public:
230 
231  static FbxQueryIsA* Create(const FbxClassId& pClassId);
232  virtual FbxInt GetUniqueId() const{ return FBXSDK_QUERY_UNIQUE_ID+4; }
233  virtual bool IsValid(const FbxProperty& pProperty) const;
234  virtual bool IsEqual(FbxQuery* pOtherQuery) const;
235 
236 protected:
237  FbxQueryIsA(const FbxClassId& pClassId);
238 
239 private:
240  FbxClassId mClassId;
241 };
242 
243 class FBXSDK_DLL FbxQueryIsProperty : public FbxQuery
244 {
245 public:
247 
248  static FbxQueryIsProperty* Create();
249  virtual FbxInt GetUniqueId() const{ return FBXSDK_QUERY_UNIQUE_ID+5; }
250  virtual bool IsValid(const FbxProperty& pProperty) const;
251  virtual bool IsEqual(FbxQuery* pOtherQuery) const;
252 
253 protected:
254  FbxQueryIsProperty();
255 };
256 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
257 
258 #include <fbxsdk/fbxsdk_nsend.h>
259 
260 #endif /* _FBXSDK_CORE_QUERY_H_ */
int operator()(const FbxCriteria &pKeyA, const FbxCriteria &pKeyB) const
Definition: fbxquery.h:158
FBX SDK environment definition.
#define FBXSDK_FRIEND_NEW()
Definition: fbxnew.h:397
SDK object manager.
Definition: fbxmanager.h:56
#define FBXSDK_QUERY_UNIQUE_ID
Definition: fbxquery.h:25
virtual FbxInt GetUniqueId() const
Get unique filter Id.
Definition: fbxquery.h:36
Defines a filtering criteria for a query of objects, connections and properties, so that only those s...
Definition: fbxquery.h:104
Class to manage Connect Filter.
Internal class used to differentiate objects during run-time.
Definition: fbxclassid.h:39
Class to hold user properties.
Definition: fbxproperty.h:37
FbxQuery * GetQuery() const
Retrieves the query.
#define FBXSDK_DLL
Definition: fbxarch.h:173
signed int FbxInt
Definition: fbxtypes.h:39
Functor to compare FbxCriteria.
Definition: fbxquery.h:156
Base class to manage query.
Definition: fbxquery.h:32