Seamly2D
Code documentation
VMeasurements Class Reference

#include <vmeasurements.h>

Inheritance diagram for VMeasurements:
Collaboration diagram for VMeasurements:

Public Member Functions

 VMeasurements (VContainer *data)
 
 VMeasurements (Unit unit, VContainer *data)
 
 VMeasurements (Unit unit, int baseSize, int baseHeight, VContainer *data)
 
virtual ~VMeasurements () Q_DECL_EQ_DEFAULT
 
virtual void setXMLContent (const QString &fileName) Q_DECL_OVERRIDE
 
virtual bool SaveDocument (const QString &fileName, QString &error) Q_DECL_OVERRIDE
 
void addEmpty (const QString &name, const QString &formula=QString())
 
void AddEmptyAfter (const QString &after, const QString &name, const QString &formula=QString())
 
void Remove (const QString &name)
 
void MoveTop (const QString &name)
 
void MoveUp (const QString &name)
 
void MoveDown (const QString &name)
 
void MoveBottom (const QString &name)
 
void ReadMeasurements () const
 
void ClearForExport ()
 
MeasurementsType Type () const
 
int BaseSize () const
 
int BaseHeight () const
 
QString Notes () const
 
void SetNotes (const QString &text)
 
QString FamilyName () const
 
void SetFamilyName (const QString &text)
 
QString GivenName () const
 
void SetGivenName (const QString &text)
 
QDate BirthDate () const
 
void SetBirthDate (const QDate &date)
 
GenderType Gender () const
 
void SetGender (const GenderType &gender)
 
QString PMSystem () const
 
void SetPMSystem (const QString &system)
 
QString Email () const
 
void SetEmail (const QString &text)
 
bool IsReadOnly () const
 
void SetReadOnly (bool ro)
 
void SetSize (qreal *size)
 
void SetHeight (qreal *height)
 
void SetMName (const QString &name, const QString &text)
 
void SetMValue (const QString &name, const QString &text)
 
void SetMBaseValue (const QString &name, double value)
 
void SetMSizeIncrease (const QString &name, double value)
 
void SetMHeightIncrease (const QString &name, double value)
 
void SetMDescription (const QString &name, const QString &text)
 
void SetMFullName (const QString &name, const QString &text)
 
QStringList ListAll () const
 
QStringList listKnown () const
 
bool IsDefinedKnownNamesValid () const
 
VContainerGetData () const
 
- Public Member Functions inherited from VDomDocument
 VDomDocument ()
 
virtual ~VDomDocument () Q_DECL_EQ_DEFAULT
 
QDomElement elementById (quint32 id, const QString &tagName=QString())
 
template<typename T >
void SetAttribute (QDomElement &domElement, const QString &name, const T &value) const
 SetAttribute set attribute in pattern file. Replace "," by ".". More...
 
Unit MUnit () const
 
QString Major () const
 
QString Minor () const
 
QString Patch () const
 
QDomNode ParentNodeById (const quint32 &nodeId)
 
QDomElement CloneNodeById (const quint32 &nodeId)
 
QDomElement NodeById (const quint32 &nodeId)
 
QVector< VLabelTemplateLineGetLabelTemplate (const QDomElement &element) const
 
void SetLabelTemplate (QDomElement &element, const QVector< VLabelTemplateLine > &lines)
 
template<>
void SetAttribute (QDomElement &domElement, const QString &name, const QString &value) const
 
template<>
void SetAttribute (QDomElement &domElement, const QString &name, const bool &value) const
 
template<>
void SetAttribute (QDomElement &domElement, const QString &name, const MeasurementsType &value) const
 

Static Public Member Functions

static QString GenderToStr (const GenderType &sex)
 
static GenderType StrToGender (const QString &sex)
 
- Static Public Member Functions inherited from VDomDocument
static quint32 GetParametrUInt (const QDomElement &domElement, const QString &name, const QString &defValue)
 Returns the long long value of the given attribute. RENAME: GetParameterLongLong? More...
 
static bool getParameterBool (const QDomElement &domElement, const QString &name, const QString &defValue)
 
static NodeUsage GetParametrUsage (const QDomElement &domElement, const QString &name)
 
