lsst.afw  14.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
transformFactory.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
3 #ifndef LSST_AFW_GEOM_TRANSFORMFACTORY_H
4 #define LSST_AFW_GEOM_TRANSFORMFACTORY_H
5 
6 /*
7  * LSST Data Management System
8  * Copyright 2008-2017 LSST Corporation.
9  *
10  * This product includes software developed by the
11  * LSST Project (http://www.lsst.org/).
12  *
13  * This program is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation, either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the LSST License Statement and
24  * the GNU General Public License along with this program. If not,
25  * see <http://www.lsstcorp.org/LegalNotices/>.
26  */
27 
28 /*
29  * Functions for producing Transforms with commonly desired properties.
30  */
31 
33 
34 namespace lsst {
35 namespace afw {
36 namespace geom {
37 
52 template <class FromEndpoint, class ToEndpoint>
53 Transform<FromEndpoint, ToEndpoint> linearizeTransform(
54  Transform<FromEndpoint, ToEndpoint> const &original,
55  typename Transform<FromEndpoint, ToEndpoint>::FromPoint const &point);
56 
57 /*
58  * The correct behavior for linearization is unclear where IcrsCoords are involved (see discussion on
59  * DM-10542). Forbid usage until somebody needs it. Note to maintainers: the template specializations MUST
60  * be deleted in the header for compilers to complain correctly.
61  */
62 #define DISABLE(From, To) \
63  template <> \
64  Transform<From, To> linearizeTransform<From, To>(Transform<From, To> const &, \
65  Transform<From, To>::FromPoint const &) = delete;
66 DISABLE(GenericEndpoint, IcrsCoordEndpoint);
67 DISABLE(Point2Endpoint, IcrsCoordEndpoint);
68 DISABLE(IcrsCoordEndpoint, GenericEndpoint);
69 DISABLE(IcrsCoordEndpoint, Point2Endpoint);
70 DISABLE(IcrsCoordEndpoint, IcrsCoordEndpoint);
71 #undef DISABLE
72 
73 } // namespace geom
74 } // namespace afw
75 } // namespace lsst
76 
77 #endif // LSST_AFW_GEOM_TRANSFORMFACTORY_H
#define DISABLE(From, To)
Transform< FromEndpoint, ToEndpoint > linearizeTransform(Transform< FromEndpoint, ToEndpoint > const &original, typename Transform< FromEndpoint, ToEndpoint >::FromPoint const &point)
Approximate a Transform by its local linearization.