/// <summary> /// Reads data that was previously written using <see cref="WriteData"/> /// </summary> /// <param name="editDeserializer">The mechanism for reading back content.</param> /// <param name="isTopological">Are we dealing with a polygon label</param> /// <param name="polPos">The label reference point (usually applies onlt to polygon labels). Null if it's /// identical to the position recorded via the geometry object.</param> /// <param name="geom">The geometry for the text.</param> static void ReadData(EditDeserializer editDeserializer, out bool isTopological, out PointGeometry polPos, out TextGeometry geom) { isTopological = editDeserializer.ReadBool(DataField.Topological); if (editDeserializer.IsNextField(DataField.PolygonX)) { polPos = editDeserializer.ReadPointGeometry(DataField.PolygonX, DataField.PolygonY); } else { polPos = null; } geom = editDeserializer.ReadPersistent <TextGeometry>(DataField.Type); }
/// <summary> /// Reads data that was previously written using <see cref="WriteData"/> /// </summary> /// <param name="editDeserializer">The mechanism for reading back content.</param> /// <param name="font">The text style</param> /// <param name="position">Position of the text's reference point</param> /// <param name="height">The height of the text, in meters on the ground.</param> /// <param name="width">The total width of the text, in meters on the ground.</param> /// <param name="rotation">Clockwise rotation from horizontal</param> static void ReadData(EditDeserializer editDeserializer, out IFont font, out PointGeometry position, out float height, out float width, out IAngle rotation) { if (editDeserializer.IsNextField(DataField.Font)) { int fontId = editDeserializer.ReadInt32(DataField.Font); font = EnvironmentContainer.FindFontById(fontId); } else { font = null; } position = editDeserializer.ReadPointGeometry(DataField.X, DataField.Y); width = (float)editDeserializer.ReadDouble(DataField.Width); height = (float)editDeserializer.ReadDouble(DataField.Height); rotation = editDeserializer.ReadRadians(DataField.Rotation); }