GLIMSView Source Code Documentation

GLIMSLineData Class Reference

#include <glimslinedata.h>

Inheritance diagram for GLIMSLineData:

Inheritance graph
[legend]

List of all members.


Detailed Description

This holds all glacier outlines and maps to them a GID and a LDF.

These mappings are integer indices into LineDefSet which is local and the set of GIDs that is stored in GLIMSGIDData. This provides routines for modifying the lines it contains as well as routines for bulk import.

History:
2005-07-06 Deborah Lee Soltesz Refactored undo functionality
History:
2005-07-23 Deborah Lee Soltesz Added redo, made a generic pop function for new redo functionality
What's New:
2005-07-23 Deborah Lee Soltesz Redo!!!
What's New:
2007-06-14 Deborah Lee Soltesz Validation function checks for required metadata, and reports to ValidationReport. Provides warning for non-required invalid/missing items, and errors for required items.
Todo:
2005-07-12 Deborah Lee Soltesz Eliminate redundant "with and without history" functions as much as possible. See also GlacierLineHistory.
Todo:
2005-07-23 Deborah Lee Soltesz Is memory being properly cleaned up during undo and redo? Are GID/Line associations properly managed?

Definition at line 51 of file glimslinedata.h.


Public Types

enum  ShapeType { POINT, LINE, POLY }

Public Slots

void transformDataset ()

Signals

void datasetChanged ()

Public Member Functions

 GLIMSLineData ()
virtual bool toXML (QDomDocument &doc, QDomElement &elem, std::string id="")
 Write Glacier Line information to the XML project file.
virtual bool fromXML (QDomElement &elem)
 Read Glacier Line information from XML project file.
void setDefGID (int gid)
 Set default Glacier ID.
void setDefLDF (int ldf)
 Set default Line Definition.
void setLDF (int iline, int ildf)
 Set Line Definition at index ildf in Line Definition Set to be associated to the line at index iline in the mXYSet and mLLSet.
void setGID (int iline, int igid)
 Set the Glacier ID at index igid to be associated to the line at index iline in the mXYSet and mLLSet.
virtual void addLine (Node &xynode)
 Create a new GlacierLine using the Node as the starting point.
virtual void restoreLine (GlacierLine &line, int iline=-1)
 Restore a deleted GlacierLine.
virtual void delLine (int iline)
 Delete an entire line.
virtual void removeLine (int iline)
 Remove an entire line without history.
virtual void breakLine (int iline, int inode)
 Break the line at index iline at the node at index inode into two lines.
virtual void restoreJoinedLines (GlacierLine &line1, int iline1, GlacierLine &line2, int iline2, GlacierLineHistoryElement *h1, GlacierLineHistoryElement *h2)
 Undo a joinLine, restoring the original lines.
virtual void joinLine (int il1, int il2, int in1, int in2)
 Join two lines into a single line.
virtual void rejoinLine (GlacierLine &originalLine, int il1, int il2, GlacierLineHistoryElement *h1, GlacierLineHistoryElement *h2)
 Rejoin the two lines at indices il1 and il2 at the nodes at indices in1 and in2 into a single line.
virtual void addLineNode (Node &node, int iline, int inode=-1)
 Add a Node to the line at index iline.
virtual void restoreLineNode (Node &node, int iline, int inode)
 Restore a deleted Node to the line at index iline.
virtual void delLineNode (int iline, int inode)
 Delete the Node at index inode in the line at index iline.
virtual void removeLineNode (int iline, int inode)
 Remove the Node at index inode in the line at index iline without recording history information.
virtual void moveLineNode (int iline, int inode, Node &xynode)
 Move the Node at index inode in the line at index iline to a new location relative to the base image.
virtual void startMoveLineNode (int iline, int inode, Node &xynode)
 Push history information for moving the Node at index inode in the line at index iline to a new location relative to the base image.
virtual void restoreMovedLineNode (int iline, int inode, Node &xynode)
 Restores a moved Node at index inode in the line at index iline to its original location, captured in xynode.
virtual void insertLineNode (Node &node, int iline, int inode=-1)
 Insert a Node to the line at index iline.
virtual void reinsertLineNode (Node &node, int iline, int inode=-1)
 Reinsert a deleted Node to the line at index iline.
virtual void pop ()
 Undo for GLIMSLineData implemented by making the top of the stack the current state, then popping the stacks so the top of the stacks are the previous state.
virtual void redo ()
 Redo for GLIMSLineData implemented by making the moving a history element from the redo stack to the current state and the undo stack.
virtual void push ()
 Saves the current selection state onto the selection set undo stack as part of history and undo functionality.
virtual void pushSelection ()
 Causes a history item to be recorded for a user selection/deselection of lines and/or nodes.
virtual void addLineNodeLL (Node &n, int iline, int inode=-1)
 Add a node to line at position inode in line stored at iline, where the node was built using lat-lon instead of XY coordinates.
virtual void addLineLL (Node &n)
 Add a line with a starting node built using lat-lon instead of XY.
virtual void addLineSetLL (std::vector< GlacierLine > &glset)
 Add a line set built using lat-lon instead of XY.
