Hi, On Wed, 2011-03-23 at 14:54 +0100, Johannes Brunen wrote: > Hello Gerrit, > > sorry, but I have another GraphOp related problem or misunderstanding. > > Attached you will find a simple OpenSG model which does contain 2 cube > geometries. One cube is a copy of the other one. I tried to use the > SharePtrGraphOp on this graph with the parameter set to includes="Geometry". > However, the geometry is not shared. After looking into the code I found the > following lines of code: > > FieldContainer *SharePtrGraphOp::shareFC(FieldContainer *fc) > { > ... > FCSetIt fcsIt = tmIt->second.begin(); > FCSetIt fcsEnd = tmIt->second.end (); > > for(; fcsIt != fcsEnd; ++fcsIt) > { > Time compareStart = getSystemTime(); > > bool compare = compareContainerEqual(*fcsIt, fc, true, true); > <== > > _compareTime += getSystemTime() - compareStart; > > if(compare) > { > if(*fcsIt != fc) > _shareCount[fcTypeId] += 1; > > return *fcsIt; > } > } > } > > The call to compareContainerEqual states that attachments should be ignored > but the compare to identity flag rules the attachment flag out. > > bool compareContainerEqualImpl( > const FieldContainer *lhs, > const FieldContainer *rhs, > FCSet &lhsVisitedSet, > FCSet &rhsVisitedSet, > bool ignoreAttachments, > bool compareIdentity ) > { > ... > if(compareIdentity == true) > { > if(lhsField->equal(rhsField) == false) > returnValue = false; > } > else > { > if(lhsField->isPointerField() == true) > { > returnValue = comparePointerFields( > lhsField, rhsField, > lhsVisitedSet, rhsVisitedSet, > ignoreAttachments, compareIdentity); > } > else > { > if(lhsField->equal(rhsField) == false) > returnValue = false; > } > } > } > > This, however, does prevent sharing of the geometries due to the > DrawableStatsAttachments. > > I need a little additional explanation about this graph op and its proper > application. What is the correct way to share the geometry cores?
The StatsAttachments should not be checked. The problem is it was added much later than the comparison function so this side effect was just missed. I'll have a look at it. kind regards gerrit ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users