Engauge Digitizer 2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Document Class Reference

Storage of one imported image and the data attached to that image. More...

#include <Document.h>

Public Member Functions

 Document (const QImage &image)
 Constructor for imported images and dragged images. Only one coordinate system is create - others are added later externally.
 
 Document (const QString &fileName)
 Constructor for opened Documents, and error report files. The specified file is opened and read.
 
void addCoordSystems (unsigned int numberCoordSystemToAdd)
 Add some number (0 or more) of additional coordinate systems.
 
void addGraphCurveAtEnd (const QString &curveName)
 Add new graph curve to the list of existing graph curves.
 
void addPointAxisWithGeneratedIdentifier (const QPointF &posScreen, const QPointF &posGraph, QString &identifier, double ordinal, bool isXOnly)
 Add a single axis point with a generated point identifier.
 
void addPointAxisWithSpecifiedIdentifier (const QPointF &posScreen, const QPointF &posGraph, const QString &identifier, double ordinal, bool isXOnly)
 Add a single axis point with the specified point identifier.
 
void addPointGraphWithGeneratedIdentifier (const QString &curveName, const QPointF &posScreen, QString &generatedIentifier, double ordinal)
 Add a single graph point with a generated point identifier.
 
void addPointGraphWithSpecifiedIdentifier (const QString &curveName, const QPointF &posScreen, const QString &identifier, double ordinal)
 Add a single graph point with the specified point identifer. Note that PointStyle is not applied to the point within the Document.
 
void addPointsInCurvesGraphs (CurvesGraphs &curvesGraphs)
 Add all points identified in the specified CurvesGraphs. See also removePointsInCurvesGraphs.
 
void checkAddPointAxis (const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage, bool isXOnly)
 Check before calling addPointAxis. Also returns the next available ordinal number (to prevent clashes)
 
void checkEditPointAxis (const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage)
 Check before calling editPointAxis.
 
const CoordSystemcoordSystem () const
 Currently active CoordSystem.
 
unsigned int coordSystemCount () const
 Number of CoordSystem.
 
CoordSystemIndex coordSystemIndex () const
 Index of current active CoordSystem.
 
const CurvecurveAxes () const
 Get method for axis curve.
 
const CurvecurveForCurveName (const QString &curveName) const
 See CurvesGraphs::curveForCurveNames, although this also works for AXIS_CURVE_NAME.
 
const CurvesGraphscurvesGraphs () const
 Make all Curves available, read only, for CmdAbstract classes only.
 
QStringList curvesGraphsNames () const
 See CurvesGraphs::curvesGraphsNames.
 
int curvesGraphsNumPoints (const QString &curveName) const
 See CurvesGraphs::curvesGraphsNumPoints.
 
DocumentAxesPointsRequired documentAxesPointsRequired () const
 Get method for DocumentAxesPointsRequired.
 
void editPointAxis (const QPointF &posGraph, const QString &identifier)
 Edit the graph coordinates of a single axis point. Call this after checkAddPointAxis to guarantee success in this call.
 
bool isXOnly (const QString &pointIdentifier) const
 See Curve::isXOnly.
 
