Krita Source Code Documentation
Loading...
Searching...
No Matches
KisMagneticWorker.cc File Reference
#include "KisMagneticWorker.h"
#include <kis_gaussian_kernel.h>
#include <lazybrush/kis_lazy_fill_tools.h>
#include <kis_algebra_2d.h>
#include <kis_painter.h>
#include <QtCore>
#include <QPolygon>
#include <QPainter>
#include <QPainterPath>
#include <boost/graph/astar_search.hpp>
#include <krita_utils.h>
#include "KisMagneticGraph.h"

Go to the source code of this file.

Classes

class  AStarGoalVisitor
 
class  AStarHeuristic
 
struct  DistanceMap
 
struct  GoalFound
 
struct  PredecessorMap
 
struct  WeightMap
 

Functions

double EuclideanDistance (VertexDescriptor p1, VertexDescriptor p2)
 
VertexDescriptor get (PredecessorMap const &m, VertexDescriptor v)
 
void put (PredecessorMap &m, VertexDescriptor key, VertexDescriptor value)
 

Function Documentation

◆ EuclideanDistance()

double EuclideanDistance ( VertexDescriptor p1,
VertexDescriptor p2 )

Definition at line 73 of file KisMagneticWorker.cc.

74{
75 return std::sqrt(std::pow(p1.y - p2.y, 2) + std::pow(p1.x - p2.x, 2));
76}
QPointF p2
QPointF p1

References p1, and p2.

◆ get()

Definition at line 62 of file KisMagneticWorker.cc.

63{
64 auto found = m.m_map.find(v);
65 return found != m.m_map.end() ? found->second : v;
66}
qreal v

References PredecessorMap::m_map, and v.

◆ put()

Definition at line 68 of file KisMagneticWorker.cc.

69{
70 m.m_map[key] = value;
71}
float value(const T *src, size_t ch)
std::map< VertexDescriptor, VertexDescriptor > m_map

References PredecessorMap::m_map, and value().