7 #ifndef __surface_SurfaceSearchable_h__ 8 #define __surface_SurfaceSearchable_h__ 35 class FE_DL_EXPORT Impact:
36 public SurfaceSphere::Impact,
42 #if FE_COUNTED_STORE_TRACKER 43 setName(
"SurfaceSearchable::Impact");
46 virtual ~Impact(
void) {}
48 virtual I32 triangleIndex(
void)
49 {
return m_triangleIndex; }
50 void setTriangleIndex(I32 a_triangleIndex)
51 { m_triangleIndex=a_triangleIndex; }
53 virtual I32 primitiveIndex(
void)
54 {
return m_primitiveIndex; }
55 void setPrimitiveIndex(I32 a_primitiveIndex)
56 { m_primitiveIndex=a_primitiveIndex; }
58 virtual I32 nearestSubIndex(
void)
59 {
return m_nearestSubIndex; }
60 void setNearestSubIndex(I32 a_nearestSubIndex)
61 { m_nearestSubIndex=a_nearestSubIndex; }
63 virtual I32 partitionIndex(
void)
64 {
return m_partitionIndex; }
65 void setPartitionIndex(I32 a_partitionIndex)
66 { m_partitionIndex=a_partitionIndex; }
86 { m_tangent=a_tangent; }
89 {
return m_barycenter; }
91 { m_barycenter=a_barycenter; }
93 virtual I32 pointIndex0(
void)
const 94 {
return m_pointIndex0; }
95 void setPointIndex0(I32 a_pointIndex0)
96 { m_pointIndex0=a_pointIndex0; }
98 virtual I32 pointIndex1(
void)
const 99 {
return m_pointIndex1; }
100 void setPointIndex1(I32 a_pointIndex1)
101 { m_pointIndex1=a_pointIndex1; }
104 {
return m_vertex0; }
106 { m_vertex0=a_vertex0; }
109 {
return m_vertex1; }
111 { m_vertex1=a_vertex1; }
114 {
return m_normal0; }
116 { m_normal0=a_normal0; }
119 {
return m_normal1; }
121 { m_normal1=a_normal1; }
129 I32 m_primitiveIndex;
130 I32 m_nearestSubIndex;
131 I32 m_partitionIndex;
156 virtual U32 partitionCount(
void)
const 157 {
return m_stringMap.size(); }
159 virtual String partitionName(U32 a_index)
const;
164 virtual I32 lookup(
String a_partitionString);
165 virtual I32 select(
String a_filterString)
166 {
return select(a_filterString,
167 PartitionI::e_matchRegex); }
168 virtual I32 select(
String a_filterString,
169 PartitionI::FilterMethod a_filterMethod);
170 virtual BWORD add(
String a_string);
171 virtual BWORD
remove(
String a_string);
173 virtual BWORD match(I32 a_partitionIndex)
175 return a_partitionIndex>=0 &&
177 I32(m_filterArray.size()) &&
178 m_filterArray[a_partitionIndex];
181 virtual BWORD matchable(
void)
const 182 {
return m_matchCount>0; }
186 std::map<String,I32> m_stringMap;
188 PartitionI::FilterMethod m_filterMethod;
203 m_refinement=a_refinement;
204 if(m_spSpatialTree.isValid())
206 m_spSpatialTree->setRefinement(
213 m_accuracy=a_accuracy;
214 if(m_spSpatialTree.isValid())
216 m_spSpatialTree->setAccuracy(
223 m_searchable=a_searchable;
228 m_searchName=a_searchName;
233 using SurfaceSphere::sample;
237 virtual void prepareForSample(
void);
238 virtual void prepareForSearch(
void);
239 virtual void prepareForUVSearch(
void);
241 using SurfaceSphere::nearestPoints;
242 using SurfaceSphere::nearestPoint;
245 nearestPoints(
const Vector2& a_uv,
246 Real a_maxDistance,U32 a_hitLimit)
const;
251 Real a_maxDistance,U32 a_hitLimit,
254 Real a_maxDistance)
const 255 {
return nearestPoint(a_origin,
256 a_maxDistance,FALSE); }
258 Real a_maxDistance,BWORD a_anyHit)
const;
260 using SurfaceSphere::rayImpacts;
265 Real a_maxDistance,U32 a_hitLimit)
const;
267 using SurfaceSphere::rayImpact;
271 Real a_maxDistance,BWORD a_anyHit)
const;
273 virtual void partitionWith(
String a_attributeName);
274 virtual U32 partitionCount(
void)
const 275 {
return m_spPartition.isValid()?
276 m_spPartition->partitionCount(): 0; }
277 virtual String partitionName(U32 a_index)
const 278 {
return m_spPartition.isValid()?
279 m_spPartition->partitionName(a_index):
281 virtual Vector4 partitionSphere(U32 a_index)
const;
283 using SurfaceSphere::setPartitionFilter;
286 virtual I32 setPartitionFilter(
String a_filterString,
287 PartitionI::FilterMethod a_filterMethod)
289 return m_spPartition.isValid()?
290 m_spPartition->select(
291 a_filterString,a_filterMethod): 0; }
294 using SurfaceSphere::draw;
297 const Color* a_pColor,
299 { drawInternal(FALSE,NULL,a_spDrawI,
307 { drawInternal(TRUE,&a_rTransform,
308 a_spDrawI,a_pColor,a_spDrawBuffer,
313 virtual void drawInternal(BWORD a_transformed,
320 I32 lookupPartition(
String a_partitionString)
321 {
return m_spPartition.isValid()?
322 m_spPartition->lookup(
323 a_partitionString): -1; }
325 virtual void cache(
void);
329 void calcTangents(
void);
330 void calcBoundingSphere(
void);
332 void setOptionalArrays(Arrays a_arrays)
333 { m_optionalArrays=a_arrays; }
334 void resizeArrays(U32 a_elementCount,U32 a_verticeCount);
335 void resizeFor(U32 a_primitiveCount,U32 a_vertexCount,
336 U32& a_rElementAllocated,
337 U32& a_rVertexAllocated);
340 SurfaceI::Accuracy m_accuracy;
347 Arrays m_optionalArrays;
354 Color* m_pColorArray;
355 Real* m_pRadiusArray;
356 I32* m_pTriangleIndexArray;
357 I32* m_pPartitionIndexArray;
358 I32* m_pPointIndexArray;
359 I32* m_pPrimitiveIndexArray;
374 mutable CountedPoolCore* m_pImpactPool;
virtual void setSearchable(BWORD a_searchable)
Set whether this surface may be searched.
Definition: SurfaceSearchable.h:221
Base class providing protection counting for cp<>
Definition: Protectable.h:28
kernel
Definition: namespace.dox:3
Special vector for color (RGBA)
Definition: Color.h:21
matchable list of strings
Definition: PartitionI.h:20
virtual I32 triangleCount(void)
Number of barycentric elements.
Definition: SurfaceSearchable.h:231
virtual void setAccuracy(SurfaceI::Accuracy a_accuracy)
Set what primitive to search down to.
Definition: SurfaceSearchable.h:211
Spherical Surface.
Definition: SurfaceSphere.h:20
Automatically reference-counted string container.
Definition: String.h:128
Tree-searchable Surface.
Definition: SurfaceSearchable.h:20
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
virtual void setRefinement(U32 a_refinement)
Set limitation of surface improvement, such as subdivision.
Definition: SurfaceSearchable.h:201
match partition strings against patterns
Definition: SurfaceSearchable.h:147
virtual void setSearch(String a_searchName)
Set component to use for searching.
Definition: SurfaceSearchable.h:226
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192