VR-Forces 4.1 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
DtMultiResPaperMap Class Reference

class DtMultiResPaperMap: More...

Inheritance diagram for DtMultiResPaperMap:
Inheritance graph
[legend]

Public Member Functions

 DtMultiResPaperMap ()
 default constructor.
virtual ~DtMultiResPaperMap ()
 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 bool loadImage (const DtFilename &imageFile, const Coordinate_System *coordSys)
virtual const DtString mapType () const
const DtFilename & mtlFilename () const
void setCacheImages (bool)
bool cacheImages () const
virtual void setMapFolder (const DtFilename &folder)
virtual const DtFilename & mapFolder () const
virtual bool hasAlpha () const
virtual bool canLoadImage () const
 Returns true if image can be loaded into memory.
- Public Member Functions inherited from DtPixmapPaperMap
 DtPixmapPaperMap ()
 default constructor.
virtual ~DtPixmapPaperMap ()
 destructor
virtual const DtPointdbSwCorner () const
 Returns the southwest point of the bitmap in database coordinates.
virtual void setDbSwCorner (const DtPoint &)
virtual const DtPointdbNeCorner () 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 void setImageName (const DtFilename &)
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 void setImageLoadingEnabled (bool)
 Sets whether or not an image is loaded when it needs to be (true).
bool imageLoadingEnabled () const
- Public Member Functions inherited from DtPaperMap
 DtPaperMap ()
virtual ~DtPaperMap ()
virtual const DtStringname (void) const
virtual void setName (const DtString &name)
virtual void setShow (bool b)
virtual bool show (void)
virtual DtPaperMap::AlphaMode alphaMode () const
virtual void setAlphaMode (DtPaperMap::AlphaMode alphaMode)
virtual void setTransparencyLevel (int d)
virtual int transparencyLevel () const
virtual const Coordinate_SystemcoordSys () const
virtual bool setCoordSys (DtPaperMap::DtCoordinateSystem sys, const Coordinate_System *terrainSys)
DtPaperMap::DtCoordinateSystem coordinateSystemType () const

Static Public Member Functions

static DtPaperMapcreate ()
static void setAllowOptimization (bool)
 Turns on/off image caching and optimization system.
static bool allowOptimization ()

Protected Member Functions

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 getImageSlice (const Coordinate_System *coordSys, const DtExtent &viewportExtent, const DtDisplaySize &screenSize, DtPoint &bitmapLocation, int &scaledBitmapSizeX, int &scaledBitmapSizeY, bool useMask, QColor *backgroundColor, QImage *retImage)
 Called from either of the two above methods, returns the resultant image in the image supplied.
virtual bool drawAsImage () const
 Currently does not support alpha channel in image, so this will always return false.
virtual void emptyActiveMapList ()
virtual void emptyCachedMapList ()
virtual bool addMapToActiveList (DtRasterMap *map)
virtual bool recheckMaps (const DtExtent &dbExtent, double resolution, QSize &imageSizeFull, QSize &imageSizeSet, const Coordinate_System *coordSys, DtExtent &globalExtent)
virtual void paintMap (const Coordinate_System *coordSys, DtMultiResActiveMapRecord &imageData, QRect &redraw, QImage *destImage, int pixWidth, int pixHeight, const DtExtent &dbExtent)
virtual void calcWindowRect (DtMultiResActiveMapRecord &imageData, int pixWidth, int pixHeight, const DtExtent &dbExtent, QPoint &topLeft, QPoint &bottomRight)
virtual bool getExtentIntersection (const DtExtent &rect1, const DtExtent &rect2, DtExtent &intersectionRect)
virtual bool loadRasterSet (const DtFilename &filename, const Coordinate_System *coordSys)
virtual void unloadRasterSet ()
virtual void getXandYIncrements (const Coordinate_System *coordSys, double &xIncrement, double &yIncrement)
virtual void initCacheInformation (const Coordinate_System *coordSys)
virtual double resolutionFor (const Coordinate_System *coordSys, const DtExtent &extent)
virtual void imageShift (const Coordinate_System *coordSys, const DtExtent &dbExtent)
 Will shift the current image to account for new sub images being placed in.
virtual bool screenLocation (const Coordinate_System *coordSys, DtMultiResActiveMapRecord &imageData, int pixWidth, int pixHeight, const DtExtent &dbExtent, DtDisplayPoint &wll, DtDisplayPoint &wur)
- Protected Member Functions inherited from DtPixmapPaperMap
 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 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 Member Functions inherited from DtPaperMap
 DtPaperMap (const DtPaperMap &orig)
