gre/hypermgr.h

Go to the documentation of this file.
00001 /**
00002  * \file hypermgr.h <gre/hypermgr.h>
00003  * \brief GRE HyperIndex Link Manager definitions
00004  *
00005  * \if NODOC
00006  * $Id: hypermgr.h_v 1.14 2005/11/02 21:32:27 mju Exp $
00007  *
00008  * $Log: hypermgr.h_v $
00009  * Revision 1.14  2005/11/02 21:32:27  mju
00010  * Move mfc stuff to atlaswin projet.
00011  *
00012  * Revision 1.13  2005/11/01 22:26:10  mju
00013  * Include gre view hdr for mfc.
00014  *
00015  * Revision 1.12  2005/10/27 12:53:46  mju
00016  * Use gre namespace instead of legacy types.
00017  *
00018  * Revision 1.11  2005/10/14 17:30:13  mju
00019  * GRE namespace.
00020  *
00021  * Revision 1.10  2005/09/26 16:50:49  scowan
00022  * Changed type of hyper link type function return.
00023  *
00024  * Revision 1.9  2005/09/12 15:49:39  scowan
00025  * Changed parameters of findNeighbors.
00026  *
00027  * Revision 1.8  2005/03/31 16:57:05  fileserver!dwilliss
00028  * Rename one of our types to MIUNICODE because it conflicted with a Microsoft #define
00029  *
00030  * Revision 1.7  2004/06/28 17:53:17  mju
00031  * Convert to spatref.
00032  *
00033  * Revision 1.6  2003/11/12 13:21:29  mju
00034  * Add HyperShapeTypeToElemType.
00035  *
00036  * Revision 1.5  2003/09/15 13:48:59  fileserver!dwilliss
00037  * Doxygen
00038  *
00039  * Revision 1.4  2003/07/30 15:00:09  mju
00040  * Ignore stuff we don't want doc'd.
00041  *
00042  * Revision 1.3  2003/05/14 21:24:21  mju
00043  * Add HasLinks using viewable.
00044  *
00045  * Revision 1.2  2003/05/01 20:55:00  mju
00046  * Move MFC GTOOL defn to implementatiaon file.
00047  *
00048  * Revision 1.1  2003/04/30 21:40:24  mju
00049  * Initial revision
00050  * \endif
00051 **/
00052 
00053 #ifndef  INC_GRE_HYPERMGR_H
00054 #define  INC_GRE_HYPERMGR_H
00055 
00056 #ifndef  INC_GRE_BASE
00057    #include <gre/base.h>
00058 #endif
00059 
00060 #if !defined(INC_GRE_VIEW_H) && defined(WIN32_MFC)
00061    #include <gre/view.h>
00062 #endif
00063 
00064 #ifndef  INC_MI32_RVCHYPER_H
00065    #include <mi32/rvchyper.h>
00066 #endif
00067 
00068 //===================================================================================================================
00069 
00070 namespace GRE {
00071 
00072 class HYPERIDXMGR {
00073    public:
00074       enum FINDFLAGS {
00075          FINDFLAG_Default =         0x00,
00076          FINDFLAG_SearchAllElem =   0x01,
00077          FINDFLAG_FirstOnly =       0x02
00078          };
00079    };
00080 DEFINE_ENUM_OP_BITWISE(HYPERIDXMGR::FINDFLAGS);
00081 
00082 }  //! End namespace GRE
00083 
00084 //===================================================================================================================
00085 // Legacy definitions - Begin
00086 
00087 #define  HYPERDRAWFLAG_Highlight          0x01
00088 #define  HYPERDRAWFLAG_Unhighlight        0x02
00089 #define  HYPERDRAWFLAG_ShowTransparent    0x04
00090 #define  HYPERDRAWFLAG_NoDraw             0x08
00091 
00092 struct MDISPHYPERSHAPE {
00093    DPOINT2D min;                       //!< Minimum extents in object coordinates
00094    DPOINT2D max;                       //!< Maximum extents in object coordinates
00095    COLOR color;                        //!< Color to draw shape in
00096    INT32 elem;                         //!< Element number for vector links
00097    UINT32 NumPoints;                   //!< Number of points used to define shape
00098    INT32 NumLinks;                     //!< Number of links to this shape
00099    INT16 ShapeType;                    //!< HYPERSHAPE_...
00100    UINT8 Highlighted;                  //!< Set if shape is currently highlighted
00101    DPOINT2D *points;                   //!< Array of points if appropriate
00102    HYPERLINK *Links;                   //!< Array of links (defined in rvchyper.h)
00103    };
00104 
00105 struct MDISPHYPERSHAPELIST {
00106    int NumShapes;                      //!< Number of shapes in array
00107    int NumAllocated;                   //!< Number of shapes allocated
00108    MDISPHYPERSHAPE *Shapes;            //!< Array of shapes
00109    };
00110 
00111 struct MDISPHYPERLINKLIST {
00112    int NumLinks;                       //!< Number of links in array
00113    int NumAllocated;                   //!< Number of links allocated
00114    HYPERLINK *Links;                   //!< Array of links (defined in rvchyper.h)
00115    MDISPHYPERLINKLIST ()
00116       { memset(this,0,sizeof(*this)); }
00117    };
00118 
00119 
00120 //===================================================================================================================
00121 
00122 //! Draw specified HyperIndex shape for layer.
00123 ERRVALUE MdispHyperDrawShape (
00124    GRE::VIEW *view, 
00125    GRE::LAYER *layer, 
00126    int obj, 
00127    const TRANS2D_MAPGEN& LayerToDisp,
00128    INT32 shapenum, 
00129    UINT32 drawflags
00130    );
00131 
00132 //! Draw specified HyperIndex shape for layer.
00133 ERRVALUE MdispHyperDrawShape (
00134    GRE::VIEW *view, 
00135    GRE::LAYER *layer, 
00136    int obj, 
00137    INT32 shapenum, 
00138    UINT32 drawflags
00139    );
00140 
00141 //! Draw all HyperIndex link shapes for view.
00142 int MdispHyperDrawShapes (
00143    GRE::VIEW *view, 
00144    UINT32 drawflags
00145    );
00146 
00147 //! Convert ellipse to rectangle corner points.
00148 void MdispHyperEllipseToRect (
00149    DPOINT2D *pt, 
00150    double rx, 
00151    double ry, 
00152    double theta, 
00153    DPOINT2D *c
00154    );
00155 
00156 //! Find shape corresponding to given layer element.
00157 //!
00158 //! @return Shape number, -1 if no shape, < -1 if error.
00159 int MdispHyperFindLayerElemShape (
00160    GRE::LAYER *layer, 
00161    int ShapeType, 
00162    INT32 ElemNum
00163    );
00164 
00165 //! Return list of shape numbers for given layer object.
00166 //!
00167 //! @return Number of shapes or error < 0.
00168 int MdispHyperFindLayerObjShapes (
00169    GRE::VIEW *view, 
00170    GRE::LAYER *layer, 
00171    int obj,                            //!< Layer object number
00172    const DPOINT2D& lpoint,             //!< Point in layer's object coordinates 
00173    INT32 **ShapeList,                  //!< Shape numbers (within HyperIndex object) returned 
00174    GRE::HYPERIDXMGR::FINDFLAGS flags = GRE::HYPERIDXMGR::FINDFLAG_Default
00175    );
00176 
00177 //! Find hyper links for view given point.
00178 int MdispHyperFindLinks (
00179    GRE::VIEW *view, 
00180    const DPOINT2D *spoint,             //!< Point in "screen" coordinates
00181    MDISPHYPERLINKLIST *linklist,
00182    GRE::HYPERIDXMGR::FINDFLAGS flags = GRE::HYPERIDXMGR::FINDFLAG_Default
00183    );
00184 
00185 //! Find hyper links for view given point.
00186 int MdispHyperFindLinksView (
00187    GRE::VIEW *view, 
00188    const DPOINT2D *lpoint,             //!< Point in "view" coordinates
00189    MDISPHYPERLINKLIST *linklist, 
00190    GRE::HYPERIDXMGR::FINDFLAGS flags = GRE::HYPERIDXMGR::FINDFLAG_Default
00191    );
00192 
00193 //! Free linked list.
00194 void MdispHyperFreeLinkList (
00195    MDISPHYPERLINKLIST *linkedlist
00196    );
00197 
00198 //! Find neighbor links/shapes for given layout.
00199 int MdispHyperFindNeighbors (
00200    GRE::LAYOUT *layout,                      //!< Layout, NULL if point is in Lat-Lon
00201    GRE::LAYOUT *playout, 
00202    const DPOINT2D& point,                 //!< Point in layout or Lat-Lon coordinates
00203    const FILEPATH& parentfilename,        //!< Name of parent file (previous navigation step)
00204    const RVC::OBJECTNAME& parentobjname,  //!< Name of parent object
00205    const FILEPATH& curfilename,           //!< Name of current file to exclude from neighbor list
00206    const RVC::OBJECTNAME& curobjname,     //!< Name of current object to exclude from neighbor list
00207    HYPERLINK neighbors[8]                 //!< Array of neighbors returned
00208    );
00209 
00210 //! Free shape list.
00211 void MdispHyperFreeShapeList (
00212    MDISPHYPERSHAPELIST *shapelist
00213    );
00214 
00215 //! Get shape list for specified layer.
00216 int MdispHyperGetLayerObjShapeList (
00217    GRE::LAYER *layer, 
00218    int obj, 
00219    MDISPHYPERSHAPE **pShapes,          //!< Pointer returned, DO NOT FREE
00220    INT32 *pNumShapes
00221    );
00222 
00223 //! Get RVC object type for HyperIndex link type.
00224 RVC::OBJTYPE MdispHyperGetLinkObjType (
00225    int linktype
00226    );
00227 
00228 //! Determine if has any hyperlinks for specified viewable.
00229 bool MdispHyperHasLinks (
00230    GRE::VIEWABLE *viewable
00231    );
00232 
00233 //! Determine if has any hyperlinks for specified point.
00234 bool MdispHyperHasLinks (
00235    GRE::VIEW *view, 
00236    const DPOINT2D& spoint,             //!< Point in "screen" coordinates
00237    GRE::HYPERIDXMGR::FINDFLAGS flags = GRE::HYPERIDXMGR::FINDFLAG_Default
00238    );
00239 
00240 //! Initialize HyperIndex module.
00241 void MdispHyperInit (void);
00242 
00243 //! Close HyperIndex object for specified layer object.
00244 int MdispHyperObjectClose (
00245    GRE::LAYER *layer, 
00246    int obj, 
00247    int CloseFile
00248    );
00249 
00250 //! Return HyperIndex object handle for specified layer object.
00251 int MdispHyperObjectGetHandle (
00252    GRE::LAYER *layer, 
00253    int obj
00254    );
00255 
00256 //! Open HyperIndex object for specified layer object.
00257 //!
00258 //! @return TRUE if opened file, FALSE if file was already open, < 0 if error.
00259 int MdispHyperObjectOpen (
00260    GRE::LAYER *layer, 
00261    int obj, 
00262    RVCHYPERINFO *hyperinfo, 
00263    int writemode
00264    );
00265 
00266 //! Convert rectangle (corner points) to ellipse.
00267 void MdispHyperRectToEllipse (
00268    DPOINT2D *pt,                       //!< Center of ellipse returned
00269    double *rx,                         //!< X Radius returned
00270    double *ry,                         //!< Y Radius returned
00271    double *theta,                      //!< Rotation angle returned
00272    DPOINT2D *c                         //!< Rectangle corners
00273    );
00274    
00275 //! Add HyperIndex shape to array of shapes for layer.
00276 int MdispHyperShapeAddToLayer (
00277    GRE::LAYER *layer, 
00278    int obj,                            //!< Layer object
00279    INT32 shapenum
00280    );
00281 
00282 //! Delete HyperIndex shape from layer.
00283 int MdispHyperShapeDelete (
00284    GRE::LAYER *layer, 
00285    int obj,                            //!< Layer object
00286    INT32 shapenum
00287    );
00288 
00289 //! Determine ELEMTYPE for HyperIndex ShapeType (HYPERSHAPE...)
00290 //! @return Element type, ELEMTYPE_Empty if can't convert.
00291 ELEMTYPE MdispHyperShapeTypeToElemType (
00292    GRE::LAYER *layer,                     //!< Layer
00293    INT16 ShapeType                     //!< HYPERSHAPE_... shape type
00294    );
00295 
00296 //! Update after any change to shape (except deletion)/
00297 int MdispHyperShapeUpdate (
00298    GRE::LAYER *layer, 
00299    int obj,                            //!< Layer object
00300    INT32 shapenum
00301    );
00302 
00303 //===================================================================================================================
00304 
00305 #endif   // INC_GRE_HYPERMGR_H

Generated on Thu Apr 26 04:44:40 2007 for TNTsdk by  doxygen 1.5.2