Exemple #1
0
void 
Serialiser::Visit(const SectorZone& data)
{
  m_node.set_attribute(_T("type"), _T("Sector"));
  m_node.set_attribute(_T("radius"), data.getRadius());
  m_node.set_attribute(_T("start_radial"), data.getStartRadial());
  m_node.set_attribute(_T("end_radial"), data.getEndRadial());
}
  void
  Visit(const SectorZone& oz)
  {
    hide_all();
    WndFrame* wp = ((WndFrame *)wf->FindByName(_T("frmOZSector")));
    if (wp)
      wp->show();

    LoadFormProperty(*wf, _T("prpOZSectorRadius"),
                     ugDistance, oz.getRadius());
    LoadFormProperty(*wf, _T("prpOZSectorStartRadial"),
                     oz.getStartRadial().value_degrees());
    LoadFormProperty(*wf, _T("prpOZSectorFinishRadial"),
                     oz.getEndRadial().value_degrees());
    WndProperty* wap = (WndProperty*)wf->FindByName(_T("prpOZSectorInnerRadius"));
    if (wap) {
      wap->hide();
    }
  }
  void
  Visit(SectorZone& oz)
  {
    fixed radius =
      Units::ToSysDistance(GetFormValueFixed(*wf, _T("prpOZSectorRadius")));
    if (fabs(radius - oz.getRadius()) > fixed(49)) {
      oz.setRadius(radius);
      task_modified = true;
    }

    fixed start_radial = GetFormValueFixed(*wf, _T("prpOZSectorStartRadial"));
    if (start_radial != oz.getStartRadial().value_degrees()) {
      oz.setStartRadial(Angle::degrees(start_radial));
      task_modified = true;
    }

    fixed finish_radial = GetFormValueFixed(*wf, _T("prpOZSectorFinishRadial"));
    if (finish_radial != oz.getEndRadial().value_degrees()) {
      oz.setEndRadial(Angle::degrees(finish_radial));
      task_modified = true;
    }
  }
 void
 Visit(const SectorZone& oz)
 {
   ozUserSize = oz.getRadius();
 }