DtPaperMapoperator= (const DtPaperMap &rhs)

Protected Attributes

DtFilename myMapFolder
DtRasterMapSetmyRasterSet
DtRasterMapResSetmyCurrentResSet
DtFilename myMtlFile
bool myCachedInformation
 Used only if geodetic split and not a geodetic database.
DtExtent myImageExtent
QSize myImageSize
bool myCacheImages
 If true (default is false) images, when loaded, will not be unloaded but rather cached in the system.
bool myOptimizeCacheImages
 Set if in optimization mode to true.
bool myOptimization
 Set to true to turn on drawing optimization.
bool myHasAlpha
 True if one of the raster maps has an alpha channel.
DtPtrQList
< DtMultiResActiveMapRecord * > 
myActiveMapList
QHash< DtRasterMap
*, DtMultiResActiveMapRecord * > 
myCachedImages
- Protected Attributes inherited from DtPixmapPaperMap
QImage * myImage
DtPoint myDbSwCorner
DtPoint myDbNeCorner
DtFilename myImageName
QSize myImageSize
bool myImageLoadingEnabled
- Protected Attributes inherited from DtPaperMap
const Coordinate_SystemmyCoordinateSystem
bool myDeleteCoordSys
bool myShow
DtString myName
DtPaperMap::AlphaMode myAlphaMode
DtPaperMap::DtCoordinateSystem myCoordinateSystemType
int myTransparencyLevel

Static Protected Attributes

static bool theAllowOptimization

Private Member Functions

 DtMultiResPaperMap (const DtMultiResPaperMap &orig)
 copy constructor: Not Implemented
DtMultiResPaperMapoperator= (const DtMultiResPaperMap &rhs)
 assignment operator: Not Implemented

Additional Inherited Members

- Public Types inherited from DtPaperMap
enum  DtCoordinateSystem {
  DtCSGeodetic, DtCSUtm, DtCSLcc, DtCSInvalid,
  DtCSFlatEarth, DtCSLast
}
enum  AlphaMode { NoAlpha, AlphaMask, AlphaBlend }

Detailed Description

class DtMultiResPaperMap:

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

Constructor & Destructor Documentation

DtMultiResPaperMap::DtMultiResPaperMap ( )

default constructor.

virtual DtMultiResPaperMap::~DtMultiResPaperMap ( )
virtual

destructor

DtMultiResPaperMap::DtMultiResPaperMap ( const DtMultiResPaperMap orig)
private

copy constructor: Not Implemented

Member Function Documentation

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

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

Reimplemented from DtPixmapPaperMap.

virtual bool DtMultiResPaperMap::loadImage ( const DtFilename &  imageFile,
const Coordinate_System coordSys 
)
virtual

Reimplemented from DtPixmapPaperMap.

virtual const DtString DtMultiResPaperMap::mapType ( ) const
virtual

Reimplemented from DtPixmapPaperMap.

static DtPaperMap* DtMultiResPaperMap::create ( )
static

Reimplemented from DtPixmapPaperMap.

const DtFilename & DtMultiResPaperMap::mtlFilename ( ) const
inline

References myMtlFile.

void DtMultiResPaperMap::setCacheImages ( bool  b)
inline

References myCacheImages.

bool DtMultiResPaperMap::cacheImages ( ) const
inline

References myCacheImages.

virtual void DtMultiResPaperMap::setMapFolder ( const DtFilename &  folder)
virtual
virtual const DtFilename& DtMultiResPaperMap::mapFolder ( ) const
virtual
bool DtMultiResPaperMap::hasAlpha ( ) const
inlinevirtual

Reimplemented from DtPixmapPaperMap.

References myHasAlpha.

void DtMultiResPaperMap::setAllowOptimization ( bool  b)
inlinestatic

Turns on/off image caching and optimization system.

References theAllowOptimization.

bool DtMultiResPaperMap::allowOptimization ( )
inlinestatic

References theAllowOptimization.

virtual bool DtMultiResPaperMap::canLoadImage ( ) const
virtual

Returns true if image can be loaded into memory.

Reimplemented from DtPixmapPaperMap.

virtual bool DtMultiResPaperMap::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 from DtPixmapPaperMap.

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

Called from either of the two above methods, returns the resultant image in the image supplied.

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

