|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDisplayTransformation
Provides access to members that control Display Transformation.
Obtain an IDisplayTransformation reference to the DisplayTransformation object from IDisplay::DisplayTransformation. Because IScreenDisplay inherits from IDisplay, you can also use IScreenDisplay::DisplayTransformation.
Each DisplayTransformation manages a coordinate system object such as a GeographicCoordinateSystem or ProjectedCoordinateSystem. Obtain a reference to the display's coordinate system object using IDisplayTransformation::SpatialReference.
The DisplayTransformation of a PageLayout object does not have a spatial reference and translates between device units and page units.
Use IDisplayTransformation for converting coordinates between real-world and device space and back. To prepare a transform for use, follow these steps:
The transform is based on the ratio between the VisibleBounds and the DeviceFrame. Normally the DeviceFrame is simply the full extent of the device with the origin equal to 0,0.
The transform object calculates the FittedBounds automatically and this is the visible map extent adjusted to fit the device.
Method Summary | |
---|---|
void |
fromMapPoint(IPoint mapPoint,
int[] x,
int[] y)
Calculates device coordinates corresponding to the map point. |
double |
fromPoints(double pointDistance)
Calculates a map distance corresponding to a point (1/72) distance. |
IEnvelope |
getBounds()
Full extent in world coordinates. |
IEnvelope |
getConstrainedBounds()
Intersection of Bounds and VisibleBounds. |
tagRECT |
getDeviceFrame()
Visible extent in device coordinates. |
IEnvelope |
getFittedBounds()
Device frame in world coordinates. |
double |
getReferenceScale()
Reference scale for computing scaled symbol sizes. |
double |
getResolution()
Resolution of the device in dots (pixels) per inch. |
double |
getRotation()
Rotation angle in degrees. |
double |
getScaleRatio()
Scale between FittedBounds and DeviceFrame. |
ISpatialReference |
getSpatialReference()
Current spatial reference. |
int |
getUnits()
Units used by world coordinates. |
IEnvelope |
getVisibleBounds()
Visible extent in world coordinates. |
boolean |
isSuppressEvents()
Indicates if transformation object suppresses events. |
boolean |
isZoomResolution()
Indicates if resolution is tied to visible bounds. |
void |
setBounds(IEnvelope bounds)
Full extent in world coordinates. |
void |
setDeviceFrame(tagRECT bounds)
Visible extent in device coordinates. |
void |
setReferenceScale(double scale)
Reference scale for computing scaled symbol sizes. |
void |
setResolution(double pDpi)
Resolution of the device in dots (pixels) per inch. |
void |
setRotation(double degrees)
Rotation angle in degrees. |
void |
setScaleRatio(double scale)
Scale between FittedBounds and DeviceFrame. |
void |
setSpatialReferenceByRef(ISpatialReference spatialReference)
Current spatial reference. |
void |
setSuppressEvents(boolean suppressEvents)
Indicates if transformation object suppresses events. |
void |
setUnits(int unitsCode)
Units used by world coordinates. |
void |
setVisibleBounds(IEnvelope bounds)
Visible extent in world coordinates. |
void |
setZoomResolution(boolean flag)
Indicates if resolution is tied to visible bounds. |
IPoint |
toMapPoint(int x,
int y)
Calculates a point in map coordinates corresponding to the device point. |
double |
toPoints(double mapDistance)
Calculates a distance in points (1/72 inch) corresponding to the map distance. |
void |
transformCoords(_WKSPoint mapPoints,
tagPOINT devPoints,
int numPoints,
int options)
Transforms a set of points or measurements from device to world space or vice versa. |
void |
transformRect(IEnvelope mapRect,
tagRECT[] devRect,
int options)
Transforms a rectangle from device to world space or vice versa. |
Methods inherited from interface com.esri.arcgis.geometry.ITransformation |
---|
transformMeasuresFF, transformMeasuresFI, transformMeasuresIF, transformMeasuresII, transformPointsFF, transformPointsFI, transformPointsIF, transformPointsII |
Method Detail |
---|
void setBounds(IEnvelope bounds) throws IOException, AutomationException
bounds
- A reference to a com.esri.arcgis.geometry.IEnvelope (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplayTransformation.getBounds()
,
IDisplayTransformation
,
IActiveView.getFullExtent()
IEnvelope getBounds() throws IOException, AutomationException
The Bounds property controls the full extent of the display. IActiveView::FullExtent really stores its full extent here and it has two uses for this property. In data view, IActiveView calculates the full extent of all the layers and automatically recalculates it whenever the spatial reference changes and when layers are added or removed from the Map. In layout view, IActiveView stores in FullExtent, the page size (expanded some) and it recalculates this property whenever the page size changes.
Setting the Bounds also sets the VisibleBounds to the same envelope and fires the ITransformEvents::BoundsUpdated and ITransformEvents::VisibleBoundsUpdated events.
>
//IActiveView.FullExtent relates to IDisplayTransformation.Bounds.MapControl mapControl;IActiveView activeView = mapControl.getActiveView();System.out.println(activeView.getFullExtent().getEnvelope().getXMax());IDisplayTransformation pDisplayTransform = activeView.getScreenDisplay().getDisplayTransformation();System.out.println(pDisplayTransform.getBounds().getXMax());
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplayTransformation.getBounds()
,
IDisplayTransformation
,
IActiveView.getFullExtent()
void setVisibleBounds(IEnvelope bounds) throws IOException, AutomationException
bounds
- A reference to a com.esri.arcgis.geometry.IEnvelope (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IEnvelope getVisibleBounds() throws IOException, AutomationException
VisibleBounds controls the visible extent of the display. By setting this property to different extents, you will get zoom in / zoom out effects. The VisibleBounds must fit within the current Bounds.
IActiveView::Extent really stores its value in this property. In data view, the Extent (VisibleBounds) is modified whenever the spatial reference changes. Also, the Extent is set the first time a layer is added to the Map. In layout view, the Extent is initially set to the page size. In both views, zooming in or out changes the Extent. The Extent is persisted in map documents.
When the VisibleBounds is set, it is always adjusted to match the aspect ratio the DeviceFrame and this is stored as the FittedBounds.
Setting the Visible Bounds also fires the ITransformEvents::BoundsUpdated and ITransformEvents::VisibleBoundsUpdated events to notify any clients that the bounds have changed.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplayTransformation.getVisibleBounds()
,
ITin.getExtent()
,
IActiveView.getExtent()
,
IFeatureClassManage.updateExtent()
,
IFeatureClassManage
,
IDisplayTransformation.getFittedBounds()
IEnvelope getFittedBounds() throws IOException, AutomationException
The VisibleBounds is adjusted to match the aspect ratio of the DeviceFrame. This adjusted rectangle is stored in FittedBounds and VisibleBounds stores the actual rectangle specified by the client. In this way, the FittedBounds is the true visible extent of the display and is a read-only property.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplayTransformation.getVisibleBounds()
,
ITin.getExtent()
,
IActiveView.getExtent()
,
IFeatureClassManage.updateExtent()
,
IFeatureClassManage
,
IDisplayTransformation.getFittedBounds()
IEnvelope getConstrainedBounds() throws IOException, AutomationException
This is usually the same as the FittedBounds unless the display is at full extent and sized so that part of the visible area falls outside of the full extent.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setDeviceFrame(tagRECT bounds) throws IOException, AutomationException
bounds
- A Structure: com.esri.arcgis.system.tagRECT (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.tagRECT getDeviceFrame() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setZoomResolution(boolean flag) throws IOException, AutomationException
flag
- The flag (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isZoomResolution() throws IOException, AutomationException
ZoomResolution is a flag that tells the DisplayTransformation whether or not to automatically adjust the device resolution (pixels per inch) based on the current zoom level. This is useful when you want to define a page display. With this kind of display, graphics are drawn at their actual size, i.e., scale is 1:1. Zooming in really means magnifying the graphics when drawing them to a computer monitor. When a map page is exported or printed, the zoom level is always 100% and the extent is defined by the page. Use ZoomResolution to specify this page-style behavior. With ZoomResolution set to true, the DisplayTransformation monitors the current zoom level. When the display is zoomed to 100%, a higher effective resolution is calculated. This has the effect of automatically magnifying all drawing. The Resolution property always returns the effective resolution. ScaleRatio always returns 1:1.
Note, when ZoomResolution is true, in order to get the physical device resolution, you must temporarily set ZoomResolution to false, get the Resolution, and then restore the ZoomResolution to true.
To find the current zoom percentage, simply divide the effective resolution by the physical resolution and multiply by 100. This is what IPageLayout::ZoomPercent does.
If you don't want graphics to scale as you zoom in, set this flag to false. For example, the Map object sets its DisplayTransformation's ZoomResolution property to false so that the contents of the map are not magnified when you zoom in on them. The PageLayout sets its DisplayTransformaion's ZoomResolution property to true.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplayTransformation
,
IDisplayTransformation.getResolution()
void setResolution(double pDpi) throws IOException, AutomationException
pDpi
- The pDpi (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.double getResolution() throws IOException, AutomationException
In layout view, when the Page is zoomed 1:1, the resolution equals the device resolution. When the Page is zoomed to > 100%, the resolution is set higher so that graphics are magnified.
In data view, the Map object always has its resolution set to that of the display. Graphics are not magnified in this view when you zoom in.
The units are always in pixels per inch.
After setting the resolution, the ITransformEvents::ResolutionUpdated event is fired.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDisplayTransformation
,
IDisplayTransformation.getResolution()
void setRotation(double degrees) throws IOException, AutomationException
degrees
- The degrees (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.double getRotation() throws IOException, AutomationException
This property controls the rotation of the display. The angle of the rotation is measured in degrees and the rotation occurs around the center of the FittedBounds.
TrackRotate automatically sets this property but if you are using RotateStart / RotateStop, you must do so yourself. RotateStop provides the final angle rotation that should be used with this property.
Setting a new rotation automatically fires the ITransformEvents::RotationUpdated event.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IScreenDisplay.rotateTimer()
,
IDisplayTransformation.getRotation()
,
IScreenDisplay.rotateMoveTo(com.esri.arcgis.geometry.IPoint)
,
IScreenDisplay.rotateStop()
,
IScreenDisplay.rotateStart(com.esri.arcgis.geometry.IPoint, com.esri.arcgis.geometry.IPoint)
int getUnits() throws IOException, AutomationException
Units is the type of esriUnits used by the DisplayTransformation. For example, the Map object stores its map units in this property and the units are based on the current coordinate system. See IMap::MapUnits for more details. Also, the PageLayout's Page object stores its units in this property and it uses inches by default. See IPage::Units for more details.
You should not change the units of your Map or Page using this property. Instead, use the related properties mentioned above. Although setting the Map's or Page's Units property will set its DisplayTransform Units property, the reverse is not always true.
Setting the Units property fires the ITransformEvents::UnitsUpdated event.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setUnits(int unitsCode) throws IOException, AutomationException
unitsCode
- A com.esri.arcgis.system.esriUnits constant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.double getScaleRatio() throws IOException, AutomationException
Several objects that manage a DisplayTransformation, such as the Map object, use this property to control the map scale. Map scale is the relationship between the dimensions of features on a map and the geographic objects they represent on the earth, commonly expressed as a fraction or a ratio. A map scale of 1/100,000 or 1:100,000 means that one unit of measure on the map equals 100,000 of the same units on the earth. When you zoom in or out in ArcMap's data view, you are changing this property on the Map's DisplayTransformation .
The Map object has a short-cut (IMap::MapScale) directly to this property on its DisplayTransformation object.
The PageLayout object does not use this property the same way as the Map object. In ArcMap's layout view, zooming in is akin to using a magnifying glass to zoom in on the page where the map is displayed. When you zoom in, you are magnifying what is actually going to print. To get this effect, the PageLayout objects always keeps its ReferenceScale set to zero and its ScaleRatio set to 1:1 (meaning that 1 inch on the screen equals one inch on the printer).
The following java code zooms the focus map to a 1:10,000 scale.
MapControl mapControl;IActiveView pActiveView = mapControl.getActiveView();IDisplayTransformation pDisplayTransform = pActiveView.getScreenDisplay().getDisplayTransformation()pDisplayTransform.setScaleRatio(10000);pActiveView.refresh();
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setScaleRatio(double scale) throws IOException, AutomationException
scale
- The scale (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.double getReferenceScale() throws IOException, AutomationException
All symbols are drawn relative to the scale value set in this property. By default this value is zero. Symbol size is true at the reference scale. When the reference scale is 0, symbols are always drawn at the same size regardless of the map scale (ScaleRatio). For example, if you set your labels to display with 10 pt font, they will appear as 10 pt text at any map scale. When the reference scale is greater than 0, symbols are drawn at a size relative to the map scale. For example, if you set your labels to display with 10 pt font and have a reference scale of 10,000, the labels will appear as 10 pt only at that map scale; as you zoom in, the size of all symbols increases because the size of the symbols is based on the smaller scale.
The Map object has a short-cut (IMap::ReferenceScale) directly to the ReferenceScale property on its DisplayTransformation object.
The PageLayout object does not use ReferenceScale and ScaleRatio the same way as the Map object. In layout view, zooming in is more like a magnifying glass looking at what is going to print. When you zoom in, you only magnify what is actually going to print. To get this effect, the ReferenceScale is always set to zero and the ScaleRatio is always set to 1:1 (i.e., 1 inch on the screen equals one inch on the printer). In data view however, zooming in or out, changes what gets printed - WYSIWYG (What You See Is What You Get).
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setReferenceScale(double scale) throws IOException, AutomationException
scale
- The scale (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setSpatialReferenceByRef(ISpatialReference spatialReference) throws IOException, AutomationException
spatialReference
- A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ISpatialReference getSpatialReference() throws IOException, AutomationException
Use this property to obtain a reference to the transforms coordinate system object.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isSuppressEvents() throws IOException, AutomationException
SuppressEvents on IDisplayTransformation prevents events collected under ITransformEvents from being fired.
For example, IScreenDisplay::StartDrawing sets SuppressEvents to TRUE and FinishDrawing sets it back to FALSE, this prevents all transform events from firing during the drawing.
SuppressEvents is set to FALSE by default.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setSuppressEvents(boolean suppressEvents) throws IOException, AutomationException
suppressEvents
- The suppressEvents (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void transformRect(IEnvelope mapRect, tagRECT[] devRect, int options) throws IOException, AutomationException
TransformRect converts a rectangle from map units to device units or vice versa. Multiple options can be entered to control the direction of the transformation etc by added the values of constants from esriDisplayTransformationEnum. The values in esriDisplayTransformationEnum define the accepted values that can be used in the transformation.
mapRect
- A reference to a com.esri.arcgis.geometry.IEnvelope (in)devRect
- A Structure: com.esri.arcgis.system.tagRECT (in/out: use single element array)options
- The options (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void transformCoords(_WKSPoint mapPoints, tagPOINT devPoints, int numPoints, int options) throws IOException, AutomationException
TransformCoords converts an array of points from map units to device units or vice versa. The TRANSFORM_TOMAP and TRANSFORM_TODEVICE flags control the direction of the transformation. The TRANSFORM_SIZE and TRANSFORM_POSITION flags specify whether the points are coordinates or sizes.
mapPoints
- A Structure: com.esri.arcgis.system._WKSPoint (A com.esri.arcgis.system._WKSPoint COM typedef) (in)devPoints
- A Structure: com.esri.arcgis.display.tagPOINT (in)numPoints
- The numPoints (in)options
- The options (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IPoint toMapPoint(int x, int y) throws IOException, AutomationException
ToMapPoint converts an (X,Y) location in device coordinates to real world coordinates (either map units or page units if working with ArcMap's PageLayout ).
x
- The x (in)y
- The y (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void fromMapPoint(IPoint mapPoint, int[] x, int[] y) throws IOException, AutomationException
FromMapPoint converts a point in map units to device coordinates.
mapPoint
- A reference to a com.esri.arcgis.geometry.IPoint (in)x
- The x (out: use single element array)y
- The y (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.double toPoints(double mapDistance) throws IOException, AutomationException
Converts the specified map distance into point distance (1/72 inch).
mapDistance
- The mapDistance (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.double fromPoints(double pointDistance) throws IOException, AutomationException
Converts the point distance into map distance.
pointDistance
- The pointDistance (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |