vector.h

Go to the documentation of this file.
00001 /**
00002  * \file rvc/vector.h 
00003  * \brief interface for the RVC::VECTOR class.
00004  *
00005  * \if NODOC
00006  * $Id: vector.h_v 1.106 2004/11/10 21:37:23 scowan Exp $
00007  *
00008  * $Log: vector.h_v $
00009  * Revision 1.106  2004/11/10 21:37:23  scowan
00010  * Added threshold parms to is equiv methods.
00011  *
00012  * Revision 1.105  2004/10/27 21:15:41  scowan
00013  * Added new private method to read label baseline.
00014  *
00015  * Revision 1.104  2004/09/08 17:06:50  scowan
00016  * No real change.
00017  *
00018  * Revision 1.103  2004/08/24 22:26:27  scowan
00019  * Added virtual methods to get and set total line length.
00020  *
00021  * Revision 1.102  2004/07/19 17:03:22  scowan
00022  *  Moved has min elem filter to geometric class.
00023  *
00024  * Revision 1.101  2004/07/14 21:13:40  scowan
00025  * Removed legacy forward declaration.
00026  *
00027  * Revision 1.100  2004/07/12 23:21:44  scowan
00028  * Removed use of geo region.
00029  *
00030  * Revision 1.99  2004/06/01 22:25:01  scowan
00031  * Added cad and region extract to methods.
00032  *
00033  * Revision 1.98  2004/05/28 20:35:48  scowan
00034  * Added new virtual method override.
00035  *
00036  * Revision 1.97  2004/03/20 18:24:13  scowan
00037  *  Added find closest elements override.
00038  *
00039  * Revision 1.96  2004/03/17 21:31:34  scowan
00040  * Added new label get extents method.
00041  *
00042  * Revision 1.95  2004/03/01 17:49:31  scowan
00043  * Added docs.
00044  *
00045  * Revision 1.94  2004/02/23 20:06:48  scowan
00046  * Make get obj filter derived class inherit publically.
00047  *
00048  * Revision 1.93  2004/02/10 23:12:57  scowan
00049  * Added makeparm ctor.
00050  *
00051  * Revision 1.92  2004/02/10 17:00:02  scowan
00052  * Added two new add methods.
00053  *
00054  * Revision 1.91  2004/02/06 21:54:34  scowan
00055  * Fixed warning.
00056  *
00057  * Revision 1.90  2004/01/08 22:53:30  scowan
00058  * Fixed op enum issue.
00059  *
00060  * Revision 1.89  2003/12/04 21:18:08  scowan
00061  * Added compare helper methods.
00062  *
00063  * Revision 1.88  2003/11/25 17:14:14  scowan
00064  * Added method to equate two vector objects..
00065  *
00066  * Revision 1.87  2003/11/21 22:17:12  scowan
00067  * Support new Capabilities system.
00068  *
00069  * Revision 1.86  2003/10/21 21:59:30  scowan
00070  * Added more filters.
00071  *
00072  * Revision 1.85  2003/10/10 23:01:05  scowan
00073  * Added filter.
00074  *
00075  * Revision 1.84  2003/10/07 19:43:43  scowan
00076  * nc.
00077  *
00078  * Revision 1.83  2003/10/07 17:30:04  scowan
00079  * Object virtual method changes.
00080  *
00081  * Revision 1.82  2003/09/30 16:52:06  dwilliss
00082  * Doxygen
00083  *
00084  * Revision 1.81  2003/09/25 21:20:04  dwilliss
00085  * Fixed doxygen comment
00086  *
00087  * Revision 1.80  2003/09/15 13:49:45  fileserver!dwilliss
00088  * Doxygen
00089  *
00090  * Revision 1.79  2003/08/27 21:26:25  scowan
00091  * Uses new rvc vector class interface and handle.
00092  *
00093  * Revision 1.78  2003/06/19 17:46:22  scowan
00094  * Added virtual method.
00095  *
00096  * Revision 1.77  2003/06/04 23:35:19  scowan
00097  * Added find element draw set.
00098  *
00099  * Revision 1.76  2003/05/12 23:33:25  scowan
00100  * Changes to virtual methods.
00101  *
00102  * Revision 1.75  2003/05/07 22:20:55  scowan
00103  * Changed virtual method format.
00104  *
00105  * Revision 1.74  2003/03/11 21:38:17  scowan
00106  * Changed label get extents to use 3d rect.
00107  *
00108  * Revision 1.73  2003/03/04 21:04:44  scowan
00109  * Changed to default to no element ID tables.
00110  *
00111  * Revision 1.72  2003/02/19 20:14:05  scowan
00112  * Something, I do not know what.
00113  *
00114  * Revision 1.71  2003/02/11 00:06:27  scowan
00115  * More const.
00116  *
00117  * Revision 1.70  2003/01/16 23:00:53  scowan
00118  * Added bool value to the class.
00119  *
00120  * Revision 1.69  2002/12/23 20:30:28  scowan
00121  * *** empty log message ***
00122  *
00123  * Revision 1.68  2002/11/07 16:58:32  scowan
00124  * Added optimize to method.
00125  *
00126  * Revision 1.67  2002/10/29 16:57:25  scowan
00127  * Changed method name.
00128  *
00129  * Revision 1.66  2002/10/23 14:56:56  scowan
00130  * Re-enable subregion and region reading code.
00131  *
00132  * Revision 1.65  2002/10/18 14:29:02  scowan
00133  * Comment out region code until I get it working again.
00134  *
00135  * Revision 1.64  2002/10/18 13:48:04  scowan
00136  * Damn mac compiler..
00137  *
00138  * Revision 1.63  2002/10/11 16:59:50  scowan
00139  * Uses bitset unwoned for read region.
00140  *
00141  * Revision 1.62  2002/10/11 16:45:12  scowan
00142  * Added read subregion and region.
00143  *
00144  * Revision 1.61  2002/10/07 23:23:27  scowan
00145  * Added another field.
00146  *
00147  * Revision 1.60  2002/10/07 17:39:55  scowan
00148  * More comment changes.
00149  *
00150  * Revision 1.59  2002/10/07 15:55:25  scowan
00151  * Fixed docs.
00152  *
00153  * Revision 1.58  2002/10/04 21:18:29  scowan
00154  * Added elem iterator decrement operator.
00155  * Added protected methods.
00156  *
00157  * Revision 1.57  2002/10/01 22:43:44  scowan
00158  * Another protected metod.
00159  *
00160  * Revision 1.56  2002/10/01 21:37:01  scowan
00161  * Added protected method.
00162  *
00163  * Revision 1.55  2002/09/30 23:22:12  scowan
00164  * Made element search code const.
00165  *
00166  * Revision 1.54  2002/09/18 15:41:05  scowan
00167  * Added clip polygon method.
00168  *
00169  * Revision 1.53  2002/09/18 14:31:52  scowan
00170  * Added comments.
00171  *
00172  * Revision 1.52  2002/09/17 22:49:03  scowan
00173  * More virtual method adjustment.
00174  *
00175  * Revision 1.51  2002/09/03 22:18:24  scowan
00176  * More virtual method moves.
00177  *
00178  * Revision 1.50  2002/08/29 22:13:16  scowan
00179  * Virtual metho adjustment.
00180  *
00181  * Revision 1.49  2002/08/19 15:09:11  scowan
00182  * Added finding text style object method.
00183  *
00184  * Revision 1.48  2002/06/21 15:14:43  scowan
00185  * SOme const changes.
00186  *
00187  * Revision 1.47  2002/06/21 14:46:08  scowan
00188  * Transfer node attributes correctly.
00189  *
00190  * Revision 1.46  2002/06/19 22:24:05  scowan
00191  * More method changes.
00192  *
00193  * Revision 1.45  2002/06/19 14:55:50  scowan
00194  * Made more methods const.
00195  *
00196  * Revision 1.44  2002/06/18 22:15:16  scowan
00197  * Added extract interface.
00198  *
00199  * Revision 1.43  2002/05/01 17:43:25  scowan
00200  * Added prototype.
00201  *
00202  * Revision 1.42  2002/04/30 22:30:52  scowan
00203  * Added max label method.
00204  *
00205  * Revision 1.41  2002/04/30 17:34:02  scowan
00206  * Change base make parm class name.
00207  *
00208  * Revision 1.40  2002/04/30 14:03:04  scowan
00209  * More const.
00210  *
00211  * Revision 1.39  2002/04/26 22:45:01  scowan
00212  * Added more virtual methods.
00213  *
00214  * Revision 1.38  2002/03/13 23:28:28  scowan
00215  * Added label to not be attached to elements, according to Merri.
00216  *
00217  * Revision 1.37  2002/03/01 16:19:16  scowan
00218  * Added virtual methods.
00219  *
00220  * Revision 1.36  2002/02/27 23:24:34  scowan
00221  * Added get element extents methods.
00222  *
00223  * Revision 1.35  2002/02/27 16:55:09  scowan
00224  * Added Add method for leader lines.
00225  *
00226  * Revision 1.34  2002/02/07 14:57:21  scowan
00227  * Added style index method.
00228  *
00229  * Revision 1.33  2002/02/04 20:58:27  scowan
00230  * Added conglomerate line reader.
00231  *
00232  * Revision 1.32  2002/01/08 17:52:14  scowan
00233  * Added template makeparm constructor.
00234  *
00235  * Revision 1.31  2002/01/08 17:01:46  scowan
00236  * Removed rvc prefix for nested classes while in rvc namespace.
00237  *
00238  * Revision 1.30  2002/01/03 23:01:17  scowan
00239  * Added mnethods for labels and extents.
00240  * Moved classes around for genator docs.
00241  *
00242  * Revision 1.29  2001/10/08 20:49:47  scowan
00243  * Added element region method.
00244  *
00245  * Revision 1.28  2001/10/02 14:43:16  scowan
00246  * Disable error position code when iterating.
00247  *
00248  * Revision 1.27  2001/09/28 15:01:39  scowan
00249  * Added extents settings to the makeparm class.
00250  *
00251  * Revision 1.26  2001/09/27 21:43:28  scowan
00252  * Finish adding flags.
00253  *
00254  * Revision 1.25  2001/09/27 21:40:47  scowan
00255  * *** empty log message ***
00256  *
00257  * Revision 1.24  2001/09/27 21:39:29  scowan
00258  * Updated with vector flags.
00259  *
00260  * Revision 1.23  2001/09/06 22:16:26  scowan
00261  * *** empty log message ***
00262  *
00263  * Revision 1.22  2001/07/31 16:40:31  scowan
00264  * Added new interface methods.
00265  *
00266  * Revision 1.21  2001/07/16 16:46:26  scowan
00267  * Added generate island shell list.
00268  *
00269  * Revision 1.20  2001/06/21 16:30:09  scowan
00270  * Added methods to get and saet label description.;
00271  *
00272  * Revision 1.19  2001/06/18 15:48:01  scowan
00273  * Added more settings for MAKEPARMS class.
00274  *
00275  * Revision 1.18  2001/06/14 16:08:11  scowan
00276  * Changed source type.
00277  *
00278  * Revision 1.17  2001/06/13 22:24:13  scowan
00279  * Added to RVC namespace.
00280  *
00281  * Revision 1.16  2001/06/13 15:14:38  scowan
00282  * Changed objtype enum.
00283  * New make method.
00284  *
00285  * Revision 1.15  2001/06/12 15:40:31  scowan
00286  * Added comments.
00287  *
00288  * Revision 1.14  2001/06/05 15:12:28  scowan
00289  * Added typedef for label leader line lists.
00290  *
00291  * Revision 1.13  2001/06/01 14:35:15  scowan
00292  * Added point in polygon method.
00293  *
00294  * Revision 1.12  2001/05/25 19:26:12  scowan
00295  * *** empty log message ***
00296  *
00297  * Revision 1.11  2001/05/24 17:37:27  scowan
00298  * Added virtual methods for finding objects.
00299  *
00300  * Revision 1.10  2001/04/23 22:52:16  scowan
00301  * Added find closest methods.
00302  *
00303  * Revision 1.9  2001/04/23 17:46:06  scowan
00304  * Added update extents.
00305  *
00306  * Revision 1.8  2001/04/23 15:23:48  scowan
00307  * Added set element id valie methods.
00308  *
00309  * Revision 1.7  2001/04/20 16:29:51  scowan
00310  * Add methods for vector flags.
00311  *
00312  * Revision 1.6  2000/12/01 16:00:22  scowan
00313  * Fixed MAC errors.
00314  *
00315  * Revision 1.5  2000/11/29 15:29:43  scowan
00316  * Added more methods.
00317  *
00318  * Revision 1.4  2000/11/24 22:53:43  scowan
00319  * Added set extents virtual method.
00320  *
00321  * Revision 1.3  2000/11/24 21:08:30  scowan
00322  * Added method to read vector label header style link information.
00323  *
00324  * Revision 1.2  2000/10/19 21:17:55  scowan
00325  * Checked in for vacation.
00326  *
00327  * Revision 1.1  2000/10/02 17:40:07  scowan
00328  * Initial revision
00329  *
00330  * \endif
00331 **/
00332 
00333 //!   \class RVC::VECTOR rvc/vector.h
00334 //!   \brief Manages RVC::OBJTYPE_Vector RVC objects.  
00335 //!   The interface currently wraps the MfVector functions.
00336 //!   
00337 //!   RVC Object Types that this class supports: RVC::OBJTYPE_Vector.
00338 //!
00339 //!   Default RVC Object Type for this class: RVC::OBJTYPE_Vector.
00340 //!
00341 //!   Valid parents for this class:
00342 //!      - RVC::OBJTYPE_File
00343 //!      - RVC::OBJTYPE_Folder
00344 
00345 #ifndef INC_RVC_VECTOR_H
00346 #define INC_RVC_VECTOR_H
00347 
00348 #ifndef INC_RVC_GEOMETRC_H
00349    #include <rvc/geometrc.h>
00350 #endif
00351 
00352 #ifndef INC_MI32_RVCVECT_H
00353    #include <mi32/rvcvect.h>
00354 #endif
00355 
00356 #ifndef INC_MI32_SIMPLEAR_H
00357    #include <mi32/simplear.h>
00358 #endif
00359 
00360 #ifndef INC_MI32_DOUBLEAR_H
00361    #include <mi32/doublear.h>
00362 #endif
00363 
00364 #ifndef INC_MI32_POLYLINE_H
00365    #include <mi32/polyline.h>
00366 #endif
00367 
00368 #ifndef INC_MI32_MILIST_H
00369    #include <mi32/milist.h>
00370 #endif
00371 
00372 // Forward Declarations
00373 class BITSET_UNOWNED;
00374 class REGION2D;
00375 class SUBREGION2D;
00376 class TRANS2D_MAPGEN;
00377 
00378 namespace RVC {
00379 
00380 // Forward Declarations
00381 class SPATIALTREE;
00382 class STYLE;
00383 class VECTORHANDLE;
00384 class DBASE_ELEMENT;
00385 
00386 class VECTOR : public GEOMETRIC {
00387    public:
00388 
00389       enum FLAGS {
00390          FLAG_None = 0,
00391          FLAG_NoStdAttribTables = 0x0001,
00392          FLAG_NoElementIDTables = 0x0002,
00393          FLAG_CannotReduceExtents = 0x0004,
00394          FLAG_CannotExpandExtents = 0x0008
00395          };
00396 
00397       enum TOPOLOGYTYPE {
00398          TOPOLOGYTYPE_Polygonal = 0,      //!< Vector object has polygons and full polygon-line-node topology
00399          TOPOLOGYTYPE_Planar,          //!< Vector object has no polygons and full line-node topology
00400          TOPOLOGYTYPE_Network,         //!< Vector object has no polygons and connected line-node topology
00401          TOPOLOGYTYPE_None          //!< Vector object has no topology, lines only
00402          };
00403 
00404       enum SUBTYPE {
00405          SUBTYPE_2DPolygonal = 0,
00406          SUBTYPE_2DPlanar,
00407          SUBTYPE_2DNetwork,
00408          SUBTYPE_3DPolygonal,
00409          SUBTYPE_3DPlanar,
00410          SUBTYPE_3DNetwork,
00411          SUBTYPE_3DNone
00412          };
00413 
00414       #ifndef GENERATING_DOXYGEN_OUTPUT
00415       class CONGLOMERATELINEFILTER;
00416       class GETOBJFILTER_HASGEOMETRICELEMENTS;
00417       class GETOBJFILTER_HASLABELS;
00418       class GETOBJFILTER_HASLINES;
00419       class GETOBJFILTER_HASPOINTS;
00420       class GETOBJFILTER_HASPOLYGONS;
00421       class LABEL;
00422       class MAKEPARMS;
00423       #endif // GENERATING_DOXYGEN_OUTPUT
00424 
00425       //! Constant iterator class
00426       //!
00427       //! This class is used to iterate through a vector objects elements
00428       //! See methods ElementBegin() and ElementEnd() for obtaining an element iterator
00429       template <class _ELEM>  
00430       class ELEMITERATOR {
00431          public:
00432 
00433             //! Default constructor
00434             ELEMITERATOR (
00435                ) : 
00436                m_ElemNum(-1),
00437                m_CurrentObj(0)
00438                {}
00439 
00440             //! Idiot constructor for G++
00441             ELEMITERATOR (
00442                int WorthlessValue
00443                ) : 
00444                m_ElemNum(-1),
00445                m_CurrentObj(0)
00446                {}
00447 
00448             //! Internal constructor used by ElementEnd() methods
00449             ELEMITERATOR (
00450                const RVC::VECTOR* vector,
00451                INT32 ElemNum
00452                ) : 
00453                m_ElemNum(ElemNum),
00454                m_CurrentObj(vector)
00455                {}
00456 
00457             //! Copy constructor
00458             ELEMITERATOR (
00459                const ELEMITERATOR<_ELEM>& rhs
00460                ) : 
00461                m_ElemNum(rhs.m_ElemNum),
00462                m_CurrentObj(rhs.m_CurrentObj),
00463                m_Element(rhs.m_Element)
00464                {}
00465 
00466             //! Internal constructor used by ElementBegin() methods
00467             ELEMITERATOR (
00468                const RVC::VECTOR* vector
00469                ) :
00470                m_ElemNum(-1),
00471                m_CurrentObj(vector)
00472                {
00473                ERRVALUE err = 0;
00474                do {           //! Scan to the first valid element
00475                   m_ElemNum ++;
00476                   ERRORPOSNDISABLE disable;
00477                   err = m_CurrentObj->Read(m_ElemNum, m_Element);
00478                   if (err < 0) m_ElemNum = -1;
00479                   } while (err >= 0 && !m_Element.IsValid());
00480                }
00481 
00482             //! Destructor
00483             virtual ~ELEMITERATOR (
00484                ) {}
00485 
00486             //! Assignment
00487             ELEMITERATOR<_ELEM>& operator= (
00488                const ELEMITERATOR<_ELEM>& rhs
00489                ) {
00490                if (this != &rhs) {
00491                   m_ElemNum = rhs.m_ElemNum;
00492                   m_CurrentObj = rhs.m_CurrentObj;
00493                   m_Element = rhs.m_Element;    //!< If LABEL, this can be expensive, so check first
00494                   }
00495                return (*this);
00496                }
00497 
00498             //! Dereference
00499             const _ELEM& operator* (
00500                ) const { return (m_Element); }
00501 
00502             //! Dereference arrow
00503             const _ELEM* operator-> (
00504                ) const { return (&**this); }
00505 
00506             //! Pre-increment
00507             ELEMITERATOR<_ELEM>& operator++ (
00508                ) {
00509                ERRVALUE err = 0;
00510                do {           //! Scan to the next valid element
00511                   m_ElemNum ++;
00512                   ERRORPOSNDISABLE disable;
00513                   err = m_CurrentObj->Read(m_ElemNum, m_Element);
00514                   if (err < 0) m_ElemNum = -1;
00515                   } while (err >= 0 && !m_Element.IsValid());
00516                return (*this);
00517                }        
00518 
00519             //! Pre-decrement
00520             ELEMITERATOR<_ELEM>& operator-- (
00521                ) {
00522                if (m_ElemNum < 0) return (*this);
00523                ERRVALUE err = 0;
00524                do {           //! Scan to the next valid element
00525                   m_ElemNum --;
00526                   ERRORPOSNDISABLE disable;
00527                   err = m_CurrentObj->Read(m_ElemNum, m_Element);
00528                   if (err < 0) m_ElemNum = -1;
00529                   } while (err >= 0 && !m_Element.IsValid());
00530                return (*this);
00531                }        
00532 
00533             //! Comparison for equality
00534             bool operator== (
00535                const ELEMITERATOR<_ELEM>& rhs
00536                ) const { return (m_ElemNum == rhs.m_ElemNum && m_CurrentObj == rhs.m_CurrentObj); }
00537 
00538             //! Comparison for inequality
00539             bool operator!= (
00540                const ELEMITERATOR<_ELEM>& rhs
00541                ) const { return (!(*this == rhs)); }
00542                
00543             INT32 GetElementNumber (
00544                ) const { return (m_ElemNum); }
00545 
00546          protected:
00547             INT32 m_ElemNum;
00548             const VECTOR *m_CurrentObj;
00549             _ELEM m_Element;
00550          };
00551 
00552       typedef ELEMITERATOR<LABEL> LABELITERATOR;
00553       typedef ELEMITERATOR<RVCVECTLINE> LINEITERATOR;
00554       typedef ELEMITERATOR<RVCVECTNODE> NODEITERATOR;
00555       typedef ELEMITERATOR<RVCVECTPOINT> POINTITERATOR;
00556       typedef ELEMITERATOR<RVCVECTPOLY> POLYGONITERATOR;
00557       
00558       //! Default constructor
00559       VECTOR (
00560          );
00561 
00562       //! Copy constructor
00563       VECTOR (
00564          const RVC::VECTOR& rhs
00565          );
00566 
00567       //! Destructor
00568       virtual ~VECTOR (
00569          );
00570 
00571       //! Assignment, will close and re-open object if possible
00572       RVC::VECTOR& operator= (
00573          const RVC::VECTOR& rhs
00574          );
00575 
00576       //! Add a label to the vector object
00577       //! @return Number of the added label element or < 0 if error
00578       INT32 Add (
00579          LABEL& label
00580          );
00581 
00582       //! Add a line to the vector object
00583       //! @return Number of the added line element or < 0 if error
00584       INT32 Add (
00585          const RVCVECTLINE& line
00586          );
00587 
00588       //! Add a node to the vector object
00589       //! @return Number of the added node element or < 0 if error
00590       INT32 Add (
00591          const RVCVECTNODE& node
00592          );
00593 
00594       //! Add a point to the vector object
00595       //! @return Number of the added point element or < 0 if error
00596       INT32 Add (
00597          const RVCVECTPOINT& point
00598          );
00599 
00600       //! Add a polygon to the vector object
00601       //! @return Number of the added polygon element or < 0 if error
00602       INT32 Add (
00603          const RVCVECTPOLY& polygon
00604          );
00605          
00606       //! Add a line to the vector object from a POLYLINE
00607       //! Will correctly set the RVCVECTLINE and update the extents of the vector
00608       //! Will not add nodes nor correct topology
00609       //! @return Number of the added line element or < 0 if error
00610       INT32 AddLine (
00611          const POLYLINE& PolyLine
00612          );
00613          
00614       //! Add a polygon to the vector object
00615       //! Will correctly set the RVCVECTPOLY and update the extents of the vector
00616       //! Will add the line and set RVCVECTLINE correctly
00617       //! Will not add nodes nor correct topology
00618       //! 'PolyLine' element MUST be closed, or an error is returned
00619       //! @return Number of the added polygon element or < 0 if error
00620       INT32 AddPolygon (
00621          const POLYLINE& Polygon
00622          );
00623          
00624       //! Mark an element as deleted
00625       ERRVALUE DeleteElement (
00626          ELEMTYPE ElemType,
00627          INT32 ElemNum
00628          );
00629          
00630       //! Obtain an element iterator to the beginning of the element list
00631       template <class _ELEM> ELEMITERATOR<_ELEM> ElementBegin (
00632          ELEMITERATOR<_ELEM> item
00633          ) const {
00634          return (ELEMITERATOR<_ELEM>(this));
00635          }
00636 
00637       //! Obtain an element iterator to the end of the element list
00638       template <class _ELEM> ELEMITERATOR<_ELEM> ElementEnd (
00639          ELEMITERATOR<_ELEM> item
00640          ) const {
00641          return (ELEMITERATOR<_ELEM>(this, -1));
00642          }
00643 
00644       //! Locate label style object referenced by 'this'
00645       //! 'StyleObj' will be attached if one is found, unattached if not
00646       ERRVALUE FindLabelStyleObject (
00647          RVC::STYLE& StyleObj
00648          ) const;
00649 
00650       //! Generate the list of islend shell lines for a specific polygon
00651       ERRVALUE GenerateIsleShellList (
00652          INT32 ParentPolygon,                //!< Parent polygon, -1 for external polygon shell list
00653          ORIENTATION orient,
00654          SIMPLE_ARRAY<INT32>& NumShellLines,
00655          SIMPLE_ARRAY<INT32>& ShellList,
00656          SIMPLE_ARRAY<DRECT2D>* RectList = 0
00657          ) const;
00658       
00659       //! Generate a point inside of a polygon     
00660       ERRVALUE GeneratePointInPolygon (
00661          INT32 PolyNum,
00662          DPOINT2D& PointInPoly
00663          ) const;
00664          
00665       //! Get vector object flags
00666       //! @return VECTOR::FLAGS
00667       RVC::VECTOR::FLAGS GetFlags (
00668          ) const;
00669 
00670       //! Obtain style object refered to by the label header
00671       ERRVALUE GetLabelStyleInfo (
00672          FILEPATH& filepath, 
00673          RVC::OBJECTNAME& StyleName
00674          ) const;
00675 
00676       //! Get MAKEPARM values from current vector object instance       
00677       ERRVALUE GetMakeParms (
00678          RVC::VECTOR::MAKEPARMS& MakeParms
00679          ) const;
00680          
00681       //! Obtain maximum number of islands in a polygon
00682       //! @return Maximum number of islands
00683       INT32 GetMaxIslands (
00684          ) const;
00685 
00686       //! Obtain maximum length of a label string
00687       //! @return Maximum length of a label string
00688       INT32 GetMaxLabelStringLength (
00689          ) const;
00690 
00691       //! Obtain maximum number of lines in a polygon or node line list
00692       //! @return Maximum number of lines
00693       INT32 GetMaxLines (
00694          ) const;
00695 
00696       //! Obtain the maximum number of points a line has
00697       //! @return Maximum number of points in a line
00698       INT32 GetMaxPoints (
00699          ) const;
00700 
00701       //! Obtain next available line ID for line ID table
00702       //! @return Next available line ID
00703       INT32 GetNextLineID (
00704          ) const;
00705 
00706       //! Obtain next available point ID for point ID table
00707       //! @return Next available point ID
00708       INT32 GetNextPointID (
00709          ) const;
00710 
00711       //! Obtain next available polygon ID for polygon ID table
00712       //! @return Next available polygon ID
00713       INT32 GetNextPolygonID (
00714          ) const;
00715 
00716       //! Obtain number of labels in the vector object
00717       //! @return Number of labels
00718       INT32 GetNumLabels (
00719          ) const;
00720 
00721       //! Obtain number of points in a line
00722       //! @return Number of line points
00723       INT32 GetNumLinePoints (
00724          INT32 LineNum
00725          ) const;
00726 
00727       //! Obtain number of lines in the vector object
00728       //! @return Number of lines
00729       INT32 GetNumLines (
00730          ) const;
00731 
00732       //! Obtain number of lines in a node
00733       //! @return Number of node lines
00734       INT32 GetNumNodeLines (
00735          INT32 NodeNum
00736          ) const;
00737 
00738       //! Obtain number of nodes in the vector object
00739       //! @return Number of nodes
00740       INT32 GetNumNodes (
00741          ) const;
00742 
00743       //! Obtain number of points in the vector object
00744       //! @return Number of points
00745       INT32 GetNumPoints (
00746          ) const;
00747 
00748       //! Obtain number of polygons in the vector object
00749       //! @return Number of polygons
00750       INT32 GetNumPolygons (
00751          ) const;
00752 
00753       //! Obtain number of islands in a polygon
00754       //! @return Number of polygon islands
00755       INT32 GetNumPolyIslands (
00756          INT32 PolyNum
00757          ) const;
00758 
00759       //! Obtain number of lines in a polygon
00760       //! @return Number of polygon lines
00761       INT32 GetNumPolyLines (
00762          INT32 PolyNum
00763          ) const;
00764 
00765       //! Obtain vector sub-type
00766       //! @return Vector object subtype
00767       SUBTYPE GetSubType (
00768          ) const;
00769 
00770       //! Obtain vector topology type for vector
00771       //! @return vector RVC::VECTOR::TOPOLOGYTYPE
00772       TOPOLOGYTYPE GetTopologyType (
00773          ) const;
00774 
00775       //! Obtain limit on the maximum number of vertices a line can have
00776       //! @return Maximum number of verticies
00777       INT32 GetVertexLimit (
00778          ) const;
00779 
00780       //! Determine if we are able to generate element ID tables for the vector object
00781       bool IsElementIDTablesValid (
00782          ) const;
00783 
00784       //! Determine if the two vector objects are equivalent 
00785       //! This method uses "Fuzzy" vertex comparisons and the direction and order of the elements are not relevant
00786       //! @return 'True' if they are, 'False' if not
00787       bool IsEquivalentTo (
00788          const VECTOR& rhs,
00789          double threshold
00790          ) const;
00791 
00792       //! Is this point inside the vector polygon specified    
00793       bool IsPointInPolygon (
00794          INT32 PolyNum,
00795          const DPOINT2D& point
00796          ) const;
00797          
00798       //! Determine if we are able to generate standard attribute tables for the vector object
00799       bool IsStdAttribTablesValid (
00800          ) const;
00801       
00802       //! Create new vector object given parent object, name, description, creation parameters, and source
00803       ERRVALUE Make (
00804          const RVC::OBJECT& parent,
00805          const RVC::OBJECTNAME& name,
00806          const RVC::OBJECTDESC& desc,
00807          const MAKEPARMS& MakeParms,
00808          const char* Source = 0
00809          );
00810       
00811       //! Create new vector object given parent object, name, description, creation parameters, and source
00812       ERRVALUE Make (
00813          const RVC::OBJITEM& ObjItem,
00814          const MAKEPARMS& MakeParms,
00815          const char* Source = 0
00816          );
00817          
00818       //! Optimize vector object
00819       ERRVALUE OptimizeTo (
00820          RVC::OBJECT& DestParentObj,         //!< Parent object to optimize vector object and copy children to
00821          RVC::VECTOR& DestVectObj            //!< Destination vector object RETURNED
00822          );
00823       
00824       //! Read a vector label given a label number
00825       ERRVALUE Read (
00826          INT32 LabelNum,
00827          LABEL& vlabel
00828          ) const;
00829 
00830       //! Read a vector line header given a line number
00831       ERRVALUE Read (
00832          INT32 LineNum,
00833          RVCVECTLINE& vline
00834          ) const;
00835 
00836       //! Read a vector node given a node number
00837       ERRVALUE Read (
00838          INT32 NodeNum,
00839          RVCVECTNODE& vnode
00840          ) const;
00841 
00842       //! Read a vector point given a point number
00843       ERRVALUE Read (
00844          INT32 PointNum,
00845          RVCVECTPOINT& vpoint
00846          ) const;
00847 
00848       //! Read a vector polygon given a polygon number
00849       ERRVALUE Read (
00850          INT32 PolyNum,
00851          RVCVECTPOLY& vpoly
00852          ) const;
00853          
00854       ERRVALUE ReadConglomerateLinePoints (
00855          INT32 StartLineNum,
00856          POLYLINE& ConglomerateLine,
00857          CONGLOMERATELINEFILTER& filter
00858          ) const;
00859          
00860       //! Read a vector line point
00861       ERRVALUE ReadLinePoint (
00862          INT32 LineNum,
00863          INT32 PointNum,
00864          DPOINT3D& point
00865          ) const;
00866 
00867       //! Read a vector line point list using the vector POINTYPE into a POLYLINE
00868       //! The DIMENSION of the POLYLINE will be set to the DIMENSION of the vector object
00869       //! @return Number of points read or error if < 0
00870       INT32 ReadLinePoints (
00871          INT32 LineNum,
00872          POLYLINE& LinePoints
00873          ) const;
00874 
00875       //! Read a vector line point list using the vector POINTYPE into a POLYLINE
00876       //! Define 'dimension' to get 2D or 3D lines
00877       //! @return Number of points read or error if < 0
00878       INT32 ReadLinePoints (
00879          INT32 LineNum,
00880          POLYLINE& LinePoints,
00881          DIMENSION dimension
00882          ) const;
00883 
00884       //! Read a partial vector line point list into a POLYLINE
00885       //! @return Number of points read or error if < 0
00886       INT32 ReadLinePoints (
00887          INT32 LineNum,
00888          INT32 Start,
00889          INT32 Length,
00890          POLYLINE& LinePoints
00891          ) const;
00892 
00893       //! Read a partial vector line point list into a POLYLINE
00894       //! Define 'dimension' to get 2D or 3D lines
00895       //! @return Number of points read or error if < 0
00896       INT32 ReadLinePoints (
00897          INT32 LineNum,
00898          INT32 Start,
00899          INT32 Length,
00900          POLYLINE& LinePoints,
00901          DIMENSION dimension
00902          ) const;
00903 
00904       //! Read a partial vector line point list into a POLYLINE
00905       //! @return Number of points read or error if < 0
00906       INT32 ReadLinePoints (
00907          INT32 LineNum,
00908          INT32 Start,
00909          INT32 Length,
00910          DPOINT2D *pts
00911          ) const;
00912 
00913       //! Read a partial vector line point list into a POLYLINE
00914       //! Will set the "Extents" optimization in the POLYLINE
00915       //! @return Number of points read or error if < 0
00916       INT32 ReadLinePoints (
00917          INT32 LineNum,
00918          INT32 Start,
00919          INT32 Length,
00920          DPOINT3D *pts
00921          ) const;
00922 
00923       //! Read a vector node line list into a SIMPLE_ARRAY<INT32>
00924       ERRVALUE ReadNodeLines (
00925          INT32 NodeNum,
00926          SIMPLE_ARRAY<INT32>& LineList
00927          ) const;
00928 
00929       //! Read a partial vector node line list into a SIMPLE_ARRAY<INT32>
00930       ERRVALUE ReadNodeLines (
00931          INT32 NodeNum,
00932          INT32 Start,
00933          INT32 Length,
00934          SIMPLE_ARRAY<INT32>& LineList
00935          ) const;
00936 
00937       //! Read a vector polygon line list into a SIMPLE_ARRAY<INT32>
00938       ERRVALUE ReadPolyLines (
00939          INT32 PolyNum,
00940          SIMPLE_ARRAY<INT32>& LineList
00941          ) const;
00942 
00943       //! Read a partial vector polygon line list into a SIMPLE_ARRAY<INT32>
00944       ERRVALUE ReadPolyLines (
00945          INT32 PolyNum,
00946          INT32 Start,
00947          INT32 Length,
00948          SIMPLE_ARRAY<INT32>& LineList
00949          ) const;
00950 
00951       //! Read a vector polygon island list into a SIMPLE_ARRAY<INT32>
00952       ERRVALUE ReadPolyIslands (
00953          INT32 PolyNum,
00954          SIMPLE_ARRAY<INT32>& IsleList
00955          ) const;
00956 
00957       //! Read a partial vector polygon island list into a SIMPLE_ARRAY<INT32>
00958       ERRVALUE ReadPolyIslands (
00959          INT32 PolyNum,
00960          INT32 Start,
00961          INT32 Length,
00962          SIMPLE_ARRAY<INT32>& IsleList
00963          ) const;
00964       
00965       //! Read a vector polygon point list using the vector POINTYPE into a POLYLINE
00966       //! Will set the "Extents" and "Orientation" optimizations in the POLYLINE
00967       //! Define 'dimension' to get 2D or 3D lines
00968       ERRVALUE ReadPolyPoints (
00969          INT32 PolyNum,
00970          POLYLINE& LinePoints,
00971          DIMENSION dimension
00972          ) const;
00973 
00974       //! Read a set of vector polygon and possibly its islands into a REGION2D
00975       ERRVALUE ReadRegion (
00976          const BITSET_UNOWNED& PolySet,   //!< Set of polygons to generate region from
00977          REGION2D& Region,                //!< Region to set
00978          DIMENSION dim,
00979          BITSET* LineSet = 0,             //!< Set of lines that made up the region, can be NULL
00980          bool NoIslands = false           //!< 'True' of no islands wanted
00981          ) const;
00982    
00983       //! Read a set of vector polygon and possibly its islands into a REGION2D
00984       ERRVALUE ReadRegion (
00985          const BITSET_UNOWNED& PolySet,   //!< Set of polygons to generate region from
00986          REGION2D& Region,                //!< Region to set
00987          BITSET* LineSet = 0,             //!< Set of lines that made up the region, can be NULL
00988          bool NoIslands = false           //!< 'True' of no islands wanted
00989          ) const;
00990    
00991       //! Read a vector polygon and possibly its islands into a SUBREGION2D
00992       ERRVALUE ReadSubRegion (
00993          INT32 PolyNum,          //!< Polygon to generate region from
00994          SUBREGION2D& SubRegion,
00995          DIMENSION dim,
00996          bool NoIslands = false
00997          ) const;
00998          
00999       //! Read a vector polygon and possibly its islands into a SUBREGION2D
01000       ERRVALUE ReadSubRegion (
01001          INT32 PolyNum,          //!< Polygon to generate region from
01002          SUBREGION2D& SubRegion,
01003          bool NoIslands = false
01004          ) const;
01005          
01006       //! Set vector object flags
01007       ERRVALUE SetFlags (
01008          RVC::VECTOR::FLAGS flags
01009          );
01010 
01011       //! Set style object refered to by the label header
01012       ERRVALUE SetLabelStyleInfo (
01013          const FILEPATH& filepath, 
01014          const RVC::OBJECTNAME& StyleName
01015          );
01016          
01017       //! Set next available line ID for line ID table
01018       ERRVALUE SetNextLineID (
01019          INT32 NewValue
01020          );
01021       
01022       //! Set next available point ID for point ID table
01023       ERRVALUE SetNextPointID (
01024          INT32 NewValue
01025          );
01026       
01027       //! Set next available polygon ID for polygon ID table
01028       ERRVALUE SetNextPolygonID (
01029          INT32 NewValue
01030          );
01031       
01032       //! Set vector object point coordinate type
01033       ERRVALUE SetPointType (
01034          POINTTYPE PointType
01035          );
01036 
01037       //! Set vector topology type
01038       ERRVALUE SetTopologyType (
01039          TOPOLOGYTYPE TopologyType
01040          );
01041             
01042       //! Set vector line vertex limit
01043       ERRVALUE SetVertexLimit (
01044          INT32 MaxVertices
01045          );
01046             
01047       //! Write a vector label given a label number
01048       //! Does not update element nor object extents
01049       ERRVALUE Write (
01050          INT32 LabelNum,
01051          LABEL& vlabel
01052          );
01053 
01054       //! Write a vector line given a line number
01055       //! Does not update element nor object extents
01056       ERRVALUE Write (
01057          INT32 LineNum,
01058          const RVCVECTLINE& vline
01059          );
01060 
01061       //! Write a vector node given a node number
01062       //! Does not update element nor object extents
01063       ERRVALUE Write (
01064          INT32 NodeNum,
01065          const RVCVECTNODE& vnode
01066          );
01067 
01068       //! Write a vector point given a point number
01069       //! Does not update element nor object extents
01070       ERRVALUE Write (
01071          INT32 PointNum,
01072          const RVCVECTPOINT& vpoint
01073          );
01074 
01075       //! Write a vector polygon given a polygon number
01076       //! Does not update element nor object extents
01077       ERRVALUE Write (
01078          INT32 PolyNum,
01079          const RVCVECTPOLY& vpoly
01080          );
01081 
01082       //! Write a vector line point
01083       //! Does not update element nor object extents
01084       ERRVALUE WriteLinePoint (
01085          INT32 LineNum,
01086          INT32 vertex,
01087          const DPOINT3D& point
01088          );
01089 
01090       //! Write a vector line point list
01091       //! Does not update element nor object extents
01092       //! @return Number of line points written or error if < 0
01093       INT32 WriteLinePoints (
01094          INT32 LineNum,
01095          const POLYLINE& PointList
01096          );
01097 
01098       //! Write a partial vector line point list
01099       //! Does not update element nor object extents
01100       //! @return Number of line points written or error if < 0
01101       INT32 WriteLinePoints (
01102          INT32 LineNum,
01103          INT32 Start,
01104          INT32 Length,
01105          const POLYLINE& PointList
01106          );
01107 
01108       //! Write a vector node line list from a SIMPLE_ARRAY<INT32>
01109       //! Does not update element nor object extents
01110       //! @return Number of node lines written or error if < 0
01111       INT32 WriteNodeLines (
01112          INT32 NodeNum,
01113          const SIMPLE_ARRAY<INT32>& LineList
01114          );
01115 
01116       //! Write a partial vector node line list from a SIMPLE_ARRAY<INT32>
01117       //! Does not update element nor object extents
01118       //! @return Number of node lines written or error if < 0
01119       INT32 WriteNodeLines (
01120          INT32 NodeNum,
01121          INT32 NumLines,
01122          INT32 Start,
01123          INT32 Length,
01124          const SIMPLE_ARRAY<INT32>& LineList
01125          );
01126 
01127       //! Write a vector polygon line list from a SIMPLE_ARRAY<INT32>
01128       //! Does not update element nor object extents
01129       //! @return Number of polygon lines written or error if < 0
01130       INT32 WritePolyLines (
01131          INT32 PolyNum,
01132          const SIMPLE_ARRAY<INT32>& LineList
01133          );
01134 
01135       //! Write a partial vector polygon line list from a SIMPLE_ARRAY<INT32>
01136       //! Does not update element nor object extents
01137       //! @return Number of polygon lines written or error if < 0
01138       INT32 WritePolyLines (
01139          INT32 PolyNum,
01140          INT32 NumLines,
01141          INT32 Start,
01142          INT32 Length,
01143          const SIMPLE_ARRAY<INT32>& LineList
01144          );
01145 
01146       //! Write a vector polygon island list from a SIMPLE_ARRAY<INT32>
01147       //! Does not update element nor object extents
01148       //! @return Number of polygon islands written or error if < 0
01149       INT32 WritePolyIslands (
01150          INT32 PolyNum,
01151          const SIMPLE_ARRAY<INT32>& IsleList
01152          );
01153 
01154       //! Write a partial vector polygon island list from a SIMPLE_ARRAY<INT32>
01155       //! Does not update element nor object extents
01156       //! @return Number of polygon islands written or error if < 0
01157       INT32 WritePolyIslands (
01158          INT32 PolyNum,
01159          INT32 NumIslands,
01160          INT32 Start,
01161          INT32 Length,
01162          const SIMPLE_ARRAY<INT32>& IsleList
01163          );
01164          
01165    protected:
01166 
01167       ERRVALUE ClearLinePointList (
01168          );
01169 
01170       ERRVALUE ClearNodeLineList (
01171          );
01172 
01173       ERRVALUE ClearPolygonIslandList (
01174          );
01175          
01176       ERRVALUE ClearPolygonLineList (
01177          );
01178          
01179       ERRVALUE SetNumLabels (
01180          INT32 NewNumLabels
01181          );
01182 
01183       ERRVALUE SetNumLines (
01184          INT32 NewNumLines
01185          );
01186 
01187       ERRVALUE SetNumNodes (
01188          INT32 NewNumNodes
01189          );
01190 
01191       ERRVALUE SetNumPoints (
01192          INT32 NewNumPolygons
01193          );
01194 
01195       ERRVALUE SetNumPolygons (
01196          INT32 NewNumPolygons
01197          );
01198          
01199       ERRVALUE SwapLinePoints (
01200          INT32 Line1,
01201          INT32 Line2
01202          );
01203 
01204       ERRVALUE SwapNodeLines (
01205          INT32 Node1,
01206          INT32 Node2
01207          );
01208 
01209       ERRVALUE SwapPolyIslands (
01210          INT32 Poly1,
01211          INT32 Poly2
01212          );
01213 
01214       ERRVALUE SwapPolyLines (
01215          INT32 Poly1,
01216          INT32 Poly2
01217          );
01218 
01219    private:
01220       #ifndef GENERATING_DOXYGEN_OUTPUT
01221 
01222       ERRVALUE ExtractLabelsTo (VECTOR& DestObj, const GEOMETRIC::ELEMTRANSLIST& TransList, const TRANS2D_MAPGEN& tmg) const;
01223       ERRVALUE ExtractLinesTo (VECTOR& DestObj, GEOMETRIC::ELEMTRANSLIST& TransList, const TRANS2D_MAPGEN& tmg, GEOMETRIC::EXTRACTFLAGS ExtractFlags) const;
01224       ERRVALUE ExtractNodesTo (VECTOR& DestObj, const GEOMETRIC::ELEMTRANSLIST& TransList, const TRANS2D_MAPGEN& tmg, GEOMETRIC::EXTRACTFLAGS ExtractFlags) const;
01225       ERRVALUE ExtractPointsTo (VECTOR& DestObj, GEOMETRIC::ELEMTRANSLIST& TransList, const TRANS2D_MAPGEN& tmg, GEOMETRIC::EXTRACTFLAGS ExtractFlags) const;
01226       ERRVALUE ExtractPolygonsTo (VECTOR& DestObj, const GEOMETRIC::ELEMTRANSLIST& TransList, const TRANS2D_MAPGEN& tmg, GEOMETRIC::EXTRACTFLAGS ExtractFlags) const;
01227 
01228       ERRVALUE ExtractToCAD (RVC::GEOMETRIC& DestObj, RVC::GEOMETRIC::ELEMTRANSLIST& TransList, const TRANS2D_MAPGEN& tmg, RVC::GEOMETRIC::EXTRACTFLAGS ExtractFlags) const;
01229       ERRVALUE ExtractToRegion (RVC::GEOMETRIC& DestObj, RVC::GEOMETRIC::ELEMTRANSLIST& TransList, const TRANS2D_MAPGEN& tmg, RVC::GEOMETRIC::EXTRACTFLAGS ExtractFlags) const;
01230       ERRVALUE ExtractToVector (RVC::GEOMETRIC& DestObj, RVC::GEOMETRIC::ELEMTRANSLIST& TransList, const TRANS2D_MAPGEN& tmg, RVC::GEOMETRIC::EXTRACTFLAGS ExtractFlags) const;
01231       
01232       INT32 FindBestRgnLine (SIMPLE_ARRAY<INT32>& TestList, INT32 LineNum, INT32 NodeNum) const;
01233       ERRVALUE ReadLabelBaselinePoints (INT32 LabelNum, POLYLINE& Baseline, DIMENSION dim, double Height) const;
01234       int SetupLabelTransList (const RVC::GEOMETRIC::ELEMSELECTPARMS& SelectParms, RVC::GEOMETRIC::ELEMTRANSLIST& TransList, RVC::GEOMETRIC::ELEMSELECTFILTER* SelectFilter) const;
01235       int SetupLineTransList (const RVC::GEOMETRIC::ELEMSELECTPARMS& SelectParms, RVC::GEOMETRIC::ELEMTRANSLIST& TransList, BITSET& LineSet, RVC::GEOMETRIC::ELEMSELECTFILTER* SelectFilter) const;
01236       int SetupPointTransList (const RVC::GEOMETRIC::ELEMSELECTPARMS& SelectParms, RVC::GEOMETRIC::ELEMTRANSLIST& TransList, RVC::GEOMETRIC::ELEMSELECTFILTER* SelectFilter) const;
01237       int SetupPolygonTransList (const RVC::GEOMETRIC::ELEMSELECTPARMS& SelectParms, RVC::GEOMETRIC::ELEMTRANSLIST& TransList, BITSET& LineSet, RVC::GEOMETRIC::ELEMSELECTFILTER* SelectFilter) const;
01238       int TestDatabaseEquivalence (const VECTOR& RhsVectObj, DBASE_ELEMENT& LhsDBaseobj, DBASE_ELEMENT& RhsDBaseobj, SIMPLE_ARRAY<INT32>& TableMatch) const;
01239          
01240       //! Implementation of RVC::OBJECT virtual methods
01241       virtual ERRVALUE v_CloseObject ();
01242       virtual OBJTYPE v_GetDftObjectType () const;
01243       virtual bool v_IsObjectOpen () const;
01244       virtual ERRVALUE v_OpenObject (OPENMODE OpenFlags, MDLGPARENT parent);
01245 
01246       //! Implementation of RVC::GEOSPATIAL virtual methods
01247       virtual void v_GetExtents (DRECT3D &extents) const;
01248       virtual void v_GetScale (double& xscale, double& yscale) const;
01249       virtual double v_GetZScale () const;
01250       virtual double v_GetZOffset () const;
01251       virtual bool v_HasCapability (int Capability) const;
01252       virtual void v_SetScale (double xscale, double yscale);
01253       virtual void v_SetZOffset (double zoffset);
01254       virtual void v_SetZScale (double zscale);
01255 
01256       //! Implementation of RVC::GEOMETRIC virtual methods
01257       virtual ERRVALUE v_AddSearchTreeElement (INT32 elemnum, ELEMTYPE ElemType, const DRECT2D& Extents);
01258       virtual ERRVALUE v_BuildSearchTree (INT32 InitialNumElements, ELEMTYPE ElemType, const DRECT2D& Extents);
01259       virtual ERRVALUE v_ClearSearchTree (INT32 InitialNumElements, ELEMTYPE ElemType, const DRECT2D& Extents);
01260       virtual ERRVALUE v_CopySearchTreeElement (INT32 SourceElement, INT32 DestElement, ELEMTYPE ElemType, const DRECT2D& Extents);
01261       virtual ERRVALUE v_DeleteSearchTreeElement (INT32 elemnum, ELEMTYPE ElemType);
01262       virtual ERRVALUE v_ExtractTo (RVC::GEOMETRIC& DestObj, RVC::GEOMETRIC::ELEMTRANSLIST& TransList, const TRANS2D_MAPGEN& tmg, RVC::GEOMETRIC::EXTRACTFLAGS ExtractFlags) const;
01263       virtual INT32 v_FindClosestElementLow (ELEMTYPE ElemType, const DPOINT2D& SearchPt, GEOMETRIC::SEARCHFILTER* SearchFilter, double SearchDist, double* DistFromElem) const;
01264       virtual ERRVALUE v_FindClosestElementsLow (const DPOINT2D& SearchPt, double SearchDist, SEARCHFILTER* SearchFilter, SIMPLE_ARRAY<RVC::ELEMENT>& ElementList) const;
01265       virtual ERRVALUE v_FindElementDrawSet (ELEMTYPE ElemType, const DRECT2D& SearchExtents, SEARCHRESULT& SearchResult) const;
01266       virtual ERRVALUE v_FindElementSearchSet (ELEMTYPE ElemType, const DRECT2D& SearchExtents, SEARCHRESULT& SearchResult) const;
01267       virtual INT32 v_GetAttachmentIndex (const RVC::ELEMENT& Element) const;
01268       virtual ERRVALUE v_GetElementExtents (ELEMTYPE ElemType, INT32 ElemNum, DRECT3D& Extents) const;
01269       virtual INT32 v_GetNextElementID (ELEMTYPE ElemType) const;
01270       virtual INT32 v_GetNumElements (ELEMTYPE ElemType) const;
01271       virtual POINTTYPE v_GetPointType () const;
01272       virtual INT32 v_GetPointSize () const;
01273       virtual double v_GetTotalLineLength () const;
01274       virtual bool v_IsElementDeleted (const RVC::ELEMENT& Element) const;
01275       virtual bool v_IsEmpty () const;
01276       virtual ERRVALUE v_SaveSearchTrees ();
01277       virtual ERRVALUE v_SetExtents (const DRECT3D &extents);
01278       virtual ERRVALUE v_SetNextElementID (ELEMTYPE ElemType, INT32 NextElementID);
01279       virtual bool v_SetSearchTree (ELEMTYPE ElemType, RVC::QSEARCHTREE* SearchTree, bool ReplaceExisting);
01280       virtual ERRVALUE v_SetTotalLineLength (double length);
01281       virtual int v_SetupElemTransList (const RVC::GEOMETRIC::ELEMSELECTPARMS& SelectParms, RVC::GEOMETRIC::ELEMTRANSLIST& TransList, RVC::GEOMETRIC::ELEMSELECTFILTER* SelectFilter) const;
01282       virtual bool v_TestElementAgainstRegion (const RVC::ELEMENT& Element, const REGION2D& region, TESTCRITERIA TestMode) const;
01283       virtual ERRVALUE v_UpdateExtents (const DRECT3D &extents);
01284 
01285       //! No values are unchangeable in header
01286 
01287       VECTORHANDLE* m_VectorHandle;
01288       POINTTYPE m_PointType;              //!< Changed when callback changes it
01289       TOPOLOGYTYPE m_TopologyType;        //!< Changed when callback changes it
01290       mutable QSEARCHTREE *m_LabelSearchTree;
01291       mutable QSEARCHTREE *m_LineSearchTree;
01292       mutable QSEARCHTREE *m_NodeSearchTree;
01293       mutable QSEARCHTREE *m_PointSearchTree;
01294       mutable QSEARCHTREE *m_PolySearchTree;
01295       mutable SPATIALTREE *m_SpatialTree;
01296       class OPTIMIZE;
01297       mutable OPTIMIZE* m_Optimize;
01298       mutable bool m_SetInstanceData;     //!< This object set the instance data if true, it needs to remove it on closing
01299       
01300       friend class LABEL;
01301       #endif // GENERATING_DOXYGEN_OUTPUT
01302 
01303    };
01304 
01305 
01306 class VECTOR::CONGLOMERATELINEFILTER {
01307    public:
01308       //! Virtual method to determine if the line is to be conglomerated
01309       virtual bool Filter (
01310          const VECTOR& VectObj,
01311          INT32 TestLineNum
01312          ) = 0;
01313    };
01314 
01315 
01316 //! GETOBJFILTER derived class to determine if the vector object has points or lines or polygons to
01317 //! perform geometric operations on.  The RVC::GEOMETRIC::ISNOTEMPTY class will let vector objects with
01318 //! only label elements to be valid.
01319 class VECTOR::GETOBJFILTER_HASGEOMETRICELEMENTS : public GETOBJFILTER {
01320    public:
01321       GETOBJFILTER_HASGEOMETRICELEMENTS () {}
01322    private:
01323       #ifndef GENERATING_DOXYGEN_OUTPUT
01324       virtual bool v_IsSelectable (const RVC::OBJITEM& ObjItem, int position);
01325       #endif // GENERATING_DOXYGEN_OUTPUT
01326    };
01327 
01328 //! GETOBJFILTER derived class to determine if the vector object has the minimum number of labels
01329 class VECTOR::GETOBJFILTER_HASLABELS : public GEOMETRIC::GETOBJFILTER_HASMINIMUMELEMENTS {
01330    public:
01331       GETOBJFILTER_HASLABELS (
01332          INT32 MinLabels = 1
01333          ) : GETOBJFILTER_HASMINIMUMELEMENTS(ELEMTYPE_Label, MinLabels) {}
01334    };
01335 
01336 //! GETOBJFILTER derived class to determine if the vector object has the minimum number of labels
01337 class VECTOR::GETOBJFILTER_HASLINES : public GEOMETRIC::GETOBJFILTER_HASMINIMUMELEMENTS {
01338    public:
01339       GETOBJFILTER_HASLINES (
01340          INT32 MinLines = 1
01341          ) : GETOBJFILTER_HASMINIMUMELEMENTS(ELEMTYPE_Line, MinLines) {}
01342    };
01343    
01344 //! GETOBJFILTER derived class to determine if the vector object has the minimum number of labels
01345 class VECTOR::GETOBJFILTER_HASPOINTS : public GEOMETRIC::GETOBJFILTER_HASMINIMUMELEMENTS {
01346    public:
01347       GETOBJFILTER_HASPOINTS (
01348          INT32 MinPoints = 1
01349          ) : GETOBJFILTER_HASMINIMUMELEMENTS(ELEMTYPE_Point, MinPoints) {}
01350    };
01351    
01352 //! GETOBJFILTER derived class to determine if the vector object has the minimum number of labels
01353 class VECTOR::GETOBJFILTER_HASPOLYGONS : public GEOMETRIC::GETOBJFILTER_HASMINIMUMELEMENTS {
01354    public:
01355       GETOBJFILTER_HASPOLYGONS (
01356          INT32 MinPolygons = 1
01357          ) : GETOBJFILTER_HASMINIMUMELEMENTS(ELEMTYPE_Polygon, MinPolygons) {}
01358    };
01359 
01360 //! Vector label class
01361 class VECTOR::LABEL {
01362    public:
01363    
01364       class LEADERLINE {
01365          public:
01366 
01367             //! Default constructor
01368             LEADERLINE (
01369                );
01370 
01371             //! Copy constructor
01372             LEADERLINE (
01373                const LEADERLINE& rhs
01374                );
01375 
01376             //! Destructor
01377             ~LEADERLINE (
01378                );
01379 
01380             //! Assignment
01381             LEADERLINE& operator= (
01382                const LEADERLINE& rhs
01383                );
01384 
01385             INT32 GetElemNum (
01386                ) const {return (m_LeaderLine.ElemNum);}
01387 
01388             ELEMTYPE GetElemType (
01389                ) const {return (static_cast<ELEMTYPE>(m_LeaderLine.ElemType));}
01390 
01391             //! Determine extents of this leader line
01392             void GetExtents (
01393                DRECT3D& extents
01394                ) const;
01395                
01396             const POLYLINE& GetLeaderPoints (
01397                ) const {return (m_LeaderPts);}
01398                
01399             const DPOINT3D& GetTiePoint (
01400                ) const {return (m_LeaderLine.TiePoint);}
01401 
01402             //! Determine if the two label leader lines are equivalent 
01403             //! This method uses "Fuzzy" vertex comparisons and the direction and order of the elements are not relevant
01404             //! @return 'True' if they are, 'False' if not
01405             bool IsEquivalentTo (
01406                const LEADERLINE& rhs,
01407                double threshold
01408                ) const;
01409 
01410             void SetElemNum (
01411                INT32 ElemNum
01412                ) {m_LeaderLine.ElemNum = ElemNum;}
01413 
01414             void SetElemType (
01415                ELEMTYPE ElemType
01416                ) {m_LeaderLine.ElemType = static_cast<INT16>(ElemType);}
01417 
01418             void SetLeaderPoints (
01419                const POLYLINE& LeaderPts
01420                ) {m_LeaderPts = LeaderPts;}
01421                
01422             void SetTiePoint (
01423                const DPOINT3D& NewTiePoint
01424                ) {m_LeaderLine.TiePoint = NewTiePoint;}
01425 
01426             //! Translate label leader line through a generic coordinate transformation
01427             ERRVALUE Translate (
01428                const TRANS2D_MAPGEN& tmg
01429                );
01430 
01431          private:
01432             #ifndef GENERATING_DOXYGEN_OUTPUT
01433 
01434             ERRVALUE Add (VECTORHANDLE* VectorHandle, INT32 LabelNum, INT32 NumLeaderLines, INT32 LeaderLineIndex);
01435             ERRVALUE Copy (const LEADERLINE& rhs);
01436             ERRVALUE Read (VECTORHANDLE* VectorHandle, INT32 LabelNum, INT32 LeaderLineNum);
01437             ERRVALUE Write (VECTORHANDLE* VectorHandle, INT32 LabelNum, INT32 NumLeaderLines, INT32 LeaderLineIndex);
01438 
01439             RVCLEADERLINE m_LeaderLine;
01440             RVCLABELSTYLE m_StyleIndex;
01441             POLYLINE m_LeaderPts;
01442 
01443             friend class LABEL;
01444             #endif // GENERATING_DOXYGEN_OUTPUT
01445          };
01446 
01447       typedef MILIST<LEADERLINE>::ITERATOR LEADERLINEITERATOR;
01448       typedef MILIST<LEADERLINE>::CONST_ITERATOR CONST_LEADERLINEITERATOR;
01449 
01450       //! Default constructor
01451       LABEL (
01452          );
01453 
01454       //! Copy constructor
01455       LABEL (
01456          const LABEL& rhs
01457          );
01458 
01459       //! Destructor
01460       ~LABEL (
01461          );
01462 
01463       //! Assignment
01464       LABEL& operator= (
01465          const LABEL& rhs
01466          );
01467 
01468       //! Add a leader line to the label
01469       void AddLeaderLine (
01470          const LEADERLINE& LeaderLine
01471          );
01472 
01473       //! Clear the label of the string and base points and leader lines
01474       void Clear (
01475          );
01476          
01477       //! Clear the leader lines of the label
01478       void ClearLeaderLines (
01479          ) {m_LeaderLines.Clear();}
01480          
01481       //! Delete a leader line from the label
01482       void DeleteLeaderLine (
01483          MILIST<LEADERLINE>::ITERATOR it
01484          ) {m_Lead