void addLDF (LineDef &ldf)
 Add a line definition, which contains metadata specific to the feature types it is designed to describe.
void loadDefaultSet ()
 Load the default line definition set.
LineDefSetgetLDFSet ()
 Get the default line definition set.
GlacierLinetoXY (GlacierLine *gl)
 Get the XY coordinate version of the GlacierLine at gl, which is built with lat-lon coordinate information.
bool validate (ValidationReport *valRep)
 Check that all lines have an associated glacier id, line definition, and at least 4 vertices.
virtual void delNode (int)
virtual void moveNode (Node &, int=-1)
virtual void insertNode (Node &, int)
virtual void addNode (Node &, int=-1)
void setImage (Image *img)
ShapeType getType ()
std::vector< Shape * > & getXYSet ()
std::vector< Shape * > & getLLSet ()
unsigned int size ()
SelectionSetgetSelSet ()
virtual bool toXMLFile (std::string fname, std::string docname)
virtual bool fromXMLFile (std::string fname, std::string docname)
virtual void setCurrentVersion (std::string versionString)
virtual void setCurrentVersion (QDate versionQDate)
virtual QDate getCurrentVersion ()
virtual std::string getCurrentVersionStr ()

Protected Member Functions

void setAttr (int iline)
void pop (GlacierLineHistory *historyUndo, GlacierLineHistory *historyRedo, std::stack< SelectionSet > *selSetUndo, std::stack< SelectionSet > *selSetRedo)
 Generic Un/Redo for GLIMSLineData implemented by making the top of the "undo" stack the current state, popping the stacks so the top of the stacks are the previous state and pushing that to the "redo" stack.
virtual bool writeTextTag (QDomDocument &doc, QDomElement &elem, std::string tagName, std::string text, std::string id="")
virtual bool writeIntTag (QDomDocument &doc, QDomElement &elem, std::string tagName, int val, std::string id="")
virtual bool writeDoubleTag (QDomDocument &doc, QDomElement &elem, std::string tagName, double val, std::string id="")
virtual std::string readTextTag (QDomElement elem, std::string tagName="", std::string id="")
virtual int readIntTag (QDomElement elem, std::string tagName="", std::string id="")
virtual double readDoubleTag (QDomElement elem, std::string tagName="", std::string id="")
virtual QDomElement createBaseTag (QDomDocument &doc, QDomElement &elem, std::string id, std::string tagName)
virtual QDomElement getElemByTagName (QDomElement &elem, std::string name)
virtual std::string qDateToString (const QDate *aQDate)
virtual bool stringToQDate (const std::string aStrDate, QDate *aQDate)
virtual std::string qDateTimeToString (const QDateTime *aQDateTime)
virtual bool stringToQDateTime (const std::string aStrDateTime, QDateTime *aQDateTime)

Protected Attributes

int mDefGID
 Default Glacier ID.
int mDefLDF
 Default Line Definition.
LineDefSet mLDFSet
 Set of Line Definitions.
GlacierLineHistory mHistory
 History of actions taken on GlacierLines.
GlacierLineHistory mRedoHistory
 History of actions popped off the history stack.
std::vector< Shape * > mLLSet
std::vector< Shape * > mXYSet
SelectionSet mSelSet
std::stack< std::vector< Shape * > > mUndoLL
std::stack< std::vector< Shape * > > mUndoXY
std::stack< SelectionSetmUndoSel
std::stack< std::vector< Shape * > > mRedoLL
std::stack< std::vector< Shape * > > mRedoXY
std::stack< SelectionSetmRedoSel
ShapeType mType
ImagemImg
QDate mCurrentVersion

Member Enumeration Documentation

enum VectorData::ShapeType [inherited]

Enumerator:
POINT 
LINE 
POLY 

Definition at line 24 of file vectordata.h.


Constructor & Destructor Documentation

GLIMSLineData::GLIMSLineData (  ) 

Definition at line 5 of file glimslinedata.cpp.


Member Function Documentation

void GLIMSLineData::setAttr ( int  iline  )  [protected]

void GLIMSLineData::pop ( GlacierLineHistory historyUndo,
GlacierLineHistory historyRedo,
std::stack< SelectionSet > *  selSetUndo,
std::stack< SelectionSet > *  selSetRedo 
) [protected]

Generic Un/Redo for GLIMSLineData implemented by making the top of the "undo" stack the current state, popping the stacks so the top of the stacks are the previous state and pushing that to the "redo" stack.

Whether this is an "undo" or a "redo" depends on the order the mHistory and mRedoHistory stacks (and associated selection set stacks) are put into the function parameters.

Usage

  • undo: pop (&mHistory, &mRedoHistory, &mUndoSel, &mRedoSel) ;
  • redo: pop (&mRedoHistory, &mHistory, &mRedoSel, &mUndoSel) ;

Actions stored in doubles (e.g. join line, break line) will have their two elements reversed when they're pushed to "redo" stack so that the order of the elements is maintained no matter what.

