MeVisLab Toolbox Reference
mlStringLineFilterFieldAddOn.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
6 
11 //----------------------------------------------------------------------------------
12 #pragma once
13 
14 #include "MLDicomAnalysisSystem.h"
15 
16 // Base class for SringLineFilter
17 #include <mlFieldAddOnBase.h>
18 
19 // String vector and tools.
20 #include <mlReleaseTools.h>
21 
22 ML_START_NAMESPACE
23 
24 //----------------------------------------------------------------------------------
27 //----------------------------------------------------------------------------------
29 {
30 public:
32  inline StringLineFilterFieldAddOn(FieldContainer &fieldContainerRef): FieldAddOnBase(fieldContainerRef){};
33 
35  enum { NumFilters = 2 };
36 
38  void addFields() override;
39 
42 
46 
49  void filterString(const std::string& stringToBeFiltered);
50 
61  static ReleaseToolsIO::StringVector determineFilterLines(const std::string &inString,
62  bool simplify);
63 
64 protected:
65 
68 
72 
75  BoolField *_useRegularExpressionFld[NumFilters];
76 
80  StringField *_firstExpressionFld[NumFilters];
81 
83  StringField *_lineEndFld[NumFilters];
84 
86  IntField *_occurenceFld[NumFilters];
87 
89  StringField *_foundValue1Fld[NumFilters];
90 
92  BoolField *_foundValue1IsValidFld[NumFilters];
93 
95  StringField *_foundValue2Fld[NumFilters];
96 
98  BoolField *_foundValue2IsValidFld[NumFilters];
100 };
101 
102 ML_END_NAMESPACE
Project global and OS specific declarations.
#define ML_DICOM_ANALYSIS_EXPORT
DLL export macro definition.
Field to encapsulate a boolean value.
Definition: mlFields.h:62
Abstract base class for field interfaces to be added to other ML module classes.
FieldChangeState
Describes the type of a field changes detected in handleFieldChanges(Field *field).
Defines the class FieldContainer to encapsulate a vector of fields for (see class Field).
Base class for all fields used in the ML.
Definition: mlField.h:73
Field to encapsulate an integer value.
Definition: mlFields.h:161
Field to encapsulate a string value.
Definition: mlFields.h:1000
Class implementing the StringLineFilterFieldAddOn which manages fields for line based filtering of a ...
BoolField * _compressWhiteSpacesFld
If true then all white spaces are replaced by spaces and multiple occurrences are compressed to singl...
void handleFieldActivationChanges() override
Do the activateAttachment-like stuff in this method.
static ReleaseToolsIO::StringVector determineFilterLines(const std::string &inString, bool simplify)
Searches lines in inStr which match a prefix expression followed somewhere later by a post fix expres...
StringLineFilterFieldAddOn(FieldContainer &fieldContainerRef)
Constructor, setting the reference of the FieldContainer managing the fields.
FieldAddOnBase::FieldChangeState handleFieldChanges(Field *field) override
Handle field notifications.
void filterString(const std::string &stringToBeFiltered)
Update the filter results according to the new string stringToBeFiltered; the string is not copied no...
void addFields() override
Add fields to field container of module.
Header file of the abstract base class FieldAddOnBase managing fields independently of an ML Module.
Main header file including all other headers of the project MLReleaseTools.
std::vector< std::string > StringVector
Define often used string vector types.