Medical Imaging Interaction Toolkit
2025.12.02
Medical Imaging Interaction Toolkit
mitkQuestionWithOptions.h
Go to the documentation of this file.
1
/*============================================================================
2
3
The Medical Imaging Interaction Toolkit (MITK)
4
5
Copyright (c) German Cancer Research Center (DKFZ)
6
All rights reserved.
7
8
Use of this source code is governed by a 3-clause BSD license that can be
9
found in the LICENSE file.
10
11
============================================================================*/
12
13
#ifndef mitkQuestionWithOptions_h
14
#define mitkQuestionWithOptions_h
15
16
#include <
mitkQuestion.h
>
17
#include <set>
18
19
namespace
mitk::Forms
20
{
28
class
MITKFORMS_EXPORT
QuestionWithOptions
:
public
Question
29
{
30
public
:
31
~QuestionWithOptions
()
override
;
32
33
std::vector<std::string>
GetResponsesAsStrings
()
const override
;
34
void
ClearResponses
()
override
;
35
36
bool
IsComplete
()
const override
;
37
44
size_t
AddOption
(
const
std::string& option);
45
46
std::vector<std::string>
GetOptions
()
const
;
47
48
protected
:
55
void
AddResponse
(
size_t
i);
56
61
void
RemoveResponse
(
size_t
i);
62
67
virtual
void
SetResponse
(
size_t
i);
68
69
private
:
70
std::vector<std::string> m_Options;
71
std::set<size_t> m_Responses;
72
};
73
74
MITKFORMS_EXPORT
void
from_json
(
const
nlohmann::ordered_json& j,
QuestionWithOptions
& q);
75
MITKFORMS_EXPORT
void
to_json
(nlohmann::ordered_json& j,
const
QuestionWithOptions
& q);
76
}
77
78
#endif
MITKFORMS_EXPORT
#define MITKFORMS_EXPORT
Definition:
MitkFormsExports.h:15
mitk::Forms::QuestionWithOptions
Base class for questions with options to choose from as response.
Definition:
mitkQuestionWithOptions.h:29
mitk::Forms::QuestionWithOptions::SetResponse
virtual void SetResponse(size_t i)
Set one of the possible answer options as the single response.
mitk::Forms::QuestionWithOptions::AddOption
size_t AddOption(const std::string &option)
Add a non-exclusive option as possible answer to the question.
mitk::Forms::QuestionWithOptions::AddResponse
void AddResponse(size_t i)
Add one of the possible answer options to the responses.
mitk::Forms::QuestionWithOptions::IsComplete
bool IsComplete() const override
Check if a question is considered to be answered completely.
mitk::Forms::QuestionWithOptions::~QuestionWithOptions
~QuestionWithOptions() override
mitk::Forms::QuestionWithOptions::RemoveResponse
void RemoveResponse(size_t i)
Remove one of the already given responses.
mitk::Forms::QuestionWithOptions::ClearResponses
void ClearResponses() override
Clear the/all response(s).
mitk::Forms::QuestionWithOptions::GetOptions
std::vector< std::string > GetOptions() const
mitk::Forms::QuestionWithOptions::GetResponsesAsStrings
std::vector< std::string > GetResponsesAsStrings() const override
Return the question's response(s) as strings.
mitk::Forms::Question
Abstract base class for all types of questions used in a Form.
Definition:
mitkQuestion.h:32
mitkQuestion.h
mitk::Forms
Definition:
mitkCheckboxesQuestion.h:19
mitk::Forms::to_json
MITKFORMS_EXPORT void to_json(nlohmann::ordered_json &j, const CheckboxesQuestion &q)
mitk::Forms::from_json
MITKFORMS_EXPORT void from_json(const nlohmann::ordered_json &j, CheckboxesQuestion &q)
src
MITK
Modules
Forms
include
mitkQuestionWithOptions.h
Generated on Mon Feb 23 2026 23:28:11 for Medical Imaging Interaction Toolkit by
1.9.1