This class implements the grid, planar or geographic, to be used with the MapDisplay. More...
#include <Grid.h>
Public Slots | |
Public slots. | |
Methods to update the internal attributes of the class, using the signal-slot mechanism of QT. | |
| void | setColor (const QColor &color) |
| Updates the color of the lines and texts. More... | |
| void | setFont (const QFont &font) |
| Updates the font of the texts. More... | |
| void | setGridType (const int &type) |
| Updates the type of grid: planar or geographic. More... | |
| void | redraw () |
| Refresh the grid image. This method MUST BE called when the area of visualization changes in MapDisplay. More... | |
Signals | |
Signals | |
Signals emmited by the widget. | |
| void | aboutToBeclosed () |
Public Member Functions | |
Constructor and destructor methods. | |
Methods related to instantiation and destruction. | |
| Grid (MapDisplay *parent) | |
| Constructor. More... | |
| ~Grid () | |
| Destuctor. More... | |
Public methods | |
Methods to access the internal attributes of the class. | |
| QColor | getColor () const |
| Returns the current color being used. More... | |
| QFont | getFont () const |
| Returns the current font being used. More... | |
| int | getType () const |
| Returns the current type of grid being used. More... | |
Protected Member Functions | |
Protected methods | |
Methods used internally by the object. | |
| void | initialize () |
| Initializes the object. More... | |
| void | makePlanarGrid () |
| Builds the planar grid. More... | |
| void | makeGeographicGrid () |
| Builds the geographic grid. More... | |
| void | paintEvent (QPaintEvent *event) |
| Reimplementation of the QFrame method. More... | |
| void | closeEvent (QCloseEvent *event) |
| Reimplementation of the QFrame method. More... | |
Protected Attributes | |
| QPixmap * | m_backGround |
| Pixmap with the grid image. More... | |
| QColor | m_color |
| Color to be used. More... | |
| MapDisplay * | m_display |
| Pointer to a MapDisplay. More... | |
| QFont | m_font |
| Font to be used. More... | |
| int | m_geoSrid |
| Geographic SRID being used to reproject the world box to a geographic coordinate system. More... | |
| std::vector< te::gm::LineString > | m_hlines |
| Grid lines. More... | |
| double | m_horizontalGap |
| Distance between lines in x-axis. More... | |
| double | m_initialX |
| Initial coordinate in x-axis. More... | |
| double | m_initialY |
| Initial coordinate in y-axis. More... | |
| int | m_maxGap |
| Maximum number of lines to be presented on the grid. More... | |
| int | m_srid |
| SRID being used to reproject the world box to a planar coordinate system. More... | |
| GridTypes | m_type |
| Type of the grid (planar or geographic). More... | |
| double | m_verticalGap |
| Distance between lines in y-axis. More... | |
| std::vector< te::gm::LineString > | m_vlines |
| Grid lines. More... | |
This class implements the grid, planar or geographic, to be used with the MapDisplay.
Definition at line 74 of file qt/widgets/canvas/Grid.h.
| te::qt::widgets::Grid::Grid | ( | MapDisplay * | parent | ) |
Constructor.
| parent | The display over what the scale will reflect. |
Definition at line 1762 of file qt/widgets/canvas/Grid.cpp.
References initialize(), m_display, and redraw().
| te::qt::widgets::Grid::~Grid | ( | ) |
|
signal |
Signal emmited when the widget is about to be closed.
Referenced by closeEvent().
|
protected |
Reimplementation of the QFrame method.
| event | The event generated. |
Definition at line 2051 of file qt/widgets/canvas/Grid.cpp.
References aboutToBeclosed().
| QColor te::qt::widgets::Grid::getColor | ( | ) | const |
Returns the current color being used.
Definition at line 1791 of file qt/widgets/canvas/Grid.cpp.
References m_color.
Referenced by te::qt::widgets::GridPropertyBrowser::GridPropertyBrowser().
| QFont te::qt::widgets::Grid::getFont | ( | ) | const |
Returns the current font being used.
Definition at line 1796 of file qt/widgets/canvas/Grid.cpp.
References m_font.
Referenced by te::qt::widgets::GridPropertyBrowser::GridPropertyBrowser().
| int te::qt::widgets::Grid::getType | ( | ) | const |
Returns the current type of grid being used.
Definition at line 1801 of file qt/widgets/canvas/Grid.cpp.
References m_type.
Referenced by te::qt::widgets::GridPropertyBrowser::GridPropertyBrowser().
|
protected |
Initializes the object.
Definition at line 1950 of file qt/widgets/canvas/Grid.cpp.
References te::map::MapDisplay::getExtent(), te::common::Singleton< SpatialReferenceSystemManager >::getInstance(), te::map::MapDisplay::getSRID(), m_display, m_srid, m_type, te::qt::widgets::PLANAR, ToGeographic(), and ToPlanar().
Referenced by Grid(), makeGeographicGrid(), and makePlanarGrid().
|
protected |
Builds the geographic grid.
Definition at line 1992 of file qt/widgets/canvas/Grid.cpp.
References CalculateHorizontalLines(), CalculateVerticalLines(), te::map::MapDisplay::getExtent(), te::gm::Envelope::getHeight(), GetInitialCoord(), te::gm::Envelope::getLowerLeftX(), te::gm::Envelope::getLowerLeftY(), te::map::MapDisplay::getSRID(), te::gm::Envelope::getWidth(), initialize(), te::gm::Envelope::isValid(), m_display, m_geoSrid, m_hlines, m_horizontalGap, m_initialX, m_initialY, m_maxGap, m_srid, m_verticalGap, m_vlines, ToPlanar(), and WorldBoxTo().
Referenced by redraw().
|
protected |
Builds the planar grid.
Definition at line 1971 of file qt/widgets/canvas/Grid.cpp.
References CalculateHorizontalLines(), CalculateVerticalLines(), te::map::MapDisplay::getExtent(), te::gm::Envelope::getHeight(), GetInitialCoord(), te::gm::Envelope::getLowerLeftX(), te::gm::Envelope::getLowerLeftY(), te::map::MapDisplay::getSRID(), te::gm::Envelope::getWidth(), initialize(), m_display, m_hlines, m_horizontalGap, m_initialX, m_initialY, m_maxGap, m_srid, m_verticalGap, m_vlines, and te::gm::Envelope::transform().
Referenced by redraw().
|
protected |
Reimplementation of the QFrame method.
| event | The event generated. |
Definition at line 2042 of file qt/widgets/canvas/Grid.cpp.
References m_backGround, and p.
|
slot |
Refresh the grid image. This method MUST BE called when the area of visualization changes in MapDisplay.
Definition at line 1827 of file qt/widgets/canvas/Grid.cpp.
References DrawAllLines(), DrawTexts(), dx, te::qt::widgets::GEOGRAPHIC, te::qt::widgets::GetCleanImage(), te::map::MapDisplay::getExtent(), te::gm::LineString::getNPoints(), te::gm::LineString::getPointN(), te::map::MapDisplay::getSRID(), GetTextsPixmap(), GetTransformGeo(), line, m_backGround, m_color, m_display, m_font, m_geoSrid, m_hlines, m_srid, m_type, m_vlines, makeGeographicGrid(), makePlanarGrid(), te::qt::widgets::MillimetersToPixels(), p, te::qt::widgets::PLANAR, WorldTransformer::setMirroring(), SetSRID(), and te::gm::Envelope::transform().
Referenced by Grid(), setColor(), setFont(), and setGridType().
|
slot |
Updates the color of the lines and texts.
| color | The new color to be used. |
Definition at line 1806 of file qt/widgets/canvas/Grid.cpp.
|
slot |
Updates the font of the texts.
| font | New font to be used. |
Definition at line 1813 of file qt/widgets/canvas/Grid.cpp.
|
slot |
Updates the type of grid: planar or geographic.
| type | The new type. |
Definition at line 1820 of file qt/widgets/canvas/Grid.cpp.
|
protected |
Pixmap with the grid image.
Definition at line 215 of file qt/widgets/canvas/Grid.h.
Referenced by paintEvent(), redraw(), and ~Grid().
|
protected |
Color to be used.
Definition at line 220 of file qt/widgets/canvas/Grid.h.
Referenced by getColor(), redraw(), and setColor().
|
protected |
Pointer to a MapDisplay.
Definition at line 209 of file qt/widgets/canvas/Grid.h.
Referenced by Grid(), initialize(), makeGeographicGrid(), makePlanarGrid(), and redraw().
|
protected |
Font to be used.
Definition at line 221 of file qt/widgets/canvas/Grid.h.
|
protected |
Geographic SRID being used to reproject the world box to a geographic coordinate system.
Definition at line 219 of file qt/widgets/canvas/Grid.h.
Referenced by makeGeographicGrid(), and redraw().
|
protected |
Grid lines.
Definition at line 216 of file qt/widgets/canvas/Grid.h.
Referenced by makeGeographicGrid(), makePlanarGrid(), and redraw().
|
protected |
Distance between lines in x-axis.
Definition at line 212 of file qt/widgets/canvas/Grid.h.
Referenced by makeGeographicGrid(), and makePlanarGrid().
|
protected |
Initial coordinate in x-axis.
Definition at line 213 of file qt/widgets/canvas/Grid.h.
Referenced by makeGeographicGrid(), and makePlanarGrid().
|
protected |
Initial coordinate in y-axis.
Definition at line 214 of file qt/widgets/canvas/Grid.h.
Referenced by makeGeographicGrid(), and makePlanarGrid().
|
protected |
Maximum number of lines to be presented on the grid.
Definition at line 210 of file qt/widgets/canvas/Grid.h.
Referenced by makeGeographicGrid(), and makePlanarGrid().
|
protected |
SRID being used to reproject the world box to a planar coordinate system.
Definition at line 218 of file qt/widgets/canvas/Grid.h.
Referenced by initialize(), makeGeographicGrid(), makePlanarGrid(), and redraw().
|
protected |
Type of the grid (planar or geographic).
Definition at line 222 of file qt/widgets/canvas/Grid.h.
Referenced by getType(), initialize(), redraw(), and setGridType().
|
protected |
Distance between lines in y-axis.
Definition at line 211 of file qt/widgets/canvas/Grid.h.
Referenced by makeGeographicGrid(), and makePlanarGrid().
|
protected |
Grid lines.
Definition at line 217 of file qt/widgets/canvas/Grid.h.
Referenced by makeGeographicGrid(), makePlanarGrid(), and redraw().