Isis 3 Developer Reference
ProjectionFactory.h
Go to the documentation of this file.
1 #ifndef ProjectionFactory_h
2 #define ProjectionFactory_h
3 
25 #include "Plugin.h"
26 #include "WorldMapper.h"
27 
28 namespace Isis {
29  class Camera;
30  class Cube;
31  class Projection;
32  class RingPlaneProjection;
33 
92  public:
93  static Isis::Projection *Create(Isis::Pvl &label, bool allowDefaults = false);
94  static Isis::Projection *RingsCreate(Isis::Pvl &label, bool allowDefaults = false);
97  static Isis::Projection *CreateFromCube(Isis::Pvl &label); // Load Method in cm
98  static Isis::Projection *RingsCreateFromCube(Isis::Pvl &label); // Load Method in cm
99  static Isis::Projection *CreateForCube(Isis::Pvl &label, int &ns, int &nl,
100  bool sizeMatch = true); // Create method in cm
102  int &samples, int &lines,
103  bool sizeMatch);
105  int &samples, int &lines,
106  Camera &cam);
108  int &samples, int &lines,
109  Camera &cam);
110 
111 
112  private:
117  ProjectionFactory() {};
118 
120  ~ProjectionFactory() {};
121 
122  static Plugin m_projPlugin;
123  };
124 
125 
132  public:
140  PFPixelMapper(double pixelResolution, double upperLeftX, double upperLeftY) {
141  p_pixelResolution = pixelResolution;
142  p_upperLeftX = upperLeftX;
143  p_upperLeftY = upperLeftY;
144  };
145 
152  double WorldX(const double projX) const {
153  return (projX - p_upperLeftX) / p_pixelResolution + 0.5;
154  };
155 
162  double WorldY(const double projY) const {
163  return (p_upperLeftY - projY) / p_pixelResolution + 0.5;
164  };
165 
172  double ProjectionX(const double sample) const {
173  return (sample - 0.5) * p_pixelResolution + p_upperLeftX;
174  };
175 
182  double ProjectionY(const double line) const {
183  return p_upperLeftY - (line - 0.5) * p_pixelResolution;
184  };
185 
187  double Resolution() const {
188  return p_pixelResolution;
189  }
190 
191  private:
192  double p_pixelResolution;
193  double p_upperLeftX;
194  double p_upperLeftY;
195  };
197 };
198 
199 #endif
200 
static Isis::Projection * Create(Isis::Pvl &label, bool allowDefaults=false)
This method returns a pointer to a Projection object.
Definition: ProjectionFactory.cpp:67
static Isis::Projection * CreateFromCube(Isis::Cube &cube)
This method is a helper method.
Definition: ProjectionFactory.cpp:1085
static Isis::Projection * RingsCreate(Isis::Pvl &label, bool allowDefaults=false)
This method returns a pointer to a RingPlaneProjection object.
Definition: ProjectionFactory.cpp:135
Loads plugins from a shared library.
Definition: Plugin.h:71
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.
Definition: ProjectionFactory.cpp:448
Definition: ProjectionFactory.h:131
Initialize a map projection.
Definition: ProjectionFactory.h:91
Definition: Camera.h:249
Base class for Map Projections.
Definition: Projection.h:171
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.
Definition: ProjectionFactory.cpp:204
static Isis::Projection * RingsCreateFromCube(Isis::Cube &cube)
This method is a helper method.
Definition: ProjectionFactory.cpp:1097
double WorldX(const double projX) const
Returns the world x position for the given x projection value.
Definition: ProjectionFactory.h:152
PFPixelMapper(double pixelResolution, double upperLeftX, double upperLeftY)
Constructs a PFFixelMapper object with the given pixel resolution and location.
Definition: ProjectionFactory.h:140
double ProjectionX(const double sample) const
Returns the x projection of the given sample.
Definition: ProjectionFactory.h:172
Container for cube-like labels.
Definition: Pvl.h:135
double Resolution() const
Returns the pixel resolution.
Definition: ProjectionFactory.h:187
double WorldY(const double projY) const
Returns the world y position for the given y projection value.
Definition: ProjectionFactory.h:162
double ProjectionY(const double line) const
Returns the y projection of the given line.
Definition: ProjectionFactory.h:182
Create a mapping between a projection and other coordinate system.
Definition: WorldMapper.h:54
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
IO Handler for Isis Cubes.
Definition: Cube.h:170