GammaLib
2.1.0.dev
|
Abstract interface for the sky region class. More...
#include <GSkyRegion.hpp>
Public Member Functions | |
GSkyRegion (void) | |
Void constructor. More... | |
GSkyRegion (const GSkyRegion ®ion) | |
Copy constructor. More... | |
virtual | ~GSkyRegion (void) |
Destructor. More... | |
virtual GSkyRegion & | operator= (const GSkyRegion ®ion) |
Assignment operator. More... | |
virtual void | clear (void)=0 |
Clear object. More... | |
virtual GSkyRegion * | clone (void) const =0 |
Clones object. More... | |
virtual std::string | classname (void) const =0 |
Return class name. More... | |
virtual void | read (const std::string ®string)=0 |
virtual std::string | write (void) const =0 |
virtual bool | contains (const GSkyDir &dir) const =0 |
virtual bool | overlaps (const GSkyRegion ®) const =0 |
virtual bool | contains (const GSkyRegion ®) const =0 |
virtual std::string | print (const GChatter &chatter=NORMAL) const =0 |
Print content of object. More... | |
const std::string & | type (void) const |
Return region type. More... | |
const std::string & | name (void) const |
Return region name. More... | |
const double & | solidangle (void) const |
Return solid angle of region. More... | |
void | type (const std::string &type) |
Set region type. More... | |
void | name (const std::string &name) |
Set region name. More... | |
void | solidangle (const double &solidangle) |
Set solid angle of region. More... | |
Public Member Functions inherited from GBase | |
virtual | ~GBase (void) |
Destructor. More... | |
Protected Member Functions | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GSkyRegion ®ion) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Attributes | |
std::string | m_type |
Type of the region (circle, rectangle,...) More... | |
std::string | m_name |
Name of the region. More... | |
double | m_solid |
Solid angle subtended by the region (sr) More... | |
Abstract interface for the sky region class.
This class provides an abstract interface for a sky region. The sky region is defined by an array of parameters names and values specific to the derived class where the region type or shape is implemented.
Accessible information elements are:
The object can be initialised from a string in the DS9 region file format, and return its description as a string in the DS9 region file format. The input/ouput to/from files is handled in the container class GSkyRegions.
Definition at line 57 of file GSkyRegion.hpp.
GSkyRegion::GSkyRegion | ( | void | ) |
GSkyRegion::GSkyRegion | ( | const GSkyRegion & | region | ) |
Copy constructor.
[in] | region | sky region. |
Definition at line 68 of file GSkyRegion.cpp.
References copy_members(), and init_members().
|
virtual |
|
pure virtual |
Return class name.
Returns the class name for non-abstract classes in a human readable way.
Implements GBase.
Implemented in GSkyRegionRectangle, GSkyRegionCircle, and GSkyRegionMap.
|
pure virtual |
Clear object.
Sets the object to a clean initial state. After calling the method the object will be in the same state as it were if an empty instance of the object would have been created.
Implements GBase.
Implemented in GSkyRegionRectangle, GSkyRegionCircle, and GSkyRegionMap.
|
pure virtual |
Clones object.
Creates a deep copy of the object and returns a pointer to the object.
Implements GBase.
Implemented in GSkyRegionRectangle, GSkyRegionCircle, and GSkyRegionMap.
Referenced by GSkyRegions::append(), GSkyRegions::insert(), and GSkyRegions::set().
|
pure virtual |
Implemented in GSkyRegionRectangle, GSkyRegionCircle, and GSkyRegionMap.
Referenced by GSkyMap::flux(), GSkyRegionMap::overlaps(), and GSkyMap::solidangle().
|
pure virtual |
Implemented in GSkyRegionRectangle, GSkyRegionCircle, and GSkyRegionMap.
|
protected |
Copy class members.
[in] | region | sky region. |
Definition at line 153 of file GSkyRegion.cpp.
References m_name, m_solid, and m_type.
Referenced by GSkyRegion(), and operator=().
|
protected |
Delete class members.
Definition at line 168 of file GSkyRegion.cpp.
Referenced by GSkyRegionMap::clear(), GSkyRegionCircle::clear(), GSkyRegionRectangle::clear(), operator=(), and ~GSkyRegion().
|
protected |
Initialise class members.
Definition at line 136 of file GSkyRegion.cpp.
References m_name, m_solid, and m_type.
Referenced by GSkyRegionMap::clear(), GSkyRegionCircle::clear(), GSkyRegionRectangle::clear(), GSkyRegion(), and operator=().
|
inline |
Return region name.
Returns the region name.
Definition at line 108 of file GSkyRegion.hpp.
References m_name.
Referenced by name().
|
inline |
Set region name.
[in] | name | Region name. |
Sets the region name.
Definition at line 122 of file GSkyRegion.hpp.
|
virtual |
Assignment operator.
[in] | region | sky region. |
Definition at line 106 of file GSkyRegion.cpp.
References copy_members(), free_members(), and init_members().
Referenced by GSkyRegionCircle::operator=(), and GSkyRegionRectangle::operator=().
|
pure virtual |
Implemented in GSkyRegionRectangle, GSkyRegionCircle, and GSkyRegionMap.
Print content of object.
[in] | chatter | Chattiness (defaults to NORMAL). |
Formats the content in a standard way and puts this content in a C++ string that is returned.
Implements GBase.
Implemented in GSkyRegionRectangle, GSkyRegionCircle, and GSkyRegionMap.
|
pure virtual |
Implemented in GSkyRegionRectangle, GSkyRegionCircle, and GSkyRegionMap.
|
inline |
Return solid angle of region.
Returns the solid angle subtended by the region (in steradians).
Definition at line 166 of file GSkyRegion.hpp.
References m_solid.
Referenced by GModelSpatialDiffuseConst::flux(), and solidangle().
|
inline |
Set solid angle of region.
[in] | solidangle | Solid angle of region (in steradians). |
Sets the solid angle subtended by the region (in steradians).
Definition at line 180 of file GSkyRegion.hpp.
References m_solid, and solidangle().
|
inline |
Return region type.
Returns the region type.
Definition at line 137 of file GSkyRegion.hpp.
References m_type.
Referenced by GSkyRegionMap::contains(), GSkyRegionCircle::contains(), GSkyRegionRectangle::contains(), GSkyRegionCircle::overlaps(), GSkyRegionRectangle::overlaps(), GSkyMap::overlaps(), and type().
|
inline |
Set region type.
[in] | type | Region type. |
Sets the region type.
Definition at line 151 of file GSkyRegion.hpp.
|
pure virtual |
Implemented in GSkyRegionRectangle, GSkyRegionCircle, and GSkyRegionMap.
|
protected |
Name of the region.
Definition at line 95 of file GSkyRegion.hpp.
Referenced by copy_members(), init_members(), name(), GSkyRegionCircle::read(), GSkyRegionRectangle::read(), GSkyRegionCircle::write(), and GSkyRegionRectangle::write().
|
protected |
Solid angle subtended by the region (sr)
Definition at line 96 of file GSkyRegion.hpp.
Referenced by GSkyRegionMap::compute_solid_angle(), GSkyRegionCircle::compute_solid_angle(), GSkyRegionRectangle::compute_solid_angle(), copy_members(), init_members(), and solidangle().
|
protected |
Type of the region (circle, rectangle,...)
Definition at line 94 of file GSkyRegion.hpp.
Referenced by copy_members(), GSkyRegionMap::init_members(), init_members(), GSkyRegionCircle::init_members(), GSkyRegionRectangle::init_members(), and type().