VR-Forces 4.2 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtPixmapPaperMap Class Reference

class DtPixmapPaperMap: More...

Inheritance diagram for DtPixmapPaperMap:
Inheritance graph
[legend]

Public Member Functions

 DtPixmapPaperMap ()
 default constructor.
virtual ~DtPixmapPaperMap ()
 destructor
virtual bool init (const DtFilename &path, DtPaperMapRecord *paperMapRec, const Coordinate_System *coordSys)
 Load the papermap. coordSys is the coordinate system of the terrain database.
virtual const DtPoint & dbSwCorner () const
 Returns the southwest point of the bitmap in database coordinates.
virtual void setDbSwCorner (const DtPoint &)
virtual const DtPoint & dbNeCorner () const
 Returns the northeast point of the bitmap in database coordinates.
virtual void setDbNeCorner (const DtPoint &)
virtual const DtFilename & imageName () const
 Returns the image name this record was loaded with.
virtual double xSize () const
 Returns the width of the bitmap.
virtual double ySize () const
 Returns the height of the bitmap.
virtual void load ()
virtual bool getScaledImage (const Coordinate_System *coordSys, const DtExtent &viewportExtent, const DtDisplaySize &screenSize, DtPoint &bitmapLocation, QImage &image, bool useMask, QColor *backgroundColor=NULL, int *scaledBitmapX=NULL, int *scaledBitmapY=NULL)
 Returns a pointer to the scaled bitmap as a QImage.
virtual bool getBoundingBox (const DtExtent &viewportExtent, DtExtent &paperMapExtent, DtExtent &visibleExtent, DtDisplayPoint &wll, DtDisplayPoint &wur)
 Returns extent information.
virtual bool setCoordinates (const DtPoint &swCorner, const DtPoint &neCorner, const Coordinate_System *coordSys)
 Sets nw and se db coordinates.
virtual const DtString mapType () const
virtual void setImageName (const DtFilename &)
virtual bool loadImage (const DtFilename &imageFile, const Coordinate_System *coordSys)
QImage * image ()
virtual QSize imageSize () const
virtual QSize setImageSize (const QSize &)
 Sets the size of the base image by scaling it (if necessary) and returns the image size that is resultant.
virtual bool hasAlpha () const
virtual void setImageLoadingEnabled (bool)
 Sets whether or not an image is loaded when it needs to be (true).
bool imageLoadingEnabled () const
virtual bool canLoadImage () const
 Returns true if image can be loaded into memory.

Static Public Member Functions

static DtPaperMapcreate ()

Protected Member Functions

 DtPixmapPaperMap (const DtPixmapPaperMap &orig)
 copy constructor
DtPixmapPaperMapoperator= (const DtPixmapPaperMap &rhs)
 assignment operator
DtPoint getDbPoint (const DtPoint &point, const Coordinate_System *coordFrom, const Coordinate_System *coordTo)
 converts metafile coordinates to database coordinates
virtual bool getExtentIntersection (const DtExtent &rect1, const DtExtent &rect2, DtExtent &intersectionRect)
virtual bool getImageSlice (const Coordinate_System *coordSys, const DtExtent &viewportExtent, const DtDisplaySize &screenSize, DtPoint &bitmapLocation, int &scaledBitmapSizeX, int &scaledBitmapSizeY, QImage &image, bool useMask, QColor *backgroundColor)
 Returns a pointer to the slice of the image we need to display.
virtual bool isSupportedTif (const QFileInfo &info) const
 Returns true if the myImage variable is non-null (which will be true if the loaded image had an alpha channel)

Protected Attributes

QImage * myImage
DtPoint myDbSwCorner
DtPoint myDbNeCorner
DtFilename myImageName
QSize myImageSize
bool myImageLoadingEnabled

Detailed Description

class DtPixmapPaperMap:

Instances of this class are individual papermaps, loaded from a file in in some raster format.

Constructor & Destructor Documentation

DtPixmapPaperMap::DtPixmapPaperMap ( )

default constructor.

virtual DtPixmapPaperMap::~DtPixmapPaperMap ( )
virtual

destructor

DtPixmapPaperMap::DtPixmapPaperMap ( const DtPixmapPaperMap orig)
protected

copy constructor

Member Function Documentation

virtual bool DtPixmapPaperMap::init ( const DtFilename &  path,
DtPaperMapRecord *  paperMapRec,
const Coordinate_System *  coordSys 
)
virtual

Load the papermap. coordSys is the coordinate system of the terrain database.

Reimplemented in DtMultiResPaperMap.

virtual const DtPoint& DtPixmapPaperMap::dbSwCorner ( ) const
virtual

Returns the southwest point of the bitmap in database coordinates.

virtual void DtPixmapPaperMap::setDbSwCorner ( const DtPoint &  )
virtual
virtual const DtPoint& DtPixmapPaperMap::dbNeCorner ( ) const
virtual

Returns the northeast point of the bitmap in database coordinates.

