ArcGIS Explorer Component Help |
GeometryOperations..::.Rotate Method (Geometry, Double) |
GeometryOperations Class Example See Also |
Returns a new Geometry which is a copy of the input Geometry rotated by the specified angle in radians.
Namespace:
ESRI.ArcGISExplorer.GeometryAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public static Geometry Rotate( Geometry inputGeometry, double rotateAngleRadians ) |
Visual Basic (Declaration) |
---|
Public Shared Function Rotate ( _ inputGeometry As Geometry, _ rotateAngleRadians As Double _ ) As Geometry |
Parameters
- inputGeometry
- Type: ESRI.ArcGISExplorer.Geometry..::.Geometry
The Geometry to copy and rotate.
- rotateAngleRadians
- Type: System..::.Double
The angle, in radians, by which to rotate the geometry.
Return Value
A new Geometry of the same type as the inputGeometry, rotated by the specified angle.Remarks
This method rotates the Geometry around its center; use the Rotate(Geometry, Point, Double) overload to perform the rotation using a different point of origin.
Examples
The code below gets the Note currently selected, and uses the GeometryOperations class to
rotate the Geometry of the Graphic of the Note.
The code assumes you have using statements for the Application, Geometry and Mapping namespaces.
CopyC#
SelectedItemsCollection selItems = ESRI.ArcGISExplorer.Application.Application.SelectedItems; if ((selItems.Count == 1) && (selItems[0] is Note)) { Note selected = selItems[0] as Note; // Rotate the geometry Geometry rotated = GeometryOperations.Rotate(selected.Graphic.Geometry, 90, Unit.Angular.Degrees); // Alternatively, specify rotation in radians, e.g. // Geometry rotated = GeometryOperations.Rotate(selected.Graphic.Geometry, 1.570796); // Update the geometry of the graphic. selected.Graphic.Geometry = rotated; }
CopyVB.NET
Dim selItems As SelectedItemsCollection = ESRI.ArcGISExplorer.Application.Application.SelectedItems If selItems.Count = 1 AndAlso TypeOf selItems(0) Is Note Then Dim selected As Note = selItems(0) Dim rotated As Geometry = GeometryOperations.Rotate(selected.Graphic.Geometry, 90, Unit.Angular.Degrees) ' Alternatively, specify rotation in radians, e.g. ' Dim rotated As Geometry = GeometryOperations.Rotate(selected.Graphic.Geometry, 1.570796) selected.Graphic.Geometry = rotated End If