LTINavigator Class Reference

provides LTIScene movement control More...

#include <lti_navigator.h>

Inheritance diagram for LTINavigator:

Inheritance graph
[legend]
Collaboration diagram for LTINavigator:

Collaboration graph
[legend]

List of all members.

Public Types

enum  Style { STYLE_LAX = 1, STYLE_STRICT = 2, STYLE_CLIP = 3 }
 Styles for scene-setting operations. More...

Public Member Functions

 LTINavigator (const LTIImage &image)
 default constructor
 LTINavigator (const LTIImage &image, const LTIScene &scene)
 constructor
 ~LTINavigator ()
 destructor
const LTIImagegetImage () const
 Returns the image the navigator is attached to.
bool isSceneValid () const
 is current scene is legal for the image
LT_STATUS moveBy (double xDelta, double yDelta, Style style)
 move by specified amount
LT_STATUS moveTo (double x, double y, Style style)
 move to specified amount
LT_STATUS zoomBy (double delta, Style style)
 zoom by specified amount
LT_STATUS zoomTo (double mag, Style style)
 zoom to specified scale
LT_STATUS bestFit (double maxWidth, double maxHeight, LTIScene &newScene)
 return scene large enough to fit window
void roundScene ()
 round scene to integral values
bool clipToImage ()
 clip scene to fit image
bool clipToScene (const LTIScene &scene)
 clip scene to fit given scene
LT_STATUS setScene (const LTIScene &scene, Style style)
 reset scene
LT_STATUS setSceneToIcon ()
 set scene to "icon"
LT_STATUS setSceneToFull ()
 set scene to full image
const LTIScenegetScene () const
 get current scene
LTIGeoCoord getGeoCoord () const
 returns the geographic coordinates of scene
Functions to set scene explicitly
LT_STATUS setSceneAsULWH (double upperLeftX, double upperLeftY, double width, double height, double magnification)
 set scene to given position
LT_STATUS setSceneAsULLR (double upperLeftX, double upperLeftY, double lowerRightX, double lowerRightY, double magnification)
 set scene to given position
LT_STATUS setSceneAsCWH (double centerX, double centerY, double width, double height, double magnification)
 sets scene to the given position
Functions to set scene explicitly, using geographic coordinates
LT_STATUS setSceneAsGeoULWH (double upperLeftX, double upperLeftY, double width, double height, double magnification)
 set scene to given position
LT_STATUS setSceneAsGeoULLR (double upperLeftX, double upperLeftY, double lowerRightX, double lowerRightY, double magnification)
 set scene to given position
LT_STATUS setSceneAsGeoCWH (double centerX, double centerY, double width, double height, double magnification)
 set scene to given position

Protected Attributes

const LTIImagem_image


Detailed Description

Class for navigating around an image. This class extends LTIScene by adding functions for moving the scene, resizing, zooming, etc.
Examples:

GeoScene.cpp.

Definition at line 30 of file lti_navigator.h.


Member Enumeration Documentation

These constants are used to define how to treat out-of-bounds conditions for scene-setting operations, i.e. when a calculated scene or magnification is not valid for our image.

Enumerator:
STYLE_LAX  if invalid scene, return success anyway
STYLE_STRICT  if invalid scene, return an error code
STYLE_CLIP  if invalid scene, clip scene to image and return success

Definition at line 39 of file lti_navigator.h.


Constructor & Destructor Documentation

LTINavigator::LTINavigator ( const LTIImage image  ) 

This constructor creates an LTINavigator whose scene corresponds to the entire given image at magnification 1.0.

Parameters:
image the image to be navigated within

LTINavigator::LTINavigator ( const LTIImage image,
const LTIScene scene 
)

This constructor creates an LTINavigator with the given scene.

Parameters:
image the image to be navigated within
scene the initial scene

LTINavigator::~LTINavigator (  ) 


Member Function Documentation

const LTIImage& LTINavigator::getImage (  )  const

Returns:
the navigator's image

bool LTINavigator::isSceneValid (  )  const

Returns true if the current scene is legal for the image. If any part of the scene is outside the boundaries of the image or if the magnification is not supported by the image, false will be returned.

Returns:
the navigator's image

LT_STATUS LTINavigator::moveBy ( double  xDelta,
double  yDelta,
Style  style 
)

Modifies the current scene by moving by the specified amount. (See also moveTo().)

Parameters:
xDelta the number of pixels to move horizontally
yDelta the number of pixels to move vertically
style how to handle boundary conditions
Returns:
status code indicating success or failure

LT_STATUS LTINavigator::moveTo ( double  x,
double  y,
Style  style 
)

Modifies the current scene by moving to the specified (x,y) position. (See also moveBy().)

Parameters:
x the x-position to move to
y the y-position to move to
style how to handle boundary conditions
Returns:
status code indicating success or failure

LT_STATUS LTINavigator::zoomBy ( double  delta,
Style  style 
)

Modifies the current scene by zooming by the specified scale factor. (See also zoomTo().) The other scene parameters (x, y, width, height) are unaffected, unless the style parameter is used.

For example, a call zoomBy(2.0) will double the magnification.

Parameters:
delta the zoom factor
style how to handle boundary conditions
Returns:
status code indicating success or failure

LT_STATUS LTINavigator::zoomTo ( double  mag,
Style  style 
)

Modifies the current scene by zooming to the specified scale. (See also zoomBy().) The other scene parameters (x, y, width, height) are unaffected, unless the style parameter is used.

