本文整理汇总了C++中TaskProjection类的典型用法代码示例。如果您正苦于以下问题:C++ TaskProjection类的具体用法?C++ TaskProjection怎么用?C++ TaskProjection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TaskProjection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IntersectingAirspaceVisitorAdapter
IntersectingAirspaceVisitorAdapter(const GeoPoint &_loc,
const GeoPoint &_end,
const TaskProjection &_projection,
AirspaceIntersectionVisitor &_visitor)
:start(_loc), end(_end), projection(&_projection),
ray(projection->ProjectInteger(start), projection->ProjectInteger(end)),
visitor(&_visitor) {}
示例2: airspace
Airspace::Airspace(const GeoPoint &loc, const TaskProjection &task_projection,
const fixed range)
:FlatBoundingBox(task_projection.ProjectInteger(loc),
task_projection.ProjectRangeInteger(loc, range)),
airspace(nullptr)
{
}
示例3: flb
void
AATPoint::set_target(const fixed range, const fixed radial,
const TaskProjection &proj)
{
fixed oldrange = fixed_zero;
fixed oldradial = fixed_zero;
get_target_range_radial(oldrange, oldradial);
const FlatPoint fprev = proj.fproject(get_previous()->get_location_remaining());
const FlatPoint floc = proj.fproject(get_location());
const FlatLine flb (fprev,floc);
const FlatLine fradius (floc,proj.fproject(get_location_min()));
const fixed bearing = fixed_minus_one * flb.angle().value_degrees();
const fixed radius = fradius.d();
fixed swapquadrants = fixed_zero;
if (positive(range) != positive(oldrange))
swapquadrants = fixed(180);
const FlatPoint ftarget1 (fabs(range) * radius *
cos((bearing + radial + swapquadrants)
/ fixed(360) * fixed_two_pi),
fabs(range) * radius *
sin( fixed_minus_one * (bearing + radial + swapquadrants)
/ fixed(360) * fixed_two_pi));
const FlatPoint ftarget2 = floc + ftarget1;
const GeoPoint targetG = proj.funproject(ftarget2);
set_target(targetG, true);
}
示例4: flb
void
AATPoint::SetTarget(const fixed range, const fixed radial,
const TaskProjection &proj)
{
fixed oldrange = fixed_zero;
fixed oldradial = fixed_zero;
GetTargetRangeRadial(oldrange, oldradial);
const FlatPoint fprev =
proj.ProjectFloat(GetPrevious()->GetLocationRemaining());
const FlatPoint floc = proj.ProjectFloat(GetLocation());
const FlatLine flb (fprev,floc);
const FlatLine fradius (floc,proj.ProjectFloat(GetLocationMin()));
const fixed bearing = fixed_minus_one * flb.angle().Degrees();
const fixed radius = fradius.d();
fixed swapquadrants = fixed_zero;
if (positive(range) != positive(oldrange))
swapquadrants = fixed(180);
const FlatPoint ftarget1 (fabs(range) * radius *
cos((bearing + radial + swapquadrants)
/ fixed(360) * fixed_two_pi),
fabs(range) * radius *
sin( fixed_minus_one * (bearing + radial + swapquadrants)
/ fixed(360) * fixed_two_pi));
const FlatPoint ftarget2 = floc + ftarget1;
const GeoPoint targetG = proj.Unproject(ftarget2);
SetTarget(targetG, true);
}
示例5: Airspace
/**
* Constructor for virtual airspaces for use in range-based
* intersection queries
*
* @param loc Location about which to create a virtual airspace envelope
* @param task_projection projection to be used for flat-earth representation
* @param range range in meters of virtual bounding box
*
* @return dummy airspace envelope
*/
Airspace(const GeoPoint&loc, const TaskProjection& task_projection, const
fixed range=fixed_zero):
FlatBoundingBox(task_projection.project(loc),
task_projection.project_range(loc,range)),
pimpl_airspace(NULL)
{
};
示例6: FlatBoundingBox
const FlatBoundingBox
AirspaceCircle::get_bounding_box(const TaskProjection& task_projection)
{
static const Angle a225 = Angle::degrees(fixed(225));
static const Angle a135 = Angle::degrees(fixed(135));
static const Angle a045 = Angle::degrees(fixed(045));
static const Angle a315 = Angle::degrees(fixed(315));
const fixed eradius = m_radius * fixed(1.42);
const GeoPoint ll = GeoVector(eradius, a225).end_point(m_center);
const GeoPoint lr = GeoVector(eradius, a135).end_point(m_center);
const GeoPoint ur = GeoVector(eradius, a045).end_point(m_center);
const GeoPoint ul = GeoVector(eradius, a315).end_point(m_center);
FlatGeoPoint fll = task_projection.project(ll);
FlatGeoPoint flr = task_projection.project(lr);
FlatGeoPoint ful = task_projection.project(ul);
FlatGeoPoint fur = task_projection.project(ur);
// note +/- 1 to ensure rounding keeps bb valid
return FlatBoundingBox(FlatGeoPoint(min(fll.Longitude, ful.Longitude) - 1,
min(fll.Latitude, flr.Latitude) - 1),
FlatGeoPoint(max(flr.Longitude, fur.Longitude) + 1,
max(ful.Latitude, fur.Latitude) + 1));
}
示例7:
GeoPoint
AirspacePolygon::ClosestPoint(const GeoPoint &loc,
const TaskProjection &projection) const
{
const FlatGeoPoint p = projection.ProjectInteger(loc);
const FlatGeoPoint pb = m_border.NearestPoint(p);
return projection.Unproject(pb);
}
示例8:
void
OrderedTaskPoint::ScanProjection(TaskProjection &task_projection) const
{
task_projection.Scan(GetLocation());
for (const auto &i : GetBoundary())
task_projection.Scan(i);
}
示例9: fixed
void
OrderedTaskPoint::scan_projection(TaskProjection& task_projection) const
{
task_projection.scan_location(get_location());
#define fixed_steps fixed(0.05)
for (fixed t=fixed_zero; t<= fixed_one; t+= fixed_steps) {
task_projection.scan_location(get_boundary_parametric(t));
}
}
示例10: fixed
void
OrderedTaskPoint::scan_projection(TaskProjection &task_projection) const
{
task_projection.scan_location(GetLocation());
#define fixed_steps fixed(0.05)
const ObservationZone::Boundary boundary = GetBoundary();
for (auto i = boundary.begin(), end = boundary.end(); i != end; ++i)
task_projection.scan_location(*i);
}
示例11: Set
void
ChartProjection::Set(const PixelRect &rc,
const TaskProjection &task_projection,
double radius_factor)
{
const GeoPoint center = task_projection.GetCenter();
const auto radius = std::max(double(10000),
task_projection.ApproxRadius() * radius_factor);
Set(rc, center, radius);
}
示例12: FlatBoundingBox
void
OrderedTaskPoint::UpdateBoundingBox(const TaskProjection &task_projection)
{
flat_bb = FlatBoundingBox(task_projection.ProjectInteger(GetLocation()));
for (const auto &i : GetBoundary())
flat_bb.Expand(task_projection.ProjectInteger(i));
flat_bb.ExpandByOne(); // add 1 to fix rounding
}
示例13: FlatBoundingBox
void
OrderedTaskPoint::update_boundingbox(const TaskProjection& task_projection)
{
flat_bb = FlatBoundingBox(task_projection.project(get_location()));
for (fixed t=fixed_zero; t<= fixed_one; t+= fixed_steps)
flat_bb.expand(task_projection.project(get_boundary_parametric(t)));
flat_bb.expand(); // add 1 to fix rounding
}
示例14: max
void
ChartProjection::Set(const PixelRect &rc,
const TaskProjection &task_projection,
fixed radius_factor)
{
const GeoPoint center = task_projection.get_center();
const fixed radius = max(fixed(10000),
task_projection.ApproxRadius() * radius_factor);
set_projection(rc, center, radius);
}
示例15: FlatBoundingBox
void
OrderedTaskPoint::update_boundingbox(const TaskProjection &task_projection)
{
flat_bb = FlatBoundingBox(task_projection.project(GetLocation()));
const ObservationZone::Boundary boundary = GetBoundary();
for (auto i = boundary.begin(), end = boundary.end(); i != end; ++i)
flat_bb.Expand(task_projection.project(*i));
flat_bb.ExpandByOne(); // add 1 to fix rounding
}