![]() |
ImFusion C++ SDK 4.5.0
|
Public Member Functions | |
| SelectorElem (std::optional< AnatomicalStructure::ContentType > ct={}, std::optional< std::string > identifier={}, std::optional< std::string > key={}, std::optional< std::pair< std::string, std::string > > attributeStructure=std::nullopt, std::optional< std::pair< std::string, std::string > > attributeObject=std::nullopt, std::set< std::string > pseudoClasses={}) | |
| Base constructor allowing specification of all member variables. | |
| bool | match (const std::string &identifier, const Properties &attributesStructure, std::optional< AnatomicalStructure::ContentType > ct, const std::string &key, const Properties &attributesObject, const std::set< std::string > &pseudoClasses) const |
| Returns true if the given object matches the selector. | |
| std::string | str () const |
| Returns a string representation of the selector. This is the inverse of the parse function. | |
Static Public Member Functions | |
| static std::optional< SelectorElem > | parse (const std::string &str) |
| Parse a string into a SelectorElem. | |
| static SelectorElem | contentTypeSelector (AnatomicalStructure::ContentType ct) |
| Utility function to create a Selector to only match by content type. | |
| static SelectorElem | attributesStructureSelector (std::pair< std::string, std::string > attr) |
| Utility function to create a Selector to only match by AnatomicalStructure::attributes(). | |
| static SelectorElem | attributesObjectSelector (std::pair< std::string, std::string > attr) |
| Utility function to create a Selector to only match by KeyValueStore::Entry::attributes(). | |
| static SelectorElem | pseudoClassesSelector (std::set< std::string > classes) |
| Utility function to create a Selector to match with a set of pseudo-classes. | |
| static SelectorElem | wildcardSelector () |
| Utility function to create a Selector to match with everything. | |
Public Attributes | |
| std::optional< AnatomicalStructure::ContentType > | m_ct |
| Content type to match. | |
| std::optional< std::string > | m_identifier |
| AnatomicalStructure::identifier() to match. | |
| bool | m_exactIdentifier = false |
| If true, m_identifier must match exactly (no child prefix rule). Serialized as "#=". | |
| std::optional< std::string > | m_key |
| AnatomicalStructure::KeyValueStore<ContentType>::key to match. | |
| bool | m_exactKey = false |
| If true, m_key must match exactly (no child prefix rule). | |
| std::map< std::string, SelectorAnnotation > | m_annotations {} |
| Post-selection metadata annotations. | |
| std::optional< std::pair< std::string, std::string > > | m_attributesStructure |
| AnatomicalStructure::attributes() to match. | |
| std::optional< std::pair< std::string, std::string > > | m_attributesObject |
| AnatomicalStructure::KeyValueStore<ContentType>::Entry::attributes() to match. | |
| std::set< std::string > | m_pseudoClasses |
| Set of pseudo-classes to match, e.g. "focus" for the ":focus" pseudo-class. | |
|
explicit |
Base constructor allowing specification of all member variables.
Members that are std::nullopt are ignored during matching, other members must all match (logical AND).
|
static |
Parse a string into a SelectorElem.
| bool ImFusion::AnatomyPlugin::SelectorElem::match | ( | const std::string & | identifier, |
| const Properties & | attributesStructure, | ||
| std::optional< AnatomicalStructure::ContentType > | ct, | ||
| const std::string & | key, | ||
| const Properties & | attributesObject, | ||
| const std::set< std::string > & | pseudoClasses ) const |
Returns true if the given object matches the selector.
Only the matching layer (ct, identifier, key, attributes, pseudo-classes) is considered. m_annotations are never consulted and do not influence the result.
| bool ImFusion::AnatomyPlugin::SelectorElem::m_exactKey = false |
If true, m_key must match exactly (no child prefix rule).
Serialized as "/=".
| std::map<std::string, SelectorAnnotation> ImFusion::AnatomyPlugin::SelectorElem::m_annotations {} |
Post-selection metadata annotations.
Does not affect match(); consumed by application code after matching. Serialized as "@name(arg1, arg2, ...)" suffix, e.g. "Images/Seg@labelValues(42, 55)". Keyed by annotation name; names must be unique within one SelectorElem (parse error otherwise). Iteration order is alphabetical by name, so str() normalizes annotation order.