hyperidx.h

Go to the documentation of this file.
00001 /**
00002  * \file rvc/hyperidx.h 
00003  * \brief interface for the RVC::HYPERINDEX class.
00004  *
00005  * \if NODOC
00006  * $Id: hyperidx.h_v 1.14 2003/10/07 17:32:45 scowan Exp $
00007  *
00008  * $Log: hyperidx.h_v $
00009  * Revision 1.14  2003/10/07 17:32:45  scowan
00010  * Object virtual method changes.
00011  *
00012  * Revision 1.13  2003/09/30 16:52:06  dwilliss
00013  * Doxygen
00014  *
00015  * Revision 1.12  2003/09/25 21:20:04  dwilliss
00016  * Fixed doxygen comment
00017  *
00018  * Revision 1.11  2003/09/15 13:49:45  fileserver!dwilliss
00019  * Doxygen
00020  *
00021  * Revision 1.10  2003/05/12 20:40:30  scowan
00022  * Adjusted to document link nested class.
00023  *
00024  * Revision 1.9  2001/06/14 18:55:33  scowan
00025  * Added to RVC namespace.
00026  *
00027  * Revision 1.8  2001/01/03 17:49:53  mju
00028  * Add new LINKTO types.
00029  *
00030  * Revision 1.7  2000/12/01 17:52:59  scowan
00031  * *** empty log message ***
00032  *
00033  * Revision 1.6  2000/12/01 16:55:08  scowan
00034  * Fixed MAC errors, undid Mike's changes to private methods.
00035  *
00036  * Revision 1.5  2000/12/01 16:21:13  mju
00037  * Add new scale types.
00038  * Change nested class/enum names.
00039  *
00040  * Revision 1.3  2000/11/17 15:45:00  scowan
00041  * Fixed compile error.
00042  *
00043  * Revision 1.1  2000/09/29 16:40:26  scowan
00044  * Initial revision
00045  *
00046  * \endif
00047 **/
00048 
00049 //!   \class RVC::HYPERINDEX rvc/hyperidx.h
00050 //!   \brief Manages RVC::OBJTYPE_HyperIndex RVC objects.  
00051 //!   
00052 //!   The interface currently wraps the MfHyper functions.
00053 //!   
00054 //!   This class inherits from RVC::OBJECT
00055 //!   
00056 //!   RVC Object Types that this class supports: RVC::OBJTYPE_HyperIndex
00057 //!
00058 //!   Default RVC Object Type for this class: RVC::OBJTYPE_HyperIndex
00059 //!
00060 //!   Valid parents for this class:
00061 //!      - RVC::OBJTYPE_Vector
00062 //!      RVC::OBJTYPE_TIN
00063 //!      RVC::OBJTYPE_CAD
00064 //!      RVC::OBJTYPE_Raster
00065 //!      RVC::OBJTYPE_RasterSet
00066 //!      RVC::OBJTYPE_Hyperspectral
00067 
00068 #ifndef INC_RVC_HYPERIDX_H
00069 #define INC_RVC_HYPERIDX_H
00070 
00071 #ifndef INC_RVC_OBJECT_H
00072    #include <rvc/object.h>
00073 #endif
00074 
00075 #ifndef INC_MI32_ELEMTYPE_H
00076    #include <mi32/elemtype.h>
00077 #endif
00078 
00079 #ifndef INC_MI32_SIMPLEAR_H
00080    #include <mi32/simplear.h>
00081 #endif
00082 
00083 #ifndef INC_MI32_DOUBLEAR_H
00084    #include <mi32/doublear.h>
00085 #endif
00086 
00087 //Ignore
00088 struct DRECT3D;
00089 struct HYPERSHAPE;
00090 struct HYPERLINK;
00091 //End Ignore
00092 
00093 namespace RVC {
00094 
00095 class HYPERINDEX : public RVC::OBJECT {
00096    public:
00097 
00098       //Ignore
00099       class LINK;
00100       //End Ignore
00101 
00102       //! Default constructor
00103       HYPERINDEX (
00104          );
00105 
00106       //! Copy constructor
00107       HYPERINDEX (
00108          const RVC::HYPERINDEX& obj
00109          );
00110 
00111       //! Destructor
00112       virtual ~HYPERINDEX (
00113          );
00114 
00115       //! Assignment
00116       RVC::HYPERINDEX& operator= (
00117          const RVC::HYPERINDEX& rhs
00118          );
00119 
00120       //! Add a link to the rvc hyperindex object, do not use WriteLink() since multiple people 
00121       //! can be trying to add a link at the same time
00122       //!
00123       //! @return Index of new link object of error if < 0
00124       INT32 AddLink (
00125          const LINK& link                       //!< Link to add
00126          );
00127 
00128       //! Add a link to a hyper shape
00129       ERRVALUE AddLinkToShape (
00130          INT32 ShapeNum,                        //!< Shape number to add to
00131          INT32 LinkNum                          //!< Stored link to add
00132          );
00133 
00134       //! Change the characteristics of a hypershape
00135       ERRVALUE ChangeShape (
00136          INT32 ShapeNum,                        //!< Number of shape to change
00137          const HYPERSHAPE& shape,               //!< New description of shape
00138          const DOUBLE_ARRAY<DPOINT2D>& Points   //!< Shape boundary points, if needed
00139          );
00140          
00141       //! Delete given shape from the list of shapes
00142       //!
00143       //! This method deletes a shape by swapping the last shape with 'ShapeNum', 
00144       //! then it resizes the number of shapes by -1.
00145       ERRVALUE DeleteShape (
00146          INT32 ShapeNum                         //!< Shape number to delete
00147          );
00148          
00149       //! Find hyperindex shape that corresponds with the element given
00150       //!
00151       //! @return: Shape number if >= 0, -1 if none found, < -1 error.
00152       INT32 FindShape (
00153          ELEMTYPE ElemType,                     //!< Type of element to find shape for
00154          INT32 ElemNum                          //!< Element number to find shape for
00155          );
00156 
00157       //! Obtain the extents of the hyperindex rvc object
00158       ERRVALUE GetExtents (
00159          DRECT3D& rect                          //!< Extents of rvc hyperindex object shapes returned
00160          );
00161 
00162       //! Obtain the maximum shape size for the rvc hyperindex object
00163       //!
00164       //! @return Maximum shape size
00165       INT32 GetMaxShapeSize (
00166          );
00167 
00168       //! Obtain the number of links in a rvc hyperindex object
00169       //!
00170       //! @return number of links
00171       INT32 GetNumLinks (
00172          );
00173 
00174       //! Obtain the number of shapes in a rvc hyperindex object
00175       //!
00176       //! @return number of shapes
00177       INT32 GetNumShapes (
00178          );
00179 
00180       //! Read a rvc hyperindex object link element
00181       ERRVALUE ReadLink (
00182          INT32 LinkNum,                         //!< The link index to read
00183          LINK& link                             //!< The link storage instance
00184          );
00185 
00186       //! Read a rvc hyperindex object shape element
00187       ERRVALUE ReadShape (
00188          INT32 ShapeNum,                        //!< Shape to read
00189          HYPERSHAPE& shape                      //!< Shape parmeters returned
00190          );
00191 
00192       //! Read a rvc hyperindex object shape element
00193       ERRVALUE ReadShape (
00194          INT32 ShapeNum,                        //!< Shape to read
00195          HYPERSHAPE& shape,                     //!< Shape parmeters returned
00196          DOUBLE_ARRAY<DPOINT2D>& Points         //!< Shape points read in
00197          );
00198          
00199       //! Read a rvc hyperindex object shape element
00200       ERRVALUE ReadShape (
00201          INT32 ShapeNum,                        //!< Shape to read
00202          HYPERSHAPE& shape,                     //!< Shape parmeters returned
00203          SIMPLE_ARRAY<INT32>& Links             //!< HyperLink indexes returned
00204          );
00205          
00206       //! Read a rvc hyperindex object shape element
00207       ERRVALUE ReadShape (
00208          INT32 ShapeNum,                        //!< Shape to read
00209          HYPERSHAPE& shape,                     //!< Shape parmeters returned
00210          DOUBLE_ARRAY<DPOINT2D>& Points,        //!< Shape points read in
00211          SIMPLE_ARRAY<INT32>& Links             //!< HyperLink indexes returned
00212          );
00213          
00214       //! Write a rvc hyperindex object link, use AddLink() to add a link
00215       ERRVALUE WriteLink (
00216          INT32 LinkNum,                         //!< Link index to write
00217          const LINK& link                       //!< Link to write
00218          );
00219 
00220       //! Read a rvc hyperindex object shape element
00221       ERRVALUE WriteShape (
00222          INT32 ShapeNum,                        //!< Shape to write
00223          const HYPERSHAPE& shape                //!< Shape parmeters to write
00224          );
00225 
00226       //! Write a rvc hyperindex object shape
00227       ERRVALUE WriteShape (
00228          INT32 ShapeNum,                        //!< Shape index to write
00229          const HYPERSHAPE& shape,               //!< Shape parameters to write
00230          const DOUBLE_ARRAY<DPOINT2D>& Points   //!< Shape boundary
00231          );
00232 
00233       //! Write a rvc hyperindex object shape
00234       ERRVALUE WriteShape (
00235          INT32 ShapeNum,                        //!< Shape index to write
00236          const HYPERSHAPE& shape,               //!< Shape parameters to write
00237          const SIMPLE_ARRAY<INT32>& Links       //!< Link indexes for this shape to contain
00238          );
00239 
00240       //! Write a rvc hyperindex object shape
00241       ERRVALUE WriteShape (
00242          INT32 ShapeNum,                        //!< Shape index to write
00243          const HYPERSHAPE& shape,               //!< Shape parameters to write
00244          const DOUBLE_ARRAY<DPOINT2D>& Points,  //!< Shape boundary
00245          const SIMPLE_ARRAY<INT32>& Links       //!< Link indexes for this shape to contain
00246          );
00247 
00248    private:
00249       #ifndef GENERATING_DOXYGEN_OUTPUT
00250 
00251       //! Implementation of RVC::OBJECT virtual methods
00252       virtual ERRVALUE v_CloseObject ();
00253       virtual OBJTYPE v_GetDftObjectType () const;
00254       virtual bool v_IsObjectOpen () const;
00255       virtual ERRVALUE v_OpenObject (OPENMODE OpenFlags, MDLGPARENT parent);
00256 
00257       int m_HyperID;
00258       #endif // GENERATING_DOXYGEN_OUTPUT
00259    };
00260 
00261 
00262 class HYPERINDEX::LINK {
00263    public:
00264 
00265       //! Type or object or file link is to.
00266       enum LINKTO {
00267          LINKTO_DISP2DWINDOW = 0,
00268          LINKTO_RasterColor,
00269          LINKTO_RasterGray,
00270          LINKTO_Vector,
00271          LINKTO_CAD,
00272          LINKTO_Layout,
00273          LINKTO_Group,
00274          LINKTO_TIN,
00275          LINKTO_TextFile,
00276          LINKTO_ExternalFile,
00277          LINKTO_URL,
00278          LINKTO_FileByAttrib,
00279          LINKTO_URLByAttrib,
00280          LINKTO_LAST
00281          };
00282 
00283       enum POSITION {
00284          POSITION_Click = 0,     //!< Center around mouse click
00285          POSITION_Center,        //!< Center of image
00286          POSITION_AsSaved,       //!< As saved in layout (layouts only
00287          POSITION_Max
00288          };
00289 
00290       //! Values for how to scale view after following link.
00291       //! These do not numerically correspond to the HYPERLINK_Scale... values.
00292       enum SCALE {
00293          SCALE_1X = 0,           //!< Display at 1X zoom
00294          SCALE_FullView,         //!< Display to fit window
00295          SCALE_AsSaved,          //!< Display at scale saved with layout
00296          SCALE_Zoomed,           //!< Display at specified zoom factor
00297          SCALE_ToMap             //!< Display at specified "map scale"
00298          };
00299 
00300       FILEPATH m_Filename;
00301       MISTRING m_Name;
00302       MISTRING m_Desc;
00303       MISTRING m_URL;
00304       LINKTO m_LinkTo;           //!< Type of object/document to link to
00305       POSITION m_PosnType;
00306       SCALE m_ScaleType;
00307       double m_ZoomFactor;       //!< Zoom factor if m_ScaleType is SCALE_Zoomed
00308       double m_MapScale;         //!< Map scale if m_ScaleType is SCALE_ToMap
00309 
00310       // CONSTRUCTORS
00311 
00312       //! Default constructor
00313       LINK (
00314          );
00315 
00316       // Default copy constructor, destructor and operator=() are used
00317 
00318       //! Clear all entries in the instance
00319       void Clear (
00320          );
00321 
00322    private:
00323       #ifndef GENERATING_DOXYGEN_OUTPUT
00324       ERRVALUE GetHyperLink (HYPERLINK& hlink, const FILEPATH& objfilepath) const;
00325       void SetHyperLink (const HYPERLINK& hlink, const FILEPATH& objfilepath);
00326 
00327       friend class HYPERINDEX;
00328       #endif // GENERATING_DOXYGEN_OUTPUT
00329    };
00330 
00331 }     //! End of RVC namespace
00332 
00333 #endif         //!< INC_RVC_HYPERIDX_H

Generated on Tue Dec 14 13:18:51 2004 for TNTsdk by  doxygen 1.3.8-20040913