bool LocationPolygons::SortByColour(LocationLayerPtr p1, LocationLayerPtr p2) { Colour p1Colour = p1->GetLocationController()->GetColour(); Colour p2Colour = p2->GetLocationController()->GetColour(); //Arbitrary weighted average to make sure the same colours are grouped together double p1Average = (2027*p1Colour.GetRed() + 2063*p1Colour.GetGreen() + 2067*p1Colour.GetBlue())/3; double p2Average = (2027*p2Colour.GetRed() + 2063*p2Colour.GetGreen() + 2067*p2Colour.GetBlue())/3; return (p1Average < p2Average); }
void TileModel::AddLocationLayer(LocationLayerPtr location) { // Update number of locations in Tile numLocations++; // Add sequence layers to tile? std::vector<SequenceLayerPtr> sequences = location->GetAllSequenceLayers(); UpdateSequences(sequences); // Add fields to tile UpdateData(location->GetLocationController()->GetData()); }