Parameters:
historyUndo The history stack to be popped
historyRedo The history stack to have the popped history pushed to
selSetUndo The selection stack to popped
selSetRedo The selection stack to have the popped selection pushed to

Definition at line 621 of file glimslinedata.cpp.

References addedLine, addedNode, brokeLine, SelectionSet::clear(), deletedLine, deletedNode, GlacierLineHistoryElement::getAction(), GlacierLineHistoryElement::getLineIndex(), GlacierLineHistoryElement::getNodeIndex(), GlacierLineHistoryElement::getShape(), insertedNode, joinedLines, mHistory, movedNode, VectorData::mSelSet, VectorData::mXYSet, GlacierLineHistory::peek(), GlacierLineHistory::pop(), GlacierLineHistory::push(), rejoinLine(), removeLine(), removeLineNode(), restoreJoinedLines(), restoreLine(), restoreLineNode(), restoreMovedLineNode(), selection, GlacierLineHistoryElement::setAction(), GlacierLineHistoryElement::setShape(), and GlacierLineHistory::size().

Here is the call graph for this function:

bool GLIMSLineData::toXML ( QDomDocument &  doc,
QDomElement &  elem,
std::string  id = "" 
) [virtual]

Write Glacier Line information to the XML project file.

Implements SimpleLineData.

Definition at line 11 of file glimslinedata.cpp.

References mLDFSet, VectorData::mLLSet, GlacierLine::toXML(), and LineDefSet::toXML().

Referenced by GLIMSDataset::toXML().

Here is the call graph for this function:

bool GLIMSLineData::fromXML ( QDomElement &  elem  )  [virtual]

void GLIMSLineData::setDefGID ( int  gid  )  [inline]

Set default Glacier ID.

Definition at line 106 of file glimslinedata.h.

References mDefGID.

Referenced by GlacierIDChooserDlg::setSelectedGID(), and GlacierConfigDlg::setSelectedGID().

void GLIMSLineData::setDefLDF ( int  ldf  )  [inline]

Set default Line Definition.

Definition at line 113 of file glimslinedata.h.

References mDefLDF.

Referenced by LineSelectorDlg::makeDefaultLineDef().

void GLIMSLineData::setLDF ( int  iline,
int  ildf 
)

Set Line Definition at index ildf in Line Definition Set to be associated to the line at index iline in the mXYSet and mLLSet.

Definition at line 835 of file glimslinedata.cpp.

References GLIMSGlobals::AVAILCOLORS, DspAttr::color, VectorData::datasetChanged(), Shape::getAttr(), GlacierLine::mLDF, mLDFSet, VectorData::mLLSet, VectorData::mXYSet, LineDefSet::size(), DspAttr::style, and DspAttr::width.

Referenced by LineSelectorDlg::changeCurLine(), GLIMSProject::importGLIMSIngestData(), and GLIMSProject::importSegmentsFromShapefile().

Here is the call graph for this function:

void GLIMSLineData::setGID ( int  iline,
int  igid 
)

Set the Glacier ID at index igid to be associated to the line at index iline in the mXYSet and mLLSet.

Definition at line 853 of file glimslinedata.cpp.

References VectorData::datasetChanged(), GlacierLine::mGID, VectorData::mLLSet, and VectorData::mXYSet.

Referenced by GLIMSProject::importGLIMSIngestData(), GLIMSProject::importSegmentsFromShapefile(), and GlacierIDChooserDlg::setCurLines().

void GLIMSLineData::addLine ( Node xynode  )  [virtual]

Create a new GlacierLine using the Node as the starting point.

Parameters:
xynode The starting point of the line, containing the XY coordinates of the image where the user clicked

Implements SimpleLineData.

Definition at line 68 of file glimslinedata.cpp.

References addedLine, GLIMSGlobals::AVAILCOLORS, GlacierLineHistory::clear(), DspAttr::color, VectorData::datasetChanged(), Image::getLL(), LineDef::mColor, mDefGID, mDefLDF, mHistory, VectorData::mImg, mLDFSet, VectorData::mLLSet, mRedoHistory, VectorData::mSelSet, LineDef::mStyle, VectorData::mUndoSel, LineDef::mWidth, VectorData::mXYSet, Line::nodeset(), GlacierLineHistory::push(), Line::setAttr(), DspAttr::style, DspAttr::width, Node::x, and Node::y.

Referenced by addLineLL().

Here is the call graph for this function:

void GLIMSLineData::restoreLine ( GlacierLine line,
int  iline = -1 
) [virtual]

Restore a deleted GlacierLine.

Parameters:
line A line containing nodes with XY coordinates. Lat/Lon coordinates will be calculated as the line is added to the line set. No history information will be recorded by this function.
iline Position in the line set to insert the line. If the default of -1 is taken, the line will be added to the end of the line set.
Author:
deborah lee soltesz
Date:
2005-07-12

Todo:
dls 2005-07-12 insert lines back into their proper place in the lineset structure

Definition at line 101 of file glimslinedata.cpp.

References VectorData::datasetChanged(), Image::getLL(), VectorData::mImg, VectorData::mLLSet, VectorData::mXYSet, and Line::size().

Referenced by pop().

