OdPrcObjectIdArray &leaders = newProductOccurrence->markups().leaders();
leaders.resize(arr_leader.size());
for(OdUInt32 f=0;f<arr_leader.size();++f)
{
newStructure.addObject(arr_leader[f]);
leaders[f] = arr_leader[f]->objectId();
}
if (leaders.size() > 0)
{
newStructure.fileStructureTessellation().tessellations().push_back(arr_leader[0]->tessellation());
if (leaders.size() == 2)
{
newStructure.fileStructureTessellation().tessellations().push_back(arr_leader[1]->tessellation());
}
}
OdPrcObjectIdArray &arr = newProductOccurrence->markups().markups();
OdPrcMarkupPtr markup = OdPrcMarkup::createObject();
newStructure.addObject(markup);
OdPrcGraphics graph;
markup->name() = name;
markup->graphics() = graph;
markup->setType(type);
markup->setSubType(subtype);
markup->tessellation() = mTess;
OdPrcObjectId un_id;
if (leaders.size() > 0)
{
un_id = leaders[0];
markup->leader().push_back(un_id);
if (leaders.size() == 2)
{
un_id = leaders[1];
markup->leader().push_back(un_id);
}
}
arr.push_back(markup->objectId());
OdPrcObjectIdArray &arr_entity = newProductOccurrence->markups().annotationEntities();
OdPrcAnnotationItemPtr ann_item = OdPrcAnnotationItem::createObject();
ann_item->name() = name;
ann_item->graphics() = graph;
un_id = markup->objectId();
ann_item->markup() = un_id;
newStructure.addObject(ann_item);
arr_entity.push_back(ann_item->objectId());
newStructure.fileStructureTessellation().tessellations().push_back(mTess);
Creating different types of markups is illustrated in the OdPrcCreate sample application.
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|