diff options
Diffstat (limited to 'src/patch/patch_system.hh')
-rw-r--r-- | src/patch/patch_system.hh | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/patch/patch_system.hh b/src/patch/patch_system.hh index 6eb70d6..08c15d8 100644 --- a/src/patch/patch_system.hh +++ b/src/patch/patch_system.hh @@ -87,11 +87,22 @@ public: fp global_z_of_local_z(fp local_z) const { return global_coords_.global_z_of_local_z(local_z); } - // ... get global (x,y,z) coordinates of local origin point + // get global (x,y,z) coordinates of local origin point fp origin_x() const { return global_coords_.origin_x(); } fp origin_y() const { return global_coords_.origin_y(); } fp origin_z() const { return global_coords_.origin_z(); } + // find patch containing (ray from origin to) given local (x,y,z) + // ... if there are multiple patches containing the position, + // we return the one which would still contain it if patches + // didn't overlap; if multiple patches satisfy this criterion + // then it's arbitrary which one we return + // ... if no patch contains the position (for a non--full-sphere + // patch system), or the position is at the origin, then + // we do an error_exit() and don't return to the caller + const patch& patch_containing_local_xyz(fp x, fp y, fp z) + const; + // // ***** meta-info about the entire patch system ***** @@ -104,11 +115,15 @@ public: int N_patches() const { return N_patches_; } // get patches by patch number - const patch &ith_patch(int pn) const + const patch& ith_patch(int pn) const { return * all_patches_[pn]; } - patch &ith_patch(int pn) + patch& ith_patch(int pn) { return * all_patches_[pn]; } + // find a patch by +/- xyz "ctype" + const patch& plus_or_minus_xyz_patch(bool is_plus, char ctype) + const; + // find a patch by name, return patch number; error_exit() if not found int patch_number_of_name(const char* name) const; |