Skip to content

area graph vertex membership #276

Description

@yakra

if ( (!p->colocated || p == p->colocated->front())
&& p->is_or_colocated_with_active_or_preview()

Either...

  • Vertices have already been created, and linked to their respective Waypoints.
    All of this could be replaced with a simple if (p->vertex), but first Waypoint::vertexmust be 0ed on construction; right now it's uninitialized until vertex setup.
    Side benefit: if any future changes use the initial value of non-vertex Waypoints, dereferencing a null pointer rather than reading/writing thru a garbage pointer should be easier to debug.
  • If the writes to every Waypoint are actually less efficient, we can get rid of the extraneous colocation check in is_or_colocated_with_active_or_preview by using a lambda:
    // first check if this is a terminal quadrant, and if it is,// we search for vertices within this quadrantif (!qt->refined())
    for (Waypoint *p : qt->points)
    { auto graph_point = [=]()
    {	if (!p->colocated) return p->route->system->active_or_preview();
    if (p != p->colocated->front()) returnfalse;
    for (Waypoint* w : *p->colocated)
    if (w->route->system->active_or_preview()) returntrue;
    returnfalse;
    };
    if (	graph_point()
    &&	contains_vertex(p->lat, p->lng)
    &&	p->region_match(gle.regions)
    &&	p->system_match(gle.systems)
    ){	vvec.push_back(p->vertex);
    hg->add_to_subgraph(p->vertex, threadnum);
    }
    }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions