gen_reaction_info.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2021 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_GEN_REACTION_INFO_H
  12. #define API_GEN_REACTION_INFO_H
  13. #include "api/api_common.h"
  14. namespace MCell {
  15. namespace API {
  16. class ReactionInfo;
  17. class GeometryObject;
  18. class ReactionRule;
  19. class PythonExportContext;
  20. class GenReactionInfo {
  21. public:
  22. GenReactionInfo() {
  23. }
  24. GenReactionInfo(DefaultCtorArgType) {
  25. }
  26. virtual ~GenReactionInfo() {}
  27. std::shared_ptr<ReactionInfo> copy_reaction_info() const;
  28. std::shared_ptr<ReactionInfo> deepcopy_reaction_info(py::dict = py::dict()) const;
  29. virtual bool __eq__(const ReactionInfo& other) const;
  30. virtual bool eq_nonarray_attributes(const ReactionInfo& other, const bool ignore_name = false) const;
  31. bool operator == (const ReactionInfo& other) const { return __eq__(other);}
  32. bool operator != (const ReactionInfo& other) const { return !__eq__(other);}
  33. std::string to_str(const bool all_details=false, const std::string ind="") const ;
  34. // --- attributes ---
  35. ReactionType type;
  36. virtual void set_type(const ReactionType new_type_) {
  37. type = new_type_;
  38. }
  39. virtual ReactionType get_type() const {
  40. return type;
  41. }
  42. std::vector<int> reactant_ids;
  43. virtual void set_reactant_ids(const std::vector<int> new_reactant_ids_) {
  44. reactant_ids = new_reactant_ids_;
  45. }
  46. virtual std::vector<int>& get_reactant_ids() {
  47. return reactant_ids;
  48. }
  49. std::vector<int> product_ids;
  50. virtual void set_product_ids(const std::vector<int> new_product_ids_) {
  51. product_ids = new_product_ids_;
  52. }
  53. virtual std::vector<int>& get_product_ids() {
  54. return product_ids;
  55. }
  56. std::shared_ptr<ReactionRule> reaction_rule;
  57. virtual void set_reaction_rule(std::shared_ptr<ReactionRule> new_reaction_rule_) {
  58. reaction_rule = new_reaction_rule_;
  59. }
  60. virtual std::shared_ptr<ReactionRule> get_reaction_rule() const {
  61. return reaction_rule;
  62. }
  63. double time;
  64. virtual void set_time(const double new_time_) {
  65. time = new_time_;
  66. }
  67. virtual double get_time() const {
  68. return time;
  69. }
  70. std::vector<double> pos3d;
  71. virtual void set_pos3d(const std::vector<double> new_pos3d_) {
  72. pos3d = new_pos3d_;
  73. }
  74. virtual std::vector<double>& get_pos3d() {
  75. return pos3d;
  76. }
  77. std::shared_ptr<GeometryObject> geometry_object;
  78. virtual void set_geometry_object(std::shared_ptr<GeometryObject> new_geometry_object_) {
  79. geometry_object = new_geometry_object_;
  80. }
  81. virtual std::shared_ptr<GeometryObject> get_geometry_object() const {
  82. return geometry_object;
  83. }
  84. int wall_index;
  85. virtual void set_wall_index(const int new_wall_index_) {
  86. wall_index = new_wall_index_;
  87. }
  88. virtual int get_wall_index() const {
  89. return wall_index;
  90. }
  91. std::vector<double> pos2d;
  92. virtual void set_pos2d(const std::vector<double> new_pos2d_) {
  93. pos2d = new_pos2d_;
  94. }
  95. virtual std::vector<double>& get_pos2d() {
  96. return pos2d;
  97. }
  98. // --- methods ---
  99. }; // GenReactionInfo
  100. class ReactionInfo;
  101. py::class_<ReactionInfo> define_pybinding_ReactionInfo(py::module& m);
  102. } // namespace API
  103. } // namespace MCell
  104. #endif // API_GEN_REACTION_INFO_H