4df9cd
4df9cd
4df9cd
#include "assistantvanishingpoint.h"
4df9cd
#include "guidelineline.h"
4df9cd
4df9cd
// TnzCore includes
4df9cd
#include "tgl.h"
4df9cd
4df9cd
4df9cd
//*****************************************************************************************
4df9cd
//    TAssistantVanishingPoint implementation
4df9cd
//*****************************************************************************************
4df9cd
4df9cd
TAssistantVanishingPoint::TAssistantVanishingPoint(TMetaObject &object):
4df9cd
  TAssistant(object)
4df9cd
{
4df9cd
  m_points.push_back(TAssistantPoint(
4df9cd
    TAssistantPoint::CircleCross ));
4df9cd
}
4df9cd
4df9cd
void
4df9cd
TAssistantVanishingPoint::getGuidelines(
4df9cd
  const TPointD &position,
4df9cd
  const TAffine &toTool,
4df9cd
  TGuidelineList &outGuidelines ) const
4df9cd
{
4df9cd
  outGuidelines.push_back(TGuidelineP(
4df9cd
    new TGuidelineInfiniteLine(
4df9cd
      toTool*m_points.front().position,
4df9cd
      position )));
4df9cd
}
4df9cd
4df9cd
void
4df9cd
TAssistantVanishingPoint::draw(TToolViewer *viewer) const {
4df9cd
  double pixelSize = sqrt(tglGetPixelSize2());
4df9cd
  const TPointD &p = m_points.front().position;
4df9cd
  TPointD dx(20.0*pixelSize, 0.0);
4df9cd
  TPointD dy(0.0, 10.0*pixelSize);
4df9cd
  drawSegment(p-dx-dy, p+dx+dy, pixelSize);
4df9cd
  drawSegment(p-dx+dy, p+dx-dy, pixelSize);
4df9cd
}