9#include "SampleFilter.h"
14#include "ControlMeasure.h"
15#include "ControlNet.h"
16#include "ControlPoint.h"
20 SampleFilter::SampleFilter(
21 AbstractFilter::FilterEffectivenessFlag flag,
22 int minimumForSuccess) : AbstractNumberFilter(flag, minimumForSuccess) {
26 SampleFilter::SampleFilter(
const SampleFilter &other) : AbstractNumberFilter(other) {
30 SampleFilter::~SampleFilter() {
34 bool SampleFilter::evaluate(
const QPair<QString, ControlNet *> *imageAndNet)
const {
35 return evaluateImageFromMeasureFilter(imageAndNet);
39 bool SampleFilter::evaluate(
const ControlPoint *point)
const {
40 return evaluatePointFromMeasureFilter(point);
44 bool SampleFilter::evaluate(
const ControlMeasure *measure)
const {
45 return AbstractNumberFilter::evaluate(measure->GetSample());
49 AbstractFilter *SampleFilter::clone()
const {
50 return new SampleFilter(*
this);
54 QString SampleFilter::getImageDescription()
const {
55 QString description = AbstractFilter::getImageDescription();
56 if (getMinForSuccess() == 1) {
57 description +=
"measure that has a sample which is ";
60 description +=
"measures that have samples which are ";
63 description += descriptionSuffix();
68 QString SampleFilter::getPointDescription()
const {
69 return getImageDescription();
73 QString SampleFilter::getMeasureDescription()
const {
74 return "have samples which are " + descriptionSuffix();
This is free and unencumbered software released into the public domain.