Added utility function isGraphicalPrimitive