virtual void DtPixmapPaperMap::setDbNeCorner ( const DtPoint &  )
virtual
virtual const DtFilename& DtPixmapPaperMap::imageName ( ) const
virtual

Returns the image name this record was loaded with.

virtual double DtPixmapPaperMap::xSize ( ) const
virtual

Returns the width of the bitmap.

virtual double DtPixmapPaperMap::ySize ( ) const
virtual

Returns the height of the bitmap.

virtual void DtPixmapPaperMap::load ( )
virtual
virtual bool DtPixmapPaperMap::getScaledImage ( const Coordinate_System *  coordSys,
const DtExtent &  viewportExtent,
const DtDisplaySize screenSize,
DtPoint &  bitmapLocation,
QImage &  image,
bool  useMask,
QColor *  backgroundColor = NULL,
int *  scaledBitmapX = NULL,
int *  scaledBitmapY = NULL 
)
virtual

Returns a pointer to the scaled bitmap as a QImage.

Note the image is returned in an unscaled for. The scaledBitmapX and scaledBitmapY are the width and height the image should be. It is not scaled to try and improve performance.

virtual bool DtPixmapPaperMap::getBoundingBox ( const DtExtent &  viewportExtent,
DtExtent &  paperMapExtent,
DtExtent &  visibleExtent,
DtDisplayPoint wll,
DtDisplayPoint wur 
)
virtual

Returns extent information.

virtual bool DtPixmapPaperMap::setCoordinates ( const DtPoint &  swCorner,
const DtPoint &  neCorner,
const Coordinate_System *  coordSys 
)
virtual

Sets nw and se db coordinates.

virtual const DtString DtPixmapPaperMap::mapType ( ) const
virtual

Reimplemented in DtMultiResPaperMap.

static DtPaperMap* DtPixmapPaperMap::create ( )
static

Reimplemented in DtMultiResPaperMap.

virtual void DtPixmapPaperMap::setImageName ( const DtFilename &  )
virtual
virtual bool DtPixmapPaperMap::loadImage ( const DtFilename &  imageFile,
const Coordinate_System *  coordSys 
)
virtual

Reimplemented in DtMultiResPaperMap.

QImage* DtPixmapPaperMap::image ( )
inline
virtual QSize DtPixmapPaperMap::imageSize ( ) const
virtual
virtual QSize DtPixmapPaperMap::setImageSize ( const QSize &  )
virtual

Sets the size of the base image by scaling it (if necessary) and returns the image size that is resultant.

bool DtPixmapPaperMap::hasAlpha ( ) const
inlinevirtual

Reimplemented in DtMultiResPaperMap.

References myImage.

virtual void DtPixmapPaperMap::setImageLoadingEnabled ( bool  )
virtual

Sets whether or not an image is loaded when it needs to be (true).

If set to false and an image is loaded, will unload image. If set to true and no image is loaded, will load image

bool DtPixmapPaperMap::imageLoadingEnabled ( ) const
inline

References myImageLoadingEnabled.

virtual bool DtPixmapPaperMap::canLoadImage ( ) const
virtual

Returns true if image can be loaded into memory.

Reimplemented in DtMultiResPaperMap.

DtPixmapPaperMap& DtPixmapPaperMap::operator= ( const DtPixmapPaperMap rhs)
protected

assignment operator

DtPoint DtPixmapPaperMap::getDbPoint ( const DtPoint &  point,
const Coordinate_System *  coordFrom,
const Coordinate_System *  coordTo 
)
protected

converts metafile coordinates to database coordinates

virtual bool DtPixmapPaperMap::getExtentIntersection ( const DtExtent &  rect1,
const DtExtent &  rect2,
DtExtent &  intersectionRect 
)
protectedvirtual

Reimplemented in DtMultiResPaperMap.

virtual bool DtPixmapPaperMap::getImageSlice ( const Coordinate_System *  coordSys,
const DtExtent &  viewportExtent,
const DtDisplaySize screenSize,
DtPoint &  bitmapLocation,
int &  scaledBitmapSizeX,
int &  scaledBitmapSizeY,
QImage &  image,
bool  useMask,
QColor *  backgroundColor 
)
protectedvirtual

Returns a pointer to the slice of the image we need to display.

Reimplemented in DtMultiResPaperMap.

virtual bool DtPixmapPaperMap::isSupportedTif ( const QFileInfo &  info) const
protectedvirtual

Returns true if the myImage variable is non-null (which will be true if the loaded image had an alpha channel)

Member Data Documentation

QImage* DtPixmapPaperMap::myImage
protected

Referenced by hasAlpha().

DtPoint DtPixmapPaperMap::myDbSwCorner
protected
DtPoint DtPixmapPaperMap::myDbNeCorner
protected
DtFilename DtPixmapPaperMap::myImageName
protected
QSize DtPixmapPaperMap::myImageSize
protected
bool DtPixmapPaperMap::myImageLoadingEnabled
protected

Referenced by imageLoadingEnabled().


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

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)