01-21-2022, 02:10 PM
This once-reliable code no longer works, no doubt due to the change in auto_pointers, etc.
I get errors in the for statement that I don't understand and can't get past. The docs online and in the download still give an example using an ArtAP with an Art::Iterator.
Is there a preferred format for iterating an ArtVector?
Also, is there a general guideline for when to use a unique_pointer and when to use a shared_pointer as relates to CORE vectors and Art objects? I've been studying them online, but it's a bit complex for me to really grasp.
Code:
hdi::core::Art::ArtVector vMatches;
hdi::core::CurrentDocument::MatchArtSpecVector vSpec;
hdi::core::MatchArtSpec selectedPaths(hdi::core::MatchArtTypePath,
hdi::core::MatchArtAttrSelected,
hdi::core::MatchArtSearchIncludes);
vSpec.push_back(selectedPaths);
vMatches = HDI_CORE_ILLUSTRATOR->currentDocument()->matchingArt(vSpec);
for (std::vector<hdi::core::Art*>::iterator iter = vMatches.begin(); iter != vMatches.end(); ++iter) {
// do something with (*iter), e.g. get (*iter)->artType()
}
hdi::core::cleanupVector(vMatches);
I get errors in the for statement that I don't understand and can't get past. The docs online and in the download still give an example using an ArtAP with an Art::Iterator.
Is there a preferred format for iterating an ArtVector?
Also, is there a general guideline for when to use a unique_pointer and when to use a shared_pointer as relates to CORE vectors and Art objects? I've been studying them online, but it's a bit complex for me to really grasp.