VR-Forces 4.1 Class Documentation
pixPprMap.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2004 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: pixPprMap.h,v $ $Revision: 1.38 $ $State: Exp $
7 *******************************************************************************/
8 
11 
12 #ifndef PIXPPRMAP_H
13 #define PIXPPRMAP_H
14 
16 
17 #include "geometry/point.h"
18 #include "geometry/tdbextent.h"
19 #include <vlutil/vlFilename.h>
20 
21 #include <QtGui/QImage>
22 #include <QtGui/QPixmap>
23 
24 class DtDisplayPoint;
25 class QFileInfo;
26 class DtLargeImageReader;
27 
34 {
35 public:
36 
39 
41  virtual ~DtPixmapPaperMap();
42 
44  virtual bool init
45  (
46  const DtFilename& path,
47  DtPaperMapRecord* paperMapRec,
48  const Coordinate_System* coordSys
49  );
50 
52  virtual const DtPoint& dbSwCorner() const;
53  virtual void setDbSwCorner(const DtPoint&);
54 
56  virtual const DtPoint& dbNeCorner() const;
57  virtual void setDbNeCorner(const DtPoint&);
58 
60  virtual const DtFilename& imageName() const;
61 
63  virtual double xSize() const;
64 
66  virtual double ySize() const;
67  virtual void load();
68 
72  virtual bool getScaledImage
73  (
74  const Coordinate_System* coordSys,
75  const DtExtent& viewportExtent,
76  const DtDisplaySize& screenSize,
77  DtPoint& bitmapLocation,
78  QImage& image,
79  bool useMask,
80  QColor* backgroundColor = NULL,
81  int* scaledBitmapX = NULL, int* scaledBitmapY = NULL
82  );
83 
85  virtual bool getBoundingBox(const DtExtent& viewportExtent,
86  DtExtent& paperMapExtent, DtExtent& visibleExtent,
87  DtDisplayPoint& wll, DtDisplayPoint& wur);
88 
90  virtual bool setCoordinates(const DtPoint & swCorner,const DtPoint & neCorner, const Coordinate_System* coordSys);
91 
92  virtual const DtString mapType() const;
93 
94  static DtPaperMap * create();
95 
96  virtual void setImageName(const DtFilename&);
97  virtual bool loadImage(const DtFilename & imageFile, const Coordinate_System * coordSys);
98 
99  inline QImage* image() { return myImage; };
100  virtual QSize imageSize() const;
101 
104  virtual QSize setImageSize(const QSize&);
105 
106  virtual bool hasAlpha() const;
107 
110  virtual void setImageLoadingEnabled(bool);
111  bool imageLoadingEnabled() const;
112 
114  virtual bool canLoadImage() const;
115 
116 protected:
117 
119  DtPixmapPaperMap(const DtPixmapPaperMap& orig);
120 
123 
124 protected:
125 
127  DtPoint getDbPoint(
128  const DtPoint& point,
129  const Coordinate_System* coordFrom,
130  const Coordinate_System* coordTo);
131 
132  virtual bool getExtentIntersection(
133  const DtExtent& rect1,
134  const DtExtent& rect2,
135  DtExtent& intersectionRect);
136 
138  virtual bool getImageSlice
139  (
140  const Coordinate_System* coordSys,
141  const DtExtent& viewportExtent,
142  const DtDisplaySize& screenSize,
143  DtPoint& bitmapLocation,
144  int &scaledBitmapSizeX,
145  int &scaledBitmapSizeY,
146  QImage& image,
147  bool useMask,
148  QColor* backgroundColor
149  );
150 
153  virtual bool isSupportedTif(const QFileInfo& info) const;
154 
155 protected:
156  QImage* myImage;
157 
160 
161  DtFilename myImageName;
162 
163  QSize myImageSize;
164 
166 };
167 
168 inline bool DtPixmapPaperMap::hasAlpha() const
169 {
170  if (myImage)
171  {
172  return myImage->hasAlphaChannel();
173  }
174  else
175  {
176  return false;
177  }
178 }
179 
181 {
182  return myImageLoadingEnabled;
183 }
184 
185 #endif

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)