00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * 00008 * David Pritchard 00009 * Side Effects Software Inc 00010 * 123 Front Street West, Suite 1401 00011 * Toronto, Ontario 00012 * Canada M5J 2M2 00013 * 416-504-9876 00014 */ 00015 00016 #ifndef __SIM_BVLeafIterator_h__ 00017 #define __SIM_BVLeafIterator_h__ 00018 00019 #include "SIM_API.h" 00020 #include <BV/BV_LeafIterator.h> 00021 #include <UT/UT_DMatrix4.h> 00022 00023 class SIM_TriangulatedGeometry; 00024 00025 /// Iterator for leaves to be enclosed by bounding volume. This iterator 00026 /// fills each leaf with a single primitive. 00027 /// Iterator retrieves info about each leaf: 00028 /// - a set of vertices forming a bounding volume for the leaf 00029 /// - barycenter (centroid) of primitive 00030 class SIM_API SIM_BVLeafIterator : public BV_LeafIterator 00031 { 00032 public: 00033 typedef BV_LeafIterator BaseClass; 00034 00035 explicit SIM_BVLeafIterator(const SIM_TriangulatedGeometry *tgeo, 00036 const UT_DMatrix4 &begxform, 00037 const UT_DMatrix4 &endxform, 00038 bool startPosOnly = false); 00039 explicit SIM_BVLeafIterator(const SIM_TriangulatedGeometry *tgeo, 00040 const UT_DMatrix4 &endxform, 00041 bool startPosOnly = false); 00042 virtual ~SIM_BVLeafIterator(); 00043 00044 protected: 00045 virtual void advanceSubclass(); 00046 virtual void jumpSubclass(int leafId); 00047 virtual bool atEndSubclass() const; 00048 virtual void rewindSubclass(); 00049 virtual int getLeafIdSubclass() const; 00050 00051 virtual UT_Vector3 calcBarycenterSubclass() const; 00052 00053 virtual void advanceVertexSubclass(); 00054 virtual bool atEndVertexSubclass() const; 00055 virtual void rewindVertexSubclass(); 00056 virtual UT_Vector4 getVertexSubclass() const; 00057 00058 virtual void setSkipDupVertsSubclass(bool flag); 00059 00060 00061 private: 00062 const SIM_TriangulatedGeometry *myTgeo; 00063 const UT_DMatrix4 myBegxform, myEndxform; 00064 int myPrim; 00065 int myVertex; 00066 00067 int *myDupArray; 00068 int myDupId; 00069 bool myEndFlag, myStartPosOnly; 00070 }; 00071 00072 #endif
1.5.9