Program Listing for File spatial_entity2D.hpp

Return to documentation for file (cosm/repr/spatial_entity2D.hpp)

#pragma once

/*******************************************************************************
 * Includes
 ******************************************************************************/
#include "rcppsw/math/range.hpp"
#include "rcppsw/spatial/euclidean_dist.hpp"

#include "cosm/repr/spatial_entity.hpp"

/*******************************************************************************
 * Namespaces
 ******************************************************************************/
namespace cosm::repr {

/*******************************************************************************
 * Class Definitions
 ******************************************************************************/
class spatial_entity2D : public spatial_entity {
 public:
  using spatial_entity::spatial_entity;

  ~spatial_entity2D(void) override = default;

  rmath::ranged xrspan(void) const { return rbb().xspan(); }

  rmath::ranged yrspan(void) const { return rbb().yspan(); }

  rspatial::euclidean_dist xrsize(void) const {
    return rspatial::euclidean_dist(rbb().xsize());
  }

  rspatial::euclidean_dist yrsize(void) const {
    return rspatial::euclidean_dist(rbb().ysize());
  }

  rmath::rangez xdspan(void) const { return dbb().xspan(); }

  rmath::rangez ydspan(void) const { return dbb().yspan(); }

  size_t xdsize(void) const { return dbb().xsize(); }

  size_t ydsize(void) const { return dbb().ysize(); }
};

} /* namespace cosm::repr */