Isis 3 Programmer Reference
ProjectionFactory.h
1#ifndef ProjectionFactory_h
2#define ProjectionFactory_h
8/* SPDX-License-Identifier: CC0-1.0 */
9#include "Plugin.h"
10#include "WorldMapper.h"
11
12namespace Isis {
13 class Camera;
14 class Cube;
15 class Projection;
16 class RingPlaneProjection;
17
76 public:
77 static Isis::Projection *Create(Isis::Pvl &label, bool allowDefaults = false);
78 static Isis::Projection *RingsCreate(Isis::Pvl &label, bool allowDefaults = false);
81 static Isis::Projection *CreateFromCube(Isis::Pvl &label); // Load Method in cm
82 static Isis::Projection *RingsCreateFromCube(Isis::Pvl &label); // Load Method in cm
83 static Isis::Projection *CreateForCube(Isis::Pvl &label, int &ns, int &nl,
84 bool sizeMatch = true); // Create method in cm
86 int &samples, int &lines,
87 bool sizeMatch);
89 int &samples, int &lines,
90 Camera &cam);
92 int &samples, int &lines,
93 Camera &cam);
94
95
96 private:
102
105
106 static Plugin m_projPlugin;
107 };
108
109
116 public:
124 PFPixelMapper(double pixelResolution, double upperLeftX, double upperLeftY) {
125 p_pixelResolution = pixelResolution;
126 p_upperLeftX = upperLeftX;
127 p_upperLeftY = upperLeftY;
128 };
129
136 double WorldX(const double projX) const {
137 return (projX - p_upperLeftX) / p_pixelResolution + 0.5;
138 };
139
146 double WorldY(const double projY) const {
147 return (p_upperLeftY - projY) / p_pixelResolution + 0.5;
148 };
149
156 double ProjectionX(const double sample) const {
157 return (sample - 0.5) * p_pixelResolution + p_upperLeftX;
158 };
159
166 double ProjectionY(const double line) const {
167 return p_upperLeftY - (line - 0.5) * p_pixelResolution;
168 };
169
171 double Resolution() const {
172 return p_pixelResolution;
173 }
174
175 private:
176 double p_pixelResolution;
177 double p_upperLeftX;
178 double p_upperLeftY;
179 };
181};
182
183#endif
184
IO Handler for Isis Cubes.
Definition Cube.h:168
double Resolution() const
Returns the pixel resolution.
PFPixelMapper(double pixelResolution, double upperLeftX, double upperLeftY)
Constructs a PFFixelMapper object with the given pixel resolution and location.
double WorldY(const double projY) const
Returns the world y position for the given y projection value.
double ProjectionX(const double sample) const
Returns the x projection of the given sample.
double ProjectionY(const double line) const
Returns the y projection of the given line.
double WorldX(const double projX) const
Returns the world x position for the given x projection value.
Loads plugins from a shared library.
Definition Plugin.h:55
Initialize a map projection.
ProjectionFactory()
Constructor (Its private, so you cannot use it.) Use the Create method instead.
static Isis::Projection * CreateFromCube(Isis::Cube &cube)
This method is a helper method.
static Isis::Projection * RingsCreate(Isis::Pvl &label, bool allowDefaults=false)
This method returns a pointer to a RingPlaneProjection object.
static Isis::Projection * Create(Isis::Pvl &label, bool allowDefaults=false)
This method returns a pointer to a Projection object.
static Isis::Projection * RingsCreateForCube(Isis::Pvl &label, int &samples, int &lines, bool sizeMatch)
This method creates a projection for a cube to a ring plane given a label.
static Isis::Projection * RingsCreateFromCube(Isis::Cube &cube)
This method is a helper method.
static Isis::Projection * CreateForCube(Isis::Pvl &label, int &ns, int &nl, bool sizeMatch=true)
This method creates a map projection for a cube given a label.
~ProjectionFactory()
Destroys the ProjectionFactory object.
Base class for Map Projections.
Definition Projection.h:155
Container for cube-like labels.
Definition Pvl.h:119
Create a mapping between a projection and other coordinate system.
Definition WorldMapper.h:38
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16