MCPcopy Create free account
hub / github.com/computationalpathologygroup/ASAP / isClockwise

Method isClockwise

annotation/Annotation.cpp:20–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20bool Annotation::isClockwise() const {
21 if (!_coordinates.empty()) {
22 std::vector<Point> coords = _coordinates;
23 coords.push_back(coords[0]);
24 double cwise = 0;
25 for (unsigned int pt = 0; pt < coords.size() - 1; ++pt) {
26 double toAdd = (coords[pt + 1].getX() - coords[pt].getX()) * ((coords[pt + 1].getY() + coords[pt].getY()));
27 cwise += toAdd;
28 }
29 return cwise < 0;
30 }
31 else {
32 return false;
33 }
34}
35
36void Annotation::setTypeFromString(const std::string& type) {
37 for (unsigned int i = 0; i < 7; ++i) {

Callers 1

convertMethod · 0.80

Calls 2

emptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected