4df9cd
#pragma once
4df9cd
4df9cd
#ifndef GUIDELINELINE_INCLUDED
4df9cd
#define GUIDELINELINE_INCLUDED
4df9cd
4df9cd
// TnzTools includes
4df9cd
#include <tools assistant.h=""></tools>
4df9cd
4df9cd
4df9cd
#undef DVAPI
4df9cd
#undef DVVAR
4df9cd
#ifdef TNZTOOLS_EXPORTS
4df9cd
#define DVAPI DV_EXPORT_API
4df9cd
#define DVVAR DV_EXPORT_VAR
4df9cd
#else
4df9cd
#define DVAPI DV_IMPORT_API
4df9cd
#define DVVAR DV_IMPORT_VAR
4df9cd
#endif
4df9cd
4df9cd
4df9cd
//==============================================================
4df9cd
4df9cd
//*****************************************************************************************
4df9cd
//    TGuidelineLineBase definition
4df9cd
//*****************************************************************************************
4df9cd
4df9cd
class DVAPI TGuidelineLineBase : public TGuideline {
4df9cd
public:
4df9cd
  const TPointD p0;
4df9cd
  const TPointD p1;
4df9cd
6cb657
  TGuidelineLineBase(bool enabled, double magnetism, const TPixelD &color, const TPointD &p0, const TPointD &p1);
7c7225
  void drawLine(const TPointD &p0, const TPointD &p1, bool restrict0, bool restrict1, bool active, bool enabled) const;
4df9cd
  static TPointD calcDirection(const TPointD &p0, const TPointD &p1);
c7854d
  static bool truncateInfiniteLine(const TRectD &bounds, TPointD &p0, TPointD &p1);
7c7225
  static bool truncateRay(const TRectD &bounds, TPointD &p0, TPointD &p1);
7c7225
  static bool truncateLine(const TRectD &bounds, TPointD &p0, TPointD &p1);
4df9cd
};
4df9cd
4df9cd
4df9cd
//*****************************************************************************************
4df9cd
//    TGuidelineLine definition
4df9cd
//*****************************************************************************************
4df9cd
4df9cd
class DVAPI TGuidelineLine : public TGuidelineLineBase {
4df9cd
public:
4df9cd
  const TPointD dir;
4df9cd
  const double dist;
4df9cd
6cb657
  TGuidelineLine(bool enabled, double magnetism, const TPixelD &color, const TPointD &p0, const TPointD &p1);
4df9cd
  TTrackPoint transformPoint(const TTrackPoint &point) const override;
8074a5
  void draw(bool active, bool enabled) const override;
4df9cd
};
4df9cd
4df9cd
4df9cd
//*****************************************************************************************
4df9cd
//    TGuidelineInfiniteLine definition
4df9cd
//*****************************************************************************************
4df9cd
4df9cd
class DVAPI TGuidelineInfiniteLine : public TGuidelineLineBase {
4df9cd
public:
4df9cd
  const TPointD dir;
4df9cd
6cb657
  TGuidelineInfiniteLine(bool enabled, double magnetism, const TPixelD &color, const TPointD &p0, const TPointD &p1);
4df9cd
  TTrackPoint transformPoint(const TTrackPoint &point) const override;
8074a5
  void draw(bool active, bool enabled) const override;
4df9cd
};
4df9cd
4df9cd
4df9cd
//*****************************************************************************************
4df9cd
//    TGuidelineRay definition
4df9cd
//*****************************************************************************************
4df9cd
4df9cd
class DVAPI TGuidelineRay : public TGuidelineLineBase {
4df9cd
public:
4df9cd
  const TPointD dir;
4df9cd
6cb657
  TGuidelineRay(bool enabled, double magnetism, const TPixelD &color, const TPointD &p0, const TPointD &p1);
4df9cd
  TTrackPoint transformPoint(const TTrackPoint &point) const override;
8074a5
  void draw(bool active, bool enabled) const override;
4df9cd
};
4df9cd
4df9cd
#endif