introspection.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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_INTROSPECTION_H
  12. #define API_INTROSPECTION_H
  13. #include "generated/gen_introspection.h"
  14. #include "api/api_common.h"
  15. namespace MCell {
  16. class World;
  17. namespace API {
  18. class Model;
  19. // this class is used only as a base to Model, it is not provided through API
  20. class Introspection: public GenIntrospection {
  21. public:
  22. Introspection() :
  23. model_inst(nullptr),
  24. world(nullptr) {
  25. }
  26. Introspection(DefaultCtorArgType) :
  27. model_inst(nullptr),
  28. world(nullptr) {
  29. }
  30. void initialize_introspection(Model* model_);
  31. std::vector<int> get_molecule_ids(std::shared_ptr<Complex> pattern = nullptr) override;
  32. std::shared_ptr<Molecule> get_molecule(const int id) override;
  33. std::string get_species_name(const int species_id) override;
  34. std::vector<double> get_vertex(std::shared_ptr<GeometryObject> object, const int vertex_index) override;
  35. std::shared_ptr<Wall> get_wall(std::shared_ptr<GeometryObject> object, const int wall_index) override;
  36. std::vector<double> get_vertex_unit_normal(std::shared_ptr<GeometryObject> object, const int vertex_index) override;
  37. std::vector<double> get_wall_unit_normal(std::shared_ptr<GeometryObject> object, const int wall_index) override;
  38. std::shared_ptr<Color> get_wall_color(std::shared_ptr<GeometryObject> object, const int wall_index) override;
  39. void set_wall_color(std::shared_ptr<GeometryObject> object, const int wall_index, std::shared_ptr<Color> color) override;
  40. void dump() const {}
  41. private:
  42. // not using name model because class Model inherits Introspection and
  43. // this made code a bit confusing
  44. Model* model_inst;
  45. World* world;
  46. };
  47. } // namespace API
  48. } // namespace MCell
  49. #endif // API_INTROSPECTION_H