Arthur~Chiu Posted June 9, 2014 Share Posted June 9, 2014 GA_FOR_ALL_PRIMITIVES(gdp, prim) { if(prim->getTypeId() == GA_PRIMPOLY) { cout<<"is polygon"<<endl; } } i also want to filter closed primitive polygon how to do this ,i find GEO_Face has operation -GEO_Face::isclosed(); can i use it ? Quote Link to comment Share on other sites More sharing options...
malexander Posted June 9, 2014 Share Posted June 9, 2014 A prim that reports GA_PRIMPOLY as its type is a GEO_PrimPoly object, which you can safely cast to a GEO_Face (or GEO_PrimPoly). Then you can call faceprim->isClosed(). 1 Quote Link to comment Share on other sites More sharing options...
Arthur~Chiu Posted June 10, 2014 Author Share Posted June 10, 2014 Posted Today, 02:54 AM A prim that reports GA_PRIMPOLY as its type is a GEO_PrimPoly object, which you can safely cast to a GEO_Face (or GEO_PrimPoly). Then you can call faceprim->isClosed(). how to do this? can you show me the code? thanks Quote Link to comment Share on other sites More sharing options...
malexander Posted June 10, 2014 Share Posted June 10, 2014 GA_FOR_ALL_PRIMITIVES(gdp, prim) { if(prim->getTypeId() == GA_PRIMPOLY) { const GEO_Face *faceprim = static_cast<const GEO_Face *>(prim); if(faceprim->isClosed()) cout<<"is closed polygon"<<endl; else cout<<"is open polygon"<<endl; } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.