static void SetParametrUsage (QDomElement &domElement, const QString &name, const NodeUsage &value)
 
static QString GetParametrString (const QDomElement &domElement, const QString &name, const QString &defValue=QString())
 Returns the string value of the given attribute. RENAME: see above. More...
 
static QString GetParametrEmptyString (const QDomElement &domElement, const QString &name)
 
static qreal GetParametrDouble (const QDomElement &domElement, const QString &name, const QString &defValue)
 Returns the double value of the given attribute. More...
 
static quint32 getParameterId (const QDomElement &domElement)
 getParameterId return value id attribute. More...
 
static void ValidateXML (const QString &schema, const QString &fileName)
 ValidateXML validate xml file by xsd schema. More...
 
static QString UnitsHelpString ()
 
static void RemoveAllChildren (QDomElement &domElement)
 RemoveAllChildren remove all children from file. More...
 
static bool SafeCopy (const QString &source, const QString &destination, QString &error)
 

Static Public Attributes

static const QString TagVST = QStringLiteral("vst")
 
static const QString TagVIT = QStringLiteral("vit")
 
static const QString TagBodyMeasurements = QStringLiteral("body-measurements")
 
static const QString TagNotes = QStringLiteral("notes")
 
static const QString TagSize = QStringLiteral("size")
 
static const QString TagHeight = QStringLiteral("height")
 
static const QString TagPersonal = QStringLiteral("personal")
 
static const QString TagFamilyName = QStringLiteral("family-name")
 
static const QString TagGivenName = QStringLiteral("given-name")
 
static const QString TagBirthDate = QStringLiteral("birth-date")
 
static const QString TagGender = QStringLiteral("gender")
 
static const QString TagPMSystem = QStringLiteral("pm_system")
 
static const QString TagEmail = QStringLiteral("email")
 
static const QString TagReadOnly = QStringLiteral("read-only")
 
static const QString TagMeasurement = QStringLiteral("m")
 
static const QString AttrBase = QStringLiteral("base")
 
static const QString AttrValue = QStringLiteral("value")
 
static const QString AttrSizeIncrease = QStringLiteral("size_increase")
 
static const QString AttrHeightIncrease = QStringLiteral("height_increase")
 
static const QString AttrDescription = QStringLiteral("description")
 
static const QString AttrName = QStringLiteral("name")
 
static const QString AttrFullName = QStringLiteral("full_name")
 
static const QString GenderMale = QStringLiteral("male")
 
static const QString GenderFemale = QStringLiteral("female")
 
static const QString GenderUnknown = QStringLiteral("unknown")
 
- Static Public Attributes inherited from VDomDocument
static const QString AttrId = QStringLiteral("id")
 
static const QString AttrText = QStringLiteral("text")
 
static const QString AttrBold = QStringLiteral("bold")
 
static const QString AttrItalic = QStringLiteral("italic")
 
static const QString AttrAlignment = QStringLiteral("alignment")
 
static const QString AttrFSIncrement = QStringLiteral("sfIncrement")
 
static const QString TagVersion = QStringLiteral("version")
 
static const QString TagUnit = QStringLiteral("unit")
 
static const QString TagLine = QStringLiteral("line")
 

Private Member Functions

void CreateEmptyMultisizeFile (Unit unit, int baseSize, int baseHeight)
 
void CreateEmptyIndividualFile (Unit unit)
 
qreal UniqueTagAttr (const QString &tag, const QString &attr, qreal defValue) const
 
QDomElement MakeEmpty (const QString &name, const QString &formula)
 
QDomElement FindM (const QString &name) const
 
MeasurementsType ReadType () const
 
qreal EvalFormula (VContainer *data, const QString &formula, bool *ok) const
 
QString ClearPMCode (const QString &code) const
 

Private Attributes

VContainerdata
 data container with data. More...
 
MeasurementsType type
 
qreal * m_currentSize
 
qreal * m_currentHeight
 

Additional Inherited Members

- Protected Member Functions inherited from VDomDocument
bool setTagText (const QString &tag, const QString &text)
 
bool setTagText (const QDomElement &domElement, const QString &text)
 
QString UniqueTagText (const QString &tagName, const QString &defVal=QString()) const
 