void iterateThroughCurvePointsAxes (const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
 See Curve::iterateThroughCurvePoints, for the axes curve.
 
void iterateThroughCurvePointsAxes (const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
 See Curve::iterateThroughCurvePoints, for the axes curve.
 
void iterateThroughCurveSegments (const QString &curveName, const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
 See Curve::iterateThroughCurveSegments, for any axes or graph curve.
 
void iterateThroughCurvesPointsGraphs (const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
 See Curve::iterateThroughCurvePoints, for all the graphs curves.
 
void iterateThroughCurvesPointsGraphs (const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
 See Curve::iterateThroughCurvePoints, for all the graphs curves.
 
bool loadCurvesFile (const QString &curvesFile)
 Load the curve names in the specified Engauge file into the current document. This is called near the end of the import process only.
 
DocumentModelAxesChecker modelAxesChecker () const
 Get method for DocumentModelAxesChecker.
 
DocumentModelColorFilter modelColorFilter () const
 Get method for DocumentModelColorFilter.
 
DocumentModelCoords modelCoords () const
 Get method for DocumentModelCoords.
 
CurveStyles modelCurveStyles () const
 Get method for CurveStyles.
 
DocumentModelDigitizeCurve modelDigitizeCurve () const
 Get method for DocumentModelDigitizeCurve.
 
DocumentModelExportFormat modelExport () const
 Get method for DocumentModelExportFormat.
 
DocumentModelGeneral modelGeneral () const
 Get method for DocumentModelGeneral.
 
DocumentModelGridRemoval modelGridRemoval () const
 Get method for DocumentModelGridRemoval.
 
DocumentModelPointMatch modelPointMatch () const
 Get method for DocumentModelPointMatch.
 
DocumentModelSegments modelSegments () const
 Get method for DocumentModelSegments.
 
void movePoint (const QString &pointIdentifier, const QPointF &deltaScreen)
 See Curve::movePoint.
 
int nextOrdinalForCurve (const QString &curveName) const
 Default next ordinal value for specified curve.
 
QPixmap pixmap () const
 Return the image that is being digitized.
 
QPointF positionGraph (const QString &pointIdentifier) const
 See Curve::positionGraph.
 
QPointF positionScreen (const QString &pointIdentifier) const
 See Curve::positionScreen.
 
void print () const
 Debugging method for printing directly from symbolic debugger.
 
void printStream (QString indentation, QTextStream &str) const
 Debugging method that supports print method of this class and printStream method of some other class(es)
 
QString reasonForUnsuccessfulRead () const
 Return an informative text message explaining why startup loading failed. Applies if successfulRead returns false.
 
void removePointAxis (const QString &identifier)
 Perform the opposite of addPointAxis.
 
void removePointGraph (const QString &identifier)
 Perform the opposite of addPointGraph.
 
void removePointsInCurvesGraphs (CurvesGraphs &curvesGraphs)
 Remove all points identified in the specified CurvesGraphs. See also addPointsInCurvesGraphs.
 
void saveXml (QXmlStreamWriter &writer) const
 Save document to xml.
 
void setCoordSystemIndex (CoordSystemIndex coordSystemIndex)
 Set the index of current active CoordSystem.
 
void setCurvesGraphs (const CurvesGraphs &curvesGraphs)
 Let CmdAbstract classes overwrite CurvesGraphs.
 
void setCurvesGraphs (CoordSystemIndex coordSystemIndex, const CurvesGraphs &curvesGraphs)
 Let CmdAbstract classes overwrite CurvesGraphs.
 
void setDocumentAxesPointsRequired (DocumentAxesPointsRequired documentAxesPointsRequired)
 Set the number of axes points required.
 
void setModelAxesChecker (const DocumentModelAxesChecker &modelAxesChecker)
 Set method for DocumentModelAxesChecker.
 
void setModelColorFilter (const DocumentModelColorFilter &modelColorFilter)
 Set method for DocumentModelColorFilter.
 
void setModelCoords (const DocumentModelCoords &modelCoords)
 Set method for DocumentModelCoords.
 
void setModelCurveStyles (const CurveStyles &modelCurveStyles)
 Set method for CurveStyles.
 
void setModelDigitizeCurve (const DocumentModelDigitizeCurve &modelDigitizeCurve)
 Set method for DocumentModelDigitizeCurve.
 
void setModelExport (const DocumentModelExportFormat &modelExport)
 Set method for DocumentModelExportFormat.
 
void setModelGeneral (const DocumentModelGeneral &modelGeneral)
 Set method for DocumentModelGeneral.
 
void setModelGridRemoval (const DocumentModelGridRemoval &modelGridRemoval)
 Set method for DocumentModelGridRemoval.
 
void setModelPointMatch (const DocumentModelPointMatch &modelPointMatch)
 Set method for DocumentModelPointMatch.
 
void setModelSegments (const DocumentModelSegments &modelSegments)
 Set method for DocumentModelSegments.
 
bool successfulRead () const
 Return true if startup loading succeeded. If the loading failed then reasonForUnsuccessfulRed will explain why.
 
void updatePointOrdinals (const Transformation &transformation)
 Update point ordinals after point addition/removal or dragging.
 

Detailed Description

Storage of one imported image and the data attached to that image.

Definition at line 40 of file Document.h.

Constructor & Destructor Documentation

◆ Document() [1/2]

Document::Document ( const QImage &  image)

Constructor for imported images and dragged images. Only one coordinate system is create - others are added later externally.

Definition at line 43 of file Document.cpp.

◆ Document() [2/2]

Document::Document ( const QString &  fileName)

Constructor for opened Documents, and error report files. The specified file is opened and read.

Definition at line 58 of file Document.cpp.

Member Function Documentation

◆ addCoordSystems()

void Document::addCoordSystems ( unsigned int  numberCoordSystemToAdd)

Add some number (0 or more) of additional coordinate systems.

This is only safe to call during import and before any changes have been made to the Document

Definition at line 138 of file Document.cpp.

◆ addGraphCurveAtEnd()

void Document::addGraphCurveAtEnd ( const QString &  curveName)

Add new graph curve to the list of existing graph curves.

Definition at line 147 of file Document.cpp.

◆ addPointAxisWithGeneratedIdentifier()

void Document::addPointAxisWithGeneratedIdentifier ( const QPointF &  posScreen,
const QPointF &  posGraph,
QString &  identifier,
double  ordinal,
bool  isXOnly 
)

Add a single axis point with a generated point identifier.

Call this after checkAddPointAxis to guarantee success in this call.

Parameters
posScreenScreen coordinates from QGraphicsView
posGraphGraph coordiantes from user
identifierIdentifier for new axis point
ordinalUnique, for curve, ordinal number
isXOnlyTrue if point has only an x coordinate

Definition at line 154 of file Document.cpp.

◆ addPointAxisWithSpecifiedIdentifier()

void Document::addPointAxisWithSpecifiedIdentifier ( const QPointF &  posScreen,
const QPointF &  posGraph,
const QString &  identifier,
double  ordinal,
bool  isXOnly 
)

Add a single axis point with the specified point identifier.

Call this after checkAddPointAxis to guarantee success in this call.

Parameters
posScreenScreen coordinates from QGraphicsView
posGraphGraph coordiantes from user
identifierIdentifier for new axis point
ordinalUnique, for curve, ordinal number
isXOnlyTrue if point has only an x coordinate

Definition at line 169 of file Document.cpp.

◆ addPointGraphWithGeneratedIdentifier()

void Document::addPointGraphWithGeneratedIdentifier ( const QString &  curveName,
const QPointF &  posScreen,
QString &  generatedIentifier,
double  ordinal 
)

Add a single graph point with a generated point identifier.

Definition at line 184 of file Document.cpp.

◆ addPointGraphWithSpecifiedIdentifier()

void Document::addPointGraphWithSpecifiedIdentifier ( const QString &  curveName,
const QPointF &  posScreen,
const QString &  identifier,
double  ordinal 
)

Add a single graph point with the specified point identifer. Note that PointStyle is not applied to the point within the Document.

Definition at line 197 of file Document.cpp.

◆ addPointsInCurvesGraphs()

void Document::addPointsInCurvesGraphs ( CurvesGraphs curvesGraphs)

Add all points identified in the specified CurvesGraphs. See also removePointsInCurvesGraphs.

Definition at line 210 of file Document.cpp.

◆ checkAddPointAxis()

void Document::checkAddPointAxis ( const QPointF &  posScreen,
const QPointF &  posGraph,
bool &  isError,
QString &  errorMessage,
bool  isXOnly 
)

Check before calling addPointAxis. Also returns the next available ordinal number (to prevent clashes)

Definition at line 233 of file Document.cpp.

◆ checkEditPointAxis()

void Document::checkEditPointAxis ( const QString &  pointIdentifier,
const QPointF &  posScreen,
const QPointF &  posGraph,
bool &  isError,
QString &  errorMessage 
)

Check before calling editPointAxis.

Definition at line 248 of file Document.cpp.

◆ coordSystem()

const CoordSystem & Document::coordSystem ( ) const

Currently active CoordSystem.

Definition at line 263 of file Document.cpp.

◆ coordSystemCount()

unsigned int Document::coordSystemCount ( ) const

Number of CoordSystem.

Definition at line 270 of file Document.cpp.

◆ coordSystemIndex()

CoordSystemIndex Document::coordSystemIndex ( ) const

Index of current active CoordSystem.

Definition at line 277 of file Document.cpp.

◆ curveAxes()

const Curve & Document::curveAxes ( ) const

Get method for axis curve.

Definition at line 284 of file Document.cpp.

◆ curveForCurveName()

const Curve * Document::curveForCurveName ( const QString &  curveName) const

See CurvesGraphs::curveForCurveNames, although this also works for AXIS_CURVE_NAME.

Definition at line 298 of file Document.cpp.

◆ curvesGraphs()

const CurvesGraphs & Document::curvesGraphs ( ) const

Make all Curves available, read only, for CmdAbstract classes only.

Definition at line 305 of file Document.cpp.

◆ curvesGraphsNames()

QStringList Document::curvesGraphsNames ( ) const

See CurvesGraphs::curvesGraphsNames.

Definition at line 312 of file Document.cpp.

◆ curvesGraphsNumPoints()

int Document::curvesGraphsNumPoints ( const QString &  curveName) const

See CurvesGraphs::curvesGraphsNumPoints.

Definition at line 319 of file Document.cpp.

◆ documentAxesPointsRequired()

DocumentAxesPointsRequired Document::documentAxesPointsRequired ( ) const

Get method for DocumentAxesPointsRequired.

Definition at line 326 of file Document.cpp.

◆ editPointAxis()

void Document::editPointAxis ( const QPointF &  posGraph,
const QString &  identifier 
)

Edit the graph coordinates of a single axis point. Call this after checkAddPointAxis to guarantee success in this call.

Definition at line 331 of file Document.cpp.

◆ isXOnly()

bool Document::isXOnly ( const QString &  pointIdentifier) const

See Curve::isXOnly.

Definition at line 357 of file Document.cpp.

◆ iterateThroughCurvePointsAxes() [1/2]

void Document::iterateThroughCurvePointsAxes ( const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &  ftorWithCallback)

See Curve::iterateThroughCurvePoints, for the axes curve.

Definition at line 362 of file Document.cpp.

◆ iterateThroughCurvePointsAxes() [2/2]

void Document::iterateThroughCurvePointsAxes ( const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &  ftorWithCallback) const

See Curve::iterateThroughCurvePoints, for the axes curve.

Definition at line 369 of file Document.cpp.

◆ iterateThroughCurveSegments()

void Document::iterateThroughCurveSegments ( const QString &  curveName,
const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &  ftorWithCallback 
) const

See Curve::iterateThroughCurveSegments, for any axes or graph curve.

Definition at line 376 of file Document.cpp.

◆ iterateThroughCurvesPointsGraphs() [1/2]

void Document::iterateThroughCurvesPointsGraphs ( const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &  ftorWithCallback)

See Curve::iterateThroughCurvePoints, for all the graphs curves.

Definition at line 385 of file Document.cpp.

◆ iterateThroughCurvesPointsGraphs() [2/2]

void Document::iterateThroughCurvesPointsGraphs ( const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &  ftorWithCallback) const

See Curve::iterateThroughCurvePoints, for all the graphs curves.

Definition at line 392 of file Document.cpp.

◆ modelAxesChecker()

DocumentModelAxesChecker Document::modelAxesChecker ( ) const

Get method for DocumentModelAxesChecker.

Definition at line 597 of file Document.cpp.

◆ modelColorFilter()

DocumentModelColorFilter Document::modelColorFilter ( ) const

Get method for DocumentModelColorFilter.

Definition at line 604 of file Document.cpp.

◆ modelCoords()

DocumentModelCoords Document::modelCoords ( ) const

Get method for DocumentModelCoords.

Definition at line 611 of file Document.cpp.

◆ modelCurveStyles()

CurveStyles Document::modelCurveStyles ( ) const

Get method for CurveStyles.

Definition at line 618 of file Document.cpp.

◆ modelDigitizeCurve()

DocumentModelDigitizeCurve Document::modelDigitizeCurve ( ) const

Get method for DocumentModelDigitizeCurve.

Definition at line 625 of file Document.cpp.

◆ modelExport()

DocumentModelExportFormat Document::modelExport ( ) const

Get method for DocumentModelExportFormat.

Definition at line 632 of file Document.cpp.

◆ modelGeneral()

DocumentModelGeneral Document::modelGeneral ( ) const

Get method for DocumentModelGeneral.

Definition at line 639 of file Document.cpp.

◆ modelGridRemoval()

DocumentModelGridRemoval Document::modelGridRemoval ( ) const

Get method for DocumentModelGridRemoval.

Definition at line 646 of file Document.cpp.

◆ modelPointMatch()

DocumentModelPointMatch Document::modelPointMatch ( ) const

Get method for DocumentModelPointMatch.

Definition at line 653 of file Document.cpp.

◆ modelSegments()

DocumentModelSegments Document::modelSegments ( ) const

Get method for DocumentModelSegments.

Definition at line 660 of file Document.cpp.

◆ movePoint()

void Document::movePoint ( const QString &  pointIdentifier,
const QPointF &  deltaScreen 
)

See Curve::movePoint.

Definition at line 667 of file Document.cpp.

◆ nextOrdinalForCurve()

int Document::nextOrdinalForCurve ( const QString &  curveName) const

Default next ordinal value for specified curve.

Definition at line 674 of file Document.cpp.

◆ pixmap()

QPixmap Document::pixmap ( ) const

Return the image that is being digitized.

Definition at line 681 of file Document.cpp.

◆ positionGraph()

QPointF Document::positionGraph ( const QString &  pointIdentifier) const

See Curve::positionGraph.

Definition at line 686 of file Document.cpp.

◆ positionScreen()

QPointF Document::positionScreen ( const QString &  pointIdentifier) const

See Curve::positionScreen.

Definition at line 691 of file Document.cpp.

◆ print()

void Document::print ( ) const

Debugging method for printing directly from symbolic debugger.

Definition at line 696 of file Document.cpp.

◆ printStream()

void Document::printStream ( QString  indentation,
QTextStream &  str 
) const

Debugging method that supports print method of this class and printStream method of some other class(es)

Definition at line 706 of file Document.cpp.

◆ reasonForUnsuccessfulRead()

QString Document::reasonForUnsuccessfulRead ( ) const

Return an informative text message explaining why startup loading failed. Applies if successfulRead returns false.

Definition at line 720 of file Document.cpp.

◆ removePointAxis()

void Document::removePointAxis ( const QString &  identifier)

Perform the opposite of addPointAxis.

Definition at line 727 of file Document.cpp.

◆ removePointGraph()

void Document::removePointGraph ( const QString &  identifier)

Perform the opposite of addPointGraph.

Definition at line 734 of file Document.cpp.

◆ removePointsInCurvesGraphs()

void Document::removePointsInCurvesGraphs ( CurvesGraphs curvesGraphs)

Remove all points identified in the specified CurvesGraphs. See also addPointsInCurvesGraphs.

Definition at line 741 of file Document.cpp.

◆ saveXml()

void Document::saveXml ( QXmlStreamWriter &  writer) const

Save document to xml.

Definition at line 748 of file Document.cpp.

◆ setCoordSystemIndex()

void Document::setCoordSystemIndex ( CoordSystemIndex  coordSystemIndex)

Set the index of current active CoordSystem.

Definition at line 777 of file Document.cpp.

◆ setCurvesGraphs() [1/2]

void Document::setCurvesGraphs ( const CurvesGraphs curvesGraphs)

Let CmdAbstract classes overwrite CurvesGraphs.

Definition at line 784 of file Document.cpp.

◆ setCurvesGraphs() [2/2]

void Document::setCurvesGraphs ( CoordSystemIndex  coordSystemIndex,
const CurvesGraphs curvesGraphs 
)

Let CmdAbstract classes overwrite CurvesGraphs.

Definition at line 791 of file Document.cpp.

◆ setDocumentAxesPointsRequired()

void Document::setDocumentAxesPointsRequired ( DocumentAxesPointsRequired  documentAxesPointsRequired)

Set the number of axes points required.

This is called during the Document creation process, after imported images have been previewed or loaded files have had at least some xml parsing

Definition at line 800 of file Document.cpp.

◆ setModelAxesChecker()

void Document::setModelAxesChecker ( const DocumentModelAxesChecker modelAxesChecker)

Set method for DocumentModelAxesChecker.

Definition at line 807 of file Document.cpp.

◆ setModelColorFilter()

void Document::setModelColorFilter ( const DocumentModelColorFilter modelColorFilter)

Set method for DocumentModelColorFilter.

Definition at line 814 of file Document.cpp.

◆ setModelCoords()

void Document::setModelCoords ( const DocumentModelCoords modelCoords)

Set method for DocumentModelCoords.

Definition at line 832 of file Document.cpp.

◆ setModelCurveStyles()

void Document::setModelCurveStyles ( const CurveStyles modelCurveStyles)

Set method for CurveStyles.

Definition at line 839 of file Document.cpp.

◆ setModelDigitizeCurve()

void Document::setModelDigitizeCurve ( const DocumentModelDigitizeCurve modelDigitizeCurve)

Set method for DocumentModelDigitizeCurve.

Definition at line 856 of file Document.cpp.

◆ setModelExport()

void Document::setModelExport ( const DocumentModelExportFormat modelExport)

Set method for DocumentModelExportFormat.

Definition at line 863 of file Document.cpp.

◆ setModelGeneral()

void Document::setModelGeneral ( const DocumentModelGeneral modelGeneral)

Set method for DocumentModelGeneral.

Definition at line 870 of file Document.cpp.

◆ setModelGridRemoval()

void Document::setModelGridRemoval ( const DocumentModelGridRemoval modelGridRemoval)

Set method for DocumentModelGridRemoval.

Definition at line 877 of file Document.cpp.

◆ setModelPointMatch()

void Document::setModelPointMatch ( const DocumentModelPointMatch modelPointMatch)

Set method for DocumentModelPointMatch.

Definition at line 884 of file Document.cpp.

◆ setModelSegments()

void Document::setModelSegments ( const DocumentModelSegments modelSegments)

Set method for DocumentModelSegments.

Definition at line 891 of file Document.cpp.

◆ successfulRead()

bool Document::successfulRead ( ) const

Return true if startup loading succeeded. If the loading failed then reasonForUnsuccessfulRed will explain why.

Definition at line 898 of file Document.cpp.

◆ updatePointOrdinals()

void Document::updatePointOrdinals ( const Transformation transformation)

Update point ordinals after point addition/removal or dragging.

See GraphicsScene::updatePointOrdinalsAfterDrag. Graph coordinates of point must be up to date

Definition at line 903 of file Document.cpp.


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