For example, a call zoomBy(2.0) will double the magnification.

Parameters:
mag the magnification to change to
style how to handle boundary conditions
Returns:
status code indicating success or failure

LT_STATUS LTINavigator::bestFit ( double  maxWidth,
double  maxHeight,
LTIScene newScene 
)

Returns a scene which fits the image to the given size. The scene will be the largest such that the entire image fits completely within the specified dimensions. A failure code will be returned if the request cannot be honored.

Note:
This function does NOT stretch, upsample, or downsample the image; it will only determine the best fit within the bounds of the resolutions that the image supports, e.g. power-of-two.
Parameters:
maxWidth the maximum width of the scene to return
maxHeight the maximum height of the scene to return
newScene the scene which fits the request
Returns:
status code indicating success or failure

void LTINavigator::roundScene (  ) 

Modifies the current scene by performing proper integral rounding on the (x,y) position and the dimensions.

bool LTINavigator::clipToImage (  ) 

This function clips the current scene to the boundaries of the image at the current magnification.

Returns:
true if the resulting scene contains any part of the image

bool LTINavigator::clipToScene ( const LTIScene scene  ) 

This function clips the current scene to the boundaries of the given scene.

Returns:
true if the resulting scene contains any part of the image

LT_STATUS LTINavigator::setScene ( const LTIScene scene,
Style  style 
)

This function manually resets the navigator scene to the given scene.

Parameters:
scene the new scene
style boundary condition mode
Returns:
status code indicating success or failure

LT_STATUS LTINavigator::setSceneToIcon (  ) 

This function sets the navigator scene to the icon (the smallest magnification this image can be represented at).

Returns:
status code indicating success or failure

LT_STATUS LTINavigator::setSceneToFull (  ) 

This function sets the navigator scene to the entire image at full resolution.

Returns:
status code indicating success or failure

const LTIScene& LTINavigator::getScene (  )  const

This function returns the current navigator scene, e.g. to be used in a call to LTIImageStage::read().

Note the returned object is volatile; caller should use copy ctor as needed.

Returns:
the navigator scene

LTIGeoCoord LTINavigator::getGeoCoord (  )  const

Returns the geographic coordinates of the current scene.

Returns:
the geo coordinates

LT_STATUS LTINavigator::setSceneAsULWH ( double  upperLeftX,
double  upperLeftY,
double  width,
double  height,
double  magnification 
)

Sets the scene to the given position. The position is specified using upper-left/width-height values.

Parameters:
upperLeftX the upper-left x-position of the new scene
upperLeftY the upper-left y-position of the new scene
width the width of the new scene
height the height of the new scene
magnification the magnification of the new scene
Returns:
status code indicating success or failure

LT_STATUS LTINavigator::setSceneAsULLR ( double  upperLeftX,
double  upperLeftY,
double  lowerRightX,
double  lowerRightY,
double  magnification 
)

Sets the scene to the given position. The position is specified using upper-left/lower-right values.

Parameters:
upperLeftX the upper-left x-position of the new scene
upperLeftY the upper-left y-position of the new scene
lowerRightX the lower-right x-position of the new scene
lowerRightY the lower-right y-position of the new scene
magnification the magnification of the new scene
Returns:
status code indicating success or failure

LT_STATUS LTINavigator::setSceneAsCWH ( double  centerX,
double  centerY,
double  width,
double  height,
double  magnification 
)

Sets the scene to the given position. The position is specified using center/width-height values.

Parameters:
centerX the center x-position of the new scene
centerY the center y-position of the new scene
width the width of the new scene
height the height of the new scene
magnification the magnification of the new scene
Returns:
status code indicating success or failure

LT_STATUS LTINavigator::setSceneAsGeoULWH ( double  upperLeftX,
double  upperLeftY,
double  width,
double  height,
double  magnification 
)

Sets the scene to the given position. The position is specified using upper-left/width-height values. The values are in "geo" space, i.e. that of the LTIGeoCoord space.

Parameters:
upperLeftX the upper-left x-position of the new scene
upperLeftY the upper-left y-position of the new scene
width the width of the new scene
height the height of the new scene
magnification the magnification of the new scene
Returns:
status code indicating success or failure

LT_STATUS LTINavigator::setSceneAsGeoULLR ( double  upperLeftX,
double  upperLeftY,
double  lowerRightX,
double  lowerRightY,
double  magnification 
)

Sets the scene to the given position. The position is specified using upper-left/lower-right values. The values are in "geo" space, i.e. that of the LTIGeoCoord space.

Parameters:
upperLeftX the upper-left x-position of the new scene
upperLeftY the upper-left y-position of the new scene
lowerRightX the lower-right x-position of the new scene
lowerRightY the lower-right y-position of the new scene
magnification the magnification of the new scene
Returns:
status code indicating success or failure

LT_STATUS LTINavigator::setSceneAsGeoCWH ( double  centerX,
double  centerY,
double  width,
double  height,
double  magnification 
)

Sets the scene to the given position. The position is specified using center/width-height values. The values are in "geo" space, i.e. that of the LTIGeoCoord space.

Parameters:
centerX the center x-position of the new scene
centerY the center y-position of the new scene
width the width of the new scene
height the height of the new scene
magnification the magnification of the new scene
Returns:
status code indicating success or failure


Member Data Documentation

const LTIImage& LTINavigator::m_image [protected]

Definition at line 369 of file lti_navigator.h.


The documentation for this class was generated from the following file:

LizardTech