示例#1
0
void RegularSurfaceRotated<A>::GetXY(size_t index, double & x, double & y) const
{
  double xloc, yloc;
  surface_.GetXY(index,xloc, yloc);
  LocalToGlobalCoord(xloc,yloc,x,y);

}
示例#2
0
void RegularSurfaceRotated<A>::CalculateMinMaxXY()
{
  std::vector<double> x(4);
  std::vector<double> y(4);

  LocalToGlobalCoord(0, 0, x[0], y[0]);
  LocalToGlobalCoord(surface_.GetLengthX(), 0, x[1], y[1]);
  LocalToGlobalCoord(0, surface_.GetLengthY(), x[2], y[2]);
  LocalToGlobalCoord(surface_.GetLengthX(), surface_.GetLengthY(), x[3], y[3]);

  x_min_ = *(std::min_element(x.begin(), x.end()));
  y_min_ = *(std::min_element(y.begin(), y.end()));
  x_max_ = *(std::max_element(x.begin(), x.end()));
  y_max_ = *(std::max_element(y.begin(), y.end()));

}
示例#3
0
void RegularSurfaceRotated<A>::GetXY(size_t index, double & x, double & y) const
{
  double x_tmp, y_tmp;
  surface_.GetXY(index,x_tmp,y_tmp);

  double x_loc = x_tmp - x_ref_;
  double y_loc = y_tmp - y_ref_;

  LocalToGlobalCoord(x_loc,y_loc,x,y);
}
示例#4
0
文件: simbox.cpp 项目: CRAVA/crava
double Simbox::RecalculateErodedLZ() const
{
  double lz = 0;
  if (this->getlx() > 0.0 || this->getly() > 0.0) { //Only do if area is initialized.
    // An arbitary grid resolution.
    int nx = 100;
    int ny = 100;

    double dx = getlx() / nx;
    double dy = getly() / ny;


    for (int i = 0; i < nx; ++i) {
      for (int j = 0; j < ny; ++j) {
        double x, y;
        LocalToGlobalCoord(dx * i, dy * j, x, y);
        lz = std::max(lz_eroded_, base_eroded_surface_->GetZ(x, y) - top_eroded_surface_->GetZ(x, y));
      }
    }
  }
  return lz;
}