reaction_info.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2020 by
  4. * The Salk Institute for Biological Studies
  5. *
  6. * Use of this source code is governed by an MIT-style
  7. * license that can be found in the LICENSE file or at
  8. * https://opensource.org/licenses/MIT.
  9. *
  10. ******************************************************************************/
  11. #ifndef API_VOLUME_REACTION_INFO_H
  12. #define API_VOLUME_REACTION_INFO_H
  13. #include "generated/gen_reaction_info.h"
  14. #include "api/api_common.h"
  15. #include "bng/bng_defines.h"
  16. namespace MCell {
  17. namespace API {
  18. class ReactionInfo: public GenReactionInfo {
  19. public:
  20. void dump() {
  21. std::cout << to_str();
  22. }
  23. ReactionInfo() {
  24. set_all_custom_attributes_to_default();
  25. }
  26. ReactionInfo(DefaultCtorArgType) {
  27. set_all_custom_attributes_to_default();
  28. }
  29. void set_all_custom_attributes_to_default() {
  30. // setting all (also inherited) attributes
  31. rxn_rule_id = BNG::RXN_RULE_ID_INVALID;
  32. geometry_object_id = GEOMETRY_OBJECT_ID_INVALID;
  33. partition_wall_index = WALL_INDEX_INVALID;
  34. // inherited attributes
  35. type = ReactionType::UNSET;
  36. reaction_rule = nullptr;
  37. time = FLT_UNSET;
  38. pos3d.clear();
  39. geometry_object = nullptr;
  40. wall_index = -1;
  41. pos2d.clear();
  42. }
  43. // extra information to be converted in Callbacks
  44. BNG::rxn_rule_id_t rxn_rule_id;
  45. geometry_object_id_t geometry_object_id; // to geometry_object
  46. wall_index_t partition_wall_index;
  47. };
  48. } // namespace API
  49. } // namespace MCell
  50. #endif // API_VOLUME_REACTION_INFO_H