7 #ifndef __houdini_SurfaceAccessorHapi_h__ 8 #define __houdini_SurfaceAccessorHapi_h__ 10 #define FE_SAHE_ASSERT_BOUNDS TRUE 30 setName(
"SurfaceAccessorHapi");
37 BWORD bind(SurfaceAccessibleI::Element a_element,
38 SurfaceAccessibleI::Attribute a_attribute)
40 m_attribute=a_attribute;
45 case SurfaceAccessibleI::e_generic:
46 case SurfaceAccessibleI::e_position:
49 case SurfaceAccessibleI::e_normal:
52 case SurfaceAccessibleI::e_uv:
55 case SurfaceAccessibleI::e_color:
58 case SurfaceAccessibleI::e_vertices:
59 m_attrName=
"vertices";
61 SurfaceAccessibleI::e_primitive);
64 case SurfaceAccessibleI::e_properties:
65 m_attrName=
"properties";
67 SurfaceAccessibleI::e_primitive);
69 return bindInternal(a_element,name);
71 BWORD bind(SurfaceAccessibleI::Element a_element,
74 m_attribute=SurfaceAccessibleI::e_generic;
78 m_attribute=SurfaceAccessibleI::e_position;
82 m_attribute=SurfaceAccessibleI::e_normal;
86 m_attribute=SurfaceAccessibleI::e_uv;
90 m_attribute=SurfaceAccessibleI::e_color;
92 else if(a_name==
"properties")
94 m_attribute=SurfaceAccessibleI::e_properties;
96 SurfaceAccessibleI::e_primitive);
99 return bindInternal(a_element,a_name);
103 virtual String type(
void)
const;
105 virtual U32 count(
void)
const;
106 virtual U32 subCount(U32 a_index)
const;
108 using SurfaceAccessorBase::set;
109 virtual void set(U32 a_index,U32 a_subIndex,
String a_string)
111 #if FE_SAHE_ASSERT_BOUNDS 112 FEASSERT(a_index<count());
113 FEASSERT(a_subIndex<subCount(a_index));
117 virtual String string(U32 a_index,U32 a_subIndex=0)
119 #if FE_SAHE_ASSERT_BOUNDS 120 FEASSERT(a_index<count());
121 FEASSERT(a_subIndex<subCount(a_index));
124 if(m_stringBuffer.size()>a_index)
126 return m_stringBuffer[a_index];
133 virtual void set(U32 a_index,U32 a_subIndex,I32 a_integer)
135 #if FE_SAHE_ASSERT_BOUNDS 136 FEASSERT(a_index<count());
137 FEASSERT(a_subIndex<subCount(a_index));
142 virtual I32 integer(U32 a_index,U32 a_subIndex=0)
144 if(m_attribute==SurfaceAccessibleI::e_properties)
147 if(a_subIndex==SurfaceAccessibleI::e_openCurve
156 #if FE_SAHE_ASSERT_BOUNDS 157 FEASSERT(a_index<count());
158 FEASSERT(m_attribute==
159 SurfaceAccessibleI::e_properties ||
160 a_subIndex<subCount(a_index));
162 if(m_element==SurfaceAccessibleI::e_primitive &&
163 m_attribute==SurfaceAccessibleI::e_vertices)
165 const I32 offset=m_vertexOffset[a_index];
167 if(a_subIndex<m_vertexCount[a_index])
169 if(!m_vertexBuffer.size())
171 return offset+a_subIndex;
174 return m_vertexBuffer[offset+a_subIndex];
178 if(m_integerBuffer.size()>a_index)
180 return m_integerBuffer[a_index];
186 virtual I32 duplicate(U32 a_index,U32 a_subIndex=0)
192 using SurfaceAccessorBase::append;
193 virtual I32 append(SurfaceAccessibleI::Form a_form)
198 virtual void append(U32 a_index,I32 a_integer)
207 virtual void remove(U32 a_index,I32 a_integer)
212 virtual void set(U32 a_index,U32 a_subIndex,Real a_real)
214 #if FE_SAHE_ASSERT_BOUNDS 215 FEASSERT(a_index<count());
216 FEASSERT(a_subIndex<subCount(a_index));
221 virtual Real real(U32 a_index,U32 a_subIndex=0)
223 #if FE_SAHE_ASSERT_BOUNDS 224 FEASSERT(a_index<count());
225 FEASSERT(a_subIndex<subCount(a_index));
228 if(m_realBuffer.size()>a_index)
230 return m_realBuffer[a_index];
237 virtual void set(U32 a_index,U32 a_subIndex,
242 virtual SpatialVector spatialVector(U32 a_index,U32 a_subIndex=0)
244 #if FE_SAHE_ASSERT_BOUNDS 245 FEASSERT(a_index<count());
246 FEASSERT(a_subIndex<subCount(a_index));
248 if(m_attribute==SurfaceAccessibleI::e_properties)
253 if(m_element==SurfaceAccessibleI::e_pointGroup)
260 SurfaceAccessibleI::e_primitiveGroup ||
261 m_attribute==SurfaceAccessibleI::e_vertices)
264 SurfaceAccessibleI::e_primitiveGroup
266 SurfaceAccessibleI::e_primitive);
272 if((m_element==SurfaceAccessibleI::e_primitive ||
273 m_element==SurfaceAccessibleI::e_vertex ||
275 SurfaceAccessibleI::e_primitiveGroup) &&
276 m_attribute==SurfaceAccessibleI::e_uv)
282 if(m_vectorBuffer.size()>a_index)
284 return m_vectorBuffer[a_index];
291 const Vector2i* a_pIndexArray,I32 a_arrayCount)
298 {
return m_spSurfaceAccessibleI; }
301 void setSession(HAPI_Session* a_pHapiSession)
303 m_pHapiSession=a_pHapiSession;
305 HAPI_Session* session(
void)
const {
return m_pHapiSession; }
307 void setNodeId(HAPI_NodeId a_hapiNodeId)
309 m_hapiNodeId=a_hapiNodeId;
311 HAPI_NodeId nodeId(
void)
const {
return m_hapiNodeId; }
314 virtual BWORD bindInternal(SurfaceAccessibleI::Element a_element,
317 BWORD isBound(
void)
const 321 return (HAPI_IsSessionValid(m_pHapiSession)==
322 HAPI_RESULT_SUCCESS &&
323 (m_stringBuffer.size() ||
324 m_integerBuffer.size() ||
325 m_realBuffer.size() ||
326 m_vectorBuffer.size()));
329 HAPI_Session* m_pHapiSession;
330 HAPI_NodeId m_hapiNodeId;
kernel
Definition: namespace.dox:3
Common Functionality for Accessor Surface.
Definition: SurfaceAccessorBase.h:20
Automatically reference-counted string container.
Definition: String.h:128
Wrapper for std::vector.
Definition: Array.h:21
Houdini Engine Surface Editing Implementation.
Definition: SurfaceAccessorHapi.h:22
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192