KiCad PCB EDA Suite
KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER Class Reference

Class TWO_POINT_GEOMETRY_MANAGER. More...

#include <two_point_geom_manager.h>

Public Member Functions

void SetOrigin (const VECTOR2I &aOrigin)
 

Set the origin of the ruler (the fixed end)

More...
 
VECTOR2I GetOrigin () const
 
void SetEnd (const VECTOR2I &aEnd)
 Set the current end of the rectangle (the end that moves with the cursor. More...
 
VECTOR2I GetEnd () const
 
void SetAngleSnap (bool aSnap)
 

Private Attributes

VECTOR2I m_origin
 
VECTOR2I m_end
 
bool m_angleSnap = false
 

Detailed Description

Class TWO_POINT_GEOMETRY_MANAGER.

Represents a very simple geometry manager for items that have a start and end point.

Definition at line 43 of file two_point_geom_manager.h.

Member Function Documentation

◆ GetEnd()

◆ GetOrigin()

◆ SetAngleSnap()

void KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::SetAngleSnap ( bool  aSnap)
inline

◆ SetEnd()

void KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::SetEnd ( const VECTOR2I aEnd)
inline

Set the current end of the rectangle (the end that moves with the cursor.

Definition at line 62 of file two_point_geom_manager.h.

63  {
64  if( m_angleSnap )
65  {
67  }
68  else
69  {
70  m_end = aEnd;
71  }
72  }
VECTOR2< T > GetVectorSnapped45(const VECTOR2< T > &aVec)
Snap a vector onto the nearest 0, 45 or 90 degree line.

References GetVectorSnapped45(), m_angleSnap, m_end, and m_origin.

Referenced by MICROWAVE_TOOL::drawMicrowaveInductor(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::MeasureTool(), GERBVIEW_SELECTION_TOOL::MeasureTool(), and EDIT_TOOL::MeasureTool().

◆ SetOrigin()

void KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::SetOrigin ( const VECTOR2I aOrigin)
inline

Member Data Documentation

◆ m_angleSnap

bool KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::m_angleSnap = false
private

Definition at line 87 of file two_point_geom_manager.h.

Referenced by SetAngleSnap(), and SetEnd().

◆ m_end

VECTOR2I KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::m_end
private

Definition at line 86 of file two_point_geom_manager.h.

Referenced by GetEnd(), and SetEnd().

◆ m_origin

VECTOR2I KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::m_origin
private

Definition at line 86 of file two_point_geom_manager.h.

Referenced by GetOrigin(), SetEnd(), and SetOrigin().


The documentation for this class was generated from the following file: