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

Model for DlgSettingsPointMatch and CmdSettingsPointMatch. More...

#include <DocumentModelPointMatch.h>

Inheritance diagram for DocumentModelPointMatch:
Inheritance graph
Collaboration diagram for DocumentModelPointMatch:
Collaboration graph

Public Member Functions

 DocumentModelPointMatch ()
 Default constructor.
 
 DocumentModelPointMatch (const Document &document)
 Initial constructor from Document.
 
 DocumentModelPointMatch (const DocumentModelPointMatch &other)
 Copy constructor.
 
DocumentModelPointMatchoperator= (const DocumentModelPointMatch &other)
 Assignment constructor.
 
virtual void loadXml (QXmlStreamReader &reader)
 Load model from serialized xml.
 
double maxPointSize () const
 Get method for max point size.
 
ColorPalette paletteColorAccepted () const
 Get method for accepted color.
 
ColorPalette paletteColorCandidate () const
 Get method for candidate color.
 
ColorPalette paletteColorRejected () const
 Get method for rejected color.
 
void printStream (QString indentation, QTextStream &str) const
 Debugging method that supports print method of this class and printStream method of some other class(es)
 
virtual void saveXml (QXmlStreamWriter &writer) const
 Save entire model as xml into stream.
 
void setMaxPointSize (double maxPointSize)
 Set method for max point size.
 
void setPaletteColorAccepted (ColorPalette paletteColorAccepted)
 Set method for accepted color.
 
void setPaletteColorCandidate (ColorPalette paletteColorCandidate)
 Set method for candidate color.
 
void setPaletteColorRejected (ColorPalette paletteColorRejected)
 Set method for rejected color.
 
- Public Member Functions inherited from DocumentModelAbstractBase
 DocumentModelAbstractBase ()
 Single constructor.
 
virtual ~DocumentModelAbstractBase ()
 Single destructor.
 

Additional Inherited Members

Detailed Description

Model for DlgSettingsPointMatch and CmdSettingsPointMatch.

Definition at line 17 of file DocumentModelPointMatch.h.

Constructor & Destructor Documentation

◆ DocumentModelPointMatch() [1/3]

DocumentModelPointMatch::DocumentModelPointMatch ( )

Default constructor.

Definition at line 22 of file DocumentModelPointMatch.cpp.

22 :
23 m_minPointSeparation (DEFAULT_MIN_POINT_SEPARATION),
24 m_maxPointSize (DEFAULT_MAX_POINT_SIZE),
25 m_paletteColorAccepted (DEFAULT_COLOR_ACCEPTED),
26 m_paletteColorCandidate (DEFAULT_COLOR_CANDIDATE),
27 m_paletteColorRejected (DEFAULT_COLOR_REJECTED)
28{
29}
const ColorPalette DEFAULT_COLOR_REJECTED
const ColorPalette DEFAULT_COLOR_ACCEPTED
const ColorPalette DEFAULT_COLOR_CANDIDATE
const double DEFAULT_MAX_POINT_SIZE
const double DEFAULT_MIN_POINT_SEPARATION

◆ DocumentModelPointMatch() [2/3]

DocumentModelPointMatch::DocumentModelPointMatch ( const Document & document)

Initial constructor from Document.

Definition at line 31 of file DocumentModelPointMatch.cpp.

31 :
32 m_maxPointSize (document.modelPointMatch().maxPointSize()),
33 m_paletteColorAccepted (document.modelPointMatch().paletteColorAccepted()),
34 m_paletteColorCandidate (document.modelPointMatch().paletteColorCandidate()),
35 m_paletteColorRejected (document.modelPointMatch().paletteColorRejected())
36{
37}
ColorPalette paletteColorRejected() const
Get method for rejected color.
ColorPalette paletteColorCandidate() const
Get method for candidate color.
double maxPointSize() const
Get method for max point size.
ColorPalette paletteColorAccepted() const
Get method for accepted color.
DocumentModelPointMatch modelPointMatch() const
Get method for DocumentModelPointMatch.
Definition Document.cpp:744

◆ DocumentModelPointMatch() [3/3]

DocumentModelPointMatch::DocumentModelPointMatch ( const DocumentModelPointMatch & other)

Copy constructor.

Definition at line 39 of file DocumentModelPointMatch.cpp.

39 :
40 m_maxPointSize (other.maxPointSize()),
41 m_paletteColorAccepted (other.paletteColorAccepted()),
42 m_paletteColorCandidate (other.paletteColorCandidate()),
43 m_paletteColorRejected (other.paletteColorRejected())
44{
45}
const int INNER_RADIUS_MIN

Member Function Documentation

◆ loadXml()

void DocumentModelPointMatch::loadXml ( QXmlStreamReader & reader)
virtual

Load model from serialized xml.

Implements DocumentModelAbstractBase.

Definition at line 57 of file DocumentModelPointMatch.cpp.

58{
59 LOG4CPP_INFO_S ((*mainCat)) << "DocumentModelPointMatch::loadXml";
60
61 bool success = true;
62
64
69
74
75 // Read until end of this subtree
76 while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
79 if (reader.atEnd()) {
80 success = false;
81 break;
82 }
83 }
84 }
85
86 if (!success) {
87 reader.raiseError (QObject::tr ("Cannot read point match data"));
88 }
89}
ColorPalette
const QString DOCUMENT_SERIALIZE_POINT_MATCH_POINT_SIZE
const QString DOCUMENT_SERIALIZE_POINT_MATCH_COLOR_REJECTED
const QString DOCUMENT_SERIALIZE_POINT_MATCH_COLOR_ACCEPTED
const QString DOCUMENT_SERIALIZE_POINT_MATCH_COLOR_CANDIDATE
const QString DOCUMENT_SERIALIZE_POINT_MATCH
log4cpp::Category * mainCat
Definition Logger.cpp:14
QXmlStreamReader::TokenType loadNextFromReader(QXmlStreamReader &reader)
Load next token from xml reader.
Definition Xml.cpp:14
void setMaxPointSize(double maxPointSize)
Set method for max point size.
void setPaletteColorCandidate(ColorPalette paletteColorCandidate)
Set method for candidate color.
void setPaletteColorAccepted(ColorPalette paletteColorAccepted)
Set method for accepted color.
void setPaletteColorRejected(ColorPalette paletteColorRejected)
Set method for rejected color.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ maxPointSize()

