Go to the documentation of this file.
22 #ifndef ASTSHIM_PCDMAP_H
23 #define ASTSHIM_PCDMAP_H
87 PcdMap(
double disco, std::vector<double>
const &pcdcen, std::string
const &options =
"")
88 :
Mapping(reinterpret_cast<AstMapping *>(_makeRawPcdMap(disco, pcdcen, options))) {}
109 std::vector<double> ctr;
110 for (
auto axis = 1; axis < 3; ++axis) {
118 return copyImpl<PcdMap, AstPcdMap>();
122 explicit PcdMap(AstPcdMap *rawptr) :
Mapping(reinterpret_cast<AstMapping *>(rawptr)) {
124 std::ostringstream os;
125 os <<
"this is a " <<
getClassName() <<
", which is not a PcdMap";
126 throw std::invalid_argument(os.str());
131 AstPcdMap *_makeRawPcdMap(
double disco, std::vector<double>
const &pcdcen,
132 std::string
const &options =
"") {
133 if (pcdcen.size() != 2) {
134 std::ostringstream os;
135 os <<
"pcdcen.size() = " << pcdcen.size() <<
"; must be 2";
136 throw std::invalid_argument(os.str());
138 auto result = astPcdMap(disco, pcdcen.data(),
"%s", options.c_str());
void assertOK(AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
Definition: base.cc:49
std::shared_ptr< PcdMap > copy() const
Return a deep copy of this object.
Definition: PcdMap.h:99
PcdMap(PcdMap &&)=default
std::vector< double > getPcdCen() const
Get PcdMap_PcdCen PcdCen for both axes: centre coordinates of pincushion/barrel distortion.
Definition: PcdMap.h:108
virtual ~PcdMap()
Definition: PcdMap.h:90
std::string getClassName() const
Definition: Object.h:139
virtual std::shared_ptr< Object > copyPolymorphic() const override
Definition: PcdMap.h:117
PcdMap & operator=(PcdMap &&)=default
double getDisco() const
Get Disco: pincushion/barrel distortion coefficient.
Definition: PcdMap.h:102
PcdMap(double disco, std::vector< double > const &pcdcen, std::string const &options="")
Definition: PcdMap.h:87
AST wrapper classes and functions.
Definition: attributes_channel.dox:1
double getD(std::string const &attrib) const
Definition: Object.h:374
PcdMap & operator=(PcdMap const &)=delete
PcdMap(AstPcdMap *rawptr)
Construct a PcdMap from a raw AST pointer.
Definition: PcdMap.h:122
AstObject const * getRawPtr() const
Definition: Object.h:292
double getPcdCen(int axis) const
Get PcdMap_PcdCen PcdCen(axis) for one axis: centre coordinates of pincushion/barrel distortion.
Definition: PcdMap.h:105
std::string formatAxisAttr(std::string const &name, int axis)
Definition: utils.h:79
PcdMap(PcdMap const &)=default
Copy constructor: make a deep copy.