7 #ifndef __ptex_SurfaceAccessorVDB_h__ 8 #define __ptex_SurfaceAccessorVDB_h__ 24 { setName(
"SurfaceAccessorVDB"); }
27 using SurfaceAccessorBase::set;
28 using SurfaceAccessorBase::spatialVector;
31 BWORD bind(SurfaceAccessibleI::Element a_element,
32 SurfaceAccessibleI::Attribute a_attribute)
34 m_attribute=a_attribute;
39 case SurfaceAccessibleI::e_generic:
40 case SurfaceAccessibleI::e_position:
43 case SurfaceAccessibleI::e_normal:
46 case SurfaceAccessibleI::e_uv:
49 case SurfaceAccessibleI::e_color:
52 case SurfaceAccessibleI::e_vertices:
53 m_attrName=
"vertices";
55 SurfaceAccessibleI::e_primitive);
58 case SurfaceAccessibleI::e_properties:
59 m_attrName=
"properties";
61 SurfaceAccessibleI::e_primitive);
65 return bindInternal(a_element,name);
67 BWORD bind(SurfaceAccessibleI::Element a_element,
70 m_attribute=SurfaceAccessibleI::e_generic;
74 m_attribute=SurfaceAccessibleI::e_position;
78 m_attribute=SurfaceAccessibleI::e_normal;
82 m_attribute=SurfaceAccessibleI::e_uv;
86 m_attribute=SurfaceAccessibleI::e_color;
89 return bindInternal(a_element,a_name);
91 virtual U32 count(
void)
const 94 m_element!=SurfaceAccessibleI::e_point ||
96 SurfaceAccessibleI::e_position &&
102 return m_spSurfaceVDB->vertexCount();
104 virtual U32 subCount(U32 a_index)
const 107 virtual void set(U32 a_index,U32 a_subIndex,
String a_string) {}
108 virtual String string(U32 a_index,U32 a_subIndex=0)
111 virtual void set(U32 a_index,U32 a_subIndex,I32 a_integer) {}
112 virtual I32 integer(U32 a_index,U32 a_subIndex=0)
115 virtual void set(U32 a_index,U32 a_subIndex,Real a_real) {}
116 virtual Real real(U32 a_index,U32 a_subIndex=0)
123 if(m_element!=SurfaceAccessibleI::e_point)
128 if(m_attrName==
"value")
131 m_spSurfaceVDB->getVertexValue(a_index,value);
139 virtual void set(U32 a_index,U32 a_subIndex,
141 virtual SpatialVector spatialVector(U32 a_index,U32 a_subIndex=0)
148 if(m_element!=SurfaceAccessibleI::e_point)
153 if(m_attribute==SurfaceAccessibleI::e_position)
156 m_spSurfaceVDB->getVertexPoint(a_index,value);
160 if(m_attribute==SurfaceAccessibleI::e_normal)
163 m_spSurfaceVDB->getVertexNormal(a_index,value);
167 if(m_attrName==
"cpt")
170 m_spSurfaceVDB->getVertexCpt(a_index,value);
184 { m_spSurfaceVDB=a_spSurfaceVDB; }
188 virtual BWORD bindInternal(SurfaceAccessibleI::Element a_element,
192 if(m_attribute==SurfaceAccessibleI::e_generic &&
193 a_name!=
"cpt" && a_name!=
"value")
198 if(a_element<0 && a_element>5)
200 a_element=SurfaceAccessibleI::e_point;
209 BWORD isBound(
void)
const 210 {
return m_spSurfaceVDB.isValid(); }
kernel
Definition: namespace.dox:3
Common Functionality for Accessor Surface.
Definition: SurfaceAccessorBase.h:20
Accessor for VDB Voxels.
Definition: SurfaceAccessorVDB.h:19
Automatically reference-counted string container.
Definition: String.h:128
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53