virtual bool DtMultiResPaperMap::drawAsImage ( ) const
protectedvirtual

Currently does not support alpha channel in image, so this will always return false.

virtual void DtMultiResPaperMap::emptyActiveMapList ( )
protectedvirtual
virtual void DtMultiResPaperMap::emptyCachedMapList ( )
protectedvirtual
virtual bool DtMultiResPaperMap::addMapToActiveList ( DtRasterMap map)
protectedvirtual
virtual bool DtMultiResPaperMap::recheckMaps ( const DtExtent dbExtent,
double  resolution,
QSize &  imageSizeFull,
QSize &  imageSizeSet,
const Coordinate_System coordSys,
DtExtent globalExtent 
)
protectedvirtual
virtual void DtMultiResPaperMap::paintMap ( const Coordinate_System coordSys,
DtMultiResActiveMapRecord imageData,
QRect &  redraw,
QImage *  destImage,
int  pixWidth,
int  pixHeight,
const DtExtent dbExtent 
)
protectedvirtual
virtual void DtMultiResPaperMap::calcWindowRect ( DtMultiResActiveMapRecord imageData,
int  pixWidth,
int  pixHeight,
const DtExtent dbExtent,
QPoint &  topLeft,
QPoint &  bottomRight 
)
protectedvirtual
virtual bool DtMultiResPaperMap::getExtentIntersection ( const DtExtent rect1,
const DtExtent rect2,
DtExtent intersectionRect 
)
protectedvirtual

Reimplemented from DtPixmapPaperMap.

virtual bool DtMultiResPaperMap::loadRasterSet ( const DtFilename &  filename,
const Coordinate_System coordSys 
)
protectedvirtual
virtual void DtMultiResPaperMap::unloadRasterSet ( )
protectedvirtual
virtual void DtMultiResPaperMap::getXandYIncrements ( const Coordinate_System coordSys,
double &  xIncrement,
double &  yIncrement 
)
protectedvirtual
virtual void DtMultiResPaperMap::initCacheInformation ( const Coordinate_System coordSys)
protectedvirtual
virtual double DtMultiResPaperMap::resolutionFor ( const Coordinate_System coordSys,
const DtExtent extent 
)
protectedvirtual
virtual void DtMultiResPaperMap::imageShift ( const Coordinate_System coordSys,
const DtExtent dbExtent 
)
protectedvirtual

Will shift the current image to account for new sub images being placed in.

virtual bool DtMultiResPaperMap::screenLocation ( const Coordinate_System coordSys,
DtMultiResActiveMapRecord imageData,
int  pixWidth,
int  pixHeight,
const DtExtent dbExtent,
DtDisplayPoint wll,
DtDisplayPoint wur 
)
protectedvirtual
DtMultiResPaperMap& DtMultiResPaperMap::operator= ( const DtMultiResPaperMap rhs)
private

assignment operator: Not Implemented

Member Data Documentation

DtFilename DtMultiResPaperMap::myMapFolder
protected
DtRasterMapSet* DtMultiResPaperMap::myRasterSet
protected
DtRasterMapResSet* DtMultiResPaperMap::myCurrentResSet
protected
DtFilename DtMultiResPaperMap::myMtlFile
protected

Referenced by mtlFilename().

bool DtMultiResPaperMap::myCachedInformation
protected

Used only if geodetic split and not a geodetic database.

DtExtent DtMultiResPaperMap::myImageExtent
protected
QSize DtMultiResPaperMap::myImageSize
protected
bool DtMultiResPaperMap::myCacheImages
protected

If true (default is false) images, when loaded, will not be unloaded but rather cached in the system.

Set this flag to true when performance is more of an issue than memory usage.

Referenced by cacheImages(), and setCacheImages().

bool DtMultiResPaperMap::myOptimizeCacheImages
protected

Set if in optimization mode to true.

Use different flag in case not in optimization mode but still want to cache images

bool DtMultiResPaperMap::myOptimization
protected

Set to true to turn on drawing optimization.

bool DtMultiResPaperMap::theAllowOptimization
staticprotected
bool DtMultiResPaperMap::myHasAlpha
protected

True if one of the raster maps has an alpha channel.

Referenced by hasAlpha().

DtPtrQList<DtMultiResActiveMapRecord*> DtMultiResPaperMap::myActiveMapList
protected
QHash<DtRasterMap*, DtMultiResActiveMapRecord*> DtMultiResPaperMap::myCachedImages
protected

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

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)