void PDF3DFigurePage_LoadPointLineGeometry::_addToPointCache()
{
  // Get highest type ID from positions
  int highestTypeID = 0;
  std::map<int, int> typeIDMap;

  // Scan all positions and get all type ID from them
  for (XMarkerList::const_iterator it = _outCachedPointPositionsList.cbegin(); it != _outCachedPointPositionsList.cend(); ++it)
  {
    XMarker thisMarker = *it;

    if (thisMarker.type > highestTypeID)
    {
      highestTypeID = thisMarker.type;
    }
  }

  // Add positions 
  for (XMarkerList::const_iterator it = _outPositionsList.cbegin(); it != _outPositionsList.cend(); ++it)
  {
    XMarker inMarker = *it;
    int inMarkerType = inMarker.type;
    int newMarkerType = inMarker.type;

    // Check if type ID must be modified
    if (inMarkerType <= highestTypeID)
    {
      std::map<int, int>::iterator findIt = typeIDMap.find(inMarkerType);

      if (findIt == typeIDMap.end())
      {
        // inMarkerType has not yet been added to map, so add it now
        newMarkerType = highestTypeID + 1;
        typeIDMap[inMarkerType] = newMarkerType;
        highestTypeID++;
      }
      else
      {
        newMarkerType = typeIDMap[inMarkerType];
      }
    }

    XMarker newCachedMarker(Vector6(inMarker.x(), inMarker.y(), inMarker.z(), inMarker.c(), inMarker.t(), inMarker.u()), newMarkerType, inMarker.name());

    _outCachedPointPositionsList.appendItem(newCachedMarker);
  }

  // Deselect items
  _outCachedPointPositionsList.selectItemAt(-1);

  // Notify observers
  _outCachedPointPositionsListFld->touch();
}