| Line | Branch | Decision | Exec | Source |
|---|---|---|---|---|
| 1 | #ifndef REGION_HPP | |||
| 2 | #define REGION_HPP | |||
| 3 | ||||
| 4 | #include "types.hpp" | |||
| 5 | #include "edge.hpp" | |||
| 6 | #include "geometry.hpp" | |||
| 7 | #include "linalg.hpp" | |||
| 8 | ||||
| 9 | class Region | |||
| 10 | // virtual base class for a geometry patch with a 2D coordinate system. Within | |||
| 11 | // a region, region functions are only called by geometry or trajectory member | |||
| 12 | // functions | |||
| 13 | { | |||
| 14 | friend class Geometry; | |||
| 15 | friend class Trajectory; | |||
| 16 | ||||
| 17 | public: | |||
| 18 | ||||
| 19 | // pointer to geometry | |||
| 20 | Geometry* const geometry; | |||
| 21 | ||||
| 22 | // const RegionType type; | |||
| 23 | double area; | |||
| 24 | double total_length; | |||
| 25 | // time tag at which the length was last updated | |||
| 26 | int previous_update_tag; | |||
| 27 | int region_id; | |||
| 28 | double z_offset; | |||
| 29 | double rot_angle; | |||
| 30 | double peri_meter; | |||
| 31 | Eigen::Vector2d mid_point; | |||
| 32 | std::vector<Edge> side; | |||
| 33 | std::map<int, int> side_map; | |||
| 34 | std::map<int, int> side_rev_map; | |||
| 35 | Eigen::Quaternion<double> q; | |||
| 36 | std::vector<Eigen::Vector2d> vertices; | |||
| 37 | std::vector<Eigen::Vector3d> orientation; | |||
| 38 | int face_tag; | |||
| 39 | int poly_intersect_mark; | |||
| 40 | std::vector<int> intersect_edg; | |||
| 41 | ||||
| 42 | // list of trajectories on the region | |||
| 43 | DLList<Trajectory, TRAJECTORY_GRANULARITY> trajectories; | |||
| 44 | ||||
| 45 | // tip management functions | |||
| 46 | std::list<MTTip*> growing_plus_tip_list; | |||
| 47 | std::list<MTTip*> shrinking_plus_tip_list; | |||
| 48 | std::list<MTTip*> minus_tip_list; | |||
| 49 | RegionMTTipTag register_on_region(MTTip*, TipType, MTType); | |||
| 50 | void unregister_from_region(RegionMTTipTag, TipType, MTType); | |||
| 51 | ||||
| 52 | // updates the length to the current system time tag | |||
| 53 | void update_region_length(bool force_update = false); | |||
| 54 | ||||
| 55 | ✗ | Region(Geometry* g, double a): | ||
| 56 | ✗ | geometry(g), | ||
| 57 | ✗ | area(a), | ||
| 58 | ✗ | total_length(0), | ||
| 59 | ✗ | previous_update_tag(0), | ||
| 60 | ✗ | region_id(0), | ||
| 61 | ✗ | z_offset(0.0), | ||
| 62 | ✗ | rot_angle(0.0), | ||
| 63 | ✗ | peri_meter(0.0) | ||
| 64 | { | |||
| 65 | ✗ | mid_point << 0.0, 0.0; | ||
| 66 |
0/2✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
|
✗ | for (int i = 0; i < 3; i++) | |
| 67 | { | |||
| 68 | ✗ | vertices.push_back(Eigen::Vector2d(0, 0)); | ||
| 69 | ✗ | side.push_back(Edge()); | ||
| 70 | } | |||
| 71 | ✗ | } | ||
| 72 | ||||
| 73 | ✗ | virtual ~Region() { return; }; | ||
| 74 | ||||
| 75 | double optical_length(); | |||
| 76 | ||||
| 77 | // vector computation functions (to be implemented in specializations) | |||
| 78 | virtual void translate_vector(SurfaceVector&, const double) = 0; | |||
| 79 | virtual void get_trajectory_coordinates(SurfaceVector&, double&, std::vector<PointAtEdge>&, TrajectoryVector&) = 0; | |||
| 80 | virtual double intersection_angle(Trajectory*, Trajectory*) = 0; | |||
| 81 | virtual void output_snapshot(std::ostream&) = 0; | |||
| 82 | virtual void output_order_heat_map(std::ostream&, std::vector<double>&, std::vector<Eigen::Vector3d>&) = 0; | |||
| 83 | ||||
| 84 | protected: | |||
| 85 | ||||
| 86 | // trajectory management functions | |||
| 87 | TrajectoryVector insert_trajectory(const SurfaceVector&); | |||
| 88 | void remove_trajectory(Trajectory*); | |||
| 89 | virtual void make_intersection_list(Trajectory*) = 0; | |||
| 90 | virtual SurfaceVector random_surface_vector() = 0; | |||
| 91 | ||||
| 92 | private: | |||
| 93 | ||||
| 94 | // avoid accidental (expensive) copying of Region objects, by declaring | |||
| 95 | // private copy constructors without definitions | |||
| 96 | Region(const Region&); | |||
| 97 | Region& operator=(const Region&); | |||
| 98 | }; | |||
| 99 | ||||
| 100 | class Cartesian: public Region | |||
| 101 | { | |||
| 102 | public: | |||
| 103 | ||||
| 104 | Cartesian(Geometry*, double); | |||
| 105 | ||||
| 106 | virtual SurfaceVector random_surface_vector() = 0; | |||
| 107 | virtual void get_trajectory_coordinates(SurfaceVector&, double&, std::vector<PointAtEdge>&, TrajectoryVector&) = 0; | |||
| 108 | void make_intersection_list(Trajectory*); | |||
| 109 | void translate_vector(SurfaceVector&, const double); | |||
| 110 | double intersection_angle(Trajectory*, Trajectory*); | |||
| 111 | ||||
| 112 | void get_order_parameters(OrderParameters&); | |||
| 113 | void get_order_parameters_raw_flat(OrderParametersRaw&, std::vector<Eigen::Vector3d>&, double); | |||
| 114 | void get_order_parameters_raw_cylinder(OrderParametersRaw&, double, double, double); | |||
| 115 | ||||
| 116 | void output_snapshot(std::ostream&); | |||
| 117 | void output_snapshot_offset(std::ostream&, double, double); | |||
| 118 | ||||
| 119 | void output_order_heat_map(std::ostream&, std::vector<double>&, std::vector<Eigen::Vector3d>&); | |||
| 120 | }; | |||
| 121 | ||||
| 122 | class Triangle: public Cartesian | |||
| 123 | { | |||
| 124 | public: | |||
| 125 | ||||
| 126 | Triangle(double, Geometry*); | |||
| 127 | ||||
| 128 | SurfaceVector random_surface_vector(); | |||
| 129 | void get_trajectory_coordinates(SurfaceVector&, double&, std::vector<PointAtEdge>&, TrajectoryVector&); | |||
| 130 | }; | |||
| 131 | ||||
| 132 | #endif // REGION_HPP | |||
| 133 |