Line data Source code
1 : #include "SphericalCoefficientsDescriptor.h" 2 : #include "DataDescriptor.h" 3 : #include "IdenticalBlocksDescriptor.h" 4 : #include "TypeCasts.hpp" 5 : 6 : namespace elsa 7 : { 8 : SphericalCoefficientsDescriptor::SphericalCoefficientsDescriptor( 9 : const DataDescriptor& blockDescriptor, const Symmetry symmetry, const index_t degree) 10 : : IdenticalBlocksDescriptor{coefficientCount(symmetry, degree), blockDescriptor}, 11 : degree{degree}, 12 : symmetry{symmetry} 13 240 : { 14 240 : } 15 : 16 : SphericalCoefficientsDescriptor* SphericalCoefficientsDescriptor::cloneImpl() const 17 156 : { 18 156 : return new SphericalCoefficientsDescriptor{*_blockDescriptor, symmetry, degree}; 19 156 : } 20 : 21 : bool SphericalCoefficientsDescriptor::isEqual(const DataDescriptor& other) const 22 32 : { 23 32 : if (!IdenticalBlocksDescriptor::isEqual(other)) 24 0 : return false; 25 : 26 : // static cast as type checked in base comparison 27 32 : const auto& otherBlock = downcast<SphericalCoefficientsDescriptor>(other); 28 32 : return degree == otherBlock.degree && symmetry == otherBlock.symmetry; 29 32 : } 30 : 31 : } // namespace elsa