HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_AttribXlateH9.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: GA_AttribXlateH9.h ( GA Library, C++)
7  *
8  * COMMENTS: Attribute translate info for .geo/.bgeo file I/O
9  */
10 
11 #ifndef __GA_AttribXlateH9__
12 #define __GA_AttribXlateH9__
13 
14 #include "GA_API.h"
15 
16 #include "GA_Types.h"
17 #include "GA_AIFFileH9.h"
18 
19 #include <UT/UT_StringMap.h>
20 
21 
22 /// Class used to lookup additional properties for attributes loaded from
23 /// H9 geometry files.
25 {
26 public:
28  {
29  public:
30  XlateInfo(GA_AIFFileH9::AttribType src_type, int src_byte_size,
31  GA_AIFFileH9::AttribTypeInfo src_type_info)
32  : mySourceType(src_type)
33  , mySourceByteSize(src_byte_size)
34  , mySourceTypeInfo(src_type_info)
35  , myTypeInfo(GA_TYPE_VOID)
36  , myNonTransformingSet(false)
37  , myNonTransforming(false)
38  {
39  }
40 
41  bool match(GA_AIFFileH9::AttribType src_type,
42  int src_byte_size,
43  GA_AIFFileH9::AttribTypeInfo src_type_info)
44  const;
45 
46  /// @{
47  /// Mapped GA type information. For example, GB had no color,
48  /// while it usually makes sense to map the Cd attribute to
49  /// GA_TYPE_COLOR.
50  GA_TypeInfo getTypeInfo() const { return myTypeInfo; }
51  void setTypeInfo(GA_TypeInfo t) { myTypeInfo = t; }
52  /// @}
53 
54  /// @{
55  /// Some attributes should have type information, but be flagged
56  /// with the non-tranforming property. For example "rest" is a
57  /// point, but shouldn't be transformed.
58  bool nonTransformingSet() const
59  { return myNonTransformingSet; }
60  bool nonTransforming() const { return myNonTransforming; }
61  void setNonTransforming(bool state)
62  {
63  myNonTransformingSet = true;
64  myNonTransforming = state;
65  }
66  /// @}
67 
68  private:
69  GA_AIFFileH9::AttribType mySourceType;
70  int mySourceByteSize;
71  GA_AIFFileH9::AttribTypeInfo mySourceTypeInfo;
72 
73  GA_TypeInfo myTypeInfo;
74  bool myNonTransformingSet;
75  bool myNonTransforming;
76  };
77 
78  const XlateInfo *lookup(const char *name, GA_AIFFileH9::AttribType type,
79  int byte_size,
80  GA_AIFFileH9::AttribTypeInfo type_info) const;
81  void append(const char *name, const XlateInfo &xlate_info);
82 
83  /// An absolute file path will load only that single file, otherwise the
84  /// HOUDINI_PATH will be searched and all matching files will be loaded
85  /// into a single xlate object.
86  static const GA_AttribXlateH9 *getXlate(const char *file_name);
87 
88 private:
89  GA_AttribXlateH9() {}
90  ~GA_AttribXlateH9() {}
91 
92  static GA_AttribXlateH9 *loadXlate(const char *file_name);
93 
94 private:
96 };
97 
98 #endif
Data has no numeric representation.
Definition: GA_Types.h:83
#define GA_API
Definition: GA_API.h:12
void setNonTransforming(bool state)
void setTypeInfo(GA_TypeInfo t)
XlateInfo(GA_AIFFileH9::AttribType src_type, int src_byte_size, GA_AIFFileH9::AttribTypeInfo src_type_info)
GLuint const GLchar * name
Definition: glcorearb.h:785
GA_TypeInfo
Definition: GA_Types.h:80
AttribType
Data types stored in Houdini 9 data files.
Definition: GA_AIFFileH9.h:52
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
AttribTypeInfo
Attribute type modifiers stored in Houdini 9 data files.
Definition: GA_AIFFileH9.h:65
GA_TypeInfo getTypeInfo() const