HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WIRE_CollisionItemIterator.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: WIRE_CollisionItemIterator.h
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __WIRE_CollisionItemIterator_h__
12 #define __WIRE_CollisionItemIterator_h__
13 
14 #include "WIRE_API.h"
16 #include <SIM/SIM_Object.h>
17 #include <SIM/SIM_Time.h>
18 #include <UT/UT_IntArray.h>
19 #include <UT/UT_Vector3.h>
20 
21 // class to explore the collision elements for a wire object
23 {
24 public:
25  explicit WIRE_CollisionItemIterator(const SIM_Object &object,
26  const SIM_Time &timestep);
27 
28  bool isValid() const { return myReader.isValid(); }
29 
30  // methods to iterate over the collision elements
31  bool atEnd() const;
32  fpreal getRadius() const;
33  void advance();
34  void rewind();
35 
36  // methods to iterate over the vertices making up the current collision
37  // element being explored
38  bool atEndVertex() const;
39  UT_Vector3 getVertexPosition() const;
40  UT_Vector3 getVertexVelocity() const;
41  void advanceVertex();
42  void rewindVertex();
43 
44  // returns true if the geometry from the i0th and i1th elements reference
45  // a common point
46  bool hasCommonPoint(int i0, int i1) const;
47 
48  // retrieves the primitive and first vertex for a given collision element
49  void getEdge(int i, int &prim, int &vtx) const;
50 
51 private:
52  const WIRE_SimpleDetailReader myReader;
53  SIM_Time myTimestep;
54  UT_IntArray myIdMapping;
55  int myVertexId;
56  int myPrim;
57  int myEdge;
58 };
59 
60 #endif
#define WIRE_API
Definition: WIRE_API.h:10
3D Vector class.
png_uint_32 i
Definition: png.h:2877
double fpreal
Definition: SYS_Types.h:263