9#include "PointTypeFilter.h"
15#include "ControlMeasure.h"
16#include "ControlNet.h"
17#include "ControlPoint.h"
22 PointTypeFilter::PointTypeFilter(
23 AbstractFilter::FilterEffectivenessFlag flag,
24 int minimumForSuccess) : AbstractMultipleChoiceFilter(flag, minimumForSuccess) {
26 options <<
"Fixed" <<
"Constrained" <<
"Free";
27 createWidget(options);
31 PointTypeFilter::PointTypeFilter(
const PointTypeFilter &other)
32 : AbstractMultipleChoiceFilter(other) {
36 PointTypeFilter::~PointTypeFilter() {
40 bool PointTypeFilter::evaluate(
const QPair<QString, ControlNet *> *imageAndNet)
const {
41 return evaluateImageFromPointFilter(imageAndNet);
45 bool PointTypeFilter::evaluate(
const ControlPoint *point)
const {
46 return ((QString) point->GetPointTypeString() == getCurrentChoice()) ^
51 bool PointTypeFilter::evaluate(
const ControlMeasure *)
const {
56 AbstractFilter *PointTypeFilter::clone()
const {
57 return new PointTypeFilter(*
this);
61 QString PointTypeFilter::getImageDescription()
const {
62 QString description = AbstractFilter::getImageDescription() +
"point";
64 if (getMinForSuccess() != 1) {
71 description +=
"that ";
73 if (getMinForSuccess() == 1) {
77 description +=
"are ";
81 description +=
"not ";
84 description +=
" of type " + getCurrentChoice();
90 QString PointTypeFilter::getPointDescription()
const {
91 QString description =
"are ";
94 description +=
"not ";
97 description +=
"of type " + getCurrentChoice();
This is free and unencumbered software released into the public domain.