Jump to content

Geometry Depth-first Search


Recommended Posts

I've found GEO_AdjPolyIterator but it only has breadth-first search.

 

Are there more graph traversal algorithms in the HDK?

 

not that i know of, but depending on your needs you might want to take a look at bgl (boost graph library) which is included in the hdk

Link to comment
Share on other sites

What are you trying to do? Should be easy enough to have a UT_BitArray for all the visited points and then just walk the geometry edges in a depth first manner.

 

I need to traverse a non-const gdp that contains a mesh and a starting point using DFS.

 

Yes I'm currently using UT_BitArray and GEO_HedgeInterface.

 

For reference what are other ways to walk the geometry? (non-const/const)

 

Ex.

 

- GEO_HedgeInterface (non-const) and GEO_DetachedHedgeInterface (const)

- GEO_AdjPolyIterator (non-const)

- GA_Edge (requires manual population)

 

- gdp->getPointAdjacentPolygons() (const)

- gdp->getPrimitivesReferencingPoint() (const)

- gdp->getEdgeAdjacentPolygons() (const)

Link to comment
Share on other sites

Don't forget that you can also go from point to vertex, vertex to next vertex, and then from vertex to primitive. Once you have a primitive, you can just in turn traverse the vertices to get a the points.

 

Perfect thank you.

 

I couldn't find them at first because I was expecting the name of the method to have a "get".

 

Here are the methods:

 

gdp->vertexPoint()

gdp->vertexPrimitive()

gdp->pointVertex()

gdp->vertexToPrevVertex()

gdp->vertexToNextVertex()

 

gdp->getVertexReferencingPoint()

gdp->getVerticesReferencingPoint()

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...