void TestUniqueId () const
 TestUniqueId test exist unique id in pattern file. Each id must be unique. More...
 
void CollectId (const QDomElement &node, QVector< quint32 > &vector) const
 

Detailed Description

Definition at line 68 of file vmeasurements.h.

Constructor & Destructor Documentation

◆ VMeasurements() [1/3]

VMeasurements::VMeasurements ( VContainer data)
explicit

Definition at line 121 of file vmeasurements.cpp.

References data, SCASSERT, and Unknown.

◆ VMeasurements() [2/3]

VMeasurements::VMeasurements ( Unit  unit,
VContainer data 
)

Definition at line 132 of file vmeasurements.cpp.

References CreateEmptyIndividualFile(), data, Individual, and SCASSERT.

◆ VMeasurements() [3/3]

VMeasurements::VMeasurements ( Unit  unit,
int  baseSize,
int  baseHeight,
VContainer data 
)

Definition at line 145 of file vmeasurements.cpp.

References CreateEmptyMultisizeFile(), data, Multisize, and SCASSERT.

◆ ~VMeasurements()

virtual VMeasurements::~VMeasurements ( )
virtual

Member Function Documentation

◆ addEmpty()

void VMeasurements::addEmpty ( const QString &  name,
const QString &  formula = QString() 
)

◆ AddEmptyAfter()

void VMeasurements::AddEmptyAfter ( const QString &  after,
const QString &  name,
const QString &  formula = QString() 
)

◆ BaseHeight()

◆ BaseSize()

◆ BirthDate()

QDate VMeasurements::BirthDate ( ) const

◆ ClearForExport()

void VMeasurements::ClearForExport ( )

◆ ClearPMCode()

QString VMeasurements::ClearPMCode ( const QString &  code) const
private

◆ CreateEmptyIndividualFile()

◆ CreateEmptyMultisizeFile()

◆ Email()

QString VMeasurements::Email ( ) const

Definition at line 502 of file vmeasurements.cpp.

References TagEmail, and VDomDocument::UniqueTagText().

Referenced by TMainWindow::InitWindow(), and TMainWindow::SaveEmail().

◆ EvalFormula()

qreal VMeasurements::EvalFormula ( VContainer data,
const QString &  formula,
bool *  ok 
) const
private

Definition at line 930 of file vmeasurements.cpp.

References data, and VContainer::DataVariables().

Referenced by ReadMeasurements().

◆ FamilyName()

QString VMeasurements::FamilyName ( ) const

◆ FindM()

QDomElement VMeasurements::FindM ( const QString &  name) const
private

◆ Gender()

GenderType VMeasurements::Gender ( ) const

◆ GenderToStr()

QString VMeasurements::GenderToStr ( const GenderType sex)
static

Definition at line 646 of file vmeasurements.cpp.

References Female, GenderFemale, GenderMale, GenderUnknown, Male, and Unknown.

Referenced by CreateEmptyIndividualFile(), and SetGender().

◆ GetData()

VContainer * VMeasurements::GetData ( ) const

Definition at line 734 of file vmeasurements.cpp.

References data.

◆ GivenName()

QString VMeasurements::GivenName ( ) const

◆ IsDefinedKnownNamesValid()

bool VMeasurements::IsDefinedKnownNamesValid ( ) const

Definition at line 711 of file vmeasurements.cpp.

References AllGroupNames(), and listKnown().

Referenced by TMainWindow::LoadFile(), and TMainWindow::LoadFromExistingFile().

◆ IsReadOnly()

◆ ListAll()

QStringList VMeasurements::ListAll ( ) const

◆ listKnown()

QStringList VMeasurements::listKnown ( ) const

Definition at line 695 of file vmeasurements.cpp.

References CustomMSign, and ListAll().

Referenced by TMainWindow::AddKnown(), and IsDefinedKnownNamesValid().

◆ MakeEmpty()

QDomElement VMeasurements::MakeEmpty ( const QString &  name,
const QString &  formula 
)
private

◆ MoveBottom()

void VMeasurements::MoveBottom ( const QString &  name)

Definition at line 262 of file vmeasurements.cpp.

