Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/classcasa_1_1LELCoordinates.html
Дата изменения: Unknown
Дата индексирования: Mon Feb 14 22:29:19 2011
Кодировка:

Поисковые слова: cygnus
casacore: casa::LELCoordinates Class Reference
Public Member Functions | Private Attributes

casa::LELCoordinates Class Reference
[Lattices_module]

Envelope class to handle Lattice Coordinates in LEL. More...

#include <LELCoordinates.h>

List of all members.

Public Member Functions

 LELCoordinates ()
 Define the possible comparison results.
 LELCoordinates (LELLattCoordBase *coordinates)
 Construct the object from the given letter class.
 LELCoordinates (const LELCoordinates &that)
 Copy constructor (reference semantics).
 ~LELCoordinates ()
LELCoordinatesoperator= (const LELCoordinates &that)
 Assignment (reference semantics).
Bool isNull () const
 Is the coordinates a null object?
Bool hasCoordinates () const
 Does the class have true coordinates? It returns False if this is a null object.
Int compare (const LELCoordinates &other) const
 Check how the coordinates of this and that compare.
const LELLattCoordBasecoordinates () const
 Return the underlying letter object.

Private Attributes

CountedPtr< LELLattCoordBasecoords_p
 The pointer to the underlying object.

Detailed Description

Envelope class to handle Lattice Coordinates in LEL.

Intended use:

Public interface

Review Status

Reviewed By:
Bob Garwood
Date Reviewed:
2000/01/25
Test programs:
tLatticeExpr

Prerequisite

Synopsis

The LatticeExpression classes (LatticeExpr, LatticeExprNode, LEL*) exist so that the C++ programmer can manipulate mathematical expressions involving Lattices. A further usage of these classes is to manipulate ImageInterface objects (which inherit from Lattice) such as PagedImages. These objects have Coordinates as well as the Lattice pixels. In order that Coordinate conformance be enforcable, we must give the LatticeExpression classes access to the Coordinates of the ImageInterface objects.

This is done through the interface of the LELCoordinates class. It is actually an envelope class which holds letter classes which are the actual implementation of the objects which hold the Lattice CoordinateSystems. Lattice objects have a member function called lelCoordinates. This returns a LELCoordinates object. This object contains a pointer (actually a CountedPtr) of type LELLattCoordBase . This is the base class of the letter classes. For Lattices such as ImageInterface, this pointer actually points at the derived letter class LELImageCoord. This class in turn contains a pointer (a CountedPtr) to the actual CoordinateSystem object.

Note that every time the lelCoordinates function is called, the LELLattCoord and LELImageCoord (or whatever the letter class actually being invoked is) objects are constructed. For example the internals of ImageInterface::lelCoordinates are
return LELCoordinates (new LELImageCoord (coords_p));
so that the LELCoordinates constructor invokes the LELImageCoord constructor with the CoordinateSystem as its argument. However, the internal use of CountedPtrs makes subsequent constructions inexpensive.

Having a LELCoordinates object in hand, the programmer then has access to the CoordinateSystem that it ultimately contains. This is via the LELCoordinates member function coordinates which returns a reference to the letter base class LELLattCoordBase. For example, if the actual letter class object was LELImageCoord, one has to then cast the reference returned by LELCoordinates::coordinates() to an LELImageCoord. This is because the LELImageCoord class functions that actually deal with the CoordinateSystem are not virtual (otherwise LELLattCoordBase needs to know about Coordinates).

Example

       PagedImage<Float> im("myimage");
       const LELCoordinates* pLatCoord = &(im.lelCoordinates());
       const LELImageCoord* pImCoord =
                     dynamic_cast<const LELImageCoord*>(pLatCoord);
       CoordinateSystem coords = pImCoord->coordinates();

Motivation

We needed access to CoordinateSystems in the Lattice Expression classes without making the Lattices module dependent on the Images or Coordinates module.

Definition at line 123 of file LELCoordinates.h.


Constructor & Destructor Documentation

casa::LELCoordinates::LELCoordinates (  ) 

Define the possible comparison results.

The default constructor creates a null object.

casa::LELCoordinates::LELCoordinates ( LELLattCoordBase coordinates  ) 

Construct the object from the given letter class.

It takes over the pointer and takes care of destructing the LELLattCoordBase object.

casa::LELCoordinates::LELCoordinates ( const LELCoordinates that  ) 

Copy constructor (reference semantics).

casa::LELCoordinates::~LELCoordinates (  ) 

Member Function Documentation

Int casa::LELCoordinates::compare ( const LELCoordinates other  )  const

Check how the coordinates of this and that compare.

The return value tells how they compare.
-1: this is subset
0: equal
1: this is superset
9: invalid (mismatch)

const LELLattCoordBase& casa::LELCoordinates::coordinates (  )  const

Return the underlying letter object.

This should in general not be used, but for specific (Image) cases it might be needed.

Bool casa::LELCoordinates::hasCoordinates (  )  const

Does the class have true coordinates? It returns False if this is a null object.

Bool casa::LELCoordinates::isNull (  )  const [inline]

Is the coordinates a null object?

Definition at line 144 of file LELCoordinates.h.

References coords_p, and casa::SimpleCountedConstPtr< t >::null().

LELCoordinates& casa::LELCoordinates::operator= ( const LELCoordinates that  ) 

Assignment (reference semantics).


Member Data Documentation

The pointer to the underlying object.

Definition at line 166 of file LELCoordinates.h.

Referenced by isNull().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines