Loading...
Searching...
No Matches
LCDifference.h
Go to the documentation of this file.
//# LCDifference.h: Make the difference of 2 regions
//# Copyright (C) 1998
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
#ifndef LATTICES_LCDIFFERENCE_H
#define LATTICES_LCDIFFERENCE_H
//# Includes
#include <casacore/casa/aips.h>
#include <casacore/lattices/LRegions/LCRegionMulti.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
// <summary>
// Make the difference of 2 regions.
// </summary>
// <use visibility=export>
// <reviewed reviewer="" date="" tests="">
// </reviewed>
// <prerequisite>
// <li> <linkto class=LCRegion>LCRegion</linkto>
// </prerequisite>
// <synopsis>
// The LCDifference class is a specialization of class
// <linkto class=LCRegion>LCRegion</linkto>.
// It makes it possible to "subtract" one region from
// another. For example, imagine an overlapping box
// and circle. The box - circle is the box with the
// chunk taken out of it where the circle overlaps.
// The circle - box is the circle with the chunk
// taken out of it where the box overlaps.
// <p>
// The center of the difference must be inside the lattice
// </synopsis>
// <example>
// <srcblock>
// </srcblock>
// </example>
// <todo asof="1997/11/11">
// </todo>
class LCDifference: public LCRegionMulti
{
public:
LCDifference();
// Construct the difference region1 - region2.
LCDifference (const LCRegion& region1, const LCRegion& region2);
// Construct from multiple regions given as a Block.
// When <src>takeOver</src> is True, the destructor will delete the
// given regions. Otherwise a copy of the regions is made.
LCDifference (Bool takeOver, const Block<const LCRegion*>& regions);
// Copy constructor (copy semantics).
LCDifference (const LCDifference& other);
virtual ~LCDifference();
// Assignment (copy semantics).
LCDifference& operator= (const LCDifference& other);
// Comparison
virtual Bool operator== (const LCRegion& other) const;
// Make a copy of the derived object.
virtual LCRegion* cloneRegion() const;
// Get the class name (to store in the record).
static String className();
// Get the region type. Returns className()
virtual String type() const;
// Convert the (derived) object to a record.
virtual TableRecord toRecord (const String& tableName) const;
// Convert correct object from a record.
static LCDifference* fromRecord (const TableRecord&,
const String& tableName);
protected:
// Construct another LCRegion (for e.g. another lattice) by moving
// this one. It recalculates the bounding box and mask.
// A positive translation value indicates "to right".
virtual LCRegion* doTranslate (const Vector<Float>& translateVector,
const IPosition& newLatticeShape) const;
// Do the actual getting of the mask.
virtual void multiGetSlice (Array<Bool>& buffer, const Slicer& section);
private:
// Make the bounding box and determine the offsets.
void defineBox();
};
} //# NAMESPACE CASACORE - END
#endif
casacore::Array
Definition Array.h:155
casacore::Block
Definition Block.h:140
casacore::IPosition
Definition IPosition.h:117
casacore::LCDifference::fromRecord
static LCDifference * fromRecord(const TableRecord &, const String &tableName)
Convert correct object from a record.
casacore::LCDifference::doTranslate
virtual LCRegion * doTranslate(const Vector< Float > &translateVector, const IPosition &newLatticeShape) const
Construct another LCRegion (for e.g.
casacore::LCDifference::className
static String className()
Get the class name (to store in the record).
casacore::LCDifference::LCDifference
LCDifference(const LCRegion &region1, const LCRegion &region2)
Construct the difference region1 - region2.
casacore::LCDifference::~LCDifference
virtual ~LCDifference()
casacore::LCDifference::LCDifference
LCDifference()
casacore::LCDifference::cloneRegion
virtual LCRegion * cloneRegion() const
Make a copy of the derived object.
casacore::LCDifference::type
virtual String type() const
Get the region type.
casacore::LCDifference::LCDifference
LCDifference(const LCDifference &other)
Copy constructor (copy semantics).
casacore::LCDifference::operator=
LCDifference & operator=(const LCDifference &other)
Assignment (copy semantics).
casacore::LCDifference::operator==
virtual Bool operator==(const LCRegion &other) const
Comparison.
casacore::LCDifference::multiGetSlice
virtual void multiGetSlice(Array< Bool > &buffer, const Slicer &section)
Do the actual getting of the mask.
casacore::LCDifference::defineBox
void defineBox()
Make the bounding box and determine the offsets.
casacore::LCDifference::LCDifference
LCDifference(Bool takeOver, const Block< const LCRegion * > &regions)
Construct from multiple regions given as a Block.
casacore::LCDifference::toRecord
virtual TableRecord toRecord(const String &tableName) const
Convert the (derived) object to a record.
casacore::LCRegionMulti::regions
const Block< const LCRegion * > & regions() const
Get the contributing regions.
Definition LCRegionMulti.h:169
casacore::LCRegionMulti::LCRegionMulti
LCRegionMulti()
casacore::LCRegion
Definition LCRegion.h:86
casacore::Slicer
Definition Slicer.h:287
casacore::String
String: the storage and methods of handling collections of characters.
Definition String.h:223
casacore::TableRecord
Definition TableRecord.h:183
casacore::Vector
Definition Vector.h:82
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40