Here is the call graph for this function:

void GLIMSLineData::delLine ( int  iline  )  [virtual]

Delete an entire line.

Parameters:
iline The index of the line of the line to be deleted in the vector "sets" of line data mXYSet and mLLSet

Implements SimpleLineData.

Definition at line 130 of file glimslinedata.cpp.

References GlacierLineHistory::clear(), deletedLine, mHistory, VectorData::mLLSet, mRedoHistory, VectorData::mSelSet, VectorData::mUndoSel, VectorData::mXYSet, and GlacierLineHistory::push().

Referenced by delLineNode().

Here is the call graph for this function:

void GLIMSLineData::removeLine ( int  iline  )  [virtual]

Remove an entire line without history.

Intended for use as an undo to addLine

Parameters:
iline The index of the line of the line to be deleted in the vector "sets" of line data mXYSet and mLLSet
Author:
deborah lee soltesz
Date:
2005-07-12

Definition at line 144 of file glimslinedata.cpp.

References VectorData::mLLSet, and VectorData::mXYSet.

Referenced by joinLine(), pop(), rejoinLine(), and removeLineNode().

void GLIMSLineData::breakLine ( int  iline,
int  inode 
) [virtual]

Break the line at index iline at the node at index inode into two lines.

The node at inode will be duplicated as the ending point of one line and the starting point of the next.

Parameters:
iline The index of the line of the line to be broken in the vector "sets" of line data mXYSet and mLLSet
inode The index of the node where the line is to be broken

Implements SimpleLineData.

Definition at line 152 of file glimslinedata.cpp.

References brokeLine, GlacierLineHistory::clear(), VectorData::datasetChanged(), Line::delNode(), GlacierLine::mGID, mHistory, GlacierLine::mLDF, VectorData::mLLSet, mRedoHistory, VectorData::mSelSet, VectorData::mUndoSel, VectorData::mXYSet, Line::nodeset(), GlacierLineHistory::push(), and Line::size().

Here is the call graph for this function:

void GLIMSLineData::restoreJoinedLines ( GlacierLine line1,
int  iline1,
GlacierLine line2,
int  iline2,
GlacierLineHistoryElement h1,
GlacierLineHistoryElement h2 
) [virtual]

Undo a joinLine, restoring the original lines.

Break the line at index iline at the node at index inode in order to restore the two original lines made into a single line by a join. The node at inode will be duplicated as the ending point of one line and the starting point of the next. No history information is stored. This is intended to be used as an undo function for joinLines.

Parameters:
line1 Copy of the original line 1 before the join
line2 Copy of the original line 2 before the join
iline1 The index of line 1 to be restored. This line became the joined line.
iline2 The index of line 2 to be restored. This line was removed from the active dataset after its vertices/nodes were added to line 1.
h1 History associated with line 1
h2 History associated with line 2
Author:
deborah lee soltesz
Date:
2005-07-12
History:
2005-07-22 deborah lee soltesz Added history elements to allow function to change the stored shapes for later un/redos

Definition at line 205 of file glimslinedata.cpp.

References VectorData::datasetChanged(), Image::getLL(), VectorData::mImg, VectorData::mLLSet, VectorData::mXYSet, Line::nodeset(), GlacierLineHistoryElement::setShape(), and Line::size().

Referenced by pop().

Here is the call graph for this function:

void GLIMSLineData::joinLine ( int  il1,
int  il2,
int  in1,
int  in2 
) [virtual]

Join two lines into a single line.

Join the two lines at indices il1 and il2 at the nodes at indices in1 and in2 into a single line

Parameters:
il1 The index of the first line to be joined
il2 The index of the second line to be joined
in1 The index of the node in the first line to be joined
in2 The index of the node in the second line to be joined
Author:
deborah lee soltesz
Date:
2005-07-12

Implements SimpleLineData.

Definition at line 265 of file glimslinedata.cpp.

References GlacierLineHistory::clear(), VectorData::datasetChanged(), joinedLines, mHistory, VectorData::mLLSet, mRedoHistory, VectorData::mSelSet, VectorData::mUndoSel, VectorData::mXYSet, Line::nodeset(), GlacierLineHistory::push(), removeLine(), and Line::size().

Here is the call graph for this function:

void GLIMSLineData::rejoinLine ( GlacierLine originalLine,
int  il1,
int  il2,
GlacierLineHistoryElement h1,
GlacierLineHistoryElement h2 
) [virtual]

Rejoin the two lines at indices il1 and il2 at the nodes at indices in1 and in2 into a single line.

No history information is saved. Intended to be used as an undo function for breakLine.

Parameters:
originalLine The original line before modified by the break
il1 The index of the original line, modified by break
il2 The index of the new line created from the break
h1 History associated with line 1
h2 History associated with line 2
Author:
deborah lee soltesz
Date:
2005-07-12
History:
2005-07-22 deborah lee soltesz Added history elements to allow function to change the stored shapes for later un/redos

Definition at line 318 of file glimslinedata.cpp.

