I have the following code which currently works in H12.0 but not for H12.5.
The return value from gaptid.get() has some large integer value in H12.5 not corresponding to any of the enum resulting in nothing matches in the case statement.
It may be that I have done it wrong since 12.0 but just happened to work.
I did a simplified test of not housing the GU_Detail pointer in a vector and it works so I am wondering if there are some smart pointer / copy constructor magic that I failed to understand.
typedef std::vector<GU_Detail *> GDPContainer;
template <typename F, typename I>
bool GUDetailVisitor<F,I>::visit()
{
GDPContainer::const_iterator gEI = _gdpContainer.end();
GDPContainer::const_iterator gIter = _gdpContainer.begin();
std::cerr << “GUDetailVisitor::visit _gdpContainer.size() = ” << _gdpContainer.size() << std::endl;
size_t numGDP = _gdpContainer.size();
size_t gdpIndex = 0;
for (;gIter!=gEI;++gIter,gdpIndex++)
{
VisitationMode vm = VM_ACCUMULATE;
if (gdpIndex == (numGDP-1))
vm = VM_EMIT;
bool processStatus = false;
bool encountered_GA_PRIMPOLY = false;
bool encountered_GA_PRIMNURBCURVE = false;
bool treatAsFur_GA_PRIMNURBCURVE = true;
const GEO_Primitive *gprim;
GU_Detail *gdp = *gIter;
GA_FOR_ALL_PRIMITIVES(gdp, gprim)
{
GA_PrimitiveTypeId gaptid = gprim->getTypeId();
switch(gaptid.get()) {
case GA_PRIMPOLY:
if (!encountered_GA_PRIMPOLY)
{
std::cerr << “New visitor encountered GA_PRIMPOLY” << std::endl;
encountered_GA_PRIMPOLY = true;
const GEO_PrimPoly* prim = dynamic_cast<const GEO_PrimPoly*>(gprim);
processStatus = processPrimPoly(prim,gdp,vm);
}
else
continue;
break;
GU_Detail object is created this way
_gdpContainer = new GU_Detail();
if (_gdpContainer)
{
std::cerr << “GUDetailVisitor constructor loading \”" << filenames.c_str() << “\”"<< std::endl;
_gdpContainer->load(is);
Houdini 12.5.487 OS X output
numfiles = 1
GUDetailVisitor constructor loading “/Users/nicholas/sphere.bgeo”
GUDetailVisitor constructor min = -0.984808 -1 -0.936608
GUDetailVisitor constructor max = 0.984808 1 0.936608
GUDetailVisitor constructor gaptid.get() = 167798304
GUDetailVisitor constructor gaptid.get() = 167798304
Houdini 12.0.888 OS X output
numfiles = 1
GUDetailVisitor constructor loading “/Users/nicholas/sphere.bgeo”
GUDetailVisitor constructor min = -0.984808 -1 -0.936608
GUDetailVisitor constructor max = 0.984808 1 0.936608
GUDetailVisitor constructor gaptid.get() = 1
GUDetailVisitor constructor gaptid.get() = 1
Cheers