00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
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
00183 #ifdef GEOMDLL
00184 #define GEOMLIBEXPORT MI_DLLEXPORT
00185 #else
00186 #define GEOMLIBEXPORT MI_DLLIMPORT
00187 #endif
00188
00189
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
00200
00201 DRECT3D GetExtents (
00202 ) const { return (DRECT3D(*this)); }
00203
00204 bool IsValid (
00205 ) const { return (true); }
00206 };
00207
00208
00209 struct RVCTINTRIANGLE {
00210 INT32 node1;
00211 INT32 node2;
00212 INT32 node3;
00213 INT32 triangle12;
00214 INT32 triangle23;
00215 INT32 triangle31;
00216 INT32 edge12;
00217 INT32 edge23;
00218 INT32 edge31;
00219 UINT8 edgeflags12;
00220 UINT8 edgeflags23;
00221 UINT8 edgeflags31;
00222 #ifndef GENERATING_DOXYGEN_OUTPUT
00223 UINT8 spare;
00224 #endif
00225
00226 bool IsValid (
00227 ) const { return (true); }
00228 };
00229
00230
00231 struct RVCTINEDGE {
00232 INT32 nodefrom;
00233 INT32 nodeto;
00234 INT32 trileft;
00235 INT32 triright;
00236
00237 bool IsValid (
00238 ) const { return (true); }
00239 };
00240
00241
00242 struct RVCTINHULL {
00243 DPOINT3D minval;
00244 DPOINT3D maxval;
00245 DOUBLE length;
00246 DOUBLE area;
00247 DOUBLE volume;
00248 DOUBLE zerolevel;
00249 INT32 exthull;
00250 UINT16 hulltype;
00251 UINT16 spare;
00252
00253
00254
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
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
00281 struct RVCTINHULLEDGE {
00282 INT32 nodefrom;
00283 INT32 trileft;
00284 };
00285
00286 struct RVCTININFO : public RVCGENINFO {
00287 DPOINT3D_OLD minval;
00288 DPOINT3D_OLD maxval;
00289 DOUBLE xscale;
00290 DOUBLE yscale;
00291 DOUBLE zscale;
00292 DOUBLE zoffset;
00293 DOUBLE xytolerance;
00294 DOUBLE minangle;
00295 DOUBLE flatfactor;
00296 DOUBLE area;
00297 DOUBLE volume;
00298 INT32 NumNodes;
00299 INT32 NumEdges;
00300 INT32 NumTriangles;
00301 INT32 NumFlat;
00302 INT32 NumHulls;
00303 INT32 NumExclude;
00304 INT16 zunits;
00305 UINT16 flags;
00306 INT32 NextNodeID;
00307 INT32 NextEdgeID;
00308 INT32 NextTriangleID;
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
00319
00320 RVCTININFO& operator= (
00321 const RVCGENINFO& ginfo
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
00335
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
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
00366 struct TRIANGLEREF {
00367 INT32 node1;
00368 INT32 node2;
00369 INT32 node3;
00370 INT32 triangle12;
00371 INT32 triangle23;
00372 INT32 triangle31;
00373 };
00374
00375
00376 struct TRIANGLENODES {
00377 INT32 node1;
00378 INT32 node2;
00379 INT32 node3;
00380 UINT32 flags;
00381 };
00382
00383
00384 struct TRIANGLEEDGES {
00385 INT32 edge1;
00386 INT32 edge2;
00387 INT32 edge3;
00388 UINT32 flags;
00389 };
00390
00391
00392 struct TRIANGLETRIANGLES {
00393 INT32 triangle1;
00394 INT32 triangle2;
00395 INT32 triangle3;
00396 UINT32 flags;
00397 };
00398
00399
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
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
00428 #define TINEDGE_Hard 0x01
00429
00430
00431 #define TINHULL_Convex 0
00432 #define TINHULL_Clip 1
00433 #define TINHULL_Exclude 2
00434
00435
00436 #define TIN_HasNodeLists 0x0001
00437 #define TIN_HasEdgeLists 0x0002
00438 #define TIN_HasCascading 0x0004
00439
00440
00441
00442
00443
00444
00445 #if (defined(X_NATIVE) || defined(WIN32_MFC)) && !defined(DEPRECATE_GROUPKEY)
00446
00447
00448 DEPRECATED inline int MdlgGetTINObject (
00449 MDLGPARENT dlgparent,
00450 FILEPATH& filename,
00451 INT32 *inode,
00452 const void *prompt,
00453 RVCTININFO *objinfo,
00454 MfFiltFuncProto filter=0,
00455 void *filtuserdata=0,
00456 GETOBJFLAGS flags=GETOBJFLAG_None
00457 ) {
00458 return (MdlgGetObject(dlgparent,filename,inode,prompt,OTYPE_TIN,RVCCONV_TINInfo,objinfo,sizeof(RVCTININFO),filter,filtuserdata,flags));
00459 }
00460
00461
00462 DEPRECATED inline int MdlgGetTINObject (
00463 MDLGPARENT dlgparent,
00464 UNICODE *filename,
00465 INT32 *inode,
00466 const void *prompt,
00467 RVCTININFO *objinfo,
00468 MfFiltFuncProto filter=0,
00469 void *filtuserdata=0,
00470 GETOBJFLAGS flags=GETOBJFLAG_None
00471 ) {
00472 return (MdlgGetObject(dlgparent,filename,inode,prompt,OTYPE_TIN,RVCCONV_TINInfo,objinfo,sizeof(RVCTININFO),filter,filtuserdata,flags));
00473 }
00474
00475 #endif
00476
00477
00478 inline int MfReadTINHeader (
00479 int fhandle,
00480 RVCINODENUM inode,
00481 RVCTININFO* info
00482 ) {
00483 return (_MfReadHeader(fhandle,inode,info,sizeof(RVCTININFO),RVCCONV_TIN));
00484 }
00485
00486
00487 inline int MfWriteTINHeader (
00488 int fhandle,
00489 RVCINODENUM inode,
00490 RVCTININFO* info
00491 ) {
00492 return (_MfWriteHeader(fhandle,inode,info,sizeof(RVCTININFO),RVCCONV_TIN));
00493 }
00494
00495
00496
00497
00498
00499 #if defined(__cplusplus)
00500 extern "C" {
00501 #endif
00502
00503
00504
00505
00506
00507
00508
00509
00510 GEOMLIBEXPORT int DelaunayProc (
00511 DPOINT3D **Nodes,
00512 TRIANGLEREF **Triangles,
00513 RVCTINHULLEDGE **Con,
00514 RVCTINHULL *HullInfo,
00515 INT32 *NumNodes,
00516 INT32 *NumTriangles,
00517 INT32 *NumHullEdges,
00518 double Tolerance,
00519 MSTATUSINTERFACE StatInt
00520 );
00521
00522
00523
00524
00525 GEOMLIBEXPORT int Delaunay3D (
00526 DPOINT3D **Nodes,
00527 TRIANGLEREF **Triangles,
00528 INT32 *NumNodes,
00529 INT32 *NumTriangles,
00530 double Tolerance,
00531 MSTATUSINTERFACE StatInt
00532 );
00533
00534
00535
00536
00537 GEOMLIBEXPORT int Delaunay2D (
00538 DPOINT2D **Nodes,
00539 TRIANGLEREF **Triangles,
00540 INT32 *NumNodes,
00541 INT32 *NumTriangles,
00542 double Tolerance,
00543 MSTATUSINTERFACE StatInt
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
00582
00583
00584
00585
00586 RVCAPPLIBEXPORT int MfClearTINEdgeList (
00587 int id
00588 );
00589
00590
00591 RVCAPPLIBEXPORT int MfReadTINEdge (
00592 int id,
00593 INT32 num,
00594 RVCTINEDGE *hdr
00595 );
00596
00597
00598 RVCAPPLIBEXPORT int MfReadTINHull (
00599 int id,
00600 INT32 num,
00601 RVCTINHULL *hdr,
00602 INT32 *numedges,
00603 INT32 *numisles
00604 );
00605
00606
00607
00608
00609 RVCAPPLIBEXPORT INT32 MfReadTINHullEdges (
00610 int id,
00611 INT32 hullnum,
00612 INT32 start,
00613 INT32 num,
00614 RVCTINHULLEDGE *edges
00615 );
00616
00617
00618
00619
00620 RVCAPPLIBEXPORT INT32 MfReadTINHullIslands (
00621 int id,
00622 INT32 hullnum,
00623 INT32 start,
00624 INT32 num,
00625 INT32 *islands
00626 );
00627
00628
00629 RVCAPPLIBEXPORT int MfReadTINNode (
00630 int id,
00631 INT32 num,
00632 RVCTINNODE *hdr,
00633 INT32 *numedges
00634 );
00635
00636
00637
00638 RVCAPPLIBEXPORT INT32 MfReadTINNodeEdges (
00639 int id,
00640 INT32 node,
00641 INT32 start,
00642 INT32 num,
00643 INT32 *edges
00644 );
00645
00646
00647
00648
00649 RVCAPPLIBEXPORT INT32 MfReadTINNodeEdgesExt (
00650 int id,
00651 INT32 node,
00652 INT32 **edges,
00653 INT32 MaxItems
00654 );
00655
00656
00657 RVCAPPLIBEXPORT int MfReadTINTriangle (
00658 int id,
00659 INT32 num,
00660 RVCTINTRIANGLE *hdr
00661 );
00662
00663
00664 RVCAPPLIBEXPORT int MfResizeTIN (
00665 int id,
00666 INT32 nodes,
00667 INT32 edges,
00668 INT32 triangles,
00669 INT32 hulls
00670 );
00671
00672
00673 RVCAPPLIBEXPORT int MfSwapTINHullEdges (
00674 int ohandle,
00675 INT32 hullnum1,
00676 INT32 hullnum2
00677 );
00678
00679
00680 RVCAPPLIBEXPORT int MfSwapTINNodeEdges (
00681 int ohandle,
00682 INT32 node1,
00683 INT32 node2
00684 );
00685
00686
00687 RVCLOWLIBEXPORT ERRVALUE MfTINCallbackAdd (
00688 int fhandle,
00689 MfCallbackFunc func,
00690 void *data,
00691 UINT32 reason
00692 );
00693
00694
00695 RVCLOWLIBEXPORT ERRVALUE MfTINCallbackRemove (
00696 int fhandle,
00697 MfCallbackFunc func,
00698 void *data,
00699 UINT32 reason
00700 );
00701
00702
00703 RVCAPPLIBEXPORT ERRVALUE MfTINGetExtents (
00704 int id,
00705 DRECT3D& Extents
00706 );
00707
00708
00709
00710
00711 RVCAPPLIBEXPORT INT32 MfTINGetNumEdges (
00712 int id
00713 );
00714
00715
00716
00717
00718 RVCAPPLIBEXPORT INT32 MfTINGetNumHulls (
00719 int id
00720 );
00721
00722
00723
00724
00725 RVCAPPLIBEXPORT INT32 MfTINGetNumNodes (
00726 int id
00727 );
00728
00729
00730
00731
00732 RVCAPPLIBEXPORT INT32 MfTINGetNumTriangles (
00733 int id
00734 );
00735
00736
00737 RVCAPPLIBEXPORT ERRVALUE MfTINSetExtents (
00738 int id,
00739 const DRECT3D& Extents
00740 );
00741
00742
00743 RVCAPPLIBEXPORT ERRVALUE MfTINUpdateExtents (
00744 int id,
00745 const DRECT3D& Extents
00746 );
00747
00748
00749 RVCAPPLIBEXPORT int MfWriteTINEdge (
00750 int id,
00751 INT32 num,
00752 const RVCTINEDGE *hdr
00753 );
00754
00755
00756 RVCAPPLIBEXPORT int MfWriteTINHull (
00757 int id,
00758 INT32 num,
00759 const RVCTINHULL *hdr
00760 );
00761
00762
00763 RVCAPPLIBEXPORT INT32 MfWriteTINHullEdges (
00764 int id,
00765 INT32 hullnum,
00766 INT32 total,
00767 INT32 start,
00768 INT32 num,
00769 const RVCTINHULLEDGE *edges
00770 );
00771
00772
00773 RVCAPPLIBEXPORT INT32 MfWriteTINHullIslands (
00774 int id,
00775 INT32 hullnum,
00776 INT32 total,
00777 INT32 start,
00778 INT32 num,
00779 const INT32 *islands
00780 );
00781
00782
00783 RVCAPPLIBEXPORT int MfWriteTINNode (
00784 int id,
00785 INT32 num,
00786 const RVCTINNODE *hdr
00787 );
00788
00789
00790 RVCAPPLIBEXPORT INT32 MfWriteTINNodeEdges (
00791 int id,
00792 INT32 node,
00793 INT32 total,
00794 INT32 start,
00795 INT32 num,
00796 const INT32 *edges
00797 );
00798
00799
00800 RVCAPPLIBEXPORT int MfWriteTINTriangle (
00801 int id,
00802 INT32 num,
00803 const RVCTINTRIANGLE *hdr
00804 );
00805
00806
00807
00808
00809 int PointInTINTriangle (
00810 int ohandle,
00811 INT32 TriangleNum,
00812 double xcheck,
00813 double ycheck
00814 );
00815
00816
00817
00818
00819
00820
00821 int ComputeTriangleContours (
00822 RVCTINNODE *A,
00823 RVCTINNODE *B,
00824 RVCTINNODE *C,
00825 DOUBLE start,
00826 DOUBLE end,
00827 DOUBLE interval,
00828 DPOLYLINE3D **Contours
00829 );
00830
00831
00832
00833
00834 int ComputeTriangleContoursExt (
00835 RVCTINNODE *A,
00836 RVCTINNODE *B,
00837 RVCTINNODE *C,
00838 DOUBLE start,
00839 DOUBLE end,
00840 DOUBLE interval,
00841 void (*CBfunc)(DPOLYLINE3D*, void*),
00842 void *userdata
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
00855