HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_IORibXlate.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: GEO_IORibXlate.h ( GEO Library, C++)
7  *
8  * COMMENTS: RIB Attribute translation...
9  */
10 
11 #ifndef __GEO_IORibXlate__
12 #define __GEO_IORibXlate__
13 
14 #include "GEO_API.h"
15 #include <GA/GA_AttributeRef.h>
16 #include <GA/GA_Types.h>
17 class GEO_Detail;
18 class UT_String;
19 
21 {
24 };
25 
27 {
28 public:
29  GEO_IORibXlate(const char *map);
30  ~GEO_IORibXlate();
31 
32  void lookup(const GEO_Detail *gdp);
33  const GA_ROAttributeRef &getAttribRef() const { return myAttribRef; }
34 
35  int isValid() const { return myAttribRef.isValid(); }
36 
38  {
39  ATTRIB_INVALID = -1,
40  ATTRIB_POINT = 0,
43  ATTRIB_DETAIL
44  };
45  AttribClass getAttribClass() const { return myHType; }
46  int isPoint() const { return myHType == ATTRIB_POINT; }
47  int isVertex() const { return myHType == ATTRIB_VERTEX; }
48  int isPrimitive() const { return myHType == ATTRIB_PRIMITIVE; }
49  int isDetail() const { return myHType == ATTRIB_DETAIL; }
50 
51 
52 #if 0
53  float getFloat(const void *data, int idx) const ;
54  void getString(UT_String &result, const void *data,
55  int idx) const;
56 #else
57 
58  float getFloat(GA_Offset obj, int idx) const;
59  void getString(UT_String &result, GA_Offset obj,
60  int idx) const;
61 #endif
62 
63  GEO_RibAttribute getRManDataType() const { return myRManData; }
64 
65  const char *getHName() const { return myHName; }
66  const char *getRMName() const { return myRManName; }
67  const char *getRMType() const { return myRManType; }
68  const char *getRMFaceType() const { return myRManFaceType; }
69  int getRMSize() const { return myRManSize; }
70  int getRMOffset() const { return myRManOffset; }
71 
72  // Here, RenderMan has 2 types of point attribute (vertex/varying)
73  // as well as two types of primitive attribute (uniform/constant). What
74  // we do is overload the vertex flag to indicate both vertex and constant
75  // since the attribute is going to be either point/primitive from the
76  // Houdini end.
77  int isRManPerVertex() const { return myRManVertex; }
78  int isRManConstant() const { return myRManVertex; }
79 
80 private:
81  GA_ROAttributeRef myAttribRef;
82  char *myHName;
83  char *myRManName;
84  const char *myRManType;
85  const char *myRManFaceType;
86  GEO_RibAttribute myRManData;
87  AttribClass myHType;
88  int myHTupleSize;
89  GA_Storage myHStorage;
90  int myRManOffset;
91  int myRManSize;
92  int myRManVertex;
93 };
94 
95 #endif
96 
GEO_RibAttribute getRManDataType() const
const char * getRMType() const
AttribClass getAttribClass() const
GEO_RibAttribute
**But if you need a result
Definition: thread.h:613
const char * getHName() const
GA_Size GA_Offset
Definition: GA_Types.h:641
This class provides a way to manage a reference to an attribute permitting Read-Only access...
int isPoint() const
#define GEO_API
Definition: GEO_API.h:14
const char * getRMFaceType() const
const char * getRMName() const
int isRManPerVertex() const
int getRMOffset() const
int isVertex() const
int isRManConstant() const
const GA_ROAttributeRef & getAttribRef() const
int isPrimitive() const
int isDetail() const
int isValid() const
GA_Storage
Definition: GA_Types.h:50
Definition: format.h:895
int getRMSize() const