GLIMSView Source Code Documentation

SelectionSet Class Reference

#include <selectionset.h>

Inheritance diagram for SelectionSet:

Inheritance graph
[legend]

List of all members.


Detailed Description

A group of user selections of vectors objects (points and lines).

The user will select vector objects on the screen and these selections are stored here as integer indices into the datasets themselves.

Author:
Dan Mingus
History:
2004-12-04 Deborah Lee Soltesz - Modified this class to inherit from QObject, enabling it to have signals and slots. This allows SelectionSet to announce (signal) when it has been changed so that other classes can refresh, repaint, reload, and so forth.

Definition at line 20 of file selectionset.h.


Signals

void selectionChanged ()

Public Member Functions

 SelectionSet ()
 SelectionSet (const SelectionSet &copyMe)
void operator= (const SelectionSet &copyMe)
 Copy.
 ~SelectionSet ()
SelectionSet::SelObjoperator[] (int iobj)
 Overload [] to make selection set behave like an array of SelObjs.
void clear ()
 Deselect all the vector objects.
int size ()
 How many vector objects are in the selection list?
void add (SelObj &obj)
 Add a new object to the list of vector objects selected by the user.
SelectionSet::SelBoxselBox ()
 Get the structure holding the information about the selection boundary the user has defined.
void setSelecting (bool sel)
 Set the status of the user defining a selection boundary.
bool isSelecting ()
 Is a selection boundary being set or has it been set?
void resetBox ()
 Reset the selection boundary.
void erase (int i)
 Remove item "i" from list of selected objects.
bool isSelObj (int iobj)
 Is this object selected? Is this object on the list of selected objects?
bool isSelNode (int iobj, int inode)
 Is this node selected?

Protected Attributes

std::vector< SelObjmSelObj
 array of selected vector elements
SelBox mBox
 selection box drawn by user
bool mSelecting
 is the user selecting (?)

Classes

struct  SelBox
 User on-screen selection box or boundary. More...
struct  SelObj
 A selected vector element. More...

Constructor & Destructor Documentation

SelectionSet::SelectionSet (  ) 

Definition at line 4 of file selectionset.cpp.

References resetBox().

Here is the call graph for this function:

SelectionSet::SelectionSet ( const SelectionSet copyMe  )  [inline]

Definition at line 52 of file selectionset.h.

References mBox, mSelecting, and mSelObj.

SelectionSet::~SelectionSet (  ) 

Definition at line 8 of file selectionset.cpp.


Member Function Documentation

void SelectionSet::operator= ( const SelectionSet copyMe  )  [inline]

Copy.

Definition at line 62 of file selectionset.h.

References mBox, mSelecting, and mSelObj.

SelectionSet::SelObj & SelectionSet::operator[] ( int  iobj  ) 

Overload [] to make selection set behave like an array of SelObjs.

Return the information about the selected object as stored in the list at index iobj. Useful for iterating through all the selected vector objects.

Parameters:
iobj index into the array of selected objects.
Returns:
SelObj is the information for a single selected object in the list of all the objects the user has selected on the screen.

Definition at line 23 of file selectionset.cpp.

References mSelObj.

void SelectionSet::clear (  ) 

int SelectionSet::size (  ) 

void SelectionSet::add ( SelObj obj  ) 

Add a new object to the list of vector objects selected by the user.

Parameters:
obj a single vector object to add to the selection list.

Definition at line 50 of file selectionset.cpp.

References mSelObj.

Referenced by GlacierConfigDlg::setSelectedGID(), GLIMSLineData::validate(), GLIMSGIDData::validate(), VectorEditor::viewMousePress(), and VectorEditor::viewSelChanged().

SelectionSet::SelBox & SelectionSet::selBox (  ) 

Get the structure holding the information about the selection boundary the user has defined.

Returns:
structure holding the information about the selection boundary the user has defined.

Definition at line 62 of file selectionset.cpp.

References mBox.

Referenced by VectorEditor::viewMouseMove(), VectorEditor::viewMousePress(), and VectorEditor::viewMouseRelease().

void SelectionSet::setSelecting ( bool  sel  ) 

Set the status of the user defining a selection boundary.

Change the status of whether or not the user is defining (or has defined) a boundary for selecting vector objects.

Parameters:
sel boolean true: selection boundary is being set or has been set false: no selection boundary

Definition at line 76 of file selectionset.cpp.

References mSelecting.

Referenced by VectorEditor::viewMousePress().

bool SelectionSet::isSelecting (  ) 

Is a selection boundary being set or has it been set?

Returns:
true or false

Definition at line 86 of file selectionset.cpp.

References mSelecting.

Referenced by VectorEditor::viewMouseMove(), and VectorEditor::viewMouseRelease().

void SelectionSet::resetBox (  ) 

Reset the selection boundary.

Wipe out the selection boundary and set its status to "no selection" (mSelecting = false).

Definition at line 95 of file selectionset.cpp.

References SelectionSet::SelBox::h, mBox, mSelecting, SelectionSet::SelBox::w, SelectionSet::SelBox::x, and SelectionSet::SelBox::y.

Referenced by SelectionSet(), and VectorEditor::viewMouseRelease().

void SelectionSet::erase ( int  i  ) 

Remove item "i" from list of selected objects.

Parameters:
i index of object to remove from list, where the first object in the list is at index 0

Definition at line 105 of file selectionset.cpp.

References mSelObj, and selectionChanged().

Referenced by VectorEditor::joinLine().

bool SelectionSet::isSelObj ( int  iobj  ) 

Is this object selected? Is this object on the list of selected objects?

Parameters:
iobj an object to look for in list of selected objects
Returns:
whether or not the object is selected

Definition at line 118 of file selectionset.cpp.

References mSelObj.

Referenced by VectorLayer::draw().

bool SelectionSet::isSelNode ( int  iobj,
int  inode 
)

Is this node selected?

Parameters:
iobj object the node is a part of
inode a Node to look for in the selected list
Returns:
whether or not the node is selected

Definition at line 134 of file selectionset.cpp.

References mSelObj.

Referenced by VectorLayer::draw().

void SelectionSet::selectionChanged (  )  [signal]

Referenced by erase().


Member Data Documentation

std::vector<SelObj> SelectionSet::mSelObj [protected]

array of selected vector elements

Definition at line 44 of file selectionset.h.

Referenced by add(), clear(), erase(), isSelNode(), isSelObj(), operator=(), operator[](), SelectionSet(), and size().

selection box drawn by user

Definition at line 45 of file selectionset.h.

Referenced by operator=(), resetBox(), selBox(), and SelectionSet().

bool SelectionSet::mSelecting [protected]

is the user selecting (?)

Definition at line 46 of file selectionset.h.

Referenced by isSelecting(), operator=(), resetBox(), SelectionSet(), and setSelecting().


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

Home | Search | Disclaimers & Privacy | Contact Us
GLIMSView Maintainer: dsoltesz@usgs.gov