References VectorData::datasetChanged(), Image::getLL(), VectorData::mImg, VectorData::mLLSet, VectorData::mXYSet, Line::nodeset(), removeLine(), GlacierLineHistoryElement::setShape(), and Line::size().

Referenced by pop().

Here is the call graph for this function:

void GLIMSLineData::addLineNode ( Node node,
int  iline,
int  inode = -1 
) [virtual]

Add a Node to the line at index iline.

If inode is greater than 0, the Node will be inserted in the line after that index. If inode is -1, the Node will be added to the end of the line.

Parameters:
node Node to be added to the line at index iline
iline Index of the line to be added to
inode Index of the Node to insert the new Node after

Implements SimpleLineData.

Definition at line 362 of file glimslinedata.cpp.

References VectorData::datasetChanged(), and insertLineNode().

Referenced by addLineNodeLL().

Here is the call graph for this function:

void GLIMSLineData::restoreLineNode ( Node node,
int  iline,
int  inode 
) [virtual]

Restore a deleted Node to the line at index iline.

If inode is greater than 0, the Node will be inserted in the line after that index. If inode is -1, the Node will be added to the end of the line. No history information will be recorded.

Parameters:
node Node to be added to the line at index iline
iline Index of the line to be added to
inode Index of the Node to insert the new Node after
Author:
deborah lee soltesz
Date:
2005-07-12

Definition at line 376 of file glimslinedata.cpp.

References VectorData::datasetChanged(), and reinsertLineNode().

Referenced by pop().

Here is the call graph for this function:

void GLIMSLineData::delLineNode ( int  iline,
int  inode 
) [virtual]

Delete the Node at index inode in the line at index iline.

Parameters:
iline The index of the line containing the Node to be removed
inode The index of the Node to remove

Implements SimpleLineData.

Definition at line 391 of file glimslinedata.cpp.

References GlacierLineHistory::clear(), VectorData::datasetChanged(), deletedNode, delLine(), Line::delNode(), mHistory, VectorData::mLLSet, mRedoHistory, VectorData::mSelSet, VectorData::mUndoSel, VectorData::mXYSet, GlacierLineHistory::push(), and Line::size().

Here is the call graph for this function:

void GLIMSLineData::removeLineNode ( int  iline,
int  inode 
) [virtual]

Remove the Node at index inode in the line at index iline without recording history information.

Intended for use with history to remove an added node.

Parameters:
iline The index of the line containing the Node to be removed
inode The index of the Node to remove

Definition at line 413 of file glimslinedata.cpp.

References VectorData::datasetChanged(), Line::delNode(), VectorData::mLLSet, VectorData::mXYSet, removeLine(), and Line::size().

Referenced by pop().

Here is the call graph for this function:

void GLIMSLineData::moveLineNode ( int  iline,
int  inode,
Node xynode 
) [virtual]

Move the Node at index inode in the line at index iline to a new location relative to the base image.

Parameters:
iline The index of the line containing the Node to be moved
inode The index of the Node to move
xynode A copy of the node to be moved with modified position information. The attributes of xynode will be copied to the node to be moved.

Implements SimpleLineData.

Definition at line 430 of file glimslinedata.cpp.

References VectorData::datasetChanged(), Image::getLL(), VectorData::mImg, VectorData::mLLSet, VectorData::mXYSet, startMoveLineNode(), Node::x, and Node::y.

Here is the call graph for this function:

void GLIMSLineData::startMoveLineNode ( int  iline,
int  inode,
Node xynode 
) [virtual]

Push history information for moving the Node at index inode in the line at index iline to a new location relative to the base image.

Parameters:
iline The index of the line containing the Node to be moved
inode The index of the Node to move
xynode A copy of the original node before it was moved. The attributes of xynode will be stored before moving.
Todo:
2005-07-12 dls Need better handling of keeping track of history of moved nodes - only first move is tracked. Getting these functions into the higher level classes will alllow them to be called at the appropriate times from VectorEditor.

Definition at line 457 of file glimslinedata.cpp.

References GlacierLineHistory::clear(), GlacierLineHistoryElement::getAction(), GlacierLineHistoryElement::getLineIndex(), GlacierLineHistoryElement::getNodeIndex(), mHistory, movedNode, mRedoHistory, VectorData::mSelSet, VectorData::mUndoSel, VectorData::mXYSet, GlacierLineHistory::peek(), GlacierLineHistory::push(), and Node::x.

Referenced by moveLineNode().

Here is the call graph for this function:

void GLIMSLineData::restoreMovedLineNode ( int  iline,
int  inode,
Node xynode 
) [virtual]

Restores a moved Node at index inode in the line at index iline to its original location, captured in xynode.

Parameters:
iline The index of the line containing the Node to be moved
inode The index of the Node to move
xynode A copy of the original node before it was moved. The attributes of xynode will be copied to the node to be restored to its original position.

Definition at line 488 of file glimslinedata.cpp.

References VectorData::datasetChanged(), Image::getLL(), VectorData::mImg, VectorData::mLLSet, VectorData::mXYSet, Node::x, and Node::y.

Referenced by pop().

Here is the call graph for this function:

