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

Generated on Thu Apr 26 04:45:16 2007 for TNTsdk by  doxygen 1.5.2