source: src/Actions/BondAction/BondAddAction.def

stable v1.7.0
Last change on this file was c30959, checked in by Frederik Heber <frederik.heber@…>, 5 years ago

BondAddAction also adds to molecule.

  • NOTE: This basically does nothing as new atoms (AddAtom action) always get a dummy molecule. However, removing them from the dummy molecule and readding one is quite complicated.
  • if we add bonds between new atoms (without a molecule set) to and atoms belonging all to the same molecule, then we automatically add the new atoms to this molecule as well. This saves the need for any GraphUpdateMolecules() call afterwards.
  • also implemented undo and redo for this.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 * BondAddAction.def
3 *
4 * Created on: Nov 14, 2012
5 * Author: heber
6 */
7
8// all includes and forward declarations necessary for non-integral types below
9#include "types.hpp"
10#include <vector>
11#include <utility>
12
13typedef std::vector<std::pair<atomId_t,atomId_t> > bondPairIds_t;
14typedef std::vector<const molecule*> molecules_t;
15
16#include "Parameters/Validators/RangeValidator.hpp"
17
18// i.e. there is an integer with variable name Z that can be found in
19// ValueStorage by the token "Z" -> first column: int, Z, "Z"
20// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
21//#define paramtypes (const element *)(BoxVector) TODO: use a validator
22#define paramtypes (int)
23#define paramtokens ("bond-degree")
24#define paramdescriptions ("bond degree of each the added bonds")
25#define paramreferences (degree)
26#define paramdefaults (PARAM_DEFAULT(1))
27#define paramvalids \
28(RangeValidator<int>(1,10))
29
30#define statetypes (bondPairIds_t)(molecules_t)(molecule *)
31#define statereferences (bondPairIds)(molecules)(add_to_mol)
32
33// some defines for all the names, you may use ACTION, STATE and PARAMS
34#define CATEGORY Bond
35#define MENUNAME "bond"
36#define MENUPOSITION 1
37#define ACTIONNAME Add
38#define TOKEN "add-bonds"
39
40// finally the information stored in the ActionTrait specialization
41#define DESCRIPTION "add bonds in between any number of selected atoms"
42#undef SHORTFORM
Note: See TracBrowser for help on using the repository browser.