How to set colour to individual points in a OdPrcPointSet object?

  1. FAQ
  2. »
  3. PDF and PRC Questions

It's not possible. In PRC, you need to create separate PointSet objects for this purpose. But you can join them into one PartDefinition:


 ...
    OdPrcPartDefinitionPtr newDefinition = OdPrcPartDefinition::createObject();
    pPrc_FileStructure->addObject(newDefinition);
    ...
   for (int k = 0; k  num_point; ++k)
  {
     OdPrcPointSetPtr pPointSet  = OdPrcPointSet::createObject();
     pPointSet->styleId() = OdPrcCategory1LineStyle::createByColor(getR(k), getG(k), getB(k), *pPrc_FileStructure);
     OdPrcName name;
     name.setName(<point name>);
     pPointSet->name() = name;
     pPointSet->setBehaviourBitField(PRC_GRAPHICS_Show);
     pPrc_FileStructure->addObject(pPointSet);

     pPointSet->point().push_back(OdGePoint3d(X(k), Y(k), Z(k)));
    
     newDefinition->representationItem().push_back(pPointSet->objectId());
  }

  newDefinition->setBehaviourBitField(PRC_GRAPHICS_Show); 
  pPrc_FileStructure->fileStructureTree().partDefinition().push_back(newDefinition->objectId());
  ...