Example #1
0
 void operator()(Airspace as) {
   if (as.intersects(*ray) &&
       visitor->set_intersections(as.Intersects(start, end)))
     visitor->Visit(as);
 }
Example #2
0
 bool operator()(const Airspace &as) const {
   return condition(*as.get_airspace());
 }
Example #3
0
 void operator()(Airspace as) {
   AbstractAirspace &aas = *as.get_airspace();
   if (predicate->condition(aas))
     visitor->Visit(as);
 }
Example #4
0
 void operator()(Airspace as) {
   AbstractAirspace &aas = *as.GetAirspace();
   if (predicate->operator()(aas))
     visitor->Visit(as);
 }
Example #5
0
 void operator()(Airspace as) {
   if (as.Intersects(ray) &&
       visitor->SetIntersections(as.Intersects(start, end, *projection)))
     visitor->Visit(as);
 }
Example #6
0
 bool operator()(const Airspace &as) const {
   return condition(as.GetAirspace());
 }
Example #7
0
gcc_pure
static bool
AirspacePointersEquals(const Airspace &a, const Airspace &b)
{
  return &a.GetAirspace() == &b.GetAirspace();
}
Example #8
0
 /**
  * Equality operator, matches if contained airspace is the same
  */
 bool operator==(Airspace const &a) const {
   return &GetAirspace() == &a.GetAirspace();
 }
Example #9
0
 /**
  * Equality operator, matches if contained airspace is the same
  */
 bool operator==(Airspace const& a) const {
   return (get_airspace() == a.get_airspace());
 }
Example #10
0
void KMLState::write(std::ostream& stream, const Airspace& airspace) const
{

    if ( !( airspace.isFIR() || airspace.isMapEdge() ) )
    {
        std::vector<Coordinate> coords;
        airspace.getCurvedPolygon().discretize( coords, RESOLUTION );

        if (coords.size() > 0)
        {

          /* polygon representing ceiling */
          stream << "  <Placemark>" << endl;
          stream << "    <name>";
          stream << getPlacemarkName(airspace);
          stream << "</name>" << endl;
          stream << "    <description>" << endl;
          stream << "Ceiling: " << airspace.getCeilingString() << " (" << ceil(airspace.getCeiling()) << " m)" << endl;
          stream << "Floor  : " << airspace.getFloorString() << " (" << floor(airspace.getFloor()) << " m)" << endl;
          stream << "    </description>" << endl;
          stream << "    <styleUrl>" << getPolygonType(airspace) << "</styleUrl>" << endl;
          stream << "  <MultiGeometry>" << endl;

          stream << "    <Polygon>" << endl;
          if ( airspace.hasAbsoluteCeiling() ) {
            stream << "      <altitudeMode>absolute</altitudeMode>" << endl;
          } else {
            stream << "      <altitudeMode>relativeToGround</altitudeMode>" << endl;
          }
          stream << "      <outerBoundaryIs>" << endl;
          stream << "        <LinearRing>" << endl;
          stream << "          <coordinates>" << endl;

          write( stream, coords, airspace.getCeiling());

          stream << "          </coordinates>" << endl;
          stream << "        </LinearRing>" << endl;
          stream << "      </outerBoundaryIs>" << endl;
          stream << "    </Polygon>" << endl;

          /* polygon representing floor */
          stream << "    <Polygon>" << endl;
          if ( airspace.hasAbsoluteCeiling() ) {
            stream << "      <altitudeMode>absolute</altitudeMode>" << endl;
          } else {
            stream << "      <altitudeMode>relativeToGround</altitudeMode>" << endl;
          }
          stream << "      <outerBoundaryIs>" << endl;
          stream << "        <LinearRing>" << endl;
          stream << "          <coordinates>" << endl;

          write( stream, coords, airspace.getFloor());

          stream << "          </coordinates>" << endl;
          stream << "        </LinearRing>" << endl;
          stream << "      </outerBoundaryIs>" << endl;
          stream << "    </Polygon>" << endl;

          /* Polygon borders: loop over all coordinates and draw a 'side-rectangle' for each coordinate. */

          for (size_t i = 0; i < coords.size(); ++i)
          {
              stream << "    <Polygon>" << endl;
              if (airspace.hasAbsoluteCeiling() || airspace.hasAbsoluteFloor()) {
                stream << "      <altitudeMode>absolute</altitudeMode>" << endl;
              } else {
                stream << "      <altitudeMode>relativeToGround</altitudeMode>" << endl;
              }
              stream << "      <outerBoundaryIs>" << endl;
              stream << "        <LinearRing>" << endl;
              stream << "          <coordinates>" << endl;

              /* Draw the 'side-rectangle' (4 points) */
              stream << "          ";
              write(stream, coords[i], airspace.getFloor());
              stream << endl;
              stream << "          ";
              write(stream, coords[(i+1)%coords.size()], airspace.getFloor());
              stream << endl;
              stream << "          ";
              write(stream, coords[(i+1)%coords.size()], airspace.getCeiling());
              stream << endl;
              stream << "          ";
              write(stream, coords[i], airspace.getCeiling());
              stream << endl;
              // One extra point, because the KML-requirement that the
              // last point must be identical to the first one to form a closed figure.
              stream << "          ";
              write(stream, coords[i], airspace.getFloor());
              stream << endl;

              stream << "          </coordinates>" << endl;
              stream << "        </LinearRing>" << endl;
              stream << "      </outerBoundaryIs>" << endl;
              stream << "    </Polygon>" << endl;
          }

          stream << "    </MultiGeometry>" << endl;
          stream << "  </Placemark>\n" << endl;

       }
    }
}
Example #11
0
void
AirspaceVisitor::Visit(const Airspace &as)
{
  Visit(*as.get_airspace());
}
Example #12
0
 /**
  * Equality operator, matches if contained airspace is the same
  */
 bool operator==(Airspace const& a) const {
   return (GetAirspace() == a.GetAirspace());
 }