HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_GEOAttributeFilter.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GT_GEOAttributeFilter.h ( GEO Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_GEOAttributeFilter__
12 #define __GT_GEOAttributeFilter__
13 
14 #include "GT_API.h"
15 #include <GA/GA_Attribute.h>
16 
17 /// Class to filter attributes when building GT_AttributeLists
19 {
20 public:
22  virtual ~GT_GEOAttributeFilter();
23 
24  /// Sub-classes should likely call the base class filtering
25  virtual bool isValid(const GA_Attribute &attrib) const
26  {
27  if (attrib.getScope() != GA_SCOPE_PUBLIC)
28  return false;
29  return attrib.getAIFTuple() ||
30  attrib.getAIFNumericArray() ||
31  attrib.getAIFStringTuple() ||
32  attrib.getAIFSharedStringArray();
33  }
34 private:
35 };
36 
37 /// Quadrics don't want to pick up either P or N if the attributes exist
39 {
40 public:
42  const GA_Attribute *N)
43  : myP(P)
44  , myN(N)
45  {}
47 
48  virtual bool isValid(const GA_Attribute &a) const
49  {
50  if (&a == myP || &a == myN)
51  return false;
53  }
54 protected:
55  const GA_Attribute *myP, *myN;
56 };
57 
58 /// Only pick up floating point attributes which have a tuple size that matches
59 /// the standard VEX types (i.e. 1, 3, 4, 9 or 16 floats).
61 {
62 public:
65 
66  virtual bool isValid(const GA_Attribute &a) const
67  {
68  if (a.getScope() != GA_SCOPE_PUBLIC)
69  return false;
70 
72  return false;
73 
74  int tsize = a.getTupleSize();
75  return tsize == 1 ||
76  tsize == 3 ||
77  tsize == 4 ||
78  tsize == 9 ||
79  tsize == 16;
80  }
81 };
82 
83 #endif
84 
Definition of a geometry attribute.
Definition: GA_Attribute.h:190
Quadrics don't want to pick up either P or N if the attributes exist.
int getTupleSize() const
Size of the AIFTuple, if it exists. If it doesn't, 1.
virtual const GA_AIFStringTuple * getAIFStringTuple() const
Return the attribute's string tuple interface or NULL.
Class to filter attributes when building GT_AttributeLists.
#define GT_API
Definition: GT_API.h:11
virtual const GA_AIFTuple * getAIFTuple() const
Return the attribute's tuple interface or NULL.
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
Standard user attribute level.
Definition: GA_Types.h:127
GT_GEOQuadricAttributeFilter(const GA_Attribute *P, const GA_Attribute *N)
virtual bool isValid(const GA_Attribute &a) const
Sub-classes should likely call the base class filtering.
GA_StorageClass getStorageClass() const
Returns the approximate type of the attribute.
virtual const GA_AIFSharedStringArray * getAIFSharedStringArray() const
Return the attribute's shared string array interface or NULL.
virtual bool isValid(const GA_Attribute &a) const
Sub-classes should likely call the base class filtering.
GA_AttributeScope getScope() const
Definition: GA_Attribute.h:204
virtual bool isValid(const GA_Attribute &attrib) const
Sub-classes should likely call the base class filtering.
GA_API const UT_StringHolder N
virtual const GA_AIFNumericArray * getAIFNumericArray() const
Return the attribute's arraydata interface or NULL.