void GLIMSLineData::insertLineNode ( Node node,
int  iline,
int  inode = -1 
) [virtual]

Insert a Node to the line at index iline.

If inode is greater than 0, the Node will be inserted in the line after that index. If inode is -1, the Node will be added to the end of the line.

Parameters:
node Node to be inserted to the line at index iline
iline Index of the line to have a node inserted into
inode Index of the Node to insert the new Node after

Implements SimpleLineData.

Definition at line 503 of file glimslinedata.cpp.

References GlacierLineHistory::clear(), VectorData::datasetChanged(), Image::getLL(), insertedNode, mHistory, VectorData::mImg, VectorData::mLLSet, mRedoHistory, VectorData::mSelSet, VectorData::mUndoSel, VectorData::mXYSet, Line::nodeset(), GlacierLineHistory::push(), Node::x, and Node::y.

Referenced by addLineNode().

Here is the call graph for this function:

void GLIMSLineData::reinsertLineNode ( Node node,
int  iline,
int  inode = -1 
) [virtual]

Reinsert a deleted Node to the line at index iline.

If inode is greater than 0, the Node will be inserted in the line after that index. If inode is -1, the Node will be added to the end of the line. No history information will be recorded.

Parameters:
node Node to be inserted to the line at index iline
iline Index of the line to have a node inserted into
inode Index of the Node to insert the new Node after
Author:
deborah lee soltesz
Date:
2005-07-12

Todo:
dls 2005-07-12 restore first node in line to its correct position

Definition at line 542 of file glimslinedata.cpp.

References VectorData::datasetChanged(), Image::getLL(), VectorData::mImg, VectorData::mLLSet, VectorData::mXYSet, Line::nodeset(), Node::x, and Node::y.

Referenced by restoreLineNode().

Here is the call graph for this function:

void GLIMSLineData::pop (  )  [virtual]

Undo for GLIMSLineData implemented by making the top of the stack the current state, then popping the stacks so the top of the stacks are the previous state.

History:
2005-05-17 dls - disabled push() and pop() with plans to refactor undo functionality to only hold minimal history information instead of a complete snapshot
History:
2005-07-06 refactor of undo functionality to only hold minimal history information instead of a complete snapshot. Old commented out code was removed.
History:
2005-07-06 altered to use generic pop function that works for both undo and redo

Implements SimpleLineData.

Definition at line 611 of file glimslinedata.cpp.

References mHistory, mRedoHistory, VectorData::mRedoSel, and VectorData::mUndoSel.

Referenced by redo().

void GLIMSLineData::redo (  )  [virtual]

Redo for GLIMSLineData implemented by making the moving a history element from the redo stack to the current state and the undo stack.

Author:
2005-07-15 Deborah Lee Soltesz

Implements SimpleLineData.

Definition at line 616 of file glimslinedata.cpp.

References mHistory, mRedoHistory, VectorData::mRedoSel, VectorData::mUndoSel, and pop().

Here is the call graph for this function:

void GLIMSLineData::push (  )  [virtual]

Saves the current selection state onto the selection set undo stack as part of history and undo functionality.

History:
2005-05-17 dls - disabled push() and pop() with plans to refactor undo functionality to only hold minimal history information instead of a complete snapshot
History:
2005-07-06 refactor of undo functionality to only hold minimal history information instead of a complete snapshot. Old commented out code was removed.

Implements SimpleLineData.

Definition at line 821 of file glimslinedata.cpp.

References VectorData::datasetChanged().

Referenced by addLineSetLL().

void GLIMSLineData::pushSelection (  )  [virtual]

Causes a history item to be recorded for a user selection/deselection of lines and/or nodes.

Implements SimpleLineData.

Definition at line 827 of file glimslinedata.cpp.

References GlacierLineHistory::clear(), mHistory, mRedoHistory, VectorData::mSelSet, VectorData::mUndoSel, GlacierLineHistory::push(), and selection.

Here is the call graph for this function:

virtual void GLIMSLineData::addLineNodeLL ( Node n,
int  iline,
int  inode = -1 
) [inline, virtual]

Add a node to line at position inode in line stored at iline, where the node was built using lat-lon instead of XY coordinates.

Used by shapefile import funtions.

Definition at line 467 of file glimslinedata.h.

References addLineNode(), Image::getXY(), VectorData::mImg, Node::x, and Node::y.

Referenced by GLIMSProject::importGLIMSIngestData(), and GLIMSProject::importSegmentsFromShapefile().

Here is the call graph for this function:

virtual void GLIMSLineData::addLineLL ( Node n  )  [inline, virtual]

Add a line with a starting node built using lat-lon instead of XY.

Used by shapefile import funtions.

Definition at line 476 of file glimslinedata.h.

References addLine(), Image::getXY(), VectorData::mImg, Node::x, and Node::y.

Referenced by GLIMSProject::importGLIMSIngestData(), and GLIMSProject::importSegmentsFromShapefile().

Here is the call graph for this function:

void GLIMSLineData::addLineSetLL ( std::vector< GlacierLine > &  glset  )  [virtual]

Add a line set built using lat-lon instead of XY.

