Documentation for VToolHeight class.

--HG--
branch : develop
This commit is contained in:
dismine 2014-01-24 21:55:08 +02:00
parent f7813f62cd
commit 45c8f5f57f
2 changed files with 33 additions and 31 deletions

View File

@ -115,6 +115,7 @@ void VToolHeight::Create(const qint64 _id, const QString &pointName, const QStri
} }
} }
//TODO Which way is better? See VAbstractTool::ClosestPoint.
QPointF VToolHeight::FindPoint(const QLineF &line, const QPointF &point) QPointF VToolHeight::FindPoint(const QLineF &line, const QPointF &point)
{ {
qreal a = 0, b = 0, c = 0; qreal a = 0, b = 0, c = 0;

View File

@ -33,23 +33,23 @@
#include "../../dialogs/dialogheight.h" #include "../../dialogs/dialogheight.h"
/** /**
* @brief The VToolHeight class * @brief The VToolHeight class tool for creation point of height. Help find point of projection onto line.
*/ */
class VToolHeight: public VToolLinePoint class VToolHeight: public VToolLinePoint
{ {
Q_OBJECT Q_OBJECT
public: public:
/** /**
* @brief VToolHeight * @brief VToolHeight 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 typeLine line type. * @param typeLine line type.
* @param basePointId * @param basePointId id base point of projection.
* @param p1LineId * @param p1LineId id first point of line.
* @param p2LineId * @param p2LineId id second point of line.
* @param typeCreation way we create this tool. * @param typeCreation way we create this tool.
* @param parent parent object * @param parent parent object.
*/ */
VToolHeight(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine, VToolHeight(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
const qint64 &basePointId, const qint64 &p1LineId, const qint64 &p2LineId, const qint64 &basePointId, const qint64 &p1LineId, const qint64 &p2LineId,
@ -59,11 +59,11 @@ 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<DialogHeight> &dialog, VMainGraphicsScene *scene, static void Create(QSharedPointer<DialogHeight> &dialog, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data); VDomDocument *doc, VContainer *data);
@ -72,14 +72,14 @@ public:
* @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 typeLine line type. * @param typeLine line type.
* @param basePointId * @param basePointId id base point of projection.
* @param p1LineId * @param p1LineId id first point of line.
* @param p2LineId * @param p2LineId id second point of line.
* @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.
*/ */
@ -88,15 +88,12 @@ public:
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation); VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation);
/** /**
* @brief FindPoint * @brief FindPoint find projection base point onto line.
* @param line * @param line line
* @param point * @param point base point.
* @return * @return point onto line.
*/ */
static QPointF FindPoint(const QLineF &line, const QPointF &point); static QPointF FindPoint(const QLineF &line, const QPointF &point);
/**
* @brief ToolType
*/
static const QString ToolType; static const QString ToolType;
public slots: public slots:
/** /**
@ -104,15 +101,19 @@ 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 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 );
/** /**
@ -125,15 +126,15 @@ protected:
virtual void RefreshDataInFile(); virtual void RefreshDataInFile();
private: private:
/** /**
* @brief dialogHeight * @brief dialogHeight dialog.
*/ */
QSharedPointer<DialogHeight> dialogHeight; QSharedPointer<DialogHeight> dialogHeight;
/** /**
* @brief p1LineId * @brief p1LineId id first point of line.
*/ */
qint64 p1LineId; qint64 p1LineId;
/** /**
* @brief p2LineId * @brief p2LineId id second point of line.
*/ */
qint64 p2LineId; qint64 p2LineId;
}; };