07-24-2016, 09:45 AM
Thanks, Garrett. I'm still puzzled, though. When I run this:
My compiler output shows this:
So each time through the loop, it found a path art with one segment, added a SegmentPoint near the path midpoint (which is where I'd expect given the three intersecting text paths), and confirmed that there were now two segments. 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...
Code:
// Pt is an ArtboardPoint passed to the function
hdi::core::Art::ArtVector vMatches;
vMatches = currDoc->artAtPoint(Pt, hdi::core::SegPointOrInteriorHitRequest);
for(std::vector<hdi::core::Art*>::iterator iter = vMatches.begin(); iter != vMatches.end(); ++iter)
{
hdi::core::HitData pHit(hdi::core::HitData(*iter, Pt, hdi::core::SegPointOrInteriorHitRequest,4.0));
if (!pHit.isEmpty())
{
hdi::core::ArtType typ = pHit.art()->artType();
std::cout<<typ<<std::endl;
std::cout <<"segcount "<<pHit.art()->path()->segCount()<<std::endl;
pHit.art()->path()->insertSegPointAtT(pHit.segIndex(),pHit.tValue());
std::cout<<"seg no "<<pHit.segIndex()<<std::endl;
std::cout<<"seg T "<<pHit.tValue()<<std::endl;
std::cout <<"segcount "<<pHit.art()->path()->segCount()<<std::endl;
}
}
vMatches.clear();
hdi::core::cleanupVector(vMatches);
My compiler output shows this:
Code:
110
segcount 1
seg no 0
seg T 0.500001
segcount 2
110
segcount 1
seg no 0
seg T 0.500002
segcount 2
110
segcount 1
seg no 0
seg T 0.500003
segcount 2
So each time through the loop, it found a path art with one segment, added a SegmentPoint near the path midpoint (which is where I'd expect given the three intersecting text paths), and confirmed that there were now two segments. 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...