#include <vectoreditor.h>
This captures viewer events produced by users such as mouse click and maps them to actions on the vectors themselves.
Definition at line 43 of file vectoreditor.h.
Public Slots | |
void | viewMousePress (QMouseEvent *me, View::MouseState &ms) |
void | viewMouseMove (QMouseEvent *me, View::MouseState &ms) |
void | viewMouseRelease (QMouseEvent *me, View::MouseState &ms) |
void | viewKeyPress (QKeyEvent *ke) |
void | viewKeyRelease (QKeyEvent *ke) |
void | viewSelChanged (SelectionSet::SelBox &box) |
Sets vector data objects as selected. | |
void | breakLine () |
void | joinLine () |
void | contLine () |
void | delSel () |
void | activeLayerChanged (int) |
Signals | |
void | repaint (bool) |
void | selBoxChanged (Rect &) |
void | selectionChanged () |
Public Member Functions | |
VectorEditor (VectorLayerSet *, ViewSet *) | |
virtual | ~VectorEditor () |
void | addView (View *view) |
void | removeView (View *view) |
void | clearAllLayerSelections () |
Clear selected vector objects on all layers. | |
Protected Member Functions | |
std::vector< SelectionSet::SelObj > | overSelNode (double x, double y) |
bool | hasIntersect (Node p1, Node p2, Node p3, Node p4) |
Answers the Question: do the lines described by p1-p2 and p3-p4 intersect? | |
int | isSelLine (int iline) |
Answer to the question: Is the line represented by iline in the current SelectionSet* mSelSet? | |
bool | isSelPoint (int &iline, int &inode) |
Answer to the question: Is the point (inode) in this line (iline) selected (in the current SelectionSet* mSelSet)? | |
void | init () |
int | _int_min (int v1, int v2) |
int | _int_max (int v1, int v2) |
Protected Attributes | |
VectorLayerSet * | mLayerSet |
ViewSet * | mViewSet |
VectorData * | mData |
SelectionSet * | mSelSet |
bool | mInObject |
bool | mCtrlDown |
bool | mShiftDown |
bool | mMovingNode |
std::vector< SelectionSet::SelObj > | mOverNode |
VectorEditor::VectorEditor | ( | VectorLayerSet * | lyrset, | |
ViewSet * | viewset | |||
) |
Definition at line 4 of file vectoreditor.cpp.
References activeLayerChanged(), init(), mData, and mSelSet.
VectorEditor::~VectorEditor | ( | ) | [virtual] |
Definition at line 18 of file vectoreditor.cpp.
std::vector< SelectionSet::SelObj > VectorEditor::overSelNode | ( | double | x, | |
double | y | |||
) | [protected] |
Definition at line 82 of file vectoreditor.cpp.
References VectorData::getType(), VectorData::getXYSet(), mData, mSelSet, SelectionSet::SelObj::nodes, SelectionSet::SelObj::obj, VectorData::POINT, Line::size(), SelectionSet::size(), Node::x, and Node::y.
Referenced by viewMouseMove().
Answers the Question: do the lines described by p1-p2 and p3-p4 intersect?
Definition at line 766 of file vectoreditor.cpp.
References Node::x, and Node::y.
Referenced by viewSelChanged().
int VectorEditor::isSelLine | ( | int | iline | ) | [protected] |
Answer to the question: Is the line represented by iline in the current SelectionSet* mSelSet?
iline | Value to match to SelObj.obj in SelectionSet* mSelSet |
Definition at line 806 of file vectoreditor.cpp.
References mSelSet, and SelectionSet::size().
Referenced by isSelPoint(), and viewSelChanged().
bool VectorEditor::isSelPoint | ( | int & | iline, | |
int & | inode | |||
) | [protected] |
Answer to the question: Is the point (inode) in this line (iline) selected (in the current SelectionSet* mSelSet)?
iline | Line to check for selected point. Value to match to SelObj.obj in SelectionSet* mSelSet. iline will be changed to either -1 (not found) or index in SelectionSet* mSelect where line is represented. | |
inode | Point to check for selection status. Value to match to a node in SelObj.nodes (for SelObj.obj in SelectionSet* mSelSet matching the given line, iline). inode will be changed to either -1 (not found) or the index in SelObj.nodes where representing the point. |
Definition at line 820 of file vectoreditor.cpp.
References isSelLine(), mSelSet, and SelectionSet::size().
Referenced by viewSelChanged().
void VectorEditor::init | ( | ) | [protected] |
Definition at line 74 of file vectoreditor.cpp.
References mCtrlDown, mInObject, mMovingNode, mOverNode, and mShiftDown.
Referenced by VectorEditor().
int VectorEditor::_int_min | ( | int | v1, | |
int | v2 | |||
) | [inline, protected] |
Definition at line 124 of file vectoreditor.h.
Referenced by viewMouseMove(), and viewMouseRelease().
int VectorEditor::_int_max | ( | int | v1, | |
int | v2 | |||
) | [inline, protected] |
Definition at line 128 of file vectoreditor.h.
Referenced by viewMouseMove(), and viewMouseRelease().
void VectorEditor::addView | ( | View * | view | ) |
Definition at line 20 of file vectoreditor.cpp.
References viewKeyPress(), viewKeyRelease(), viewMouseMove(), viewMousePress(), and viewMouseRelease().
Referenced by MainToolbar::setupProj().
void VectorEditor::removeView | ( | View * | view | ) |
Definition at line 47 of file vectoreditor.cpp.
References viewKeyPress(), viewKeyRelease(), viewMouseMove(), viewMousePress(), and viewMouseRelease().
void VectorEditor::clearAllLayerSelections | ( | ) |
Clear selected vector objects on all layers.
Definition at line 867 of file vectoreditor.cpp.
References SelectionSet::clear(), VectorLayer::getData(), VectorLayerSet::getLayer(), VectorData::getSelSet(), mLayerSet, VectorLayerSet::numLayers(), selectionChanged(), and SelectionSet::size().
Referenced by delSel(), viewMousePress(), and viewSelChanged().
void VectorEditor::viewMousePress | ( | QMouseEvent * | me, | |
View::MouseState & | ms | |||
) | [slot] |
Definition at line 124 of file vectoreditor.cpp.
References SelectionSet::add(), VectorData::addLine(), VectorData::addLineNode(), VectorData::addNode(), SelectionSet::clear(), clearAllLayerSelections(), VectorData::getXYSet(), View::GLACIER_ID, SelectionSet::SelBox::h, VectorData::insertLineNode(), View::LINE, mCtrlDown, View::MouseState::mCurPos, mData, mInObject, mMovingNode, mOverNode, mSelSet, View::mTool, mViewSet, SelectionSet::SelObj::nodes, SelectionSet::SelObj::obj, View::POINTER, VectorData::push(), VectorData::pushSelection(), ViewSet::repaintViews(), SelectionSet::selBox(), View::SELECTION, selectionChanged(), SelectionSet::setSelecting(), Line::size(), VectorData::size(), SelectionSet::size(), SelectionSet::SelBox::w, SelectionSet::SelBox::x, Node::x, SelectionSet::SelBox::y, Node::y, and Node::z.
Referenced by addView(), and removeView().
void VectorEditor::viewMouseMove | ( | QMouseEvent * | me, | |
View::MouseState & | ms | |||
) | [slot] |
Definition at line 251 of file vectoreditor.cpp.
References _int_max(), _int_min(), VectorData::getType(), View::GLACIER_ID, Rect::h, SelectionSet::isSelecting(), View::LINE, mCtrlDown, View::MouseState::mCurPos, mData, mMovingNode, VectorData::moveLineNode(), VectorData::moveNode(), mOverNode, mSelSet, View::mTool, mViewSet, overSelNode(), VectorData::POINT, View::POINTER, ViewSet::repaintViews(), SelectionSet::selBox(), View::SELECTION, selectionChanged(), ViewSet::setSelBox(), Rect::w, SelectionSet::SelBox::x, Rect::x, Node::x, SelectionSet::SelBox::y, Rect::y, and Node::y.
Referenced by addView(), and removeView().
void VectorEditor::viewMouseRelease | ( | QMouseEvent * | me, | |
View::MouseState & | ms | |||
) | [slot] |
Definition at line 331 of file vectoreditor.cpp.
References _int_max(), _int_min(), View::GLACIER_ID, Rect::h, SelectionSet::SelBox::h, SelectionSet::isSelecting(), View::LINE, View::MouseState::mCurPos, mData, mMovingNode, mSelSet, View::mTool, mViewSet, View::POINTER, ViewSet::repaintViews(), SelectionSet::resetBox(), SelectionSet::selBox(), View::SELECTION, selectionChanged(), ViewSet::setSelBox(), viewSelChanged(), Rect::w, SelectionSet::SelBox::w, Rect::x, SelectionSet::SelBox::x, Rect::y, and SelectionSet::SelBox::y.
Referenced by addView(), and removeView().
void VectorEditor::viewKeyPress | ( | QKeyEvent * | ke | ) | [slot] |
Definition at line 384 of file vectoreditor.cpp.
References delSel(), mCtrlDown, mData, mShiftDown, mViewSet, VectorData::pop(), VectorData::push(), VectorData::redo(), ViewSet::repaintViews(), and selectionChanged().
Referenced by addView(), and removeView().
void VectorEditor::viewKeyRelease | ( | QKeyEvent * | ke | ) | [slot] |
Definition at line 443 of file vectoreditor.cpp.
References mCtrlDown, and mShiftDown.
Referenced by addView(), and removeView().
void VectorEditor::viewSelChanged | ( | SelectionSet::SelBox & | box | ) | [slot] |
Sets vector data objects as selected.
Determines which vector data objects (points and/or lines) are inside the selection box (marquis, "dancing ants") the user has drawn, and sets those objects as selected. If the user has depressed the shift-key, the objects are added to the current list of selected objects, otherwise the list of selected objects is cleared before adding the current selection.
box | the selection box (marquis, "dancing ants") the user has drawn for the purpose of selecting vector objects on the screen to make them active for moving, deleting, etc. |
Definition at line 459 of file vectoreditor.cpp.
References SelectionSet::add(), clearAllLayerSelections(), VectorData::getType(), VectorData::getXYSet(), SelectionSet::SelBox::h, hasIntersect(), isSelLine(), isSelPoint(), mData, mSelSet, mShiftDown, mViewSet, SelectionSet::SelObj::obj, VectorData::POINT, ViewSet::repaintViews(), selectionChanged(), SelectionSet::size(), Line::size(), SelectionSet::SelBox::w, SelectionSet::SelBox::x, Node::x, SelectionSet::SelBox::y, and Node::y.
Referenced by viewMouseRelease().
void VectorEditor::breakLine | ( | ) | [slot] |
Definition at line 577 of file vectoreditor.cpp.
References VectorData::breakLine(), VectorData::getXYSet(), mData, mSelSet, mViewSet, ViewSet::repaintViews(), selectionChanged(), Line::size(), and SelectionSet::size().
void VectorEditor::joinLine | ( | ) | [slot] |
Definition at line 620 of file vectoreditor.cpp.
References SelectionSet::erase(), VectorData::getXYSet(), VectorData::joinLine(), mData, mSelSet, mViewSet, VectorData::pushSelection(), ViewSet::repaintViews(), selectionChanged(), Line::size(), and SelectionSet::size().
void VectorEditor::contLine | ( | ) | [slot] |
Definition at line 675 of file vectoreditor.cpp.
void VectorEditor::delSel | ( | ) | [slot] |
Definition at line 695 of file vectoreditor.cpp.
References clearAllLayerSelections(), VectorData::delLine(), VectorData::delLineNode(), VectorData::delNode(), VectorData::getType(), VectorData::getXYSet(), mCtrlDown, mData, mSelSet, mViewSet, VectorData::POINT, ViewSet::repaintViews(), selectionChanged(), Line::size(), and SelectionSet::size().
Referenced by viewKeyPress().
void VectorEditor::activeLayerChanged | ( | int | ilyr | ) | [slot] |
Definition at line 855 of file vectoreditor.cpp.
References VectorLayer::getData(), VectorLayerSet::getLayer(), VectorData::getSelSet(), mData, mLayerSet, and mSelSet.
Referenced by VectorEditor().
void VectorEditor::repaint | ( | bool | ) | [signal] |
void VectorEditor::selBoxChanged | ( | Rect & | ) | [signal] |
void VectorEditor::selectionChanged | ( | ) | [signal] |
Referenced by breakLine(), clearAllLayerSelections(), delSel(), joinLine(), viewKeyPress(), viewMouseMove(), viewMousePress(), viewMouseRelease(), and viewSelChanged().
VectorLayerSet* VectorEditor::mLayerSet [protected] |
Set of VectorLayer objects.
For internal use only.
Passed into VectorEditor during instantiation.
Definition at line 46 of file vectoreditor.h.
Referenced by activeLayerChanged(), and clearAllLayerSelections().
ViewSet* VectorEditor::mViewSet [protected] |
Set of View objects.
For internal use only.
Passed into VectorEditor during instantiation.
Definition at line 51 of file vectoreditor.h.
Referenced by breakLine(), delSel(), joinLine(), viewKeyPress(), viewMouseMove(), viewMousePress(), viewMouseRelease(), and viewSelChanged().
VectorData* VectorEditor::mData [protected] |
VectorData from active layer, consisting of std::vectors of Shapes, a SelectionSet, a Stack of undo's, an Image, and some other info. The VectorData will be GLIMSLineData or GLIMSGIDData, both of which ultimately inherit from the VectorData class.
For internal use only.
mData is retrieved from the active layer in VectorLayerSet mLayerSet using VectorLayer::getData during setActiveLayer call.
Definition at line 56 of file vectoreditor.h.
Referenced by activeLayerChanged(), breakLine(), delSel(), joinLine(), overSelNode(), VectorEditor(), viewKeyPress(), viewMouseMove(), viewMousePress(), viewMouseRelease(), and viewSelChanged().
SelectionSet* VectorEditor::mSelSet [protected] |
List of selected vector objects.
For internal use only.
mSelSet is retrieved from mData.
Definition at line 66 of file vectoreditor.h.
Referenced by activeLayerChanged(), breakLine(), delSel(), isSelLine(), isSelPoint(), joinLine(), overSelNode(), VectorEditor(), viewMouseMove(), viewMousePress(), viewMouseRelease(), and viewSelChanged().
bool VectorEditor::mInObject [protected] |
bool VectorEditor::mCtrlDown [protected] |
Definition at line 73 of file vectoreditor.h.
Referenced by delSel(), init(), viewKeyPress(), viewKeyRelease(), viewMouseMove(), and viewMousePress().
bool VectorEditor::mShiftDown [protected] |
Definition at line 74 of file vectoreditor.h.
Referenced by init(), viewKeyPress(), viewKeyRelease(), and viewSelChanged().
bool VectorEditor::mMovingNode [protected] |
Definition at line 75 of file vectoreditor.h.
Referenced by init(), viewMouseMove(), viewMousePress(), and viewMouseRelease().
std::vector<SelectionSet::SelObj> VectorEditor::mOverNode [protected] |
Definition at line 77 of file vectoreditor.h.
Referenced by init(), viewMouseMove(), and viewMousePress().
Home |
Search |
Disclaimers & Privacy |
Contact Us GLIMSView Maintainer: dsoltesz@usgs.gov |