References FindM(), TagBodyMeasurements, and TagMeasurement.

Referenced by TMainWindow::MoveBottom().

◆ MoveDown()

void VMeasurements::MoveDown ( const QString &  name)

Definition at line 247 of file vmeasurements.cpp.

References FindM(), TagBodyMeasurements, and TagMeasurement.

Referenced by TMainWindow::MoveDown().

◆ MoveTop()

void VMeasurements::MoveTop ( const QString &  name)

Definition at line 213 of file vmeasurements.cpp.

References FindM(), TagBodyMeasurements, and TagMeasurement.

Referenced by TMainWindow::MoveTop().

◆ MoveUp()

void VMeasurements::MoveUp ( const QString &  name)

Definition at line 232 of file vmeasurements.cpp.

References FindM(), TagBodyMeasurements, and TagMeasurement.

Referenced by TMainWindow::MoveUp().

◆ Notes()

QString VMeasurements::Notes ( ) const

Definition at line 412 of file vmeasurements.cpp.

References TagNotes, and VDomDocument::UniqueTagText().

Referenced by TMainWindow::InitWindow(), and TMainWindow::SaveNotes().

◆ PMSystem()

QString VMeasurements::PMSystem ( ) const

◆ ReadMeasurements()

◆ ReadType()

MeasurementsType VMeasurements::ReadType ( ) const
private

Definition at line 912 of file vmeasurements.cpp.

References Individual, Multisize, TagVIT, TagVST, and Unknown.

Referenced by setXMLContent().

◆ Remove()

void VMeasurements::Remove ( const QString &  name)

Definition at line 206 of file vmeasurements.cpp.

References FindM(), and TagBodyMeasurements.

Referenced by TMainWindow::Remove().

◆ SaveDocument()

bool VMeasurements::SaveDocument ( const QString &  fileName,
QString &  error 
)
virtual

◆ SetBirthDate()

void VMeasurements::SetBirthDate ( const QDate &  date)

Definition at line 463 of file vmeasurements.cpp.

References IsReadOnly(), VDomDocument::setTagText(), and TagBirthDate.

Referenced by TMainWindow::SaveBirthDate().

◆ SetEmail()

void VMeasurements::SetEmail ( const QString &  text)

Definition at line 508 of file vmeasurements.cpp.

References IsReadOnly(), VDomDocument::setTagText(), and TagEmail.

Referenced by TMainWindow::SaveEmail().

◆ SetFamilyName()

void VMeasurements::SetFamilyName ( const QString &  text)

Definition at line 433 of file vmeasurements.cpp.

References IsReadOnly(), VDomDocument::setTagText(), and TagFamilyName.

Referenced by TMainWindow::SaveFamilyName().

◆ SetGender()

void VMeasurements::SetGender ( const GenderType gender)

Definition at line 478 of file vmeasurements.cpp.

References GenderToStr(), IsReadOnly(), VDomDocument::setTagText(), and TagGender.

Referenced by TMainWindow::SaveGender().

◆ SetGivenName()

void VMeasurements::SetGivenName ( const QString &  text)

Definition at line 448 of file vmeasurements.cpp.

References IsReadOnly(), VDomDocument::setTagText(), and TagGivenName.

Referenced by TMainWindow::SaveGivenName().

◆ SetHeight()

void VMeasurements::SetHeight ( qreal *  height)

◆ SetMBaseValue()

void VMeasurements::SetMBaseValue ( const QString &  name,
double  value 
)

Definition at line 576 of file vmeasurements.cpp.

References AttrBase, FindM(), and VDomDocument::SetAttribute().

Referenced by TMainWindow::SaveMBaseValue().

◆ SetMDescription()

void VMeasurements::SetMDescription ( const QString &  name,
const QString &  text 
)

Definition at line 618 of file vmeasurements.cpp.

References AttrDescription, FindM(), and VDomDocument::SetAttribute().

Referenced by TMainWindow::SaveMDescription().

◆ SetMFullName()

void VMeasurements::SetMFullName ( const QString &  name,
const QString &  text 
)

Definition at line 632 of file vmeasurements.cpp.

References AttrFullName, FindM(), and VDomDocument::SetAttribute().

