ZoomConstraint Class Reference

#include <ZoomConstraint.h>

Inherited by PowerOfSqrtTwoZoomConstraint [virtual], and PowerOfTwoZoomConstraint [virtual].

Inheritance diagram for ZoomConstraint:

Inheritance graph
[legend]
List of all members.

Detailed Description

ZoomConstraint is a simple interface that describes a limitation on the available zoom sizes for a view, for example based on cache strategy or a (processing) window-size limitation.

The default ZoomConstraint imposes no actual constraint except for a nominal maximum.

Definition at line 30 of file ZoomConstraint.h.

Public Types

enum  RoundingDirection { RoundDown, RoundUp, RoundNearest }

Public Member Functions

virtual ~ZoomConstraint ()
virtual size_t getNearestBlockSize (size_t requestedBlockSize, RoundingDirection=RoundNearest) const
 Given the "ideal" block size (frames per pixel) for a given zoom level, return the nearest viable block size for this constraint.
virtual size_t getMaxZoomLevel () const
 Return the maximum zoom level within range for this constraint.


Member Enumeration Documentation

enum ZoomConstraint::RoundingDirection

Enumerator:
RoundDown 
RoundUp 
RoundNearest 

Definition at line 35 of file ZoomConstraint.h.


Constructor & Destructor Documentation

virtual ZoomConstraint::~ZoomConstraint (  )  [inline, virtual]

Definition at line 33 of file ZoomConstraint.h.


Member Function Documentation

virtual size_t ZoomConstraint::getNearestBlockSize ( size_t  requestedBlockSize,
RoundingDirection  = RoundNearest 
) const [inline, virtual]

Given the "ideal" block size (frames per pixel) for a given zoom level, return the nearest viable block size for this constraint.

For example, if a block size of 1523 frames per pixel is requested but the underlying model only supports value summaries at powers-of-two block sizes, return 1024 or 2048 depending on the rounding direction supplied.

Reimplemented in PowerOfSqrtTwoZoomConstraint, and PowerOfTwoZoomConstraint.

Definition at line 51 of file ZoomConstraint.h.

References getMaxZoomLevel().

virtual size_t ZoomConstraint::getMaxZoomLevel (  )  const [inline, virtual]

Return the maximum zoom level within range for this constraint.

Definition at line 62 of file ZoomConstraint.h.

Referenced by getNearestBlockSize(), PowerOfTwoZoomConstraint::getNearestBlockSize(), and PowerOfSqrtTwoZoomConstraint::getNearestBlockSize().


The documentation for this class was generated from the following file:
Generated on Wed Feb 20 15:45:37 2008 for SonicVisualiser by  doxygen 1.5.1