07-24-2016, 11:46 AM
(07-24-2016, 09:45 AM)Rick Johnson Wrote:Code:hdi::core::HitData pHit(hdi::core::HitData(*iter, Pt, hdi::core::SegPointOrInteriorHitRequest,4.0));
There is no need to create a HitData object and then create a copy of it with the copy constructor. Simply do this instead:
Code:
hdi::core::HitData pHit(*iter, Pt, hdi::core::SegPointOrInteriorHitRequest,4.0);
(07-24-2016, 09:45 AM)Rick Johnson Wrote:Code:if (!pHit.isEmpty())
As the documentation states, all this does is check whether the HitData object refers to any actual hit data, rather than referring to nothing (which would happen if you constructed a HitData object with the default constructor). Any CORE class which has a "isEmpty()" method behaves like this.
If you want to check whether the HitData object recorded an actual hit, you must use the hdi::core::HitData::hit() method.
(07-24-2016, 09:45 AM)Rick Johnson Wrote:Code:vMatches.clear();
hdi::core::cleanupVector(vMatches);
If you clear the vector before calling "hdi::core::cleanupVector()" then the vector is already emptied, so the function will not help in any way (i.e. you will still leak the memory for the Art objects). Simply call "hdi::core::cleanupVector()" on its own instead.
(07-24-2016, 09:45 AM)Rick Johnson Wrote: Going back to my AI document, nothing has changed. What art did I manipulate? Does the vector contain pointers to existing art or does it create duplicates? Gee, I'm really missing AI's debug screen right now...
You manipulated the real art. In what type of event did you perform this action? Remember that CORE automatically handles all the strange undo operations the SDK requires during mouse drag events, so no changes will stick unless you additionally perform them in a mouse up event (where no undo operations take place). If I had to take a shot in the dark, I would guess this is your problem.