Documentation for VToolCutSplinePath class.

--HG--
branch : develop
This commit is contained in:
dismine 2014-01-24 20:13:18 +02:00
parent 0da4bbf850
commit 5dd98fd02b

View File

@ -34,12 +34,25 @@
#include "../../widgets/vsimplespline.h" #include "../../widgets/vsimplespline.h"
/** /**
* @brief The VToolCutSplinePath class * @brief The VToolCutSplinePath class for tool CutSplinePath. This tool find point on splinePath and cut splinePath on
* two.
*/ */
class VToolCutSplinePath : public VToolPoint class VToolCutSplinePath : public VToolPoint
{ {
Q_OBJECT Q_OBJECT
public: public:
/**
* @brief VToolCutSplinePath constructor.
* @param doc dom document container.
* @param data container with variables.
* @param id object id in container.
* @param formula string with formula length first splinePath.
* @param splinePathId id splinePath (we cut this splinePath) in data container.
* @param splPath1id id first splinePath after cutting.
* @param splPath2id id second splinePath after cutting.
* @param typeCreation way we create this tool.
* @param parent parent object.
*/
VToolCutSplinePath(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &formula, VToolCutSplinePath(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &formula,
const qint64 &splinePathId, const qint64 &splPath1id, const qint64 &splPath2id, const qint64 &splinePathId, const qint64 &splPath1id, const qint64 &splPath2id,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0); const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
@ -48,25 +61,25 @@ public:
*/ */
virtual void setDialog(); virtual void setDialog();
/** /**
* @brief Create help create tool * @brief Create help create tool form GUI.
* @param dialog * @param dialog dialog.
* @param scene pointer to scene. * @param scene pointer to scene.
* @param doc dom document container * @param doc dom document container.
* @param data container with variables * @param data container with variables.
*/ */
static void Create(QSharedPointer<DialogCutSplinePath> &dialog, VMainGraphicsScene *scene, static void Create(QSharedPointer<DialogCutSplinePath> &dialog, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data); VDomDocument *doc, VContainer *data);
/** /**
* @brief Create help create tool * @brief Create help create tool.
* @param _id tool id, 0 if tool doesn't exist yet. * @param _id tool id, 0 if tool doesn't exist yet.
* @param pointName point name. * @param pointName point name.
* @param formula * @param formula string with formula length first splinePath.
* @param splineId * @param splineId id splinePath in data container.
* @param mx label bias x axis. * @param mx label bias x axis.
* @param my label bias y axis. * @param my label bias y axis.
* @param scene pointer to scene. * @param scene pointer to scene.
* @param doc dom document container * @param doc dom document container.
* @param data container with variables * @param data container with variables.
* @param parse parser file mode. * @param parse parser file mode.
* @param typeCreation way we create this tool. * @param typeCreation way we create this tool.
*/ */
@ -74,9 +87,6 @@ public:
const qint64 &splinePathId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, const qint64 &splinePathId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data, const Document::Documents &parse, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
const Tool::Sources &typeCreation); const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType; static const QString ToolType;
static const QString AttrSplinePath; static const QString AttrSplinePath;
public slots: public slots:
@ -86,12 +96,12 @@ public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
/** /**
* @brief FullUpdateFromGui refresh tool data from change options. * @brief FullUpdateFromGui refresh tool data from change options.
* @param result * @param result result working dialog.
*/ */
virtual void FullUpdateFromGui(int result); virtual void FullUpdateFromGui(int result);
/** /**
* @brief SplineChoosed * @brief SplineChoosed send signal about selection splinePath.
* @param id object id in container * @param id object id in container.
*/ */
void SplineChoosed(qint64 id); void SplineChoosed(qint64 id);
/** /**
@ -99,11 +109,15 @@ public slots:
* @param newName new name active pattern peace. * @param newName new name active pattern peace.
*/ */
virtual void ChangedActivDraw(const QString &newName); virtual void ChangedActivDraw(const QString &newName);
/**
* @brief ShowContextMenu show context menu.
* @param event context menu event.
*/
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event); virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
protected: protected:
/** /**
* @brief contextMenuEvent handle context menu events. * @brief contextMenuEvent handle context menu events.
* @param event * @param event context menu event.
*/ */
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/** /**
@ -118,6 +132,9 @@ protected:
* @brief RefreshGeometry refresh item on scene. * @brief RefreshGeometry refresh item on scene.
*/ */
void RefreshGeometry(); void RefreshGeometry();
/**
* @brief RemoveReferens decrement referens value for used objects.
*/
virtual void RemoveReferens(); virtual void RemoveReferens();
private: private:
Q_DISABLE_COPY(VToolCutSplinePath) Q_DISABLE_COPY(VToolCutSplinePath)
@ -126,23 +143,35 @@ private:
*/ */
QString formula; QString formula;
/** /**
* @brief splineId keep id of spline * @brief splineId keep id of spline.
*/ */
qint64 splinePathId; qint64 splinePathId;
/** /**
* @brief DialogCutSpline pointer to the tool's dialog * @brief DialogCutSpline pointer to the tool's dialog.
*/ */
QSharedPointer<DialogCutSplinePath> dialogCutSplinePath; QSharedPointer<DialogCutSplinePath> dialogCutSplinePath;
/** /**
* @brief firstSpline * @brief firstSpline first splinePath after cutting.
*/ */
VSimpleSpline *firstSpline; VSimpleSpline *firstSpline;
/** /**
* @brief secondSpline * @brief secondSpline second splinePath after cutting.
*/ */
VSimpleSpline *secondSpline; VSimpleSpline *secondSpline;
/**
* @brief splPath1id id first splinePath after cutting.
*/
const qint64 splPath1id; const qint64 splPath1id;
/**
* @brief splPath2id id second splinePath after cutting.
*/
const qint64 splPath2id; const qint64 splPath2id;
/**
* @brief RefreshSpline refresh splinePath on scene.
* @param spline splinePath.
* @param splPathid splinePath id.
* @param tr splineType type.
*/
void RefreshSpline(VSimpleSpline *spline, qint64 splPathid, SimpleSpline::Translation tr); void RefreshSpline(VSimpleSpline *spline, qint64 splPathid, SimpleSpline::Translation tr);
}; };