15 #ifndef __GEO_AdjPolyIterator_h__
16 #define __GEO_AdjPolyIterator_h__
34 virtual bool advance() = 0;
35 void rewind() { myIterationCount = 0; }
44 : myGdp(gdp), myProcess(process_grp), myIterationCount(-1)
45 , myAdjacentPoly(NULL), myNumAdjacentPolys(-1)
63 while( ++myIterationCount < myNumAdjacentPolys )
65 GA_Offset adj_poly_off = myAdjacentPolys(myIterationCount);
67 if( myProcess && !myProcess->containsOffset(adj_poly_off) )
71 myGdp->getPrimitiveList().get(adj_poly_off);
106 while( ++myIterationCount < myNumAdjacentPolys )
109 myAdjacencyData(myIterationCount);
110 GA_Offset adj_poly_off = data.myAdjacentPolygon;
112 if( myProcess && !myProcess->containsOffset(adj_poly_off) )
116 myGdp->getPrimitiveList().get(adj_poly_off);
153 bool myWindingReversed;
158 while( ++myIterationCount < myNumAdjacentPolys )
161 myAdjacencyData(myIterationCount);
162 GA_Offset adj_poly_off = data.myAdjacentPolygon;
164 if( myProcess && !myProcess->containsOffset(adj_poly_off) )
168 myGdp->getPrimitiveList().get(adj_poly_off);
208 virtual void onEndOfConnectedGeometry() = 0;
225 bool winding_reversed) { }
231 bool winding_reversed) { }
274 GA_Offset thing = std::queue<GA_Offset>::front();
275 std::queue<GA_Offset>::pop();
288 virtual void iterateThroughAdjacentPolygons() = 0;
295 void init(
bool insure_poly_only );
306 bool insure_poly_only )
307 : myVisitedPoly(NULL), myGdp(gdp), myVisitor(visitor), myBoss(boss), myProgressCounter(0)
309 myProcess = myGdp->newInternalPrimitiveGroup();
310 myProcess->copyMembership(*process_grp);
311 init( insure_poly_only );
317 : myVisitedPoly(NULL), myGdp(gdp), myVisitor(visitor), myBoss(boss), myProgressCounter(0)
319 myProcess = myGdp->newInternalPrimitiveGroup();
320 myProcess->toggleEntries();
326 myGdp->destroyPrimitiveGroup(myProcess);
327 myGdp->destroyPrimitiveGroup(myDiscoveredPolyGrp);
341 bool insure_poly_only =
false )
363 bool insure_poly_only =
false )
382 #define GEO_FOR_ALL_POLY_ADJ_TO_PT( gdp, pt_offset, adj_poly ) \
383 GEO_PointAdjPolyIterator poly_it( (gdp), (pt_offset) ); \
384 while( poly_it.advance() && (adj_poly = poly_it.getAdjPoly()) )
386 #define GEO_FOR_ALL_GROUP_POLY_ADJ_TO_PT( gdp, grp, pt_offset, adj_poly ) \
387 GEO_PointAdjPolyIterator poly_it( (gdp), (pt_offset), (grp) ); \
388 while( poly_it.advance() && (adj_poly = poly_it.getAdjPoly()) )
391 #define GEO_FOR_ALL_POLY_EDGE_ADJ_TO_POLY( gdp, poly, adj_poly ) \
392 GEO_EdgeAdjPolyIterator poly_it( (gdp), (poly)->getMapOffset() ); \
393 while( poly_it.advance() && (adj_poly = poly_it.getAdjPoly()) )
395 #define GEO_FOR_ALL_GROUP_POLY_EDGE_ADJ_TO_POLY( gdp, grp, poly, adj_poly ) \
396 GEO_EdgeAdjPolyIterator poly_it( (gdp), (poly)->getMapOffset(), (grp) ); \
397 while( poly_it.advance() && (adj_poly = poly_it.getAdjPoly()) )
399 #define GEO_FOR_ALL_POLY_ADJ_TO_POLY( gdp, poly, adj_poly ) \
400 GEO_PolyAdjPolyIterator poly_it( (gdp), (poly)->getMapOffset() ); \
401 while( poly_it.advance() && (adj_poly = poly_it.getAdjPoly()) )
403 #define GEO_FOR_ALL_GROUP_POLY_ADJ_TO_POLY( gdp, grp, poly, adj_poly ) \
404 GEO_PolyAdjPolyIterator poly_it( (gdp), (poly)->getMapOffset(), (grp) ); \
405 while( poly_it.advance() && (adj_poly = poly_it.getAdjPoly()) )
*pool push(my_func, arg1,...)
virtual void onNewlyDiscoveredPoly(GEO_PrimPoly *visited, GEO_PrimPoly *discovered, GA_Offset shared_pt)
GEO_PrimPoly * myAdjacentPoly
GEO_PrimPoly * myVisitedPoly
virtual ~GEO_BFSAdjPolyTraverser()
virtual void onPreviouslyDiscoveredPoly(GEO_PrimPoly *visited, GEO_PrimPoly *discovered, GA_Offset shared_pt)
virtual ~GEO_AdjPolyIterator()
Iteration over a range of elements.
const GA_PrimitiveGroup * myProcess
~GEO_PolyAdjPolyIterator() override
GEO_BFSAdjPolyTraverser(GEO_Detail *gdp, const GA_PrimitiveGroup *process_grp, GEO_BFSTraverserVisitor &visitor, UT_Interrupt *boss, bool insure_poly_only)
void onVisitedPoly(GEO_PrimPoly *visited) override
~GEO_EdgeAdjPolyIterator() override
void onEndOfConnectedGeometry() override
GEO_BFSEdgeAdjPolyTraverser(GEO_Detail *gdp, GEO_BFSTraverserVisitor &visitor, UT_Interrupt *boss=NULL)
exint GA_Size
Defines the bit width for index and offset types in GA.
GEO_PrimPoly * getAdjPoly()
GA_Offset myVisitedOffset
#define GA_INVALID_OFFSET
virtual void onNewlyDiscoveredPoly(GEO_PrimPoly *visited, GEO_PrimPoly *discovered, GA_Offset edge_start_pt, GA_Offset edge_end_pt, bool winding_reversed)
virtual void onPreviouslyDiscoveredPoly(GEO_PrimPoly *visited, GEO_PrimPoly *discovered, GA_Offset edge_start_pt, GA_Offset edge_end_pt, bool winding_reversed)
void onVisitedPoly(GEO_PrimPoly *visited) override
GA_Size getEdgeAdjacentPolygons(GEO_EdgeAdjArray &adjacencies, GA_Offset poly_off) const
GEO_BFSPointAdjPolyTraverser(GEO_Detail *gdp, GEO_BFSTraverserVisitor &visitor, UT_Interrupt *boss)
GEO_BFSEdgeAdjPolyTraverser(GEO_Detail *gdp, const GA_PrimitiveGroup *process_grp, GEO_BFSTraverserVisitor &visitor, UT_Interrupt *boss=NULL, bool insure_poly_only=false)
GEO_PolyAdjPolyIterator(GEO_Detail *gdp, GA_Offset poly_offset, const GA_PrimitiveGroup *process_grp=NULL)
GEO_BFSPointAdjPolyTraverser(GEO_Detail *gdp, const GA_PrimitiveGroup *process_grp, GEO_BFSTraverserVisitor &visitor, UT_Interrupt *boss=NULL, bool insure_poly_only=false)
GA_PrimitiveGroup * myProcess
GLsizei GLsizei GLchar * source
void onEndOfConnectedGeometry() override
GA_Offset myStartEdgePoint
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the queue
GA_Offset getStartEdgePt()
GA_Size getPointAdjacentPolygons(GEO_PointAdjArray &adjacencies, GA_Offset poly_off) const
GEO_BFSTraverserVisitor & myVisitor
void onStartOfConnectedGeometry(GEO_PrimPoly *source) override
GEO_AdjPolyIterator & operator++()
virtual void iterateThroughAdjacentPolygons()=0
GA_Size myNumAdjacentPolys
GEO_AdjPolyIterator(GEO_Detail *gdp, const GA_PrimitiveGroup *process_grp=NULL)
GEO_PointAdjPolyIterator(GEO_Detail *gdp, GA_Offset pt_offset, const GA_PrimitiveGroup *process_grp=NULL)
void enqueue(GA_Offset thing)
void onStartOfConnectedGeometry(GEO_PrimPoly *source) override
virtual ~GEO_BFSTraverserVisitor()
GEO_EdgeAdjPolyIterator(GEO_Detail *gdp, GA_Offset poly_offset, const GA_PrimitiveGroup *process_grp=NULL)
GA_PrimitiveGroup * myDiscoveredPolyGrp
GA_Offset getSharedPoint()
GA_Size getPrimitivesReferencingPoint(GA_OffsetArray &primitives, GA_Offset point_offset) const
GEO_BFSAdjPolyTraverser(GEO_Detail *gdp, GEO_BFSTraverserVisitor &visitor, UT_Interrupt *boss)
~GEO_PointAdjPolyIterator() override