LCOV - code coverage report
Current view: top level - elsa/core/Descriptors - PlanarDetectorDescriptor.cpp (source / functions) Hit Total Coverage
Test: coverage-all.lcov Lines: 21 21 100.0 %
Date: 2024-05-16 04:22:26 Functions: 6 6 100.0 %

          Line data    Source code
       1             : #include "PlanarDetectorDescriptor.h"
       2             : 
       3             : namespace elsa
       4             : {
       5             :     PlanarDetectorDescriptor::PlanarDetectorDescriptor(const IndexVector_t& numOfCoeffsPerDim,
       6             :                                                        const std::vector<Geometry>& geometryList)
       7             :         : DetectorDescriptor(numOfCoeffsPerDim, geometryList)
       8        5759 :     {
       9        5759 :     }
      10             :     PlanarDetectorDescriptor::PlanarDetectorDescriptor(const IndexVector_t& numOfCoeffsPerDim,
      11             :                                                        const RealVector_t& spacingPerDim,
      12             :                                                        const std::vector<Geometry>& geometryList)
      13             :         : DetectorDescriptor(numOfCoeffsPerDim, spacingPerDim, geometryList)
      14       12705 :     {
      15       12705 :     }
      16             : 
      17             :     RealRay_t
      18             :         PlanarDetectorDescriptor::computeRayFromDetectorCoord(const RealVector_t& detectorCoord,
      19             :                                                               const index_t poseIndex) const
      20      234600 :     {
      21      234600 :         return DetectorDescriptor::computeRayFromDetectorCoord(detectorCoord, poseIndex);
      22      234600 :     }
      23             : 
      24             :     bool PlanarDetectorDescriptor::isEqual(const DataDescriptor& other) const
      25          13 :     {
      26             :         // PlanarDetectorDescriptor has no data, so just deligate it to base class
      27          13 :         return DetectorDescriptor::isEqual(other);
      28          13 :     }
      29             : 
      30             :     PlanarDetectorDescriptor* PlanarDetectorDescriptor::cloneImpl() const
      31       12655 :     {
      32       12655 :         return new PlanarDetectorDescriptor(getNumberOfCoefficientsPerDimension(),
      33       12655 :                                             getSpacingPerDimension(), _geometry);
      34       12655 :     }
      35             : 
      36             :     std::unique_ptr<DetectorDescriptor>
      37             :         PlanarDetectorDescriptor::cloneWithGeometry(std::vector<Geometry> geometries) const
      38           2 :     {
      39           2 :         auto coeff = getNumberOfCoefficientsPerDimension();
      40           2 :         auto dim = coeff.size();
      41           2 :         coeff[dim - 1] = geometries.size();
      42           2 :         return std::make_unique<PlanarDetectorDescriptor>(coeff, getSpacingPerDimension(),
      43           2 :                                                           geometries);
      44           2 :     }
      45             : 
      46             : } // namespace elsa

Generated by: LCOV version 1.14