valentina/src/geometry/vdetail.h

209 lines
5 KiB
C
Raw Normal View History

/************************************************************************
**
** @file vdetail.h
** @author Roman Telezhinsky <dismine@gmail.com>
** @date November 15, 2013
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
2013-08-28 10:55:11 +02:00
#ifndef VDETAIL_H
#define VDETAIL_H
#include "vnodedetail.h"
#include <QString>
#include <QVector>
namespace Detail
{
/**
* @brief The Contour enum
*/
enum Contour { OpenContour, CloseContour };
Q_DECLARE_FLAGS(Contours, Contour)
/**
* @brief The Equidistant enum
*/
enum Equidistant { OpenEquidistant, CloseEquidistant };
Q_DECLARE_FLAGS(Equidistants, Equidistant)
}
Q_DECLARE_OPERATORS_FOR_FLAGS(Detail::Contours)
Q_DECLARE_OPERATORS_FOR_FLAGS(Detail::Equidistants)
/**
* @brief The VDetail class
*/
class VDetail
{
2013-08-28 10:55:11 +02:00
public:
/**
* @brief VDetail
*/
2013-10-26 22:42:54 +02:00
VDetail();
/**
* @brief VDetail
* @param name
* @param nodes
*/
2013-10-26 22:42:54 +02:00
VDetail(const QString &name, const QVector<VNodeDetail> &nodes);
/**
* @brief VDetail
* @param detail
*/
2013-10-26 22:42:54 +02:00
VDetail(const VDetail &detail);
/**
* @brief operator =
* @param detail
* @return
*/
2013-10-26 22:42:54 +02:00
VDetail &operator=(const VDetail &detail);
/**
* @brief append
* @param node
*/
2013-10-26 22:42:54 +02:00
inline void append(const VNodeDetail &node) {nodes.append(node);}
/**
* @brief Clear
*/
2013-10-26 22:42:54 +02:00
void Clear();
/**
* @brief CountNode
* @return
*/
2013-10-26 22:42:54 +02:00
inline qint32 CountNode() const {return nodes.size();}
/**
* @brief Containes
* @param id
* @return
*/
2013-10-26 22:42:54 +02:00
bool Containes(const qint64 &id)const;
/**
* @brief operator []
* @param indx
* @return
*/
VNodeDetail & operator[](ptrdiff_t indx);
/**
* @brief getName
* @return
*/
2013-10-26 22:42:54 +02:00
inline QString getName() const {return name;}
/**
* @brief setName
* @param value
*/
2013-10-26 22:42:54 +02:00
inline void setName(const QString &value) {name = value;}
/**
* @brief getMx
* @return
*/
2013-10-26 22:42:54 +02:00
inline qreal getMx() const {return mx;}
/**
* @brief setMx
* @param value
*/
2013-10-26 22:42:54 +02:00
inline void setMx(const qreal &value) {mx = value;}
/**
* @brief getMy
* @return
*/
2013-10-26 22:42:54 +02:00
inline qreal getMy() const {return my;}
/**
* @brief setMy
* @param value
*/
2013-10-26 22:42:54 +02:00
inline void setMy(const qreal &value) {my = value;}
/**
* @brief getSupplement
* @return
*/
2013-10-26 22:42:54 +02:00
inline bool getSupplement() const {return supplement;}
/**
* @brief setSupplement
* @param value
*/
2013-10-26 22:42:54 +02:00
inline void setSupplement(bool value) {supplement = value;}
/**
* @brief getClosed
* @return
*/
2013-10-26 22:42:54 +02:00
inline bool getClosed() const {return closed;}
/**
* @brief setClosed
* @param value
*/
2013-10-26 22:42:54 +02:00
inline void setClosed(bool value) {closed = value;}
/**
* @brief getWidth
* @return
*/
2013-10-26 22:42:54 +02:00
inline qreal getWidth() const {return width;}
/**
* @brief setWidth
* @param value
*/
2013-10-26 22:42:54 +02:00
inline void setWidth(const qreal &value) {width = value;}
/**
* @brief getNodes
* @return
*/
2013-10-26 22:42:54 +02:00
inline QVector<VNodeDetail> getNodes() const {return nodes;}
/**
* @brief setNodes
* @param value
*/
2013-10-26 22:42:54 +02:00
inline void setNodes(const QVector<VNodeDetail> &value) {nodes = value;}
2013-08-28 10:55:11 +02:00
private:
/**
* @brief nodes
*/
2013-08-28 10:55:11 +02:00
QVector<VNodeDetail> nodes;
/**
* @brief name
*/
2013-10-26 22:42:54 +02:00
QString name;
/**
* @brief mx
*/
2013-10-26 22:42:54 +02:00
qreal mx;
/**
* @brief my
*/
2013-10-26 22:42:54 +02:00
qreal my;
/**
* @brief supplement
*/
2013-10-26 22:42:54 +02:00
bool supplement;
/**
* @brief closed
*/
2013-10-26 22:42:54 +02:00
bool closed;
/**
* @brief width
*/
2013-10-26 22:42:54 +02:00
qreal width;
2013-08-28 10:55:11 +02:00
};
#endif // VDETAIL_H