TiePointList.h

Go to the documentation of this file.
00001 /*
00002  * The information in this file is
00003  * Copyright(c) 2007 Ball Aerospace & Technologies Corporation
00004  * and is subject to the terms and conditions of the
00005  * GNU Lesser General Public License Version 2.1
00006  * The license text is available from   
00007  * http://www.gnu.org/licenses/lgpl.html
00008  */
00009 
00010 #ifndef TIEPOINTLIST_H
00011 #define TIEPOINTLIST_H
00012 
00013 #include "DataElement.h"
00014 
00015 #include <string>
00016 #include <vector>
00017 
00018 /**
00019  *  Ties a geographical position between two scenes.
00020  *
00021  *  A %TiePoint stores the geographical relationship between a point in one
00022  *  scene and the same geographical point in another scene. The relationship
00023  *  is stored in terms of pixel coordinates.
00024  *
00025  *  @see     TiePointList
00026  */
00027 class TiePoint
00028 {
00029 public:
00030    struct
00031    {
00032       int mX, mY;
00033    } mReferencePoint;
00034    struct
00035    {
00036       float mX, mY;
00037    } mMissionOffset;
00038    int mConfidence;
00039    int mPhi;
00040 
00041    bool operator== (const TiePoint& tiePoint) const
00042    {
00043       if ((tiePoint.mReferencePoint.mX == mReferencePoint.mX) &&
00044          (tiePoint.mReferencePoint.mY == mReferencePoint.mY) &&
00045          (tiePoint.mMissionOffset.mX == mMissionOffset.mX) &&
00046          (tiePoint.mMissionOffset.mY == mMissionOffset.mY) &&
00047          (tiePoint.mConfidence == mConfidence) &&
00048          (tiePoint.mPhi == mPhi))
00049       {
00050          return true;
00051       }
00052 
00053       return false;
00054    }
00055 };
00056 
00057 /**
00058  *  Stores a set of tie points.
00059  *
00060  *  A %TiePointList is a DataElement that stores a set of tie points.
00061  *
00062  *  This subclass of Subject will notify upon the following conditions:
00063  *  - The following method is called: adoptTiePoints().
00064  *  - Everything else documented in DataElement.
00065  *
00066  *  @see     DataElement
00067  */
00068 class TiePointList : public DataElement
00069 {
00070 public:
00071    /**
00072     *  Sets the name of the mission dataset on the tie point list.
00073     *
00074     *  Sets the name of the mission dataset of the tie point list.
00075     *  A tie point list has two associated datasets. This method
00076     *  allows the specification of the second one. The name of the
00077     *  reference dataset is the name that is used when the tie point
00078     *  list is created.
00079     *
00080     *  @param   missionName
00081     *           The name of the mission dataset.
00082     *
00083     *  @see     ModelServices::createElement()
00084     */
00085    virtual void setMissionDatasetName(std::string missionName) = 0;
00086 
00087    /**
00088     *  Gets the name of the mission dataset of the tie point list.
00089     *
00090     *  Gets the name of the mission dataset of the tie point list.
00091     *  A tie point list has two associated datasets. This method
00092     *  allows querying of the second one. The normal
00093     *  DataElement::getName() method gets the name of the reference
00094     *  dataset.
00095     *
00096     *  @return   The name of the mission dataset.
00097     */
00098    virtual const std::string &getMissionDatasetName() const = 0;
00099 
00100    /**
00101     *  Gets a reference to the tie points in the list.
00102     *
00103     *  @return   The tie points in the list.
00104     */
00105    virtual const std::vector<TiePoint>& getTiePoints() const = 0;
00106 
00107    /**
00108     *  Sets the tie points in the list.
00109     *
00110     *  This method sets the tie points in the list and overwrites whatever
00111     *  tie points have already been to the list.  It replaces rather than
00112     *  appends to the list.
00113     *
00114     *  The implementation of this method calls swap() on the given vector
00115     *  to avoid allocating potentially large amounts of memory.  After
00116     *  calling this method, the contents of the given vector will be empty.
00117     *
00118     *  @param   points
00119     *           The points to set in the list.  This is a non-const vector so
00120     *           that swap() can be called on the vector to avoid allocating
00121     *           potentially large amounts of memory.
00122     *
00123     *  @notify  This method will notify Subject::signalModified.
00124     */
00125    virtual void adoptTiePoints(std::vector<TiePoint>& points) = 0;
00126 
00127 protected:
00128    /**
00129     * This should be destroyed by calling ModelServices::destroyElement.
00130     */
00131    virtual ~TiePointList() {}
00132 };
00133 
00134 #endif

Software Development Kit - Opticks 4.9.0 Build 16218