51 int actual_clearance = std::numeric_limits<int>::max();
52 std::vector<const SHAPE*> a_shapes;
53 std::vector<const SHAPE*> b_shapes;
59 a_shapes.push_back(
this );
62 b_shapes.push_back( aOther );
64 for(
const SHAPE* a : a_shapes )
66 for(
const SHAPE* b : b_shapes )
69 a->Collide( b, std::numeric_limits<int>::max() / 2, &temp_dist );
71 if( temp_dist < actual_clearance )
72 actual_clearance = temp_dist;
76 return actual_clearance;
virtual size_t GetIndexableSubshapeCount() const
SHAPE_TYPE m_type
< type of our shape
virtual void GetIndexableSubshapes(std::vector< const SHAPE * > &aSubshapes) const
An abstract shape on 2D plane.
int GetClearance(const SHAPE *aOther) const
Return the actual minimum distance between two shapes.
virtual bool Parse(std::stringstream &aStream)
virtual const std::string Format(bool aCplusPlus=true) const