Mantid
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Mantid::Geometry::HKLFilterNone Class Referencefinal

BasicHKLFilters. More...

#include <BasicHKLFilters.h>

Inheritance diagram for Mantid::Geometry::HKLFilterNone:
Mantid::Geometry::HKLFilter

Public Member Functions

std::string getDescription () const noexcept override
 
bool isAllowed (const Kernel::V3D &) const noexcept override
 
- Public Member Functions inherited from Mantid::Geometry::HKLFilter
std::function< bool(const Kernel::V3D &)> fn () const noexcept
 Returns a function object that wraps HKLFilter::isAllowed. More...
 
virtual std::string getDescription () const =0
 
virtual bool isAllowed (const Kernel::V3D &hkl) const =0
 
virtual ~HKLFilter ()=default
 

Detailed Description

BasicHKLFilters.

This file contains some implementations of HKLFilter that provide filtering based on things like d-value, space group or centering.

A common use would be to generate a specific list of HKLs, for example all reflections that are allowed according to a certain range of d-values and the reflection conditions of a space group:

HKLFilter_const_sptr filter = std::make_shared<HKLFilterDRange>(unitCell, 0.5) & std::make_shared<HKLFilterSpaceGroup>(spaceGroup);

HKLGenerator gen(unitCell, 0.5); std::vector<V3D> hkls;

std::remove_copy_if(gen.begin(), gen.end(), std::back_inserter(hkls), (~filter)->fn());

An existing list of HKLs could be checked for indices that match the reflection conditions of a space group:

HKLFilter_const_sptr sgFilter = std::make_shared<HKLFilterSpaceGroup>(spaceGroup);

auto matchingHKLCount = std::count_if(hkls.begin(), hkls.end(), sgFilter->fn());

auto violatingHKLCount = std::count_if(hkls.begin(), hkls.end(), (~sgFilter)->fn());

Combining HKLGenerator and different HKLFilters provides a very flexible system for creating and processing specific sets of Miller indices that is easy to expand by adding other HKLFilters. A class to do no filtering of HKL values.

It implements the NULL-object pattern to avoid having generic code check if a filter is available. Instead use this if no filter is required.\

Definition at line 64 of file BasicHKLFilters.h.

Member Function Documentation

◆ getDescription()

std::string Mantid::Geometry::HKLFilterNone::getDescription ( ) const
inlineoverridevirtualnoexcept

Implements Mantid::Geometry::HKLFilter.

Definition at line 66 of file BasicHKLFilters.h.

◆ isAllowed()

bool Mantid::Geometry::HKLFilterNone::isAllowed ( const Kernel::V3D ) const
inlineoverridevirtualnoexcept

Implements Mantid::Geometry::HKLFilter.

Definition at line 67 of file BasicHKLFilters.h.


The documentation for this class was generated from the following file: