本文整理汇总了C++中TaskProjection类的典型用法代码示例。如果您正苦于以下问题:C++ TaskProjection类的具体用法?C++ TaskProjection怎么用?C++ TaskProjection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TaskProjection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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) {}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:7,代码来源:Airspaces.cpp
示例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)
{
}
开发者ID:robertscottbeattie,项目名称:xcsoardev,代码行数:7,代码来源:Airspace.cpp
示例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);
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:30,代码来源:AATPoint.cpp
示例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);
}
开发者ID:,项目名称:,代码行数:31,代码来源:
示例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)
{
};
开发者ID:hnpilot,项目名称:XCSoar,代码行数:17,代码来源:Airspace.hpp
示例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));
}
开发者ID:Plantain,项目名称:XCSoar,代码行数:26,代码来源:AirspaceCircle.cpp
示例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);
}
开发者ID:,项目名称:,代码行数:8,代码来源:
示例8:
void
OrderedTaskPoint::ScanProjection(TaskProjection &task_projection) const
{
task_projection.Scan(GetLocation());
for (const auto &i : GetBoundary())
task_projection.Scan(i);
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:8,代码来源:OrderedTaskPoint.cpp
示例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));
}
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:9,代码来源:OrderedTaskPoint.cpp
示例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);
}
开发者ID:alon,项目名称:xcsoar,代码行数:10,代码来源:OrderedTaskPoint.cpp
示例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);
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:10,代码来源:ChartProjection.cpp
示例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
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:10,代码来源:OrderedTaskPoint.cpp
示例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
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:10,代码来源:OrderedTaskPoint.cpp
示例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);
}
开发者ID:,项目名称:,代码行数:10,代码来源:
示例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
}
开发者ID:alon,项目名称:xcsoar,代码行数:11,代码来源:OrderedTaskPoint.cpp
示例16: min
void
OrderedTaskPoint::update_boundingbox(const TaskProjection& task_projection)
{
FlatGeoPoint fmin;
FlatGeoPoint fmax;
bool empty = true;
for (fixed t=fixed_zero; t<= fixed_one; t+= fixed_steps) {
FlatGeoPoint f = task_projection.project(get_boundary_parametric(t));
if (empty) {
empty = false;
fmin = f;
fmax = f;
} else {
fmin.Longitude = min(fmin.Longitude, f.Longitude);
fmin.Latitude = min(fmin.Latitude, f.Latitude);
fmax.Longitude = max(fmax.Longitude, f.Longitude);
fmax.Latitude = max(fmax.Latitude, f.Latitude);
}
}
// note +/- 1 to ensure rounding keeps bb valid
fmin.Longitude-= 1; fmin.Latitude-= 1;
fmax.Longitude+= 1; fmax.Latitude+= 1;
flat_bb = FlatBoundingBox(fmin,fmax);
}
开发者ID:galippi,项目名称:xcsoar,代码行数:25,代码来源:OrderedTaskPoint.cpp
示例17: projected
SearchPoint::SearchPoint(const GeoPoint &loc, const TaskProjection &tp)
:location(loc), flat_location(tp.ProjectInteger(loc))
#ifndef NDEBUG
, projected(true)
#endif
{
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:7,代码来源:SearchPoint.cpp
示例18: dp
GeoPoint
RoutePolars::MSLIntercept(const int index, const AGeoPoint& p,
const TaskProjection& proj) const
{
const unsigned safe_index = ((unsigned)index) % ROUTEPOLAR_POINTS;
const FlatGeoPoint fp = proj.ProjectInteger(p);
const fixed d = p.altitude * polar_glide.GetPoint(safe_index).inv_gradient;
const fixed scale = proj.GetApproximateScale();
const int steps = int(d / scale) + 1;
int dx, dy;
RoutePolar::IndexToDXDY(safe_index, dx, dy);
dx = (dx * steps) >> 7;
dy = (dy * steps) >> 7;
const FlatGeoPoint dp(fp.longitude + dx, fp.latitude + dy);
return proj.Unproject(dp);
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:16,代码来源:RoutePolars.cpp
示例19:
void
SearchPoint::Project(const TaskProjection &tp)
{
flat_location = tp.ProjectInteger(location);
#ifndef NDEBUG
projected = true;
#endif
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:9,代码来源:SearchPoint.cpp
示例20: ray
AirspaceIntersectionVector
AirspacePolygon::Intersects(const GeoPoint &start, const GeoPoint &end,
const TaskProjection &projection) const
{
const FlatRay ray(projection.ProjectInteger(start),
projection.ProjectInteger(end));
AirspaceIntersectSort sorter(start, *this);
for (auto it = m_border.begin(); it + 1 != m_border.end(); ++it) {
const FlatRay r_seg(it->GetFlatLocation(), (it + 1)->GetFlatLocation());
fixed t = ray.DistinctIntersection(r_seg);
if (!negative(t))
sorter.add(t, projection.Unproject(ray.Parametric(t)));
}
return sorter.all();
}
开发者ID:,项目名称:,代码行数:19,代码来源:
注:本文中的TaskProjection类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论