Referenced by TMainWindow::SaveMFullName().

◆ SetMHeightIncrease()

void VMeasurements::SetMHeightIncrease ( const QString &  name,
double  value 
)

◆ SetMName()

void VMeasurements::SetMName ( const QString &  name,
const QString &  text 
)

Definition at line 548 of file vmeasurements.cpp.

References AttrName, FindM(), and VDomDocument::SetAttribute().

Referenced by TMainWindow::SaveMName().

◆ SetMSizeIncrease()

void VMeasurements::SetMSizeIncrease ( const QString &  name,
double  value 
)

◆ SetMValue()

void VMeasurements::SetMValue ( const QString &  name,
const QString &  text 
)

Definition at line 562 of file vmeasurements.cpp.

References AttrValue, FindM(), and VDomDocument::SetAttribute().

Referenced by TMainWindow::Fx(), and TMainWindow::SaveMValue().

◆ SetNotes()

void VMeasurements::SetNotes ( const QString &  text)

Definition at line 418 of file vmeasurements.cpp.

References IsReadOnly(), VDomDocument::setTagText(), and TagNotes.

Referenced by TMainWindow::SaveNotes().

◆ SetPMSystem()

void VMeasurements::SetPMSystem ( const QString &  system)

◆ SetReadOnly()

void VMeasurements::SetReadOnly ( bool  ro)

Definition at line 523 of file vmeasurements.cpp.

References falseStr, VDomDocument::setTagText(), TagReadOnly, and trueStr.

Referenced by TMainWindow::FileSaveAs().

◆ SetSize()

void VMeasurements::SetSize ( qreal *  size)

◆ setXMLContent()

void VMeasurements::setXMLContent ( const QString &  fileName)
virtual

◆ StrToGender()

GenderType VMeasurements::StrToGender ( const QString &  sex)
static

Definition at line 661 of file vmeasurements.cpp.

References Female, GenderFemale, GenderMale, GenderUnknown, Male, and Unknown.

Referenced by Gender().

◆ Type()

MeasurementsType VMeasurements::Type ( ) const

◆ UniqueTagAttr()

qreal VMeasurements::UniqueTagAttr ( const QString &  tag,
const QString &  attr,
qreal  defValue 
) const
private

Definition at line 832 of file vmeasurements.cpp.

References Cm, VDomDocument::GetParametrDouble(), VDomDocument::MUnit(), and UnitConvertor().

Referenced by BaseHeight(), and BaseSize().

Member Data Documentation

◆ AttrBase

const QString VMeasurements::AttrBase = QStringLiteral("base")
static

◆ AttrDescription

const QString VMeasurements::AttrDescription = QStringLiteral("description")
static

Definition at line 150 of file vmeasurements.h.

Referenced by ReadMeasurements(), and SetMDescription().

◆ AttrFullName

const QString VMeasurements::AttrFullName = QStringLiteral("full_name")
static

Definition at line 152 of file vmeasurements.h.

Referenced by ReadMeasurements(), and SetMFullName().

◆ AttrHeightIncrease

const QString VMeasurements::AttrHeightIncrease = QStringLiteral("height_increase")
static

Definition at line 149 of file vmeasurements.h.

Referenced by MakeEmpty(), ReadMeasurements(), and SetMHeightIncrease().

◆ AttrName

const QString VMeasurements::AttrName = QStringLiteral("name")
static

Definition at line 151 of file vmeasurements.h.

Referenced by FindM(), ListAll(), MakeEmpty(), ReadMeasurements(), and SetMName().

◆ AttrSizeIncrease

const QString VMeasurements::AttrSizeIncrease = QStringLiteral("size_increase")
static

Definition at line 148 of file vmeasurements.h.

Referenced by MakeEmpty(), ReadMeasurements(), and SetMSizeIncrease().

◆ AttrValue

const QString VMeasurements::AttrValue = QStringLiteral("value")
static

Definition at line 147 of file vmeasurements.h.

Referenced by ClearForExport(), MakeEmpty(), ReadMeasurements(), and SetMValue().

◆ data

VContainer* VMeasurements::data
private

data container with data.

Definition at line 172 of file vmeasurements.h.

