lsst.afw  15.0-16-g953e39cab
XYTransform.cc
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2008, 2009, 2010 LSST Corporation.
6  *
7  * This product includes software developed by the
8  * LSST Project (http://www.lsst.org/).
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the LSST License Statement and
21  * the GNU General Public License along with this program. If not,
22  * see <http://www.lsstcorp.org/LegalNotices/>.
23  */
24 
26 #include <memory>
27 
28 namespace lsst {
29 namespace afw {
30 namespace geom {
31 
32 XYTransform::XYTransform() : daf::base::Citizen(typeid(this)) {}
33 
34 XYTransform::XYTransform(XYTransform const &) = default;
38 
40  Point2D px = p + Extent2D(1, 0);
41  Point2D py = p + Extent2D(0, 1);
42 
43  return makeAffineTransformFromTriple(p, px, py, this->forwardTransform(p), this->forwardTransform(px),
44  this->forwardTransform(py));
45 }
46 
48  Point2D px = p + Extent2D(1, 0);
49  Point2D py = p + Extent2D(0, 1);
50 
51  return makeAffineTransformFromTriple(p, px, py, this->reverseTransform(p), this->reverseTransform(px),
52  this->reverseTransform(py));
53 }
54 
56  return std::make_shared<InvertedXYTransform>(this->clone());
57 }
58 }
59 }
60 }
XYTransform & operator=(XYTransform const &)
Extent< double, 2 > Extent2D
Definition: Extent.h:383
virtual Point2D reverseTransform(Point2D const &point) const =0
virtual Point2D forwardTransform(Point2D const &point) const =0
virtuals for forward and reverse transforms
virtual AffineTransform linearizeReverseTransform(Point2D const &point) const
default implementation; subclass may override
Definition: XYTransform.cc:47
virtual std::shared_ptr< XYTransform > clone() const =0
returns a deep copy
A base class for image defects.
An affine coordinate transformation consisting of a linear transformation and an offset.
virtual std::shared_ptr< XYTransform > invert() const
returns a "deep inverse" in this sense that the forward+inverse transforms do not share state default...
Definition: XYTransform.cc:55
virtual AffineTransform linearizeForwardTransform(Point2D const &point) const
linearized forward and reversed transforms
Definition: XYTransform.cc:39
Virtual base class for 2D transforms.
Definition: XYTransform.h:49
AffineTransform makeAffineTransformFromTriple(Point2D const &p1, Point2D const &p2, Point2D const &p3, Point2D const &q1, Point2D const &q2, Point2D const &q3)