8 #ifndef __WIRE_SimpleDetailReader_h__
9 #define __WIRE_SimpleDetailReader_h__
20 #define WIRE_SIMPLEDETAILREADER_GET_VT_F_INTERNAL(name) \
21 private: fpreal get##name##Internal(GA_Index primind, GA_Size vtx) const \
23 const GA_Attribute *a = my##name.getAttribute(); \
24 GA_AttributeOwner owner = a->getOwner(); \
25 if (owner == GA_ATTRIB_DETAIL) \
26 return my##name.get(GA_DETAIL_OFFSET); \
27 if (primind >= myGdpConst->getNumPrimitives()) \
29 GA_Offset offset = myGdpConst->primitiveOffset(primind); \
30 if(owner == GA_ATTRIB_PRIMITIVE) \
31 return my##name.get(offset); \
32 const GEO_Primitive *prim = myGdpConst->getGEOPrimitive(offset); \
33 if (vtx >= prim->getVertexCount()) \
35 if (owner == GA_ATTRIB_VERTEX) \
36 return my##name.get(prim->getVertexOffset(vtx)); \
37 return my##name.get(prim->getPointOffset(vtx)); \
39 #define WIRE_SIMPLEDETAILREADER_GET_VT_F(name) \
40 WIRE_SIMPLEDETAILREADER_GET_VT_F_INTERNAL(name) \
41 public: fpreal get##name(GA_Index primind, GA_Size vtx) const \
43 fpreal result = my##name##Default; \
44 if(my##name.isValid()) \
45 result *= get##name##Internal(primind, vtx); \
50 #define WIRE_SIMPLEDETAILREADER_GET_VT_I(name) \
51 public: int get##name(GA_Index primind, GA_Size vtx) const \
53 const GA_Attribute *a = my##name.getAttribute(); \
56 GA_AttributeOwner owner = a->getOwner(); \
57 if (owner == GA_ATTRIB_DETAIL) \
58 return my##name.get(GA_DETAIL_OFFSET); \
59 if (primind >= myGdpConst->getNumPrimitives()) \
61 GA_Offset offset = myGdpConst->primitiveOffset(primind); \
62 if(owner == GA_ATTRIB_PRIMITIVE) \
63 return my##name.get(offset); \
64 const GEO_Primitive *prim = myGdpConst->getGEOPrimitive(offset); \
65 if (vtx >= prim->getVertexCount()) \
67 if (owner == GA_ATTRIB_VERTEX) \
68 return my##name.get(prim->getVertexOffset(vtx)); \
69 return my##name.get(prim->getPointOffset(vtx)); \
72 #define WIRE_SIMPLEDETAILREADER_GET_PT_F(name) \
73 public: fpreal get##name(GA_Index ptind) const \
75 fpreal retval = my##name##Default; \
76 if(my##name.isValid()) \
78 GA_Offset offset = myGdpConst->pointOffset(ptind); \
79 if (offset != GA_INVALID_OFFSET) \
80 retval *= my##name.get(offset); \
84 #define WIRE_SIMPLEDETAILREADER_GET_VT_B(name) \
85 WIRE_SIMPLEDETAILREADER_GET_VT_F_INTERNAL(name##F) \
86 WIRE_SIMPLEDETAILREADER_GET_VT_I(name##I) \
87 public: bool get##name(GA_Index primind, GA_Size vtx) const \
89 if(my##name##I.isValid()) \
90 return get##name##I(primind, vtx) != 0; \
91 if(my##name##F.isValid()) \
92 return get##name##FInternal(primind, vtx) > 0.5; \
114 {
return myGdpConst->getPos3(myGdpConst->pointOffset(i)) * myTransform; }
117 if (myVelocity.isInvalid())
119 return rowVecMult3(myVelocity.get(myGdpConst->pointOffset(i)), myTransform);
const UT_DMatrix4 & getTransform() const
#define WIRE_SIMPLEDETAILREADER_GET_VT_B(name)
GA_ROHandleF myNoCollideF
UT_Vector3T< float > UT_Vector3
GU_DetailHandleAutoReadLock * myGdpLock
#define WIRE_SIMPLEDETAILREADER_GET_VT_F(name)
GA_ROHandleF myDynamicFriction
const GU_Detail * myGdpConst
fpreal myDynamicFrictionDefault
UT_Vector3 getVelocity(GA_Index i) const
GA_ROHandleI myNoCollideI
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
#define WIRE_SIMPLEDETAILREADER_GET_PT_F(name)
UT_Vector3T< T > rowVecMult3(const UT_Vector3T< T > &v, const UT_Matrix4T< S > &m)
const GU_Detail * getDetailConst() const