Commit 256fb39f96b5d6a0bc630fb80fb254c4fd2f1302
1 parent
b2940aa9
Added method to set region name in GSkyRegion class
Showing
2 changed files
with
16 additions
and
2 deletions
include/GSkyRegion.hpp
| ... | ... | @@ -48,6 +48,7 @@ class GSkyDir; |
| 48 | 48 | * |
| 49 | 49 | * Accessible information elements are: |
| 50 | 50 | * - Type of the region (circle, rectangle,...) |
| 51 | + * - Name of the region (must be different for different regions in container) | |
| 51 | 52 | * - Solid angle subtended by the region |
| 52 | 53 | * |
| 53 | 54 | * The object can be initialised from a string in the DS9 region file format, |
| ... | ... | @@ -78,6 +79,7 @@ public: |
| 78 | 79 | // Implemented methods |
| 79 | 80 | const std::string& type(void) const; |
| 80 | 81 | const std::string& name(void) const; |
| 82 | + void name(const std::string& name); | |
| 81 | 83 | const double& solidangle(void) const; |
| 82 | 84 | |
| 83 | 85 | protected: |
| ... | ... | @@ -92,6 +94,20 @@ protected: |
| 92 | 94 | double m_solid; //!< Solid angle subtended by the region (sr) |
| 93 | 95 | }; |
| 94 | 96 | |
| 97 | +/***********************************************************************//** | |
| 98 | +* @brief Set region name | |
| 99 | +* | |
| 100 | +* @param[in] name region name. | |
| 101 | +* | |
| 102 | +* Set name of the region. | |
| 103 | +***************************************************************************/ | |
| 104 | +inline | |
| 105 | +void GSkyRegion::name(const std::string& name) | |
| 106 | +{ | |
| 107 | + m_name = name; | |
| 108 | + return; | |
| 109 | +} | |
| 110 | + | |
| 95 | 111 | |
| 96 | 112 | /***********************************************************************//** |
| 97 | 113 | * @brief Return region name | ... | ... |
include/GSkyRegionCircle.hpp
| ... | ... | @@ -43,7 +43,6 @@ |
| 43 | 43 | * This class provides an implementation for a circular sky region. The sky |
| 44 | 44 | * region is defined by an array of parameters, the meaning of which is |
| 45 | 45 | * specific to the derived class where the region type or shape is defined. |
| 46 | - * The parameters are GModelPar objects for convenience. | |
| 47 | 46 | * |
| 48 | 47 | * The class holds several properties such as solid angle subtended by the |
| 49 | 48 | * region and computed through internal method compute_solid(). |
| ... | ... | @@ -52,7 +51,6 @@ |
| 52 | 51 | * - Do we want a member relating the region to an observation run ? |
| 53 | 52 | * - Constructor and read/write using XML may not be needed if we use DS9 |
| 54 | 53 | * region file format ? |
| 55 | - * - Replace GModelPar by double for the parameters (GModelPar is overkill) ? | |
| 56 | 54 | * |
| 57 | 55 | ***************************************************************************/ |
| 58 | 56 | class GSkyRegionCircle : public GSkyRegion { | ... | ... |