25#ifndef _SO_INTERSECTION_DETECTION_ACTION_
26#define _SO_INTERSECTION_DETECTION_ACTION_
181#ifndef HIDDEN_FROM_DOC
182 struct ShapeInformationItem {
184 float xMin, yMin, zMin;
185 float xMax, yMax, zMax;
188 struct CoupleTableItem {
190 float xMin, yMin, zMin;
191 float xMax, yMax, zMax;
194 struct ActiveListItem {
197 enum Position position;
201 static float m_fIntersectEpsilon;
218 static void initClass();
219 static void exitClass();
232 void* userDataFilterCB;
234 void* userDataIntersectionCB;
235 void* m_callback_list;
243 int shapeInformationSize;
244 int shapeInformationReservedSize;
245 ShapeInformationItem* shapeInformation;
247 int coupleTableReservedSize;
248 CoupleTableItem* coupleTable;
250 int activeListReservedSize;
251 ActiveListItem* activeList;
252 int primitiveTableSize;
253 int primitiveTableReservedSize;
255 int currentShapeIndex1;
256 int currentShapeIndex2;
257 CoupleTableItem* currentCouple;
262 void shapeInformationDestroy();
263 void shapeInformationClear();
264 void shapeInformationAddItem(
SoPath *path);
266 void coupleTableDestroy();
267 void coupleTableClear();
268 CoupleTableItem * coupleTableGetItem(
int shapeIndex1,
int shapeIndex2);
269 void coupleTableSetOverlaping(
int shapeIndex1,
int shapeIndex2,
271 void coupleTableUpdate(
enum Axis axis);
273 void activeListDestroy();
274 void activeListClear();
275 void activeListAddItem(
int shapeIndex);
276 void activeListSort(
int (*compareFunction)(
void const *,
void const *));
277 static int activeListXCompare(
void const *pointer1,
void const *pointer2);
278 static int activeListYCompare(
void const *pointer1,
void const *pointer2);
279 static int activeListZCompare(
void const *pointer1,
void const *pointer2);
280 void activeListClean();
281 void primitiveTableBuild();
282 void primitiveTableDestroy();
283 void primitiveTableClear();
284 void primitiveTableReserveSpace();
292 void shapesCollisionTest(
int shapeIndex1,
int shapeIndex2);
314 static void primitiveTableAddTriangleCB (
void *userData,
320 primitiveTableAddTriangle (action, vertex1, vertex2, vertex3); }
321 static void primitiveTableAddLineSegmentCB (
void *userData,
326 primitiveTableAddLineSegment (action, vertex1, vertex2); }
327 static void triangleCollisionTestCB (
void *userData,
333 triangleCollisionTest (action, vertex1, vertex2, vertex3); }
334 static void lineSegmentCollisionTestCB (
void *userData,
339 lineSegmentCollisionTest (action, vertex1, vertex2); }
342 void quickSort(
void *array,
int nElm,
int elmSize,
343 int (*compare)(
void const *,
void const *),
345 void sort(
void *array,
int nElm,
int elmSize,
346 int (*compare)(
void const *,
void const *));
#define FALSE
Possible value of SbBool.
SbBool SoIntersectionFilterCB(void *userData, const SoPath *p1, const SoPath *p2)
#define SO_ACTION_HEADER(className)
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable mutex c...
Class for representing a viewport.
Abstract base class for all actions.
Performs a generic traversal of a scene graph or path.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Class to manage ...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Class to detect ...
void apply(const SoPathList &pathList, SbBool obeysRules=FALSE)
Initiates an action on the graph defined by a list of paths.
static float getIntersectEpsilon()
Queries epsilon (small value) to be used in the collision computation.
void removeIntersectionCallback(SoIntersectionCB *f, void *userData=NULL)
Removes a callback to be called when there is an intersection.
SoIntersectionDetectionAction()
Constructor.
static void setIntersectEpsilon(float epsilon)
Sets epsilon (small value) to be used in the collision computation.
void apply(SoPath *path)
Initiates an action on the graph defined by a path.
@ NEXT_PRIMITIVE
Next primitive.
void apply(SoNode *node)
Initiates an action on the graph defined by a node.
~SoIntersectionDetectionAction()
Destructor.
void setFilterCallback(SoIntersectionFilterCB *newFilterCB, void *data=NULL)
Sets a filter which allow the user to continue or not the intersection finding for a pair of shapes.
Resp SoIntersectionCB(void *userData, const SoIntersectingPrimitive *, const SoIntersectingPrimitive *)
void addIntersectionCallback(SoIntersectionCB *f, void *userData=NULL)
Adds a callback to be called when there is an intersection.
Abstract base class for all database nodes.
Path that points to a list of hierarchical nodes.
Maintains a list of pointers to paths.
Represents a vertex of a generated primitive.
Searches for nodes in a scene graph.
SbVec3f vertex[3]
Vertex of the primitive.
SbVec3f xf_vertex[3]
Transformed vertex of the primitive.
PrimitiveType type
Type of primitive.
PrimitiveType
Primitive type.
@ LINE_SEGMENT
Line segment.
SoPath * path
Path of the shape.