Documentation for VToolSpline class.

--HG--
branch : develop
This commit is contained in:
dismine 2014-01-27 11:54:33 +02:00
parent f8208e3416
commit 50e55ad7c8
2 changed files with 52 additions and 48 deletions

View File

@ -33,7 +33,7 @@
#include "../../dialogs/dialogsinglepoint.h" #include "../../dialogs/dialogsinglepoint.h"
/** /**
* @brief The VToolSinglePoint class class tool for creation pattern base point. Obly base point can move. All object * @brief The VToolSinglePoint class tool for creation pattern base point. Obly base point can move. All object
* pattern peace depend on base point. * pattern peace depend on base point.
*/ */
class VToolSinglePoint : public VToolPoint class VToolSinglePoint : public VToolPoint

View File

@ -36,19 +36,19 @@
#include "../../geometry/vsplinepath.h" #include "../../geometry/vsplinepath.h"
/** /**
* @brief The VToolSpline class * @brief The VToolSpline class tool for creation spline. I mean bezier curve.
*/ */
class VToolSpline:public VDrawTool, public QGraphicsPathItem class VToolSpline:public VDrawTool, public QGraphicsPathItem
{ {
Q_OBJECT Q_OBJECT
public: public:
/** /**
* @brief VToolSpline * @brief VToolSpline constructor.
* @param doc dom document container * @param doc dom document container.
* @param data container with variables * @param data container with variables.
* @param id object id in container * @param id object id in container.
* @param typeCreation way we create this tool. * @param typeCreation way we create this tool.
* @param parent parent object * @param parent parent object.
*/ */
VToolSpline (VDomDocument *doc, VContainer *data, qint64 id, const Tool::Sources &typeCreation, VToolSpline (VDomDocument *doc, VContainer *data, qint64 id, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0 ); QGraphicsItem * parent = 0 );
@ -57,27 +57,27 @@ public:
*/ */
virtual void setDialog(); virtual void setDialog();
/** /**
* @brief Create help create tool * @brief Create help create tool from 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<DialogSpline> &dialog, VMainGraphicsScene *scene, VDomDocument *doc, static void Create(QSharedPointer<DialogSpline> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data); 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 p1 * @param p1 id first spline point.
* @param p4 * @param p4 id last spline point.
* @param kAsm1 * @param kAsm1 coefficient of length first control line.
* @param kAsm2 * @param kAsm2 coefficient of length second control line.
* @param angle1 * @param angle1 angle from first point to first control point.
* @param angle2 * @param angle2 angle from second point to second control point.
* @param kCurve * @param kCurve coefficient of curvature spline.
* @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.
*/ */
@ -85,27 +85,21 @@ public:
const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve, const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve,
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation); const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief TagName
*/
static const QString TagName; static const QString TagName;
/**
* @brief ToolType
*/
static const QString ToolType; static const QString ToolType;
signals: signals:
/** /**
* @brief RefreshLine * @brief RefreshLine refresh control line.
* @param indexSpline * @param indexSpline position spline in spline list.
* @param position * @param position position point in spline.
* @param controlPoint * @param controlPoint new position control point.
* @param splinePoint * @param splinePoint new position spline point.
*/ */
void RefreshLine ( const qint32 &indexSpline, SplinePoint::Position position, const QPointF &controlPoint, void RefreshLine ( const qint32 &indexSpline, SplinePoint::Position position, const QPointF &controlPoint,
const QPointF &splinePoint ); const QPointF &splinePoint );
/** /**
* @brief setEnabledPoint * @brief setEnabledPoint disable control points.
* @param enable * @param enable enable or diasable points.
*/ */
void setEnabledPoint ( bool enable ); void setEnabledPoint ( bool enable );
public slots: public slots:
@ -115,14 +109,14 @@ 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 ControlPointChangePosition * @brief ControlPointChangePosition handle change position control point.
* @param indexSpline * @param indexSpline position spline in spline list.
* @param position * @param position position point in spline.
* @param pos * @param pos new position.
*/ */
void ControlPointChangePosition (const qint32 &indexSpline, const SplinePoint::Position &position, void ControlPointChangePosition (const qint32 &indexSpline, const SplinePoint::Position &position,
const QPointF &pos); const QPointF &pos);
@ -134,8 +128,8 @@ public slots:
/** /**
* @brief ShowTool highlight tool. * @brief ShowTool highlight tool.
* @param id object id in container * @param id object id in container
* @param color * @param color highlight color.
* @param enable * @param enable enable or disable highlight.
*/ */
virtual void ShowTool(qint64 id, Qt::GlobalColor color, bool enable); virtual void ShowTool(qint64 id, Qt::GlobalColor color, bool enable);
/** /**
@ -146,7 +140,7 @@ public slots:
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 );
/** /**
@ -159,32 +153,42 @@ protected:
virtual void RefreshDataInFile(); virtual void RefreshDataInFile();
/** /**
* @brief mouseReleaseEvent handle mouse release events. * @brief mouseReleaseEvent handle mouse release events.
* @param event * @param event context menu event.
*/ */
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ); virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/** /**
* @brief hoverMoveEvent handle hover move events. * @brief hoverMoveEvent handle hover move events.
* @param event * @param event hover move event.
*/ */
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event ); virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/** /**
* @brief hoverLeaveEvent handle hover leave events. * @brief hoverLeaveEvent handle hover leave events.
* @param event * @param event hover leave event.
*/ */
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
/** /**
* @brief RemoveReferens decrement value of reference. * @brief RemoveReferens decrement value of reference.
*/ */
virtual void RemoveReferens(); virtual void RemoveReferens();
/**
* @brief itemChange hadle item change.
* @param change change.
* @param value value.
* @return value.
*/
virtual QVariant itemChange ( GraphicsItemChange change, const QVariant &value ); virtual QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
/**
* @brief keyReleaseEvent handle key release events.
* @param event key release event.
*/
virtual void keyReleaseEvent(QKeyEvent * event); virtual void keyReleaseEvent(QKeyEvent * event);
private: private:
/** /**
* @brief dialogSpline * @brief dialogSpline dialog.
*/ */
QSharedPointer<DialogSpline> dialogSpline; QSharedPointer<DialogSpline> dialogSpline;
/** /**
* @brief controlPoints * @brief controlPoints list pointers of control points.
*/ */
QVector<VControlPointSpline *> controlPoints; QVector<VControlPointSpline *> controlPoints;
/** /**