double DocumentModelPointMatch::maxPointSize ( ) const

Get method for max point size.

Definition at line 91 of file DocumentModelPointMatch.cpp.

92{
93 return m_maxPointSize;
94}

◆ operator=()

DocumentModelPointMatch & DocumentModelPointMatch::operator= ( const DocumentModelPointMatch & other)

Assignment constructor.

Definition at line 47 of file DocumentModelPointMatch.cpp.

48{
49 m_maxPointSize = other.maxPointSize();
50 m_paletteColorAccepted = other.paletteColorAccepted();
51 m_paletteColorCandidate = other.paletteColorCandidate();
52 m_paletteColorRejected = other.paletteColorRejected();
53
54 return *this;
55}

◆ paletteColorAccepted()

ColorPalette DocumentModelPointMatch::paletteColorAccepted ( ) const

Get method for accepted color.

Definition at line 96 of file DocumentModelPointMatch.cpp.

97{
98 return m_paletteColorAccepted;
99}

◆ paletteColorCandidate()

ColorPalette DocumentModelPointMatch::paletteColorCandidate ( ) const

Get method for candidate color.

Definition at line 101 of file DocumentModelPointMatch.cpp.

102{
103 return m_paletteColorCandidate;
104}

◆ paletteColorRejected()

ColorPalette DocumentModelPointMatch::paletteColorRejected ( ) const

Get method for rejected color.

Definition at line 106 of file DocumentModelPointMatch.cpp.

107{
108 return m_paletteColorRejected;
109}

◆ printStream()

void DocumentModelPointMatch::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 111 of file DocumentModelPointMatch.cpp.

113{
114 str << indentation << "DocumentModelPointMatch\n";
115
117
118 str << indentation << "minPointSeparation=" << m_minPointSeparation << "\n";
119 str << indentation << "maxPointSize=" << m_maxPointSize << "\n";
120 str << indentation << "colorAccepted=" << colorPaletteToString (m_paletteColorAccepted) << "\n";
121 str << indentation << "colorCandidate=" << colorPaletteToString (m_paletteColorCandidate) << "\n";
122 str << indentation << "colorRejected=" << colorPaletteToString (m_paletteColorRejected) << "\n";
123}
QString colorPaletteToString(ColorPalette colorPalette)
const QString INDENTATION_DELTA

◆ saveXml()

void DocumentModelPointMatch::saveXml ( QXmlStreamWriter & writer) const
virtual

Save entire model as xml into stream.

Implements DocumentModelAbstractBase.

Definition at line 125 of file DocumentModelPointMatch.cpp.

126{
127 LOG4CPP_INFO_S ((*mainCat)) << "DocumentModelPointMatch::saveXml";
128
129 writer.writeStartElement(DOCUMENT_SERIALIZE_POINT_MATCH);
130 writer.writeAttribute(DOCUMENT_SERIALIZE_POINT_MATCH_POINT_SIZE, QString::number (m_maxPointSize));
131 writer.writeAttribute(DOCUMENT_SERIALIZE_POINT_MATCH_COLOR_ACCEPTED, QString::number (m_paletteColorAccepted));
133 writer.writeAttribute(DOCUMENT_SERIALIZE_POINT_MATCH_COLOR_CANDIDATE, QString::number (m_paletteColorCandidate));
135 writer.writeAttribute(DOCUMENT_SERIALIZE_POINT_MATCH_COLOR_REJECTED, QString::number (m_paletteColorRejected));
137 writer.writeEndElement();
138}
const QString DOCUMENT_SERIALIZE_POINT_MATCH_COLOR_CANDIDATE_STRING
const QString DOCUMENT_SERIALIZE_POINT_MATCH_COLOR_ACCEPTED_STRING
const QString DOCUMENT_SERIALIZE_POINT_MATCH_COLOR_REJECTED_STRING

◆ setMaxPointSize()

void DocumentModelPointMatch::setMaxPointSize ( double maxPointSize)

Set method for max point size.

Definition at line 140 of file DocumentModelPointMatch.cpp.

141{
142 m_maxPointSize = maxPointSize;
143}

◆ setPaletteColorAccepted()

void DocumentModelPointMatch::setPaletteColorAccepted ( ColorPalette paletteColorAccepted)

Set method for accepted color.

Definition at line 145 of file DocumentModelPointMatch.cpp.

146{
147 m_paletteColorAccepted = paletteColorAccepted;
148}

◆ setPaletteColorCandidate()

void DocumentModelPointMatch::setPaletteColorCandidate ( ColorPalette paletteColorCandidate)

Set method for candidate color.

Definition at line 150 of file DocumentModelPointMatch.cpp.

151{
152 m_paletteColorCandidate = paletteColorCandidate;
153}

◆ setPaletteColorRejected()

void DocumentModelPointMatch::setPaletteColorRejected ( ColorPalette paletteColorRejected)

Set method for rejected color.

Definition at line 155 of file DocumentModelPointMatch.cpp.

156{
157 m_paletteColorRejected = paletteColorRejected;
158}

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