mi32/rvchyper.h

Go to the documentation of this file.
00001 /**
00002  * \file rvchyper.h <mi32/rvchyper.h>
00003  * \brief Definitions for HyperIndex(R) objects
00004  *
00005  * \if NODOC
00006  * $Id: rvchyper.h_v 3.35 2003/11/12 13:20:16 mju Exp $
00007  *
00008  * $Log: rvchyper.h_v $
00009  * Revision 3.35  2003/11/12 13:20:16  mju
00010  * Add new hypershape type values for cad, ShapeElem, TIN_Node.
00011  *
00012  * Revision 3.34  2003/10/20 23:43:04  scowan
00013  * Removed unused inlines.
00014  *
00015  * Revision 3.33  2003/09/15 13:49:56  fileserver!dwilliss
00016  * Doxygen
00017  *
00018  * Revision 3.32  2003/01/02 18:43:37  scowan
00019  * Added sopme methods.
00020  *
00021  * Revision 3.31  2002/08/21 21:51:01  scowan
00022  * Fixed deprecated stuff.
00023  *
00024  * Revision 3.30  2002/08/20 15:06:35  mju
00025  * Use prevent_memfunc.
00026  *
00027  * Revision 3.29  2002/03/11 18:45:38  scowan
00028  * Fixed C linkage issue.
00029  *
00030  * Revision 3.28  2002/03/11 18:18:16  scowan
00031  * Added methods and deprecated mem... functions.
00032  *
00033  * Revision 3.27  2001/03/05 15:51:13  mju
00034  * Use const in Link copy.
00035  *
00036  * Revision 3.26  2001/01/03 17:50:25  mju
00037  * Add new link/shape types for linking via attribute.
00038  *
00039  * Revision 3.25  2000/12/20 18:18:28  mju
00040  * Fix return type of MfCopyHyperLink.
00041  *
00042  * Revision 3.24  2000/12/15 18:36:52  msmith
00043  * Genitor documentation.
00044  *
00045  * Revision 3.23  2000/11/30 18:09:23  mju
00046  * Change partialview to fracitonalview.
00047  *
00048  * Revision 3.22  2000/11/30 16:43:30  mju
00049  * Add HYPERLINK.ScaleValue.
00050  * Add more HYPERLINK_Scale... #defines.
00051  *
00052  * Revision 3.21  2000/08/11 16:47:27  scowan
00053  * More const.
00054  *
00055  * Revision 3.20  2000/03/27 22:01:42  scowan
00056  * More const.
00057  *
00058  * Revision 3.19  2000/03/22 00:07:17  scowan
00059  * inlcude color include file.
00060  *
00061  * Revision 3.18  1999/10/28 20:54:48  mju
00062  * Define HYPERLINK_ScaleTypeMax/PosnTypeMax.
00063  *
00064  * Revision 3.17  1999/10/28  20:09:12  mju
00065  * Add new HYPERLINK_ScaleView... defns.h
00066  *
00067  * Revision 3.16  1999/10/05  22:46:55  scowan
00068  * Changed header to inheritance.
00069  *
00070  * Revision 3.15  1999/07/02 17:16:41  mju
00071  * Update HYPERLINKOBJ_LAST.
00072  *
00073  * Revision 3.14  1999/06/02  16:35:36  scowan
00074  * *** empty log message ***
00075  *
00076  * Revision 3.13  1999/05/07 21:22:53  mju
00077  * Header restruct.
00078  *
00079  * Revision 3.12  1999/03/19  16:52:13  mju
00080  * Add HYPERLINKOBJ_TextFile and ExternalFile.
00081  *
00082  * Revision 3.11  1999/03/09  14:57:53  mju
00083  * Add #ifndef so doesn't get included multiple times.
00084  *
00085  * \endif
00086 **/
00087 
00088 #ifndef  INC_MI32_RVCHYPER_H
00089 #define  INC_MI32_RVCHYPER_H
00090 
00091 #ifndef INC_MI32_RVCDEFNS_H
00092 #include <mi32/rvcdefns.h>
00093 #endif
00094 
00095 #ifndef INC_MI32_COLOR_H
00096 #include <mi32/color.h>
00097 #endif
00098 
00099 //! Description of hyperlink object header.
00100 struct RVCHYPERINFO : public RVCGENINFO {
00101    DPOINT3D min;                       //!< Min/max of points in shapes.
00102    DPOINT3D max;                       //!< Kept track of automatically
00103    UINT32 NumShapes;                   //!< Number of shapes
00104    UINT32 NumLinks;                    //!< Number of links
00105    UINT32 MaxShapeSize;                //!< Maximum shape size
00106    INT32 space;                        //!< Reserved
00107    
00108    RVCHYPERINFO (
00109       ) {Clear();}
00110    
00111    RVCHYPERINFO (
00112       const RVCGENINFO& ginfo
00113       ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;}
00114    
00115    RVCHYPERINFO& operator= (
00116       const RVCGENINFO& ginfo          //!< RVCGENINFO structure to copy from
00117       ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);}
00118       
00119    void Clear (
00120       ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00121       
00122    #ifdef RVCSYSDLL
00123    void CopyFrom (
00124       const RVCHYPERINFO& Source,
00125       size_t size
00126       ) { memcpy(static_cast<void*>(this), &Source, MIN(size, sizeof(*this))); }
00127    #endif
00128    
00129    //! Get object extents.
00130    //! @return extents of vector object
00131    DRECT3D GetExtents (
00132       ) const {
00133       DRECT3D rect;
00134       rect.xinit = min.x;     
00135       rect.yinit = min.y;     
00136       rect.zinit = min.z;     
00137       rect.xlast = max.x;
00138       rect.ylast = max.y;
00139       rect.zlast = max.z;
00140       return (rect);
00141       }
00142 
00143    //! Set extents of vector object.
00144    void SetExtents (
00145       const DRECT3D& rect
00146       ) {
00147       min.x = rect.xinit;     
00148       min.y = rect.yinit;     
00149       min.z = rect.zinit;     
00150       max.x = rect.xlast;
00151       max.y = rect.ylast;
00152       max.z = rect.zlast;
00153       return;
00154       }
00155 
00156    };
00157 
00158 PREVENT_MEMFUNC(RVCHYPERINFO)
00159 
00160 //! Hyperlink structure.
00161 // This structure not stored in RVC files
00162 // However, it is passed to a DLL, so items may only be added to the end.
00163 struct HYPERLINK {
00164    UNICODE *filename;                  //!< Name of file or URL linked to
00165    UNICODE *name;                      //!< Name of object linked to or table.field for HYPERLINKOBJ_Attrib...
00166    UNICODE *desc;                      //!< Link description
00167    UNICODE *HyperName;                 //!< OBSOLETE
00168    UINT16 otype;                       //!< HYPERLINKOBJ_... object type
00169    UINT16 PosnType;                    //!< Positioning type, HYPERLINK_Posn...
00170    UINT16 ScaleType;                   //!< Scaling type, HYPERLINK_Scale...
00171    UINT16 ScaleValue;                  //!< Scale value, meaning depends on ScaleType.
00172    UINT32 shape;                       //!< Temp: used by disphypr to keep track of stuff
00173    void *layer;                        //!< Temp: used by disphypr to keep track of stuff
00174    };
00175 
00176 #define  HYPERLINKOBJ_DISP2DWINDOW  0  //!< Display 2D window
00177 #define  HYPERLINKOBJ_RasterColor   1  //!< Raster color
00178 #define  HYPERLINKOBJ_RasterGray    2  //!< Raster gray
00179 #define  HYPERLINKOBJ_Vector        3  //!< Vector
00180 #define  HYPERLINKOBJ_CAD           4  //!< CAD
00181 #define  HYPERLINKOBJ_Layout        5  //!< Layout
00182 #define  HYPERLINKOBJ_Group         6  //!< Group
00183 #define  HYPERLINKOBJ_TIN           7  //!< TIN
00184 #define  HYPERLINKOBJ_TextFile      8  //!< Text file
00185 #define  HYPERLINKOBJ_ExternalFile  9  //!< External file
00186 #define  HYPERLINKOBJ_URL           10 //!< URL
00187 #define  HYPERLINKOBJ_AttribFile    11 //!< File specified by database attribute
00188 #define  HYPERLINKOBJ_AttribURL     12 //!< URL specified by database attribute
00189 #define  HYPERLINKOBJ_LAST          12 //!< Last
00190 
00191 //! Hypershape structure.
00192 struct HYPERSHAPE {
00193    DPOINT3D min;                       //!< Minimum value
00194    DPOINT3D max;                       //!< Maximum value
00195    COLOR color;                        //!< Color of shape
00196    INT32 elem;                         //!< Element number for vector links
00197    INT16 ShapeType;                    //!< 0 = square, 1 = Circle, 2 = polygon
00198    INT16 spare_word;                   // Align structure
00199    UINT32 NumPoints;                   //!< Square = 2, Circle = 2 (center, radius), poly = N
00200    UINT32 NumLinks;                    //!< Number of links
00201    };
00202 
00203 
00204 #define HYPERSHAPEFLAG_Transparent     1
00205 
00206 #define HYPERSHAPE_Deleted       -1    //!< Shape has been deleted
00207 #define HYPERSHAPE_Rect          0     //!< 2 points, min and max
00208 #define HYPERSHAPE_Circle        1     //!< Center (X,Y) followed by radius in meters (rx,ry)
00209 #define HYPERSHAPE_Poly          2     //!< N points
00210 #define HYPERSHAPE_VectPointAny  5     //!< Any (closest) vector point
00211 #define HYPERSHAPE_VectLineAny   6     //!< Any (closest) vector line
00212 #define HYPERSHAPE_VectPolyAny   7     //!< Any (closest) vector polygon
00213 #define HYPERSHAPE_VectPoint     8     //!< Vector point
00214 #define HYPERSHAPE_VectLine      9     //!< Vector line
00215 #define HYPERSHAPE_VectPoly      10    //!< Vector polygon
00216 #define HYPERSHAPE_CAD           11    //!< CAD
00217 #define HYPERSHAPE_CAD_Any       12    //!< Any (closest) CAD element
00218 #define HYPERSHAPE_ShapeElem     13    //!< Shape object element
00219 #define HYPERSHAPE_ShapeElem_Any 14    //!< Any (closest) shape object element
00220 #define HYPERSHAPE_TIN_Node      15    //!< TIN node
00221 #define HYPERSHAPE_TIN_Node_Any  16    //!< Any (closest) TIN node
00222 
00223 
00224 //! Values for PosnType
00225 #define  HYPERLINK_PosnClick        0  //!< Center around mouse click
00226 #define  HYPERLINK_PosnCenter       1  //!< Center of image
00227 #define  HYPERLINK_PosnAsSaved      2  //!< As saved in layout (layouts only
00228 #define  HYPERLINK_PosnTypeMax      2  //!< Maximum
00229 
00230 //! Values for ScaleType
00231 #define  HYPERLINK_Scale1X             0  //!< Display at 1X zoom
00232 #define  HYPERLINK_ScaleFullView       1  //!< Display to fit window
00233 #define  HYPERLINK_ScaleAsSaved        2  //!< Display as saved
00234 #define  HYPERLINK_ScaleView2          3  //!< Display at 1/2 of full view
00235 #define  HYPERLINK_ScaleView3          4  //!< Display at 1/3 of full view
00236 #define  HYPERLINK_ScaleView4          5  //!< Display at 1/4 of full view
00237 #define  HYPERLINK_ScaleView5          6  //!< Display at 1/5 of full view
00238 #define  HYPERLINK_ScaleView6          7  //!< Display at 1/6 of full view
00239 #define  HYPERLINK_ScaleView7          8  //!< Display at 1/7 of full view
00240 #define  HYPERLINK_ScaleView8          9  //!< Display at 1/8 of full view
00241 #define  HYPERLINK_ScaleFractionalView 10 //!< Display partial view where ScaleValue high byte is numerator and low byte is denominator
00242 #define  HYPERLINK_ScaleMap            11 //!< Display at map scale of 1 to ScaleValue
00243 #define  HYPERLINK_ScaleMap100         12 //!< Display at map scale of 1 to 100*ScaleValue
00244 #define  HYPERLINK_ScaleMap1000        13 //!< Display at map scale of 1 to 1000*ScaleValue
00245 #define  HYPERLINK_ScaleTypeMax        13 //!< Maximum
00246 
00247 //!:Associate with "RVC HyperIndex object functions"
00248 //!\addtogroup hyper RVC HyperIndex object functions
00249 //!@{
00250 
00251 #ifndef GENERATING_DOXYGEN_OUTPUT
00252 
00253 #if defined(__cplusplus)
00254 extern "C" {
00255 #endif
00256 
00257 RVCAPPLIBEXPORT int _MfHyperClose (
00258    int id,
00259    RVCHYPERINFO *info,
00260    int HeaderSize
00261    );
00262 
00263 RVCAPPLIBEXPORT int _MfHyperHeaderReadOpen (
00264    int id, 
00265    RVCHYPERINFO *newinfo,
00266    int HeaderSize
00267    );
00268 
00269 RVCAPPLIBEXPORT int _MfHyperHeaderWriteOpen (
00270    int id, 
00271    RVCHYPERINFO *newinfo,
00272    int HeaderSize
00273    );
00274 
00275 RVCAPPLIBEXPORT void _MfHyperLinkCopy (
00276    HYPERLINK *dest, 
00277    const HYPERLINK *src,
00278    int LinkSize
00279    );
00280 
00281 RVCAPPLIBEXPORT void _MfHyperLinkFree (
00282    HYPERLINK *link,
00283    int LinkSize
00284    );
00285 
00286 RVCAPPLIBEXPORT int _MfHyperLinkRead (
00287    int id, 
00288    INT32 num, 
00289    HYPERLINK *newlink,
00290    int LinkSize
00291    );
00292 
00293 RVCAPPLIBEXPORT int _MfHyperLinkWrite (
00294    int id, 
00295    INT32 num, 
00296    HYPERLINK *newlink,
00297    int LinkSize
00298    );
00299 
00300 RVCAPPLIBEXPORT int _MfHyperMake (
00301    int fileindex,
00302    RVCHYPERINFO *info,
00303    int HeaderSize,
00304    UINT32 flags
00305    );
00306 
00307 RVCAPPLIBEXPORT int _MfHyperOpen (
00308    int fileindex, 
00309    INT32 inode, 
00310    RVCHYPERINFO *newinfo, 
00311    int HeaderSize,
00312    UINT32 flags
00313    );
00314 
00315 RVCAPPLIBEXPORT int _MfHyperShapeChange (
00316    int id, 
00317    INT32 num, 
00318    const HYPERSHAPE *newshape, 
00319    int ShapeSize,
00320    const DPOINT2D *points
00321    );
00322 
00323 RVCAPPLIBEXPORT int _MfHyperShapeRead (
00324    int id, 
00325    INT32 num, 
00326    HYPERSHAPE *newshape, 
00327    int ShapeSize,
00328    DPOINT2D **points_p, 
00329    INT32 **links_p
00330    );
00331 
00332 RVCAPPLIBEXPORT int _MfHyperShapeWrite (
00333    int id, 
00334    INT32 num, 
00335    const HYPERSHAPE *newshape, 
00336    int ShapeSize,
00337    const DPOINT2D *points, 
00338    const INT32 *links
00339    );
00340 
00341 #endif //!< GENERATING_DOXYGEN_OUTPUT
00342 
00343 //! Find a shape in a hyperlink object.
00344 RVCAPPLIBEXPORT INT32 MfFindHyperShape (
00345    int id,                             //!< Object handle
00346    INT32 element,                      //!< Element to find
00347    int ShapeType                       //!< Type to find
00348    );
00349 
00350 //! Return number of shapes in a hyperlink object.
00351 //!
00352 //! @return number of shapes
00353 RVCAPPLIBEXPORT INT32 MfHyperNumShapes (
00354    int id                              //!< Object handle
00355    );
00356 
00357 //! Return number of links in a hyperlink object.
00358 RVCAPPLIBEXPORT INT32 MfHyperNumLinks (
00359    int id                              //!< Object handle
00360    );
00361 
00362 //! Remove a link from a hyperlink shape.
00363 RVCAPPLIBEXPORT int MfHyperShapeRemoveLink (
00364    int id,                             //!< Object handle
00365    INT32 num,                          //!< Item number
00366    INT32 link                          //!< Link to remove
00367    );
00368 
00369 //! Add a link to a hyperlink shape.
00370 RVCAPPLIBEXPORT int MfHyperShapeAddLink (
00371    int id,                             //!< Object handle
00372    INT32 num,                          //!< Item number
00373    INT32 link                          //!< Link to add
00374    );
00375 
00376 //! Resize a HypderIndex shape list.
00377 RVCAPPLIBEXPORT int MfResizeHyperShape (
00378    int id,                             //!< Object handle
00379    INT32 numshapes                     //!< Number of shapes
00380    );
00381 
00382 //! Swap two hyperlink shapes
00383 RVCAPPLIBEXPORT int MfSwapHyperShapes (
00384    int id,                             //!< Object handle
00385    INT32 item1,                        //!< Shape 1
00386    INT32 item2                         //!< Shape 2
00387    );
00388 
00389 //! Close a previously opened hyperlink object.
00390 inline int MfCloseHyper (
00391    int id,                             //!< Open hyper handle
00392    RVCHYPERINFO *info                  //!< Hyper info structure (can be NULL)
00393    ) {
00394    return _MfHyperClose(id, info, sizeof(RVCHYPERINFO));
00395    }
00396 
00397 //! Create a new RVC hyperlink object.
00398 inline int MfMakeHyper (
00399    int fileindex,                      //!< Open file handle
00400    RVCHYPERINFO *info,                 //!< Hyper info structure
00401    UINT32 flags                        //!< Flags
00402    ) {
00403    return _MfHyperMake(fileindex, info,sizeof(RVCHYPERINFO), flags);
00404    }
00405 
00406 //! Open an existing RVC hyperlink object.
00407 inline int MfOpenHyper (
00408    int fileindex,                      //!< Open file handle
00409    INT32 inode,                        //!< Hyper object inode
00410    RVCHYPERINFO *newinfo,              //!< Hyper info structure
00411    UINT32 flags                        //!< Flags
00412    ) {
00413    return _MfHyperOpen(fileindex, inode, newinfo, sizeof(RVCHYPERINFO), flags);
00414    }
00415 
00416 //! Read the header for an open hyperlink given a handle.
00417 inline int MfReadOpenHyperHeader (
00418    int id,                             //!< Hyperlink object handle
00419    RVCHYPERINFO *newinfo               //!< Header to read into
00420    ) {
00421    return _MfHyperHeaderReadOpen(id, newinfo, sizeof(RVCHYPERINFO));
00422    }
00423 
00424 //! Read a hyperlink shape.
00425 inline int MfReadHyperShape (
00426    int id,                             //!< hyperlink object handle
00427    INT32 num,                          //!< Item number
00428    HYPERSHAPE *newshape,               //!< Hyper shape object to read into
00429    DPOINT2D **points_p,                //!< Point list returned
00430    INT32 **links_p                     //!< Link list returned
00431    ) {
00432    return _MfHyperShapeRead(id, num, newshape, sizeof(HYPERSHAPE), points_p, links_p);
00433    }
00434 
00435 //! Write a hyperlink shape.
00436 inline int MfWriteHyperShape (
00437    int id,                             //!< hyperlink object handle
00438    INT32 num,                          //!< Item number
00439    const HYPERSHAPE *newshape,         //!< Hyper shape object to write from
00440    const DPOINT2D *points,             //!< Point list
00441    const INT32 *links                  //!< Link list
00442    ) {
00443    return _MfHyperShapeWrite(id, num, newshape, sizeof(HYPERSHAPE), points, links);
00444    }
00445 
00446 //! Change a hyperlink shape.
00447 inline int MfHyperChangeShape (
00448    int id,                             //!< hyperlink object handle
00449    INT32 num,                          //!< Item number
00450    const HYPERSHAPE *newshape,         //!< Hyper shape object to change
00451    const DPOINT2D *points              //!< Point list
00452    ) {
00453    return _MfHyperShapeChange(id, num, newshape, sizeof(HYPERSHAPE), points);
00454    }
00455 
00456 //! Read a hyperlink.
00457 inline int MfReadHyperLink (
00458    int id,                             //!< Hyperlink object handle
00459    INT32 num,                          //!< Item number
00460    HYPERLINK *newlink                  //!< Hyperlink structure to read into
00461    ) {
00462    return _MfHyperLinkRead(id, num, newlink, sizeof(HYPERLINK));
00463    }
00464 
00465 //! Write a hyperlink.
00466 inline int MfWriteHyperLink (
00467    int id,                             //!< Hyperlink object handle
00468    INT32 num,                          //!< Item number
00469    HYPERLINK *newlink                  //!< Hyperlink structure to write from
00470    ) {
00471    return (_MfHyperLinkWrite(id, num, newlink,sizeof(HYPERLINK)));
00472    }
00473 
00474 //! Free a hyperlink.
00475 inline void MfFreeHyperLink (
00476    HYPERLINK *link                     //!< Hyperlink structure to free
00477    ) {
00478    _MfHyperLinkFree(link, sizeof(HYPERLINK));
00479    return;
00480    }
00481 
00482 //! Copy a hyperlink.
00483 inline void MfCopyHyperLink (
00484    HYPERLINK *dest,                    //!< Destination hyperlink structure 
00485    const HYPERLINK *src                //!< Source hyperlink structure
00486    ) {
00487    _MfHyperLinkCopy(dest, src, sizeof(HYPERLINK));
00488    return;
00489    }
00490 
00491 
00492 #if defined(__cplusplus)
00493 }
00494 #endif
00495 
00496 //!@}
00497 
00498 #endif   //!< #ifndef INC_MI32_RVCHYPER_H

Generated on Thu Aug 12 06:19:05 2004 for TNTsdk by doxygen 1.3.4-20031026