本文整理汇总了C++中AATPoint类的典型用法代码示例。如果您正苦于以下问题:C++ AATPoint类的具体用法?C++ AATPoint怎么用?C++ AATPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AATPoint类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ell
AATIsoline::AATIsoline(const AATPoint& ap, const TaskProjection &projection):
ell(ap.get_previous()->get_location_remaining(),
ap.get_next()->get_location_remaining(),
ap.get_location_target(),
projection)
{
}
示例2: OnRangeModified
static void
OnRangeModified(fixed new_value)
{
if (target_point < initial_active_task_point)
return;
const fixed new_range = new_value / fixed(100);
if (new_range == range_and_radial.range)
return;
if (negative(new_range) != negative(range_and_radial.range)) {
/* when the range gets flipped, flip the radial as well */
if (negative(range_and_radial.radial.Native()))
range_and_radial.radial += Angle::HalfCircle();
else
range_and_radial.radial -= Angle::HalfCircle();
LoadRadial();
}
range_and_radial.range = new_range;
{
ProtectedTaskManager::ExclusiveLease lease(*protected_task_manager);
const OrderedTask &task = lease->GetOrderedTask();
AATPoint *ap = task.GetAATTaskPoint(target_point);
if (ap == nullptr)
return;
ap->SetTarget(range_and_radial,
lease->GetOrderedTask().GetTaskProjection());
}
map->Invalidate();
}
示例3: assert
bool
TargetMapWindow::isInSector(PixelPoint pt)
{
assert(task != nullptr);
GeoPoint gp = projection.ScreenToGeo(pt);
ProtectedTaskManager::Lease lease(*task);
AATPoint *p = lease->GetOrderedTask().GetAATTaskPoint(target_index);
return p != nullptr && p->GetObservationZone().IsInSector(gp);
}
示例4:
bool
TaskManager::TargetLock(const unsigned index, bool do_lock)
{
if (!CheckOrderedTask())
return false;
AATPoint *ap = task_ordered.GetAATTaskPoint(index);
if (ap)
ap->target_lock(do_lock);
return true;
}
示例5:
bool
TaskManager::SetTarget(const unsigned index, RangeAndRadial rar)
{
if (!CheckOrderedTask())
return false;
AATPoint *ap = ordered_task->GetAATTaskPoint(index);
if (ap)
ap->SetTarget(rar, ordered_task->GetTaskProjection());
return true;
}
示例6: seg
void
TaskPointRenderer::DrawIsoline(const AATPoint &tp)
{
if (!tp.valid() || !IsTargetVisible(tp))
return;
AATIsolineSegment seg(tp, task_projection);
if (!seg.IsValid())
return;
#define fixed_twentieth fixed(1.0 / 20.0)
GeoPoint start = seg.Parametric(fixed_zero);
GeoPoint end = seg.Parametric(fixed_one);
if (m_proj.GeoToScreenDistance(start.Distance(end)) <= 2)
return;
RasterPoint screen[21];
screen[0] = m_proj.GeoToScreen(start);
screen[20] = m_proj.GeoToScreen(end);
for (unsigned i = 1; i < 20; ++i) {
fixed t = i * fixed_twentieth;
GeoPoint ga = seg.Parametric(t);
screen[i] = m_proj.GeoToScreen(ga);
}
canvas.Select(task_look.isoline_pen);
canvas.SetBackgroundTransparent();
canvas.DrawPolyline(screen, 21);
canvas.SetBackgroundOpaque();
}
示例7: seg
inline void
TaskPointRenderer::DrawIsoline(const AATPoint &tp)
{
if (!tp.valid() || !IsTargetVisible(tp))
return;
AATIsolineSegment seg(tp, flat_projection);
if (!seg.IsValid())
return;
GeoPoint start = seg.Parametric(0);
GeoPoint end = seg.Parametric(1);
if (m_proj.GeoToScreenDistance(start.DistanceS(end)) <= 2)
return;
BulkPixelPoint screen[21];
screen[0] = m_proj.GeoToScreen(start);
screen[20] = m_proj.GeoToScreen(end);
for (unsigned i = 1; i < 20; ++i) {
constexpr double twentieth = 1.0 / 20.0;
auto t = i * twentieth;
GeoPoint ga = seg.Parametric(t);
screen[i] = m_proj.GeoToScreen(ga);
}
canvas.Select(task_look.isoline_pen);
canvas.SetBackgroundTransparent();
canvas.DrawPolyline(screen, 21);
canvas.SetBackgroundOpaque();
}
示例8:
bool
AATIsolineIntercept::Intercept(const AATPoint &ap, const AircraftState &state,
const double bearing_offset, GeoPoint& ip) const
{
AircraftState s1, s2;
if (ell.IntersectExtended(state.location, s1.location, s2.location)) {
if (ap.IsInSector(s1)) {
ip = s1.location;
return true;
}
if (ap.IsInSector(s2)) {
ip = s2.location;
return true;
}
}
return false;
}
示例9: OnRadialModified
static void
OnRadialModified(fixed new_value)
{
if (target_point < initial_active_task_point)
return;
Angle new_radial = Angle::Degrees(new_value);
if (new_radial == range_and_radial.radial)
return;
bool must_reload_radial = false;
if (new_radial >= Angle::HalfCircle()) {
new_radial -= Angle::FullCircle();
must_reload_radial = true;
} else if (new_radial <= -Angle::HalfCircle()) {
new_radial += Angle::FullCircle();
must_reload_radial = true;
}
if ((new_radial.Absolute() > Angle::QuarterCircle()) !=
(range_and_radial.radial.Absolute() > Angle::QuarterCircle())) {
/* when the radial crosses the +/-90 degrees threshold, flip the
range */
range_and_radial.range = -range_and_radial.range;
LoadRange();
}
range_and_radial.radial = new_radial;
{
ProtectedTaskManager::ExclusiveLease lease(*protected_task_manager);
const OrderedTask &task = lease->GetOrderedTask();
AATPoint *ap = task.GetAATTaskPoint(target_point);
if (ap == nullptr)
return;
ap->SetTarget(range_and_radial,
lease->GetOrderedTask().GetTaskProjection());
}
if (must_reload_radial)
LoadRadial();
map->Invalidate();
}
示例10: seg
void
PrintHelper::aatpoint_print(std::ostream& f,
const AATPoint& tp,
const AircraftState& state,
const TaskProjection &projection,
const int item)
{
switch(item) {
case 0:
orderedtaskpoint_print(f, tp, state, item);
f << "# Target " << tp.m_target_location.longitude << ","
<< tp.m_target_location.latitude << "\n";
break;
case 1:
if (tp.valid() && (tp.getActiveState() != OrderedTaskPoint::BEFORE_ACTIVE)) {
assert(tp.get_previous());
assert(tp.get_next());
// note in general this will only change if
// prev max or target changes
AATIsolineSegment seg(tp, projection);
fixed tdist = tp.get_previous()->GetLocationRemaining().Distance(
tp.GetLocationMin());
fixed rdist = tp.get_previous()->GetLocationRemaining().Distance(
tp.get_location_target());
bool filter_backtrack = true;
if (seg.IsValid()) {
for (double t = 0.0; t<=1.0; t+= 1.0/20) {
GeoPoint ga = seg.Parametric(fixed(t));
fixed dthis = tp.get_previous()->GetLocationRemaining().Distance(ga);
if (!filter_backtrack
|| (dthis>=tdist)
|| (dthis>=rdist)) {
/// @todo unless double dist is better than current
f << ga.longitude << " " << ga.latitude << "\n";
}
}
} else {
GeoPoint ga = seg.Parametric(fixed_zero);
f << ga.longitude << " " << ga.latitude << "\n";
}
f << "\n";
}
break;
}
}
示例11:
bool
AATIsolineSegment::isInSector(const AATPoint& ap, fixed t) {
GeoPoint a = ell.parametric(t);
AIRCRAFT_STATE s;
s.Location = a;
if (ap.isInSector((s)))
return true;
else
return false;
}
示例12:
AATIsoline::AATIsoline(const AATPoint& ap, const TaskProjection &projection)
:ell(ap.GetPrevious()->GetLocationRemaining(),
ap.GetNext()->GetLocationRemaining(),
ap.GetTargetLocation(), projection) {}
示例13: Visit
virtual void Visit(const AATPoint& tp) {
printf("# got an aat\n");
ozv.Visit(*tp.get_oz());
}
示例14: Visit
virtual void Visit(AATPoint& tp) {
ObservationZoneEdit ozv;
tp.Accept_oz(ozv);
}