Isis 3 Programmer Reference
ProjectionFactory.h
1 #ifndef ProjectionFactory_h
2 #define ProjectionFactory_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include "Plugin.h"
10 #include "WorldMapper.h"
11 
12 namespace 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 
Isis::PFPixelMapper::Resolution
double Resolution() const
Returns the pixel resolution.
Definition: ProjectionFactory.h:171
Isis::ProjectionFactory::RingsCreate
static Isis::Projection * RingsCreate(Isis::Pvl &label, bool allowDefaults=false)
This method returns a pointer to a RingPlaneProjection object.
Definition: ProjectionFactory.cpp:119
Isis::PFPixelMapper::ProjectionX
double ProjectionX(const double sample) const
Returns the x projection of the given sample.
Definition: ProjectionFactory.h:156
Isis::ProjectionFactory::CreateForCube
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:188
Isis::PFPixelMapper
Definition: ProjectionFactory.h:115
Isis::PFPixelMapper::PFPixelMapper
PFPixelMapper(double pixelResolution, double upperLeftX, double upperLeftY)
Constructs a PFFixelMapper object with the given pixel resolution and location.
Definition: ProjectionFactory.h:124
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::ProjectionFactory::RingsCreateFromCube
static Isis::Projection * RingsCreateFromCube(Isis::Cube &cube)
This method is a helper method.
Definition: ProjectionFactory.cpp:1081
Isis::Camera
Definition: Camera.h:236
Isis::PFPixelMapper::WorldX
double WorldX(const double projX) const
Returns the world x position for the given x projection value.
Definition: ProjectionFactory.h:136
Isis::ProjectionFactory::~ProjectionFactory
~ProjectionFactory()
Destroys the ProjectionFactory object.
Definition: ProjectionFactory.h:104
Isis::PFPixelMapper::WorldY
double WorldY(const double projY) const
Returns the world y position for the given y projection value.
Definition: ProjectionFactory.h:146
Isis::WorldMapper
Create a mapping between a projection and other coordinate system.
Definition: WorldMapper.h:38
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::ProjectionFactory::Create
static Isis::Projection * Create(Isis::Pvl &label, bool allowDefaults=false)
This method returns a pointer to a Projection object.
Definition: ProjectionFactory.cpp:51
Isis::PFPixelMapper::ProjectionY
double ProjectionY(const double line) const
Returns the y projection of the given line.
Definition: ProjectionFactory.h:166
Isis::ProjectionFactory::CreateFromCube
static Isis::Projection * CreateFromCube(Isis::Cube &cube)
This method is a helper method.
Definition: ProjectionFactory.cpp:1069
Isis::ProjectionFactory::RingsCreateForCube
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:432
Isis::ProjectionFactory::ProjectionFactory
ProjectionFactory()
Constructor (Its private, so you cannot use it.) Use the Create method instead.
Definition: ProjectionFactory.h:101
Isis::Projection
Base class for Map Projections.
Definition: Projection.h:155
Isis::ProjectionFactory
Initialize a map projection.
Definition: ProjectionFactory.h:75
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::Plugin
Loads plugins from a shared library.
Definition: Plugin.h:55