30 #include "boost/make_shared.hpp"
37 template<
typename CoordSysT>
39 CoordSysT
const &nativeCoordSys,
42 _nativeCoordSys(nativeCoordSys), _transforms()
44 for (
typename Transforms::const_iterator trIter = transforms.begin();
45 trIter != transforms.end(); ++trIter) {
47 std::ostringstream os;
48 os <<
"Duplicate coordSys \"" << trIter->first <<
"\"";
49 throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError, os.str());
51 std::ostringstream os;
52 os <<
"coordSys \"" << trIter->first <<
"\" matches nativeCoordSys";
53 throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError, os.str());
61 boost::make_shared<IdentityXYTransform>()));
65 template<
typename CoordSysT>
69 template<
typename CoordSysT>
72 CoordSysT
const &fromCoordSys,
73 CoordSysT
const &toCoordSys
75 if (fromCoordSys == toCoordSys) {
82 return toTransform->forwardTransform(fromTransform->reverseTransform(fromPoint));
85 template<
typename CoordSysT>
87 std::vector<Point2D>
const &pointList,
88 CoordSysT
const &fromCoordSys,
89 CoordSysT
const &toCoordSys
91 if (fromCoordSys == toCoordSys) {
95 std::vector<Point2D> outList;
98 if (fromCoordSys != _nativeCoordSys) {
100 for (std::vector<Point2D>::const_iterator fromPtIter = pointList.begin();
101 fromPtIter != pointList.end(); ++fromPtIter) {
102 outList.push_back(fromTransform->reverseTransform(*fromPtIter));
105 for (std::vector<Point2D>::const_iterator fromPtIter = pointList.begin();
106 fromPtIter != pointList.end(); ++fromPtIter) {
107 outList.push_back(*fromPtIter);
112 if (toCoordSys != _nativeCoordSys) {
114 for (std::vector<Point2D>::iterator nativePtIter = outList.begin();
115 nativePtIter != outList.end(); ++nativePtIter) {
116 *nativePtIter = toTransform->forwardTransform(*nativePtIter);
122 template<
typename CoordSysT>
124 std::vector<CoordSysT> coordSysList;
125 for (
typename Transforms::const_iterator trIter = _transforms.begin();
126 trIter != _transforms.end(); ++trIter) {
127 coordSysList.push_back(trIter->first);
132 template<
typename CoordSysT>
134 CoordSysT const &coordSys
136 typename Transforms::const_iterator
const foundIter = _transforms.find(coordSys);
137 if (foundIter == _transforms.end()) {
138 std::ostringstream os;
139 os <<
"Registry does not support coordSys \"" << coordSys <<
"\"";
140 throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError, os.str());
142 return foundIter->second;
145 template<
typename CoordSysT>
147 CoordSysT
const &coordSys
149 return _transforms.find(coordSys) != _transforms.end();
#define LSST_EXCEPT(type,...)
Include files required for standard LSST Exception handling.