Used by shapefile import funtions.

Definition at line 873 of file glimslinedata.cpp.

References VectorData::mLLSet, VectorData::mXYSet, push(), and VectorData::transformDataset().

Referenced by ImageCalculator::calculate().

Here is the call graph for this function:

void GLIMSLineData::addLDF ( LineDef ldf  )  [inline]

Add a line definition, which contains metadata specific to the feature types it is designed to describe.

Definition at line 491 of file glimslinedata.h.

References LineDefSet::add(), VectorData::datasetChanged(), and mLDFSet.

Referenced by GLIMSProject::importGLIMSIngestData(), GLIMSProject::importSegmentsFromShapefile(), and loadDefaultSet().

Here is the call graph for this function:

void GLIMSLineData::loadDefaultSet (  )  [inline]

Load the default line definition set.

Definition at line 499 of file glimslinedata.h.

References addLDF(), GLIMSGlobals::mGlbLDFSet, and LineDefSet::size().

Referenced by GLIMSProject::create().

Here is the call graph for this function:

LineDefSet& GLIMSLineData::getLDFSet (  )  [inline]

GlacierLine * GLIMSLineData::toXY ( GlacierLine gl  ) 

Get the XY coordinate version of the GlacierLine at gl, which is built with lat-lon coordinate information.

Used by shapefile import functions.

Definition at line 580 of file glimslinedata.cpp.

References GLIMSGlobals::AVAILCOLORS, DspAttr::color, Shape::getAttr(), Image::getXY(), LineDef::mColor, GlacierLine::mGID, VectorData::mImg, GlacierLine::mLDF, mLDFSet, LineDef::mStyle, LineDef::mWidth, Line::nodeset(), Line::size(), DspAttr::style, DspAttr::width, Node::x, and Node::y.

Here is the call graph for this function:

bool GLIMSLineData::validate ( ValidationReport valRep  ) 

Check that all lines have an associated glacier id, line definition, and at least 4 vertices.

Invalide lines will be highlighted (selected) on the screen. Also launches the line definition validation.

Returns:
bool true if all lines have glacier ids, and false if not
History:
2007-06-21 dls Added vertex count check

Definition at line 901 of file glimslinedata.cpp.

References SelectionSet::add(), ValidationReport::breakBegin(), ValidationReport::breakEnd(), SelectionSet::clear(), GlacierLine::mGID, GlacierLine::mLDF, mLDFSet, VectorData::mLLSet, VectorData::mSelSet, Line::nodeset(), SelectionSet::SelObj::obj, ValidationReport::reportError(), ValidationReport::reportWarning(), ValidationReport::subsectionBegin(), ValidationReport::subsectionEnd(), and LineDefSet::validate().

Referenced by GLIMSProject::validate().

Here is the call graph for this function:

virtual void SimpleLineData::delNode ( int   )  [inline, virtual, inherited]

Implements VectorData.

Definition at line 19 of file simplelinedata.h.

virtual void SimpleLineData::moveNode ( Node ,
int  = -1 
) [inline, virtual, inherited]

Implements VectorData.

Definition at line 21 of file simplelinedata.h.

virtual void SimpleLineData::insertNode ( Node ,
int   
) [inline, virtual, inherited]

Implements VectorData.

Definition at line 23 of file simplelinedata.h.

virtual void SimpleLineData::addNode ( Node ,
int  = -1 
) [inline, virtual, inherited]

Implements VectorData.

Definition at line 25 of file simplelinedata.h.

void VectorData::setImage ( Image img  )  [inline, inherited]

Definition at line 87 of file vectordata.h.

References VectorData::mImg.

Referenced by GLIMSDataset::GLIMSDataset().

ShapeType VectorData::getType (  )  [inline, inherited]

std::vector<Shape*>& VectorData::getXYSet (  )  [inline, inherited]

std::vector<Shape*>& VectorData::getLLSet (  )  [inline, inherited]

unsigned int VectorData::size (  )  [inline, inherited]

SelectionSet& VectorData::getSelSet (  )  [inline, inherited]

void VectorData::transformDataset (  )  [slot, inherited]

void VectorData::datasetChanged (  )  [signal, inherited]

bool XMLSerializeable::writeTextTag ( QDomDocument &  doc,
QDomElement &  elem,
std::string  tagName,
std::string  text,
std::string  id = "" 
) [protected, virtual, inherited]

virtual bool XMLSerializeable::writeIntTag ( QDomDocument &  doc,
QDomElement &  elem,
std::string  tagName,
int  val,
std::string  id = "" 
) [inline, protected, virtual, inherited]

virtual bool XMLSerializeable::writeDoubleTag ( QDomDocument &  doc,
QDomElement &  elem,
std::string  tagName,
double  val,
std::string  id = "" 
) [inline, protected, virtual, inherited]

std::string XMLSerializeable::readTextTag ( QDomElement  elem,
std::string  tagName = "",
std::string  id = "" 
) [protected, virtual, inherited]

virtual int XMLSerializeable::readIntTag ( QDomElement  elem,
std::string  tagName = "",
std::string  id = "" 
) [inline, protected, virtual, inherited]