Referenced by EvalFormula(), GetData(), ReadMeasurements(), and VMeasurements().

◆ GenderFemale

const QString VMeasurements::GenderFemale = QStringLiteral("female")
static

Definition at line 155 of file vmeasurements.h.

Referenced by GenderToStr(), and StrToGender().

◆ GenderMale

const QString VMeasurements::GenderMale = QStringLiteral("male")
static

Definition at line 154 of file vmeasurements.h.

Referenced by GenderToStr(), and StrToGender().

◆ GenderUnknown

const QString VMeasurements::GenderUnknown = QStringLiteral("unknown")
static

Definition at line 156 of file vmeasurements.h.

Referenced by Gender(), GenderToStr(), and StrToGender().

◆ m_currentHeight

qreal* VMeasurements::m_currentHeight
private

Definition at line 176 of file vmeasurements.h.

Referenced by ReadMeasurements(), and SetHeight().

◆ m_currentSize

qreal* VMeasurements::m_currentSize
private

Definition at line 175 of file vmeasurements.h.

Referenced by ReadMeasurements(), and SetSize().

◆ TagBirthDate

const QString VMeasurements::TagBirthDate = QStringLiteral("birth-date")
static

Definition at line 139 of file vmeasurements.h.

Referenced by BirthDate(), CreateEmptyIndividualFile(), and SetBirthDate().

◆ TagBodyMeasurements

const QString VMeasurements::TagBodyMeasurements = QStringLiteral("body-measurements")
static

◆ TagEmail

const QString VMeasurements::TagEmail = QStringLiteral("email")
static

Definition at line 142 of file vmeasurements.h.

Referenced by CreateEmptyIndividualFile(), Email(), and SetEmail().

◆ TagFamilyName

const QString VMeasurements::TagFamilyName = QStringLiteral("family-name")
static

Definition at line 137 of file vmeasurements.h.

Referenced by CreateEmptyIndividualFile(), FamilyName(), and SetFamilyName().

◆ TagGender

const QString VMeasurements::TagGender = QStringLiteral("gender")
static

Definition at line 140 of file vmeasurements.h.

Referenced by CreateEmptyIndividualFile(), Gender(), and SetGender().

◆ TagGivenName

const QString VMeasurements::TagGivenName = QStringLiteral("given-name")
static

Definition at line 138 of file vmeasurements.h.

Referenced by CreateEmptyIndividualFile(), GivenName(), and SetGivenName().

◆ TagHeight

const QString VMeasurements::TagHeight = QStringLiteral("height")
static

Definition at line 135 of file vmeasurements.h.

Referenced by BaseHeight(), and CreateEmptyMultisizeFile().

◆ TagMeasurement

const QString VMeasurements::TagMeasurement = QStringLiteral("m")
static

◆ TagNotes

const QString VMeasurements::TagNotes = QStringLiteral("notes")
static

◆ TagPersonal

const QString VMeasurements::TagPersonal = QStringLiteral("personal")
static

Definition at line 136 of file vmeasurements.h.

Referenced by CreateEmptyIndividualFile().

◆ TagPMSystem

const QString VMeasurements::TagPMSystem = QStringLiteral("pm_system")
static

◆ TagReadOnly

const QString VMeasurements::TagReadOnly = QStringLiteral("read-only")
static

◆ TagSize

const QString VMeasurements::TagSize = QStringLiteral("size")
static

Definition at line 134 of file vmeasurements.h.

Referenced by BaseSize(), and CreateEmptyMultisizeFile().

◆ TagVIT

const QString VMeasurements::TagVIT = QStringLiteral("vit")
static

Definition at line 131 of file vmeasurements.h.

Referenced by CreateEmptyIndividualFile(), and ReadType().

◆ TagVST

const QString VMeasurements::TagVST = QStringLiteral("vst")
static

Definition at line 130 of file vmeasurements.h.

Referenced by CreateEmptyMultisizeFile(), and ReadType().

◆ type

MeasurementsType VMeasurements::type
private

Definition at line 173 of file vmeasurements.h.

Referenced by BaseHeight(), BaseSize(), MakeEmpty(), ReadMeasurements(), setXMLContent(), and Type().


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