Gyoto
Classes | Typedefs | Functions | Variables
Gyoto::Astrobj Namespace Reference

Access to astronomical objects. More...

Classes

class  Generic
 Base class for astronomical object. More...
 
class  Properties
 Observable properties of an Astronomical object. More...
 
class  Complex
 Complex astronomical object. More...
 
class  DirectionalDisk
 Geometrically thin disk read from FITS file. More...
 
class  Disk3D
 Geometrically thick disk read from FITS file. More...
 
class  DynamicalDisk
 Geometrically thin disk read from a set of FITS files. More...
 
class  DynamicalDisk3D
 Geometrically thick optically thin disk read from a set of FITS files. More...
 
class  FixedStar
 Fixed (i.e. non-moving) star (or spherical blob) More...
 
class  PageThorneDisk
 Geometrically thin disk in Kerr metric. More...
 
class  PatternDisk
 Geometrically thin disk read from FITS file. More...
 
class  PatternDiskBB
 Geometrically thin disk read from FITS file with black body spectrum. More...
 
class  PolishDoughnut
 A toroïdal accretion structure. More...
 
class  Standard
 Astronomical objects defined bya a potential/distance. More...
 
class  Star
 Mass-less, spherical object following a timelike geodesic. More...
 
class  StarTrace
 Like a Star that would be on all points of its orbit at all time. More...
 
class  ThinDisk
 Geometrically thin disks and rings. More...
 
class  ThinDiskIronLine
 
class  ThinDiskPL
 Geometrically thin disk with black-body emission. More...
 
class  Torus
 Optically thin or thick torus in circular rotation. More...
 
class  UniformSphere
 Optically thick or thin, spherical objects. More...
 

Typedefs

typedef SmartPointer
< Gyoto::Astrobj::Generic
Subcontractor_t (Gyoto::FactoryMessenger *)
 A function to build instances of a specific Astrobj::Generic sub-class. More...
 

Functions

template<typename T >
SmartPointer< Astrobj::GenericSubcontractor (FactoryMessenger *fmp)
 A template for Subcontractor_t functions. More...
 
Gyoto::Astrobj::Subcontractor_tgetSubcontractor (std::string name, int errmode=0)
 Query the Astrobj register. More...
 
void initRegister ()
 Empty the Astrobj register. More...
 
void Register (std::string name, Gyoto::Astrobj::Subcontractor_t *scp)
 Make an Astrobj kind known to the Factory. More...
 

Variables

Gyoto::Register::EntryRegister_
 The Astrobj register. More...
 

Detailed Description

Access to astronomical objects.

Objects which are supposed to be the target of the ray-tracing code should inherit from the Gyoto::Astrobj::Generic class.

When implementing a new object, you must:

In addition, you should make sure that your object plays nicely in the Yorick plug-in, which means:

There are basically two ways of making Generic::Impact() work: either by making the Astrobj a sub-class of the low-level Gyoto::Astrobj::Generic class ans providing your own Generic::Impact() function (which, in principle, should rely on Generic::processHitQuantities()), or by making the Astrobj a sub-class of the higher-level Gyoto::Astrobj::Standard class and implementing two lower level, simpler functions which are used by the Standard::Impact():

Generic::processHitQuantities() itself is an intermediate-level function which you may choose to reimplement. It uses three low-level, easy to implement functions:

To be usable, a Astrobj::Generic (or Astrobj::Standard) sub-classe should register an Astrobj::Subcontractor_t function using the Astrobj::Register() function. See also Writing plug-ins for Gyoto . If your clas implements setParameter() and/or, if necessary, setParameters(), registering it is normally done using the provided template:

Astrobj::Register("MyKind", &(Astrobj::Subcontractor<Astrobj::MyKind>));

Typedef Documentation

typedef SmartPointer<Gyoto::Astrobj::Generic> Gyoto::Astrobj::Subcontractor_t(Gyoto::FactoryMessenger *)

A function to build instances of a specific Astrobj::Generic sub-class.

This is a more specific version of the SmartPointee::Subcontractor_t type. An Astrobj::Subcontrator_t is called by the Gyoto::Factory to build an instance of the kind of astronomical object specified in an XML file (see Register()). The Factory and Subcontractor_t function communicate through a Gyoto::FactoryMessenger. A template is provided so that you may not have to code anything.

Function Documentation

Gyoto::Astrobj::Subcontractor_t* Gyoto::Astrobj::getSubcontractor ( std::string  name,
int  errmode = 0 
)

Query the Astrobj register.

Query the Astrobj register to get the Astrobj::Subcontractor_t correspondig to a given kind name. This function is normally called only from the Factory.

Parameters
namee.g. "Star"
errmode1 to return NULL in case of failure instead of throwing an Error.
Returns
pointer to the corresponding subcontractor.
void Gyoto::Astrobj::initRegister ( )

Empty the Astrobj register.

This must be called once.

void Gyoto::Astrobj::Register ( std::string  name,
Gyoto::Astrobj::Subcontractor_t scp 
)

Make an Astrobj kind known to the Factory.

Register a new Astrobj::Generic sub-class so that the Gyoto::Factory knows it.

Parameters
nameThe kind name which identifies this object type in an XML file, as in <Astrobj kind="name">
scpA pointer to the subcontractor, which will communicate whith the Gyoto::Factory to build an instance of the class from its XML description
template<typename T >
SmartPointer<Astrobj::Generic> Gyoto::Astrobj::Subcontractor ( FactoryMessenger *  fmp)

A template for Subcontractor_t functions.

Instead of reimplementing the wheel, your subcontractor can simply be Gyoto::Astrobj::Subcontractor<MyKind>.

If MyKind accepts any XML parameters, it should re-implement Astrobj::Generic::setParameter() or, if low-level access to the FactoryMessenger is needed, Generic::setParameters().

Template Parameters
TGyoto::Astrobj::Generic sub-class

Variable Documentation

Gyoto::Register::Entry* Gyoto::Astrobj::Register_

The Astrobj register.

Use the Astrobj::initRegister() once in your program to initiliaze it, the Astrobj::Register() function to fill it, and the Astrobj::getSubcontractor() function to query it.