rvctin.h

Go to the documentation of this file.
00001 /***
00002  * \file rvctin.h <mi32/rvctin.h>
00003  * \brief Definitions for TIN (Triangulated Irregular Network) objects
00004  *
00005  * \if NODOC
00006  * $Id: rvctin.h_v 1.51 2004/08/24 22:09:08 scowan Exp $
00007  *
00008  * $Log: rvctin.h_v $
00009  * Revision 1.51  2004/08/24 22:09:08  scowan
00010  * Added total line length field to header.
00011  *
00012  * Revision 1.50  2004/03/12 15:07:04  mju
00013  * Remove another unused legacy object selection dialog inline.
00014  *
00015  * Revision 1.49  2004/03/10 22:53:26  mju
00016  * Mark legacy dialogs as deprecated.
00017  *
00018  * Revision 1.48  2004/01/30 18:57:51  vdronov
00019  * make it HardEdge
00020  *
00021  * Revision 1.47  2004/01/29 23:42:34  vdronov
00022  * added FLAG_BreakEdge to EDGEINFO
00023  *
00024  * Revision 1.46  2004/01/08 20:29:23  vdronov
00025  * added cople more structures
00026  *
00027  * Revision 1.45  2004/01/08 00:01:15  vdronov
00028  * added TRIANGLENODES, TRIANGLEEDGES, EDGEINFO structures.
00029  *
00030  * Revision 1.44  2003/10/15 17:39:43  mju
00031  * Deprecate groupkey.
00032  *
00033  * Revision 1.43  2003/10/13 16:10:58  scowan
00034  * Removed more inline unused functions.
00035  *
00036  * Revision 1.42  2003/10/13 15:42:36  scowan
00037  * Removed unused function prototypes.
00038  *
00039  * Revision 1.41  2003/09/15 13:49:56  fileserver!dwilliss
00040  * Doxygen
00041  *
00042  * Revision 1.40  2002/12/26 16:23:54  scowan
00043  * Fixed invalid extents handling.
00044  *
00045  * Revision 1.39  2002/10/04 21:46:45  scowan
00046  * Added more methodcs.
00047  *
00048  * Revision 1.38  2002/09/10 22:54:59  scowan
00049  * Added ext function version.
00050  *
00051  * Revision 1.37  2002/09/10 21:03:58  scowan
00052  * Added is valid methods.
00053  *
00054  * Revision 1.36  2002/08/21 21:55:46  scowan
00055  * Fixed derecated stuff.
00056  *
00057  * Revision 1.35  2002/08/20 15:20:03  mju
00058  * Use prevent_memfunc macro always.
00059  * Remove obsolete dialog defines.
00060  *
00061  * Revision 1.34  2002/03/08 18:38:05  scowan
00062  * Added clear method.
00063  *
00064  * Revision 1.33  2002/01/03 22:50:30  scowan
00065  * Added functions to manage tin object extents.
00066  *
00067  * Revision 1.32  2001/09/14 14:58:45  mju
00068  * No mdlg in win32native.
00069  *
00070  * Revision 1.31  2001/01/31 14:49:45  scowan
00071  * Fixed dll import / export error.
00072  *
00073  * Revision 1.30  2000/10/30 18:52:15  msmith
00074  * Genitor documentation.
00075  *
00076  * Revision 1.29  2000/10/19 17:46:56  scowan
00077  * Added function to get the number of elements.
00078  *
00079  * Revision 1.28  2000/08/11 19:40:42  scowan
00080  * Update prompts.
00081  *
00082  * Revision 1.27  2000/05/08 16:52:32  mju
00083  * Remove TRIANGLEDATA and TINCASCADING struct defns as nothing uses them.
00084  *
00085  * Revision 1.26  2000/04/21 15:49:34  mju
00086  * Add op= for assignment of GENINFO to TININFO.
00087  *
00088  * Revision 1.25  1999/11/19 14:23:20  mju
00089  * MdlgGetTIN... prompt const.
00090  *
00091  * Revision 1.24  1999/10/05  22:48:49  scowan
00092  * Changed headers to use inheritance.
00093  *
00094  * Revision 1.23  1999/06/14 19:43:55  mju
00095  * Add defaults for Mdlg fns.
00096  *
00097  * Revision 1.22  1999/06/11  14:46:32  mju
00098  * Obj sel dlg.
00099  *
00100  * Revision 1.21  1999/06/10  22:11:28  mju
00101  * Object selection dialog update.
00102  *
00103  * Revision 1.20  1999/05/07  21:23:58  mju
00104  * Hdr restruct.
00105  *
00106  * Revision 1.19  1999/04/08  15:36:20  mju
00107  * Use wrong inclusion guard for rvcdefns.h
00108  *
00109  * Revision 1.18  1999/01/05  19:13:49  scowan
00110  * Swapped multiple keywords
00111  *
00112  * Revision 1.17  1998/09/30 21:54:46  scowan
00113  * Setup DLL.
00114  *
00115  * Revision 1.15  1998/09/02  20:22:22  scowan
00116  * Exported Dealaunay functions.
00117  *
00118  * Revision 1.14  1998/02/04  23:27:01  scowan
00119  * Added element id's.
00120  *
00121  * Revision 1.13  1996/12/20  16:37:34  coffee!dwilliss
00122  * Added __cplusplus things
00123  *
00124  * Revision 1.11  1996/09/26  21:46:44  dfrolov
00125  * ComputeTriangleContoursExt added
00126  *
00127  * Revision 1.10  1996/09/26  19:18:04  dfrolov
00128  * add ComputeTriangleContours
00129  *
00130  * Revision 1.9  1996/09/20  00:03:22  dfrolov
00131  * nothing important
00132  *
00133  * Revision 1.8  1996/01/11  17:39:51  scowan
00134  * Added MfReadOpenTINHeader().
00135  *
00136  * Revision 1.7  1995/09/01  23:16:25  scowan
00137  * Added prototype for MfResizeTIN().
00138  *
00139  * Revision 1.6  1995/02/01  21:45:09  dfrolov
00140  * eliminate problem with versions
00141  *
00142  * Revision 1.4  1994/12/16  00:04:53  dfrolov
00143  * Add Delaunay family
00144  *
00145  * Revision 1.3  1994/11/07  17:45:54  mju
00146  * Add FindClosestTIN...() functions and PointInTINTriangle().
00147  *
00148  * Revision 1.2  1994/11/02  18:22:16  scowan
00149  * Fixed spelling error.
00150  *
00151  * Revision 1.1  1994/11/02  17:40:02  scowan
00152  * Initial revision
00153  *
00154  *
00155  *
00156  * \endif
00157 **/
00158 
00159 #ifndef  INC_MI32_RVCTIN_H
00160 #define  INC_MI32_RVCTIN_H
00161 
00162 #ifndef  INC_MI32_STDDEFNS_H
00163    #include <mi32/stddefns.h>
00164 #endif
00165 
00166 #ifndef  INC_MI32_RVCDEFNS_H
00167    #include <mi32/rvcdefns.h>
00168 #endif
00169 
00170 #ifndef  INC_MI32_MSTATUS_H
00171    #include <mi32/mstatus.h>
00172 #endif
00173 
00174 #ifndef  INC_MI32_POINT_H
00175    #include <mi32/point.h>
00176 #endif
00177 
00178 #ifndef  INC_MI32_RECT_H
00179    #include <mi32/rect.h>
00180 #endif
00181 
00182 //! Note: This MUST go after inclusion of stddefns.h
00183 #ifdef GEOMDLL
00184    #define GEOMLIBEXPORT MI_DLLEXPORT
00185 #else
00186    #define GEOMLIBEXPORT MI_DLLIMPORT
00187 #endif
00188 
00189 //! TIN node structure.
00190 struct RVCTINNODE : public DPOINT3D {
00191 
00192    RVCTINNODE& operator= (
00193       const DPOINT3D& pt
00194       ) { 
00195       *static_cast<DPOINT3D*>(this) = pt; 
00196       return (*this);
00197       }
00198 
00199    //! Get extents of TIN node.
00200    //! @return extents of TIN node
00201    DRECT3D GetExtents (
00202       ) const { return (DRECT3D(*this)); }
00203 
00204    bool IsValid (
00205       ) const { return (true); }
00206    };
00207 
00208 //! TIN triangle structure.
00209 struct RVCTINTRIANGLE {
00210    INT32 node1;                        //!< Id of node 1
00211    INT32 node2;                        //!< Id of node 2
00212    INT32 node3;                        //!< Id of node 3
00213    INT32 triangle12;                   //!< Connected triangle id, shared edge 1-2
00214    INT32 triangle23;                   //!< Connected triangle id, shared edge 2-3
00215    INT32 triangle31;                   //!< Connected triangle id, shared edge 3-1
00216    INT32 edge12;                       //!< Id of edge 1-2
00217    INT32 edge23;                       //!< Id of edge 2-3
00218    INT32 edge31;                       //!< Id of edge 3-1
00219    UINT8 edgeflags12;                  //!< Flags for edge 1-2
00220    UINT8 edgeflags23;                  //!< Flags for edge 2-3
00221    UINT8 edgeflags31;                  //!< Flags for edge 3-1
00222    #ifndef GENERATING_DOXYGEN_OUTPUT
00223    UINT8 spare;
00224    #endif //!< GENERATING_DOXYGEN_OUTPUT
00225    
00226    bool IsValid (
00227       ) const { return (true); }
00228    };
00229 
00230 //! TIN edge structure.
00231 struct RVCTINEDGE {
00232    INT32 nodefrom;                     //!< Id of the starting node
00233    INT32 nodeto;                       //!< Id of the ending node
00234    INT32 trileft;                      //!< Id of the left triangle
00235    INT32 triright;                     //!< Id of the right triangle
00236 
00237    bool IsValid (
00238       ) const { return (true); }
00239    };
00240 
00241 //! TIN hull structure.
00242 struct RVCTINHULL {
00243    DPOINT3D minval;                    //!< Minimum range value for HULL
00244    DPOINT3D maxval;                    //!< Maxmum range value for HULL
00245    DOUBLE length;                      //!< Perimeter
00246    DOUBLE area;                        //!< Area, excluding islands area
00247    DOUBLE volume;                      //!< Volume if applicable
00248    DOUBLE zerolevel;                   //!< Zero-level for volume, if applicable
00249    INT32 exthull;                      //!< id of the external hull, -1 if none
00250    UINT16 hulltype;                    //!< TINHULL_Convex, TINHULL_Clip or TINHULL_Exclude
00251    UINT16 spare;                       //!< For double alignment
00252 
00253    //! Get extents of TIN object.
00254    //! @return extents of TIN object
00255    DRECT3D GetExtents (
00256       ) const {
00257       DRECT3D retval(minval);
00258       retval.Extend(maxval);
00259       return (retval);
00260       }
00261 
00262    bool IsValid (
00263       ) const { return (true); }
00264       
00265    //! Set extents of TIN object.
00266    void SetExtents (
00267       const DRECT3D& rect
00268       ) {
00269       minval.x = rect.xinit;     
00270       minval.y = rect.yinit;     
00271       minval.z = rect.zinit;     
00272       maxval.x = rect.xlast;
00273       maxval.y = rect.ylast;
00274       maxval.z = rect.zlast;
00275       return;
00276       }
00277 
00278    };
00279 
00280 //! TIN hull edge structure.
00281 struct RVCTINHULLEDGE {
00282    INT32 nodefrom;                     //!< Starting node
00283    INT32 trileft;                      //!< Left triangle
00284    };
00285 
00286 struct RVCTININFO : public RVCGENINFO {
00287    DPOINT3D_OLD minval;                //!< Minimum range value for entire TIN object
00288    DPOINT3D_OLD maxval;                //!< Maximum range value for entire TIN object
00289    DOUBLE xscale;                      //!< X scale between object and ground distances
00290    DOUBLE yscale;                      //!< Y scale between object and ground distances
00291    DOUBLE zscale;                      //!< Z-value scale factor
00292    DOUBLE zoffset;                     //!< Z-value offset
00293    DOUBLE xytolerance;                 //!< Minimal distance between 2 points in TIN
00294    DOUBLE minangle;                    //!< Possible minimal angle in triangle
00295    DOUBLE flatfactor;                  //!< Flat-triangle criterion
00296    DOUBLE area;                        //!< Total area covered by TIN
00297    DOUBLE volume;                      //!< Total volume
00298    INT32 NumNodes;                     //!< Total number of nodes
00299    INT32 NumEdges;                     //!< Total number of edges
00300    INT32 NumTriangles;                 //!< Total number of triangles
00301    INT32 NumFlat;                      //!< Number of flat triangles
00302    INT32 NumHulls;                     //!< Total number of separated hulls, include "exclude areas"
00303    INT32 NumExclude;                   //!< Number of exclude areas
00304    INT16 zunits;                       //!< Units of measure elevation or something else
00305    UINT16 flags;                       //!< HASNODELIST, HASEDGELIST, HASCASCADINGTABLE
00306    INT32 NextNodeID;                   //!< Next node ID variable
00307    INT32 NextEdgeID;                   //!< Next edge ID variable
00308    INT32 NextTriangleID;               //!< Next triangle ID variable
00309    DOUBLE m_TotalLineLength;
00310 
00311    RVCTININFO (
00312       ) {Clear();}
00313    
00314    RVCTININFO (
00315       const RVCGENINFO& ginfo
00316       ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;}
00317    
00318    //! Assignment operator.
00319    //! @return copy of RVCTININFO
00320    RVCTININFO& operator= (
00321       const RVCGENINFO& ginfo          //!< RVCTININFO to copy
00322       ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);}
00323 
00324    void Clear (
00325       ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00326    
00327    #ifdef RVCSYSDLL
00328    void CopyFrom (
00329       const RVCTININFO& Source,
00330       size_t size
00331       ) { memcpy(static_cast<void*>(this), &Source, MIN(size, sizeof(*this))); }
00332    #endif
00333    
00334    //! Get extents of TIN object.
00335    //! @return extents of TIN object
00336    DRECT3D GetExtents (
00337       ) const {
00338       DRECT3D rect;
00339       rect.xinit = minval.x;     
00340       rect.yinit = minval.y;     
00341       rect.zinit = minval.z;     
00342       rect.xlast = maxval.x;
00343       rect.ylast = maxval.y;
00344       rect.zlast = maxval.z;
00345       return (rect);
00346       }
00347 
00348    //! Set extents of TIN object.
00349    void SetExtents (
00350       const DRECT3D& rect
00351       ) {
00352       minval.x = rect.xinit;     
00353       minval.y = rect.yinit;     
00354       minval.z = rect.zinit;     
00355       maxval.x = rect.xlast;
00356       maxval.y = rect.ylast;
00357       maxval.z = rect.zlast;
00358       return;
00359       }
00360 
00361    };
00362 
00363 PREVENT_MEMFUNC(RVCTININFO)
00364 
00365 //! Triangle structure.
00366 struct TRIANGLEREF {
00367    INT32 node1;                        //!< Id of node 1
00368    INT32 node2;                        //!< Id of node 2
00369    INT32 node3;                        //!< Id of node 3
00370    INT32 triangle12;                   //!< Connected triangle id, shared edge 1-2
00371    INT32 triangle23;                   //!< Connected triangle id, shared edge 2-3
00372    INT32 triangle31;                   //!< Connected triangle id, shared edge 3-1
00373    };
00374 
00375 //! Triangle Nodes structure.
00376 struct TRIANGLENODES {
00377    INT32 node1;      
00378    INT32 node2; 
00379    INT32 node3;    
00380    UINT32 flags;    
00381    };
00382 
00383 //! Triangle Edges structure.
00384 struct TRIANGLEEDGES {
00385    INT32 edge1;      
00386    INT32 edge2; 
00387    INT32 edge3;    
00388    UINT32 flags;    
00389    };
00390 
00391 //! Triangle Triangles structure.
00392 struct TRIANGLETRIANGLES {
00393    INT32 triangle1;     
00394    INT32 triangle2; 
00395    INT32 triangle3;   
00396    UINT32 flags;    
00397    };
00398 
00399 //! Triangle Info structure.
00400 struct TRIANGLEINFO {
00401    INT32 node1;                 
00402    INT32 node2;                      
00403    INT32 node3;                   
00404    INT32 triangle12;                 
00405    INT32 triangle23;               
00406    INT32 triangle31;                 
00407    INT32 edge12;                      
00408    INT32 edge23;                    
00409    INT32 edge31;                      
00410    UINT32 flags;    
00411    };
00412 
00413 //! Edge Info structure.
00414 struct EDGEINFO {
00415 
00416    enum FLAG {
00417       FLAG_HardEdge = 0x00000001
00418       };
00419 
00420    INT32 startnode;     
00421    INT32 endnode; 
00422    INT32 lefttriangle;  
00423    INT32 righttriangle; 
00424    UINT32 flags;    
00425    };
00426 
00427 //! Values for RVCTINTRIANGLE.edgeflagsXX
00428 #define  TINEDGE_Hard   0x01
00429 
00430 //! Values for RVCTINHULL.hulltype
00431 #define TINHULL_Convex  0
00432 #define TINHULL_Clip    1
00433 #define TINHULL_Exclude 2
00434 
00435 //! Values for RVCTININFO.flags
00436 #define  TIN_HasNodeLists  0x0001
00437 #define  TIN_HasEdgeLists  0x0002
00438 #define  TIN_HasCascading  0x0004
00439 
00440 
00441 /*-------------------------------------------------------------------------*/
00442 /*    Object Selection Dialogs                                             */
00443 /*-------------------------------------------------------------------------*/
00444 
00445 #if (defined(X_NATIVE) || defined(WIN32_MFC)) && !defined(DEPRECATE_GROUPKEY)
00446 
00447 //! Pop-up dialog allowing user to select a TIN object.
00448 DEPRECATED inline int MdlgGetTINObject (
00449    MDLGPARENT dlgparent,               //!< Parent widget
00450    FILEPATH& filename,                 //!< Default filename
00451    INT32 *inode,                       //!< Vector object inode passed/returned
00452    const void *prompt,                 //!< Prompt label
00453    RVCTININFO *objinfo,                //!< Object header passed/returned
00454    MfFiltFuncProto filter=0,           //!< Filter function
00455    void *filtuserdata=0,               //!< Filter function data
00456    GETOBJFLAGS flags=GETOBJFLAG_None   //!< Get object flags (See rvcdefns.h)
00457    ) {
00458    return (MdlgGetObject(dlgparent,filename,inode,prompt,OTYPE_TIN,RVCCONV_TINInfo,objinfo,sizeof(RVCTININFO),filter,filtuserdata,flags));
00459    }
00460 
00461 //! Pop-up dialog allowing user to select a TIN object.
00462 DEPRECATED inline int MdlgGetTINObject (
00463    MDLGPARENT dlgparent,               //!< Parent widget
00464    UNICODE *filename,                  //!< Default filename
00465    INT32 *inode,                       //!< Vector object inode passed/returned
00466    const void *prompt,                 //!< Prompt label
00467    RVCTININFO *objinfo,                //!< Object header passed/returned
00468    MfFiltFuncProto filter=0,           //!< Filter function
00469    void *filtuserdata=0,               //!< Filter function data
00470    GETOBJFLAGS flags=GETOBJFLAG_None   //!< Get object flags (See rvcdefns.h)
00471    ) {
00472    return (MdlgGetObject(dlgparent,filename,inode,prompt,OTYPE_TIN,RVCCONV_TINInfo,objinfo,sizeof(RVCTININFO),filter,filtuserdata,flags));
00473    }
00474 
00475 #endif   //!< X_NATIVE || WIN32_MFC
00476 
00477 //! Read TIN header.
00478 inline int MfReadTINHeader (
00479    int fhandle,                        //!< RVC file handle
00480    RVCINODENUM inode,                  //!< Object inode
00481    RVCTININFO* info                    //!< TIN info to read
00482    ) {
00483    return (_MfReadHeader(fhandle,inode,info,sizeof(RVCTININFO),RVCCONV_TIN));
00484    }
00485 
00486 //! Write TIN header.
00487 inline int MfWriteTINHeader (
00488    int fhandle,                        //!< RVC file handle
00489    RVCINODENUM inode,                  //!< Object inode
00490    RVCTININFO* info                    //!< TIN info to write
00491    ) {
00492    return (_MfWriteHeader(fhandle,inode,info,sizeof(RVCTININFO),RVCCONV_TIN));
00493    }
00494 
00495 /*-----------------------------------------------------------------------*/
00496 /*    Prototypes for RVC TIN functions                                   */
00497 /*-----------------------------------------------------------------------*/
00498 
00499 #if defined(__cplusplus)
00500 extern "C" {
00501 #endif
00502 //! Performs Delaunay triangulation (full parameters list).
00503 //!
00504 //! NOTE: The triangle vertices in TRIANGLEREF structure are organized in
00505 //! clockwise direction (when looking down)
00506 //! WARNING: The order of input Nodes will be changed, all nodes will be sorted
00507 //! using X coordinate (then Y if two points have equal X coordinates).
00508 //! WARNING: NUMBER OF NODES RETURNED MIGHT BE DIFFERENT FROM INPUT,
00509 //! because of duplicate point removal using tolerance value.
00510 GEOMLIBEXPORT int DelaunayProc (
00511    DPOINT3D **Nodes,                   //!< Input/output array of points
00512    TRIANGLEREF **Triangles,            //!< Output array of triangles
00513    RVCTINHULLEDGE **Con,               //!< Output array of hull edges
00514    RVCTINHULL *HullInfo,               //!< Information about convex hull
00515    INT32 *NumNodes,                    //!< Number of input/output nodes passed/returned
00516    INT32 *NumTriangles,                //!<  Number of the output triangles
00517    INT32 *NumHullEdges,                //!< Number of the hull edges
00518    double Tolerance,                   //!< Spatial tolerance
00519    MSTATUSINTERFACE StatInt            //!< Status interface from MstatusInterfaceGet()
00520    );
00521 
00522 //! Performs Delaunay triangulation (short parameters list).
00523 //!
00524 //! Note: This function calls DelaunayProc.
00525 GEOMLIBEXPORT int Delaunay3D (
00526    DPOINT3D **Nodes,                   //!< Input/output array of points
00527    TRIANGLEREF **Triangles,            //!< Output array of triangles
00528    INT32 *NumNodes,                    //!< Number of input/output nodes passed/returned
00529    INT32 *NumTriangles,                //!< Number of the output triangles
00530    double Tolerance,                   //!< Spatial tolerance
00531    MSTATUSINTERFACE StatInt            //!< Status interface from MstatusInterfaceGet()
00532    );
00533 
00534 //! Performs Delaunay triangulation (short parameters list).
00535 //!
00536 //! Note: This function calls DelaunayProc.
00537 GEOMLIBEXPORT int Delaunay2D (
00538    DPOINT2D **Nodes,                   //!< Input/output array of points
00539    TRIANGLEREF **Triangles,            //!< Output array of triangles
00540    INT32 *NumNodes,                    //!< Number of input/output nodes passed/returned
00541    INT32 *NumTriangles,                //!< Number of the output triangles
00542    double Tolerance,                   //!< Spatial tolerance
00543    MSTATUSINTERFACE StatInt            //!< Status interface from MstatusInterfaceGet()
00544    );
00545 
00546 #ifndef GENERATING_DOXYGEN_OUTPUT
00547 
00548 RVCAPPLIBEXPORT int _MfTINClose (
00549    int id,
00550    RVCTININFO *info,
00551    int HeaderSize
00552    );
00553 
00554 RVCAPPLIBEXPORT int _MfTINHeaderReadOpen (
00555    int id,
00556    RVCTININFO *newtinfo,
00557    int HeaderSize
00558    );
00559 
00560 RVCAPPLIBEXPORT int _MfTINHeaderWriteOpen (
00561    int id,
00562    RVCTININFO *tinfo,
00563    int HeaderSize
00564    );
00565 
00566 RVCAPPLIBEXPORT int _MfTINMake (
00567    int fhandle,
00568    RVCTININFO *info,
00569    int HeaderSize,
00570    UINT32 flags
00571    );
00572 
00573 RVCAPPLIBEXPORT int _MfTINOpen (
00574    int fhandle,
00575    INT32 inode,
00576    RVCTININFO *info,
00577    int HeaderSize,
00578    UINT32 flags
00579    );
00580 
00581 #endif //!< GENERATING_DOXYGEN_OUTPUT
00582 
00583 //! Efficiently erases the edge list.
00584 //!
00585 //! Used before rebuilding the edge list to avoid AddToFreeList() calls in rvclist.c.
00586 RVCAPPLIBEXPORT int MfClearTINEdgeList (
00587    int id                              //!< Open TIN object handle
00588    );
00589 
00590 //! Read TIN edge.
00591 RVCAPPLIBEXPORT int MfReadTINEdge (
00592    int id,                             //!< Open TIN object handle
00593    INT32 num,                          //!< Edge id
00594    RVCTINEDGE *hdr                     //!< RVCTINEDGE passed / returned
00595    );
00596 
00597 //! Read TIN hull.
00598 RVCAPPLIBEXPORT int MfReadTINHull (
00599    int id,                             //!< Open TIN object handle
00600    INT32 num,                          //!< Hull id
00601    RVCTINHULL *hdr,                    //!< RVCTINHULL passed / returned
00602    INT32 *numedges,                    //!< Number of edges returned
00603    INT32 *numisles                     //!< Number of islands returned
00604    );
00605 
00606 //! Read TIN hull edges.
00607 //!
00608 //! @return number of edges read
00609 RVCAPPLIBEXPORT INT32 MfReadTINHullEdges (
00610    int id,                             //!< Open TIN object handle
00611    INT32 hullnum,                      //!< Hull id
00612    INT32 start,                        //!< Starting edge id
00613    INT32 num,                          //!< Number of edges to read
00614    RVCTINHULLEDGE *edges               //!< RVCTINHULLEDGE passed / returned
00615    );
00616 
00617 //! Read TIN hull islands.
00618 //!
00619 //! @return number of islands read
00620 RVCAPPLIBEXPORT INT32 MfReadTINHullIslands (
00621    int id,                             //!< Open TIN object handle
00622    INT32 hullnum,                      //!< Hull id
00623    INT32 start,                        //!< Starting island id
00624    INT32 num,                          //!< Number of islands to read
00625    INT32 *islands                      //!< Island id's returned
00626    );
00627 
00628 //! Read TIN node.
00629 RVCAPPLIBEXPORT int MfReadTINNode (
00630    int id,                             //!< Open TIN object handle
00631    INT32 num,                          //!< Node id
00632    RVCTINNODE *hdr,                    //!< RVCTINNODE passed / returned
00633    INT32 *numedges                     //!< Edge id's returned
00634    );
00635 
00636 //! Read TIN node edges.
00637 //! @return number of edges read
00638 RVCAPPLIBEXPORT INT32 MfReadTINNodeEdges (
00639    int id,                             //!< Open TIN object handle
00640    INT32 node,                         //!< Node id
00641    INT32 start,                        //!< Starting edge id
00642    INT32 num,                          //!< Number of edges to read
00643    INT32 *edges                        //!< Edge id's returned
00644    );
00645 
00646 //! Read TIN node edges.
00647 //! Used by the wrapper class
00648 //! @return number of edges read
00649 RVCAPPLIBEXPORT INT32 MfReadTINNodeEdgesExt (
00650    int id,                             //!< Open TIN object handle
00651    INT32 node,                         //!< Node id
00652    INT32 **edges,                      //!< Edge id's returned
00653    INT32 MaxItems                      //!< Size of buffer in INT32 increments
00654    );
00655 
00656 //! Read TIN triangle
00657 RVCAPPLIBEXPORT int MfReadTINTriangle (
00658    int id,                             //!< Open TIN object handle
00659    INT32 num,                          //!< Triangle id
00660    RVCTINTRIANGLE *hdr                 //!< RVDTINTRIANGLE returned
00661    );
00662 
00663 //! Resize a TIN.
00664 RVCAPPLIBEXPORT int MfResizeTIN (
00665    int id,                             //!< Open TIN object handle
00666    INT32 nodes,                        //!< Number of nodes in the new TIN
00667    INT32 edges,                        //!< Number of edges in the new TIN
00668    INT32 triangles,                    //!< Number of triangles in the new TIN
00669    INT32 hulls                         //!< Number of hulls in the new TIN
00670    );
00671 
00672 //! Swap two TIN hulls.
00673 RVCAPPLIBEXPORT int MfSwapTINHullEdges (
00674    int ohandle,                        //!< Open TIN object handle
00675    INT32 hullnum1,                     //!< Hull number to swap
00676    INT32 hullnum2                      //!< Hull number to swap
00677    );
00678 
00679 //! Swap two TIN nodes.
00680 RVCAPPLIBEXPORT int MfSwapTINNodeEdges (
00681    int ohandle,                        //!< Open TIN object handle
00682    INT32 node1,                        //!< Node number to swap
00683    INT32 node2                         //!< Node number to swap
00684    );
00685 
00686 //!  Add a callback.
00687 RVCLOWLIBEXPORT ERRVALUE MfTINCallbackAdd (
00688    int fhandle,                        //!< Open file handle
00689    MfCallbackFunc func,                //!< Callback function
00690    void *data,                         //!< Callback data
00691    UINT32 reason                       //!< Callback reason
00692    );
00693 
00694 //! REmove a callback.
00695 RVCLOWLIBEXPORT ERRVALUE MfTINCallbackRemove (
00696    int fhandle,                        //!< Open file handle
00697    MfCallbackFunc func,                //!< Callback function
00698    void *data,                         //!< Callback data
00699    UINT32 reason                       //!< Callback reason
00700    );
00701 
00702 //! Get extents for the vector object
00703 RVCAPPLIBEXPORT ERRVALUE MfTINGetExtents (
00704    int id,
00705    DRECT3D& Extents
00706    );
00707    
00708 //! Get number of edges in a TIN.
00709 //!
00710 //! @return number of edges
00711 RVCAPPLIBEXPORT INT32 MfTINGetNumEdges (
00712    int id                              //!< Open TIN object handle
00713    );
00714 
00715 //! Get number of hulls in a TIN.
00716 //!
00717 //! @return number of hulls
00718 RVCAPPLIBEXPORT INT32 MfTINGetNumHulls (
00719    int id                              //!< Open TIN object handle
00720    );
00721 
00722 //! Get number of nodes in a TIN.
00723 //!
00724 //! @return number of nodes
00725 RVCAPPLIBEXPORT INT32 MfTINGetNumNodes (
00726    int id                              //!< Open TIN object handle
00727    );
00728 
00729 //! Get number of triangles in a TIN.
00730 //!
00731 //! @return number of triangles
00732 RVCAPPLIBEXPORT INT32 MfTINGetNumTriangles (
00733    int id                              //!< Open TIN object handle
00734    );
00735 
00736 //! Set extents for the vector object
00737 RVCAPPLIBEXPORT ERRVALUE MfTINSetExtents (
00738    int id,
00739    const DRECT3D& Extents
00740    );
00741    
00742 //! Update extents for the vector object
00743 RVCAPPLIBEXPORT ERRVALUE MfTINUpdateExtents (
00744    int id,
00745    const DRECT3D& Extents
00746    );
00747    
00748 //! Write TIN edge.
00749 RVCAPPLIBEXPORT int MfWriteTINEdge (
00750    int id,                             //!< Open TIN object handle
00751    INT32 num,                          //!< Edge number to write
00752    const RVCTINEDGE *hdr               //!< TIN edge data to write
00753    );
00754 
00755 //! Write TIN hull.
00756 RVCAPPLIBEXPORT int MfWriteTINHull (
00757    int id,                             //!< Open TIN object handle
00758    INT32 num,                          //!< Hull number to write
00759    const RVCTINHULL *hdr               //!< TIN hull data to write
00760    );
00761 
00762 //! Write TIN hull edges.
00763 RVCAPPLIBEXPORT INT32 MfWriteTINHullEdges (
00764    int id,                             //!< Open TIN object handle
00765    INT32 hullnum,                      //!< Hull number to write
00766    INT32 total,                        //!< Total number of edges
00767    INT32 start,                        //!< Starting edge
00768    INT32 num,                          //!< Number of edges to write
00769    const RVCTINHULLEDGE *edges         //!< TIN hull edge data to write
00770    );
00771 
00772 //! Write TIN hull islands.
00773 RVCAPPLIBEXPORT INT32 MfWriteTINHullIslands (
00774    int id,                             //!< Open TIN object handle
00775    INT32 hullnum,                      //!< Hull number to write
00776    INT32 total,                        //!< Total number of islands
00777    INT32 start,                        //!< Starting island
00778    INT32 num,                          //!< Number of islands to write
00779    const INT32 *islands                //!< TIN hull island id's to write
00780    );
00781 
00782 //! Write TIN node.
00783 RVCAPPLIBEXPORT int MfWriteTINNode (
00784    int id,                             //!< Open TIN object handle
00785    INT32 num,                          //!< Node number to write
00786    const RVCTINNODE *hdr               //!< TIN node data to write
00787    );
00788 
00789 //! Write TIN node edges.
00790 RVCAPPLIBEXPORT INT32 MfWriteTINNodeEdges (
00791    int id,                             //!< Open TIN object handle
00792    INT32 node,                         //!< Node number to write
00793    INT32 total,                        //!< Total number to edges
00794    INT32 start,                        //!< Starting edge
00795    INT32 num,                          //!< Number of edges to write
00796    const INT32 *edges                  //!< TIN edge id's to write
00797    );
00798 
00799 //! Write TIN triangle.
00800 RVCAPPLIBEXPORT int MfWriteTINTriangle (
00801    int id,                             //!< Open TIN object handle
00802    INT32 num,                          //!< Triangle number to write
00803    const RVCTINTRIANGLE *hdr           //!< TIN triangle data to write
00804    );
00805 
00806 //! Determine if a given point is inside specified TIN triangle.
00807 //!
00808 //! @return 1 if true, 0 if false, < 0 if error
00809 int PointInTINTriangle (
00810    int ohandle,                        //!< RVC handle for open TIN object
00811    INT32 TriangleNum,                  //!< Triangle number to test
00812    double xcheck,                      //!< TIN X coordinate of point to test
00813    double ycheck                       //!< TIN Y coordinate of point to test
00814    );
00815 
00816 //! Compute full set of contour segments for a given triangle (as a set of 3 nodes).
00817 //!
00818 //! Return: number of contours computed (might return 0).
00819 //! NOTE:   Programmer is responsible for freeing Contours when done, 
00820 //!   do not forget to free individual entries: (*Contours)[i].point  .
00821 int ComputeTriangleContours (
00822    RVCTINNODE *A,                      //!< passed node of the triangle (supply x,y,z)
00823    RVCTINNODE *B,                      //!< passed node of the triangle (supply x,y,z)
00824    RVCTINNODE *C,                      //!< passed node of the triangle (supply x,y,z)
00825    DOUBLE start,                       //!< passed starting level of contouring range (Z)
00826    DOUBLE end,                         //!< passed ending level of contouring range (Z)
00827    DOUBLE interval,                    //!< passed interval between contour lines in Z units
00828    DPOLYLINE3D **Contours              //!< return array of DPOLYLINE3D that contains contours
00829    );
00830 
00831 //! Compute full set of contour segments for a given triangle (as a set of 3 nodes).
00832 //!
00833 //! @return number of contours computed (might return 0).
00834 int ComputeTriangleContoursExt (
00835    RVCTINNODE *A,                      //!< passed node of the triangle (supply x,y,z)
00836    RVCTINNODE *B,                      //!< passed node of the triangle (supply x,y,z)
00837    RVCTINNODE *C,                      //!< passed node of the triangle (supply x,y,z)
00838    DOUBLE start,                       //!< passed starting level of contouring range (Z)
00839    DOUBLE end,                         //!< passed ending level of contouring range (Z)
00840    DOUBLE interval,                    //!< passed interval between contour lines in Z units
00841    void (*CBfunc)(DPOLYLINE3D*, void*),//! callback that will be envoked for each contour line
00842    void *userdata                      //!< user specified data to be passed to callback
00843    );
00844 
00845 #define  MfCloseTIN(_id,_info)            _MfTINClose((_id),(_info),sizeof(RVCTININFO))
00846 #define  MfReadOpenTINHeader(_id,_info)   _MfTINHeaderReadOpen((_id),(_info),sizeof(RVCTININFO))
00847 #define  MfMakeTIN(_id,_info,_fl)         _MfTINMake((_id),(_info),sizeof(RVCTININFO),(_fl))
00848 #define  MfOpenTIN(_id,_oi,_info,_fl)     _MfTINOpen((_id),(_oi),(_info),sizeof(RVCTININFO),(_fl))
00849 
00850 #if defined(__cplusplus)
00851 }
00852 #endif
00853 
00854 #endif      //!<  #ifndef INC_MI32_RVCTIN_H 
00855 

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