Action #502

Feature #490: Avoid casts for derived classes

Rework GModelSpatial interface

Added by Knödlseder Jürgen about 12 years ago. Updated almost 12 years ago.

Status:ClosedStart date:09/20/2012
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-Estimated time:0.00 hour
Target version:00-07-00
Duration:

Description

Here a list of the methods implemented in the derived class of GModelSpatial:

GModelRadial:
  • virtual double eval(const double& theta) const = 0;
  • virtual double eval_gradients(const double& theta) const = 0;
  • virtual double theta_max(void) const = 0;
  • double ra(void) const;
  • double dec(void) const;
  • GSkyDir dir(void) const;
  • void dir(const GSkyDir& dir);

Note: the ra(), dec(), and dir() methods can be implement on the level of GModelSpatial as each spatial model has some kind of center or direction. It is up to the derived classes to see how this is interpreted.

GModelRadialDisk:
  • double radius(void) const;
  • void radius(const double& radius);

Note: these methods are just luxury as the parameter access can also be done using the parameter access operators.

GModelRadialGauss:
  • double sigma(void) const;
  • void sigma(const double& sigma);

Note: these methods are just luxury as the parameter access can also be done using the parameter access operators.

GModelRadialShell:
  • double radius(void) const;
  • double width(void) const;
  • bool small_angle(void) const;
  • void radius(const double& radius);
  • void width(const double& width);
  • void small_angle(const bool& small_angle);

Note: the radius() and width() methods are just luxury as the parameter access can also be done using the parameter access operators. The small_angle() methods are very low-level.

GModelSpatialConst:
None

GModelSpatialCube:
None

GModelSpatialMap:
None

GModelSpatialPtsrc:
  • double ra(void) const;
  • double dec(void) const;
  • GSkyDir dir(void) const;
  • void dir(const GSkyDir& dir);

Note: the ra() and dec() methods are just luxury as the parameter access can also be done using the parameter access operators. The dir() method is also some luxury as the same can be achieved by ra() and dec().


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen about 12 years ago

  • Description updated (diff)

#2 Updated by Knödlseder Jürgen about 12 years ago

  • Description updated (diff)

#3 Updated by Knödlseder Jürgen about 12 years ago

  • Start date set to 09/20/2012

due to changes in a related task

#4 Updated by Knödlseder Jürgen about 12 years ago

  • Status changed from New to Feedback
  • Assigned To set to Knödlseder Jürgen
  • Remaining (hours) set to 0.0

The interface has not been reworked. Instead, output typemaps have been implemented that perform typecasting at the access level.

#5 Updated by Knödlseder Jürgen almost 12 years ago

  • Status changed from Feedback to Closed
  • Estimated time set to 0.00

#6 Updated by Knödlseder Jürgen almost 12 years ago

  • % Done changed from 0 to 100

Also available in: Atom PDF