-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJoin.cpp
More file actions
26 lines (20 loc) · 739 Bytes
/
Join.cpp
File metadata and controls
26 lines (20 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "stdafx.h"
#include "Join.h"
bool Join::matches(const Shape::ShapeWithAnchors & firstShape, const Shape::ShapeWithAnchors & secondShape) const
{
PartType firstPartType = first->type;
PartType secondPartType = second->type;
std::vector<PartType> firstTypes = similar_parts(firstPartType);
std::vector<PartType> secondTypes = similar_parts(secondPartType);
for (std::vector<PartType>::iterator it = firstTypes.begin(); it != firstTypes.end(); ++it)
{
PartType firstType = *it;
for (std::vector<PartType>::iterator it = secondTypes.begin(); it != secondTypes.end(); ++it)
{
PartType secondType = *it;
if ( Shape::match(firstShape, secondShape, firstType, secondType) )
return true;
}
}
return false;
}