当前位置: 首页>>代码示例>>C++>>正文


C++ ControlPoint::SetAprioriSurfacePoint方法代码示例

本文整理汇总了C++中ControlPoint::SetAprioriSurfacePoint方法的典型用法代码示例。如果您正苦于以下问题:C++ ControlPoint::SetAprioriSurfacePoint方法的具体用法?C++ ControlPoint::SetAprioriSurfacePoint怎么用?C++ ControlPoint::SetAprioriSurfacePoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ControlPoint的用法示例。


在下文中一共展示了ControlPoint::SetAprioriSurfacePoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: IsisMain

void IsisMain() {
  // Create a serial number list
  UserInterface &ui = Application::GetUserInterface();
  QString filename = ui.GetFileName("FROM");
  SerialNumberList serialNumberList;
  serialNumberList.Add(filename);

  // Get the coordinate for updating the camera pointing
  // We will want to make the camera pointing match the lat/lon at this
  // line sample
  double samp1 = ui.GetDouble("SAMP1");
  double line1 = ui.GetDouble("LINE1");
  Latitude lat1(ui.GetDouble("LAT1"), Angle::Degrees);
  Longitude lon1(ui.GetDouble("LON1"), Angle::Degrees);
  Distance rad1;
  if(ui.WasEntered("RAD1")) {
    rad1 = Distance(ui.GetDouble("RAD1"), Distance::Meters);
  }
  else {
    rad1 = GetRadius(ui.GetFileName("FROM"), lat1, lon1);
  }

  // In order to use the bundle adjustment class we will need a control
  // network
  ControlMeasure * m = new ControlMeasure;
  m->SetCubeSerialNumber(serialNumberList.SerialNumber(0));
  m->SetCoordinate(samp1, line1);
//   m->SetType(ControlMeasure::Manual);
  m->SetType(ControlMeasure::RegisteredPixel);

  ControlPoint * p = new ControlPoint;
  p->SetAprioriSurfacePoint(SurfacePoint(lat1, lon1, rad1));
  p->SetId("Point1");
  p->SetType(ControlPoint::Fixed);
  p->Add(m);

  ControlNet cnet;
//  cnet.SetType(ControlNet::ImageToGround);
  cnet.AddPoint(p);

    // We need the target body
    Cube c;
    c.open(filename, "rw");
    //check for target name
    if(c.label()->hasKeyword("TargetName", PvlObject::Traverse)) {
//       c.Label()->findKeyword("TargetName");
      PvlGroup inst = c.label()->findGroup("Instrument", PvlObject::Traverse);
      QString targetName = inst["TargetName"];
      cnet.SetTarget(targetName);
    }
    c.close();

  // See if they wanted to solve for twist
  if(ui.GetBoolean("TWIST")) {
    double samp2 = ui.GetDouble("SAMP2");
    double line2 = ui.GetDouble("LINE2");
    Latitude lat2(ui.GetDouble("LAT2"), Angle::Degrees);
    Longitude lon2(ui.GetDouble("LON2"), Angle::Degrees);
    Distance rad2;
    if(ui.WasEntered("RAD2")) {
      rad2 = Distance(ui.GetDouble("RAD2"), Distance::Meters);
    }
    else {
      rad2 = GetRadius(ui.GetFileName("FROM"), lat2, lon2);
    }

    ControlMeasure * m = new ControlMeasure;
    m->SetCubeSerialNumber(serialNumberList.SerialNumber(0));
    m->SetCoordinate(samp2, line2);
    m->SetType(ControlMeasure::Manual);

    ControlPoint * p = new ControlPoint;
    p->SetAprioriSurfacePoint(SurfacePoint(lat2, lon2, rad2));
    p->SetId("Point2");
    p->SetType(ControlPoint::Fixed);
    p->Add(m);

    cnet.AddPoint(p);
  }

  // Bundle adjust to solve for new pointing
  try {
    BundleAdjust b(cnet, serialNumberList);
    b.SetSolveTwist(ui.GetBoolean("TWIST"));
    //    double tol = ui.GetDouble("TOL");
    //int maxIterations = ui.GetInteger("MAXITS");
    //b.Solve(tol, maxIterations);
    b.SetSolveCmatrix(BundleAdjust::AnglesOnly);
    b.SetSolveSpacecraftPosition(BundleAdjust::Nothing);
    b.SetErrorPropagation(false);
    b.SetOutlierRejection(false);
    b.SetSolutionMethod("SPECIALK");
    b.SetStandardOutput(true);
    b.SetCSVOutput(false);
    b.SetResidualOutput(true);
    b.SetConvergenceThreshold(ui.GetDouble("SIGMA0"));
    b.SetMaxIterations(ui.GetInteger("MAXITS"));

    b.SetDecompositionMethod(BundleAdjust::SPECIALK);
    b.SolveCholesky();
//.........这里部分代码省略.........
开发者ID:jlaura,项目名称:isis3,代码行数:101,代码来源:deltack.cpp

示例2: setApriori

/**
 * Slot to set apriori on selected Points from Navigator list box
 *
 * @author 2011-03-24 Tracie Sucharski
 *
 * @internal
 * @todo  This method should be temporary until the control point editor
 *           comes online.  If this stick around, needs to be re-disigned-
 *           put in a separate class??
 *
 * @history 2011-04-04 Tracie Sucharski - Grey out userEntered if more than
 *                        a single point is selected.  Grey out lat,lon,radius
 *                        edits if UserEntered is not selected.
 * @history 2011-04-13 Tracie Sucharski - If single point selected, fill in
 *                        LineEdit's with current controlPoint values.
 * @history 2011-04-19 Tracie Sucharski - Redesign using modeless dialog.
 * @history 2011-04-26 Tracie Sucharski - Move from QnetNavTool to
 *                        QnetSetAprioriDialog.
 */
void QnetSetAprioriDialog::setApriori() {

    double latSigma = Null;
    double lat = Null;
    double lonSigma = Null;
    double lon = Null;
    double radiusSigma = Null;
    double radius = Null;

    if (latitudeConstraintsGroupBox->isChecked()) {

        if (userEnteredRadioButton->isChecked() && aprioriLatEdit->text() != "") {
            lat = aprioriLatEdit->text().toDouble();
        }
        if (latSigmaEdit->text() != "") {
            latSigma = latSigmaEdit->text().toDouble();
        }
    }
    if (longitudeConstraintsGroupBox->isChecked()) {

        if (userEnteredRadioButton->isChecked() && aprioriLonEdit->text() != "") {
            lon = aprioriLonEdit->text().toDouble();
        }
        if (lonSigmaEdit->text() != "") {
            lonSigma = lonSigmaEdit->text().toDouble();
        }
    }

    if (radiusConstraintsGroupBox->isChecked()) {

        if (userEnteredRadioButton->isChecked() && aprioriRadiusEdit->text() != "") {
            radius = aprioriRadiusEdit->text().toDouble();
        }
        if (radiusSigmaEdit->text() != "") {
            radiusSigma = radiusSigmaEdit->text().toDouble();
        }
    }

    //  If the SetAprioriPoint group box selected, set aprioriSurfacePoint for
    //  those points not editLocked.
    for (int i = 0; i < m_points.size(); i++) {
        QString id = m_points.at(i)->text();
        ControlPoint *pt = m_qnetTool->controlNet()->GetPoint(id);
        if (pt->IsEditLocked()) continue;

        if (!pt->HasAprioriCoordinates()) {
            QString msg = "Point [" + id + "] does not have an Apriori coordinate.  "
                          "Make sure to save the ground source measurement then the Point before "
                          "setting the sigmas.  The sigmas for this point will not be set.";
            QMessageBox::warning((QWidget *)parent(), "Warning", msg);
            continue;
        }

        if (pointSourceGroupBox->isChecked()) {
            if (referenceMeasureRadioButton->isChecked()) {
                ControlMeasure *m = pt->GetRefMeasure();
                // Find camera from network camera list
                int camIndex = m_qnetTool->serialNumberList()->SerialNumberIndex(
                                   m->GetCubeSerialNumber());
                Camera *cam = m_qnetTool->controlNet()->Camera(camIndex);
                cam->SetImage(m->GetSample(),m->GetLine());
                pt->SetAprioriSurfacePoint(cam->GetSurfacePoint());
                pt->SetAprioriSurfacePointSource(ControlPoint::SurfacePointSource::Reference);
            }
            else if (averageMeasuresRadioButton->isChecked()) {
                pt->ComputeApriori();
                // Do not need to set AprioriSurfacePointSource or AprioriRadiusSource,
                // ComputeApriori does this for us.
            }
            else if (userEnteredRadioButton->isChecked()) {
                pt->SetAprioriSurfacePoint(SurfacePoint(
                                               Latitude(lat, Angle::Degrees),
                                               Longitude(lon, Angle::Degrees),
                                               Distance(radius,Distance::Meters)));
                pt->SetAprioriSurfacePointSource(ControlPoint::SurfacePointSource::User);
                pt->SetAprioriRadiusSource(ControlPoint::RadiusSource::User);
            }
        }

        try {
            //  Read Surface point from the control point and set the sigmas,
//.........这里部分代码省略.........
开发者ID:jlaura,项目名称:isis3,代码行数:101,代码来源:QnetSetAprioriDialog.cpp


注:本文中的ControlPoint::SetAprioriSurfacePoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。