KiCad PCB EDA Suite
Loading...
Searching...
No Matches
construction_manager.cpp File Reference
#include "tool/construction_manager.h"
#include <chrono>
#include <wx/timer.h>
#include <advanced_config.h>
#include <hash.h>

Go to the source code of this file.

Classes

class  ACTIVATION_HELPER< T >
 A helper class to manage the activation of a "proposal" after a timeout. More...
 
struct  CONSTRUCTION_MANAGER::PENDING_BATCH
 

Functions

static std::size_t HashConstructionBatchSources (const CONSTRUCTION_MANAGER::CONSTRUCTION_ITEM_BATCH &aBatch, bool aIsPersistent)
 Construct a hash based on the sources of the items in the batch.
 
static bool pointHasEscapedSnapLineX (const VECTOR2I &aCursor, const VECTOR2I &aSnapLineOrigin, int aEscapeRange, EDA_ANGLE aLongRangeEscapeAngle)
 Check if the cursor has moved far enough away from the snap line origin to escape snapping in the X direction.
 
static bool pointHasEscapedSnapLineY (const VECTOR2I &aCursor, const VECTOR2I &aSnapLineOrigin, int aEscapeRange, EDA_ANGLE aLongRangeEscapeAngle)
 As above, but for the Y direction.
 

Function Documentation

◆ HashConstructionBatchSources()

static std::size_t HashConstructionBatchSources ( const CONSTRUCTION_MANAGER::CONSTRUCTION_ITEM_BATCH & aBatch,
bool aIsPersistent )
static

Construct a hash based on the sources of the items in the batch.

Definition at line 197 of file construction_manager.cpp.

References hash_combine(), and hash_val().

Referenced by CONSTRUCTION_MANAGER::ProposeConstructionItems().

◆ pointHasEscapedSnapLineX()

static bool pointHasEscapedSnapLineX ( const VECTOR2I & aCursor,
const VECTOR2I & aSnapLineOrigin,
int aEscapeRange,
EDA_ANGLE aLongRangeEscapeAngle )
static

Check if the cursor has moved far enough away from the snap line origin to escape snapping in the X direction.

This is defined as within aEscapeRange of the snap line origin, and within aLongRangeEscapeAngle of the vertical line passing through the snap line origin.

Definition at line 458 of file construction_manager.cpp.

References std::abs(), DEGREES_T, EDA_ANGLE::Normalize90(), and VECTOR2< T >::x.

Referenced by SNAP_LINE_MANAGER::GetNearestSnapLinePoint().

◆ pointHasEscapedSnapLineY()

static bool pointHasEscapedSnapLineY ( const VECTOR2I & aCursor,
const VECTOR2I & aSnapLineOrigin,
int aEscapeRange,
EDA_ANGLE aLongRangeEscapeAngle )
static

As above, but for the Y direction.

Definition at line 473 of file construction_manager.cpp.

References std::abs(), EDA_ANGLE::Normalize90(), and VECTOR2< T >::y.

Referenced by SNAP_LINE_MANAGER::GetNearestSnapLinePoint().