virtual double XMLSerializeable::readDoubleTag ( QDomElement  elem,
std::string  tagName = "",
std::string  id = "" 
) [inline, protected, virtual, inherited]

virtual QDomElement XMLSerializeable::createBaseTag ( QDomDocument &  doc,
QDomElement &  elem,
std::string  id,
std::string  tagName 
) [inline, protected, virtual, inherited]

QDomElement XMLSerializeable::getElemByTagName ( QDomElement &  elem,
std::string  name 
) [protected, virtual, inherited]

Definition at line 119 of file xmlserializeable.cpp.

Referenced by GlacierIDDef::fromXML().

std::string XMLSerializeable::qDateToString ( const QDate *  aQDate  )  [protected, virtual, inherited]

bool XMLSerializeable::stringToQDate ( const std::string  aStrDate,
QDate *  aQDate 
) [protected, virtual, inherited]

std::string XMLSerializeable::qDateTimeToString ( const QDateTime *  aQDateTime  )  [protected, virtual, inherited]

Definition at line 149 of file xmlserializeable.cpp.

References XMLSerializeable::qDateToString().

Here is the call graph for this function:

bool XMLSerializeable::stringToQDateTime ( const std::string  aStrDateTime,
QDateTime *  aQDateTime 
) [protected, virtual, inherited]

Definition at line 205 of file xmlserializeable.cpp.

References XMLSerializeable::stringToQDate().

Here is the call graph for this function:

bool XMLSerializeable::toXMLFile ( std::string  fname,
std::string  docname 
) [virtual, inherited]

bool XMLSerializeable::fromXMLFile ( std::string  fname,
std::string  docname 
) [virtual, inherited]

void XMLSerializeable::setCurrentVersion ( std::string  versionString  )  [virtual, inherited]

Definition at line 249 of file xmlserializeable.cpp.

References XMLSerializeable::mCurrentVersion, and XMLSerializeable::stringToQDate().

Referenced by MainToolbar::setupProj().

Here is the call graph for this function:

void XMLSerializeable::setCurrentVersion ( QDate  versionQDate  )  [virtual, inherited]

Definition at line 254 of file xmlserializeable.cpp.

References XMLSerializeable::mCurrentVersion.

QDate XMLSerializeable::getCurrentVersion (  )  [virtual, inherited]

Definition at line 258 of file xmlserializeable.cpp.

References XMLSerializeable::mCurrentVersion.

std::string XMLSerializeable::getCurrentVersionStr (  )  [virtual, inherited]

Definition at line 262 of file xmlserializeable.cpp.

References XMLSerializeable::mCurrentVersion, and XMLSerializeable::qDateToString().

Here is the call graph for this function:


Member Data Documentation

int GLIMSLineData::mDefGID [protected]

Default Glacier ID.

Definition at line 55 of file glimslinedata.h.

Referenced by addLine(), and setDefGID().

int GLIMSLineData::mDefLDF [protected]

Default Line Definition.

Definition at line 56 of file glimslinedata.h.

Referenced by addLine(), and setDefLDF().

Set of Line Definitions.

Definition at line 57 of file glimslinedata.h.

Referenced by addLDF(), addLine(), fromXML(), getLDFSet(), setLDF(), toXML(), toXY(), and validate().

History of actions taken on GlacierLines.

Definition at line 59 of file glimslinedata.h.

Referenced by addLine(), breakLine(), delLine(), delLineNode(), insertLineNode(), joinLine(), pop(), pushSelection(), redo(), and startMoveLineNode().

History of actions popped off the history stack.

Definition at line 60 of file glimslinedata.h.

Referenced by addLine(), breakLine(), delLine(), delLineNode(), insertLineNode(), joinLine(), pop(), pushSelection(), redo(), and startMoveLineNode().

std::vector<Shape*> VectorData::mLLSet [protected, inherited]

std::vector<Shape*> VectorData::mXYSet [protected, inherited]

SelectionSet VectorData::mSelSet [protected, inherited]

std::stack<std::vector<Shape*> > VectorData::mUndoLL [protected, inherited]

Definition at line 35 of file vectordata.h.

Referenced by GLIMSGIDData::pop(), and GLIMSGIDData::push().

std::stack<std::vector<Shape*> > VectorData::mUndoXY [protected, inherited]

Definition at line 38 of file vectordata.h.

Referenced by GLIMSGIDData::pop(), and GLIMSGIDData::push().

std::stack<SelectionSet> VectorData::mUndoSel [protected, inherited]

std::stack<std::vector<Shape*> > VectorData::mRedoLL [protected, inherited]

std::stack<std::vector<Shape*> > VectorData::mRedoXY [protected, inherited]

std::stack<SelectionSet> VectorData::mRedoSel [protected, inherited]

ShapeType VectorData::mType [protected, inherited]

Definition at line 55 of file vectordata.h.

Referenced by VectorData::getType(), and VectorData::transformDataset().

Image* VectorData::mImg [protected, inherited]

QDate XMLSerializeable::mCurrentVersion [protected, inherited]


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

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