private void SaveRotation(IMuteMap map) { var layer = map.GetLayer(CurrentObject.LayerHandle); var fs = layer.FeatureSet; var feature = fs.Features[CurrentObject.ObjectIndex]; if (feature == null) { return; } CurrentObject.SaveRotationField(layer); }
private void RotateSymbol(IMuteMap map, double dx, double dy, bool snapToFeatures = false, bool snapToAxes = false) { var layer = map.GetLayer(CurrentObject.LayerHandle); var fs = layer.FeatureSet; var feature = fs.Features[CurrentObject.ObjectIndex]; if (feature == null) { return; } var projCoordinate = _context.Map.PixelToProj(new Coordinate(dx, dy)); CurrentObject.UpdateRotationField(layer, projCoordinate.X, projCoordinate.Y, snapToFeatures, snapToAxes); map.Redraw(); }
/// <summary> /// Rotates the current symbol /// </summary> private void RotateSymbol(IMuteMap map, double dx, double dy, bool snapToFeatures = false, bool snapToAxes = false) { var layer = map.GetLayer(_currentObject.LayerHandle); var fs = layer.FeatureSet; var feature = fs.Features[_currentObject.ObjectIndex]; if (feature == null) { return; } // Check if the featureset has setup offset x or y fields & store the new offset if so if (_currentObject.HasBackingRotationField) { _currentObject.UpdateRotationField(layer, dx, dy, snapToFeatures, snapToAxes); } map.Redraw(); }
/// <summary> /// Moves the current label /// </summary> private void MoveLabel(IMuteMap map, double dx, double dy) { var layer = map.GetLayer(_currentObject.LayerHandle); var fs = layer.FeatureSet; var label = fs.Labels.Items[_currentObject.ObjectIndex, _currentObject.PartIndex]; if (label == null) { return; } // Check if the featureset has setup offset x or y fields & store the new offset if so if (_currentObject is ObjectTranslateData translateData && translateData.HasBackingOffsetFields) { // We add the existing offset to the new offset & store it in the tabe of the shapefile dx += label.OffsetX; dy += label.OffsetY; translateData.UpdateOffsetFields(layer, dx, dy); }