source: src/UIElements/TextUI/Query/TextQuery.hpp@ 038ccd

AutomationFragmentation_failures Candidate_v1.6.1 ChemicalSpaceEvaluator Exclude_Hydrogens_annealWithBondGraph ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_contraction-expansion Gui_displays_atomic_force_velocity PythonUI_with_named_parameters StoppableMakroAction TremoloParser_IncreasedPrecision
Last change on this file since 038ccd was f4b6bc9, checked in by Frederik Heber <frederik.heber@…>, 7 years ago

Query::handle() no longer returns bool but has internal result flag.

  • we use this flag conditionally in setResult(), i.e. if the handle() has failed, then we should not set its result which might overwrite a present default value in the parameter.
  • this fixes the problem with StepWorldTime which has a default value of 1 but which was overwritten with 0 because of the non-conditionally calling of setResult().
  • this required change of "output-types" default parameter to an empty vector. So far, we were just lucky that this actually worked.
  • also StoreSaturatedFragmentAction needed the same change as default values have to be consistent over the specific token.
  • Property mode set to 100644
File size: 1.8 KB
RevLine 
[738ae1]1/*
2 * TextQuery.hpp
3 *
4 * Created on: Nov 8, 2010
5 * Author: heber
6 */
7
8#ifndef TEXTQUERY_HPP_
9#define TEXTQUERY_HPP_
10
[56f73b]11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16
[738ae1]17#include "TextUI/TextDialog.hpp"
18
19class TextDialog::EmptyTextQuery : public Dialog::EmptyQuery {
20public:
[f130d4]21 EmptyTextQuery(const std::string &_title, const std::string &_description = NULL);
[738ae1]22 virtual ~EmptyTextQuery();
[f4b6bc9]23 virtual void handle();
[738ae1]24};
25
[6af6470]26class TextDialog::VectorTextQuery : public Dialog::TQuery<Vector> {
27public:
28 VectorTextQuery(Parameter<Vector> &_param, const std::string &_title, const std::string &_description = "");
29 virtual ~VectorTextQuery();
[f4b6bc9]30 virtual void handle();
[6af6470]31};
32
33class TextDialog::VectorsTextQuery : public Dialog::TQuery< std::vector<Vector> > {
34public:
35 VectorsTextQuery(Parameter< std::vector<Vector> > &_param, const std::string &_title, const std::string &_description = "");
36 virtual ~VectorsTextQuery();
[f4b6bc9]37 virtual void handle();
[6af6470]38};
[738ae1]39
[37a67f]40 /** With the following boost::preprocessor code we generate forward declarations
41 * of query class for all desired query types in the Qt specialization class of
42 * Dialog.
43 */
44#include "UIElements/GlobalListOfParameterQueries.hpp"
45#include "UIElements/Dialog_impl_pre.hpp"
[33e801]46
[37a67f]47 #include <boost/preprocessor/facilities/empty.hpp>
[33e801]48
[37a67f]49 // iterate over all parameter query types for forward declarations
50 #if defined GLOBALLISTOFPARAMETERQUERIES_Token && defined GLOBALLISTOFPARAMETERQUERIES_Type
51 #define BOOST_PP_LOCAL_MACRO(n) queryclass_definition(~, n, GLOBALLISTOFPARAMETERQUERIES_Token, GLOBALLISTOFPARAMETERQUERIES_Type, Text)
52 #define BOOST_PP_LOCAL_LIMITS (0, MAXPARAMETERTOKENS-1)
53 #include BOOST_PP_LOCAL_ITERATE()
54 #undef queryclass_definition
55 #endif
[738ae1]56
[37a67f]57#include "Dialog_impl_undef.hpp"
58 /* End of preprocessor code piece */
[738ae1]59
60
61#endif /* TEXTQUERY_HPP_ */
Note: See TracBrowser for help on using the repository browser.