Isis 3 Programmer Reference
Isis::CameraFactory Class Reference

Initializes a Camera Model. More...

#include <CameraFactory.h>

Collaboration diagram for Isis::CameraFactory:
Collaboration graph

Static Public Member Functions

static CameraCreate (Cube &cube)
 Creates a Camera object using Pvl Specifications. More...
 
static int CameraVersion (Cube &cube)
 This looks up the current camera model version from the cube. More...
 
static int CameraVersion (Pvl &lab)
 Looks up the current camera model version in the pvl labels. More...
 
static void initPlugin ()
 Reads the appropriate plugin file for the ISIS cameras, and scans the directories specified in IsisPreferences for CSM cameras. More...
 

Private Member Functions

 CameraFactory ()
 Constructor (Its private, so you cannot use it. More...
 
 ~CameraFactory ()
 Destroys the CameraFactory object. More...
 

Static Private Attributes

static Plugin m_cameraPlugin
 The plugin file for the camera. More...
 
static bool m_initialized = false
 Has the plugin list been initialized. More...
 

Detailed Description

Initializes a Camera Model.

This factory class is used to obtain a Camera Model object given a PVL which contains a valid Instrument group. The Instrument group can come from an image/cube or a hand-created PVL file. The camera is loaded based on information using the SpacecraftName and IntrumentID contained in the Instrument group. It is plugin oriented. That is, this class looks in $ISISROOT/lib/Camera.plugin to convert the SpacecraftName and IntrumentID string into a pointer to the appropriate camera class (e.g., Viking, HiRISE, etc.). This allows programmers who develop new camera models to create a plugin without the need for recompiling all the Isis applications that use camera models.

Author
2005-05-10 Elizabeth Ribelin
History:
2005-10-06 Elizabeth Miller - added unitTest.exclude file
History:
2006-05-17 Elizabeth Miller - changed CameraManager.plugin to Camera.plugin
History:
2009-05-12 Steven Lambright - Added CameraVersion(...) and version checking.
History:
2011-05-23 Jannet Barrett and Steven Lambright - Added m_cameraPlugin to reduce cost of instantiating Cameras.
History:
2012-09-06 Steven Lambright - Changed Create() to take Cube instead of Pvl because cameras now require cubes to construct. Please see Camera for more information.
History:
2017-7-11 Summer Stapleton - Added functionality to find the most recent (last) version of the camera model
History:
2017-08-30 Summer Stapleton - Updated documentation. References #4807.
History:
2021-02-17 Kristin Berry and Stuart Sides - added static plugins initialized variable and made initPlugin plublic.

Definition at line 52 of file CameraFactory.h.

Constructor & Destructor Documentation

◆ CameraFactory()

Isis::CameraFactory::CameraFactory ( )
inlineprivate

Constructor (Its private, so you cannot use it.

Use the Create method instead

Definition at line 64 of file CameraFactory.h.

◆ ~CameraFactory()

Isis::CameraFactory::~CameraFactory ( )
inlineprivate

Destroys the CameraFactory object.

Definition at line 67 of file CameraFactory.h.

Member Function Documentation

◆ CameraVersion() [1/2]

int Isis::CameraFactory::CameraVersion ( Cube cube)
static

This looks up the current camera model version from the cube.

Parameters
cubeInput cube
Returns
int Latest Camera Version

Definition at line 161 of file CameraFactory.cpp.

References Isis::Cube::label().

Referenced by Isis::KernelDb::findAll().

◆ CameraVersion() [2/2]

int Isis::CameraFactory::CameraVersion ( Pvl lab)
static

Looks up the current camera model version in the pvl labels.

Parameters
labThe pvl labels
Returns
The current camera model version

Definition at line 173 of file CameraFactory.cpp.

References Isis::PvlObject::findGroup(), Isis::PvlContainer::hasKeyword(), and Isis::PvlObject::Traverse.

◆ Create()

Camera * Isis::CameraFactory::Create ( Cube cube)
static

Creates a Camera object using Pvl Specifications.

Parameters
cubeThe original cube with the current version camera model
Returns
Camera* The Camera object created
Exceptions
Isis::iException::System- Unsupported camera model, unable to find the plugin
Isis::iException::Camera- Unable to initialize camera model

Definition at line 45 of file CameraFactory.cpp.

References Isis::PvlContainer::addKeyword(), Isis::PvlObject::findGroup(), Isis::Cube::hasBlob(), Isis::PvlContainer::hasKeyword(), Isis::Cube::label(), and Isis::PvlObject::Traverse.

Referenced by Isis::ControlNetFilter::CubeDistanceFilter(), Isis::QnetTool::openGround(), Isis::ControlNetFilter::PointDistanceFilter(), Isis::ControlNetFilter::PointLatLonFilter(), and Isis::UniversalGroundMap::UniversalGroundMap().

◆ initPlugin()

void Isis::CameraFactory::initPlugin ( )
static

Reads the appropriate plugin file for the ISIS cameras, and scans the directories specified in IsisPreferences for CSM cameras.

Definition at line 121 of file CameraFactory.cpp.

References Isis::FileName::expanded(), Isis::FileName::fileExists(), Isis::PvlObject::findGroup(), and Isis::PvlObject::Traverse.

Member Data Documentation

◆ m_cameraPlugin

Plugin Isis::CameraFactory::m_cameraPlugin
staticprivate

The plugin file for the camera.

Definition at line 69 of file CameraFactory.h.

◆ m_initialized

bool Isis::CameraFactory::m_initialized = false
staticprivate

Has the plugin list been initialized.

Definition at line 70 of file CameraFactory.h.


The documentation for this class was generated from the following files: