This class implements a concrete tool for vertex operations (move, add, etc.). More...
#include <VertexTool.h>
Public Types | |
enum | StageType { FEATURE_SELECTION, VERTEX_SEARCH, VERTEX_FOUND, VERTEX_MOVING, VERTEX_READY_TO_ADD } |
Defines the operation stage to this tool. More... | |
Public Member Functions | |
virtual void | setCursor (const QCursor &cursor) |
It sets the tool cursor. More... | |
Initializer Methods | |
Methods related to instantiation and destruction. | |
VertexTool (te::qt::widgets::MapDisplay *display, const te::map::AbstractLayerPtr &layer, QObject *parent=0) | |
It constructs a vertex tool associated with the given map display. More... | |
~VertexTool () | |
Destructor. More... | |
AbstractTool Methods | |
Methods related with tool behavior. | |
bool | mousePressEvent (QMouseEvent *e) |
This event handler can be reimplemented in a concrete tool class to receive mouse press events for the watched object. More... | |
bool | mouseMoveEvent (QMouseEvent *e) |
This event handler can be reimplemented in a concrete tool class to receive mouse move events for the watched object. More... | |
bool | mouseReleaseEvent (QMouseEvent *e) |
This event handler can be reimplemented in a concrete tool class to receive mouse release events for the watched object. More... | |
bool | mouseDoubleClickEvent (QMouseEvent *e) |
This event handler can be reimplemented in a concrete tool class to receive mouse double click events for the watched object. More... | |
AbstractTool Methods | |
Methods related with tool behavior. | |
virtual bool | eventFilter (QObject *watched, QEvent *e) |
Filters events if this object has been installed as an event filter for the watched object. More... | |
Protected Attributes | |
QCursor | m_cursor |
The default tool cursor. More... | |
MapDisplay * | m_display |
The map display associated with the tool. More... | |
Private Slots | |
void | onExtentChanged () |
Private Member Functions | |
te::gm::Envelope | buildEnvelope (const QPointF &pos) |
void | draw (te::gm::Point *virtualVertex=0) |
void | pickFeature (const te::map::AbstractLayerPtr &layer, const QPointF &pos) |
void | pickFeature (const te::map::AbstractLayerPtr &layer, const te::gm::Envelope &env) |
void | reset () |
void | setStage (StageType stage) |
void | storeEditedFeature () |
void | updateCursor () |
void | updateRTree () |
Private Attributes | |
StageType | m_currentStage |
VertexIndex | m_currentVertexIndex |
Feature * | m_feature |
te::map::AbstractLayerPtr | m_layer |
std::vector< te::gm::LineString * > | m_lines |
te::sam::rtree::Index < VertexIndex, 8 > | m_rtree |
This class implements a concrete tool for vertex operations (move, add, etc.).
Definition at line 70 of file VertexTool.h.
Defines the operation stage to this tool.
Enumerator | |
---|---|
FEATURE_SELECTION |
Selection of feature. |
VERTEX_SEARCH |
Search of vertex. |
VERTEX_FOUND |
Vertex found. |
VERTEX_MOVING |
Vertex movement. |
VERTEX_READY_TO_ADD |
Vertex add. |
Definition at line 81 of file VertexTool.h.
te::edit::VertexTool::VertexTool | ( | te::qt::widgets::MapDisplay * | display, |
const te::map::AbstractLayerPtr & | layer, | ||
QObject * | parent = 0 |
||
) |
It constructs a vertex tool associated with the given map display.
display | The map display associated with the tool. |
parent | The tool's parent. |
Definition at line 54 of file VertexTool.cpp.
References draw(), m_currentVertexIndex, te::qt::widgets::AbstractTool::m_display, m_layer, te::edit::VertexIndex::makeInvalid(), onExtentChanged(), and updateCursor().
te::edit::VertexTool::~VertexTool | ( | ) |
Destructor.
Definition at line 72 of file VertexTool.cpp.
|
private |
Definition at line 350 of file VertexTool.cpp.
|
private |
Definition at line 291 of file VertexTool.cpp.
References te::edit::Renderer::begin(), te::edit::Renderer::draw(), te::edit::Renderer::drawRepository(), te::edit::Renderer::drawVertexes(), te::edit::Renderer::end(), te::common::Singleton< Renderer >::getInstance(), te::common::Singleton< RepositoryManager >::getInstance(), te::gm::LineString::getPointN(), te::gm::Envelope::isValid(), and te::edit::Renderer::setPointStyle().
Referenced by VertexTool().
|
virtualinherited |
Filters events if this object has been installed as an event filter for the watched object.
watched | The watched object. |
event | The last event sent to watched object. |
Reimplemented in te::qt::widgets::ZoomKeyboard, and te::qt::widgets::ZoomWheel.
Definition at line 50 of file AbstractTool.cpp.
Referenced by te::qt::widgets::ZoomKeyboard::eventFilter(), and te::qt::widgets::ZoomWheel::eventFilter().
|
virtual |
This event handler can be reimplemented in a concrete tool class to receive mouse double click events for the watched object.
e | The mouse event. |
Reimplemented from te::qt::widgets::AbstractTool.
Definition at line 217 of file VertexTool.cpp.
References te::edit::AddVertex(), and te::edit::GetPosition().
|
virtual |
This event handler can be reimplemented in a concrete tool class to receive mouse move events for the watched object.
e | The mouse event. |
Reimplemented from te::qt::widgets::AbstractTool.
Definition at line 119 of file VertexTool.cpp.
References te::gm::Envelope::getCenter(), te::gm::GetGeomFromEnvelope(), te::edit::GetPosition(), te::edit::MoveVertex(), te::gm::Coord2D::x, and te::gm::Coord2D::y.
|
virtual |
This event handler can be reimplemented in a concrete tool class to receive mouse press events for the watched object.
e | The mouse event. |
Reimplemented from te::qt::widgets::AbstractTool.
Definition at line 77 of file VertexTool.cpp.
References te::edit::RemoveVertex().
|
virtual |
This event handler can be reimplemented in a concrete tool class to receive mouse release events for the watched object.
e | The mouse event. |
Reimplemented from te::qt::widgets::AbstractTool.
Definition at line 188 of file VertexTool.cpp.
References te::edit::GetPosition().
|
privateslot |
Definition at line 345 of file VertexTool.cpp.
Referenced by VertexTool().
|
private |
Definition at line 262 of file VertexTool.cpp.
|
private |
Definition at line 268 of file VertexTool.cpp.
References te::edit::GetLines(), and te::edit::PickFeature().
|
private |
Definition at line 248 of file VertexTool.cpp.
|
virtualinherited |
It sets the tool cursor.
cursor | The cursor that will be used during the tool operation. |
Definition at line 98 of file AbstractTool.cpp.
Referenced by te::edit::CreateLineTool::CreateLineTool(), te::edit::CreatePolygonTool::CreatePolygonTool(), te::qt::widgets::ExtentAcquire::ExtentAcquire(), te::qt::widgets::Info::Info(), te::qt::widgets::Measure::Measure(), te::qt::widgets::Pan::Pan(), te::qt::widgets::PanExtent::PanExtent(), te::qt::widgets::PointPicker::PointPicker(), te::qt::widgets::Selection::Selection(), te::qt::widgets::ZoomArea::ZoomArea(), and te::qt::widgets::ZoomClick::ZoomClick().
|
private |
Definition at line 387 of file VertexTool.cpp.
|
private |
Definition at line 415 of file VertexTool.cpp.
References te::edit::RepositoryManager::addGeometry(), and te::common::Singleton< RepositoryManager >::getInstance().
|
private |
Definition at line 393 of file VertexTool.cpp.
Referenced by VertexTool().
|
private |
Definition at line 367 of file VertexTool.cpp.
References te::gm::LineString::getNPoints(), te::gm::LineString::getX(), te::gm::LineString::getY(), and te::edit::VertexIndex::setIndex().
|
private |
Definition at line 156 of file VertexTool.h.
|
private |
Definition at line 154 of file VertexTool.h.
Referenced by VertexTool().
|
protectedinherited |
The default tool cursor.
Definition at line 161 of file AbstractTool.h.
|
protectedinherited |
The map display associated with the tool.
Definition at line 160 of file AbstractTool.h.
Referenced by te::qt::widgets::AbstractTool::AbstractTool(), te::qt::widgets::CoordTracking::CoordTracking(), te::edit::CreateLineTool::CreateLineTool(), te::edit::CreatePolygonTool::CreatePolygonTool(), te::qt::widgets::Measure::Measure(), te::edit::MoveGeometryTool::MoveGeometryTool(), te::qt::widgets::PolygonAcquire::PolygonAcquire(), VertexTool(), and te::qt::widgets::ZoomKeyboard::ZoomKeyboard().
|
private |
Definition at line 152 of file VertexTool.h.
|
private |
Definition at line 151 of file VertexTool.h.
Referenced by VertexTool().
|
private |
Definition at line 153 of file VertexTool.h.
|
private |
Definition at line 155 of file VertexTool.h.