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

void KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::SetAngleSnap ( bool  aSnap)
inline
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.

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

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

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.
void KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER::SetOrigin ( const VECTOR2I aOrigin)
inline

Set the origin of the ruler (the fixed end)

Definition at line 48 of file two_point_geom_manager.h.

References m_origin.

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

49  {
50  m_origin = aOrigin;
51  }

Member Data Documentation

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().

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().

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: