rvc/tin.h

Go to the documentation of this file.
00001 /**
00002  * \file rvc/tin.h 
00003  * \brief interface for the RVC::TIN class.
00004  *
00005  * \if NODOC
00006  * $Id: tin.h_v 1.49 2003/11/21 22:17:11 scowan Exp $
00007  *
00008  * $Log: tin.h_v $
00009  * Revision 1.49  2003/11/21 22:17:11  scowan
00010  * Support new Capabilities system.
00011  *
00012  * Revision 1.48  2003/10/07 17:30:14  scowan
00013  * Object virtual method changes.
00014  *
00015  * Revision 1.47  2003/09/30 16:52:06  dwilliss
00016  * Doxygen
00017  *
00018  * Revision 1.46  2003/09/25 21:20:04  dwilliss
00019  * Fixed doxygen comment
00020  *
00021  * Revision 1.45  2003/09/15 13:49:45  fileserver!dwilliss
00022  * Doxygen
00023  *
00024  * Revision 1.44  2003/06/19 17:46:06  scowan
00025  * Added virtual method and enum.
00026  *
00027  * Revision 1.43  2003/06/04 23:35:12  scowan
00028  * Added find element draw set.
00029  *
00030  * Revision 1.42  2003/05/12 23:33:20  scowan
00031  * Changes to virtual methods.
00032  *
00033  * Revision 1.41  2003/05/07 22:20:46  scowan
00034  * Changed virtual method format.
00035  *
00036  * Revision 1.40  2002/09/30 23:22:26  scowan
00037  * Made element search code const.
00038  *
00039  * Revision 1.39  2002/09/17 22:49:21  scowan
00040  * More virtual method adjustment.
00041  *
00042  * Revision 1.38  2002/09/17 16:15:37  scowan
00043  * Added more methods.
00044  *
00045  * Revision 1.37  2002/09/12 22:09:31  scowan
00046  * Updated search tree copy elem.
00047  *
00048  * Revision 1.36  2002/09/11 22:18:26  scowan
00049  * Added more methods.
00050  *
00051  * Revision 1.35  2002/09/10 22:55:17  scowan
00052  * Added more methods.
00053  *
00054  * Revision 1.34  2002/09/10 21:04:02  scowan
00055  * Added element iterator and a method.
00056  *
00057  * Revision 1.33  2002/09/03 22:18:38  scowan
00058  * More virtual method moves.
00059  *
00060  * Revision 1.32  2002/08/29 22:13:29  scowan
00061  * Virtual method adjustment.
00062  *
00063  * Revision 1.31  2002/06/19 22:24:14  scowan
00064  * More method changes.
00065  *
00066  * Revision 1.30  2002/06/18 22:15:27  scowan
00067  * Added extract interface.
00068  *
00069  * Revision 1.29  2002/04/30 17:33:56  scowan
00070  * Change base make parm class name.
00071  *
00072  * Revision 1.28  2002/04/30 14:40:40  scowan
00073  * Removed namespace from inheritance.
00074  *
00075  * Revision 1.27  2002/04/30 14:03:17  scowan
00076  * More const.
00077  *
00078  * Revision 1.26  2002/04/26 22:44:55  scowan
00079  * Added more virtual methods.
00080  *
00081  * Revision 1.25  2002/03/01 16:19:37  scowan
00082  * Added virtual methods.
00083  *
00084  * Revision 1.24  2002/03/01 15:27:14  scowan
00085  * Added element id methods.
00086  *
00087  * Revision 1.23  2002/02/27 23:25:00  scowan
00088  * Added get element extents methods.
00089  *
00090  * Revision 1.22  2002/01/09 23:41:11  scowan
00091  * Avoid mass docs.
00092  *
00093  * Revision 1.21  2002/01/09 23:40:23  scowan
00094  * Added more default setup for makeparm constructor.
00095  *
00096  * Revision 1.20  2002/01/09 23:38:46  scowan
00097  * Moved makeparms out of the class and added more make parameters.
00098  *
00099  * Revision 1.19  2002/01/03 22:57:38  scowan
00100  * Added extents management methods.
00101  *
00102  * Revision 1.18  2001/10/08 20:49:54  scowan
00103  * Added element region method.
00104  *
00105  * Revision 1.17  2001/09/28 15:29:24  scowan
00106  * Added extetnts to the make parms.
00107  *
00108  * Revision 1.16  2001/07/31 16:40:43  scowan
00109  * Added new interface methods.
00110  *
00111  * Revision 1.15  2001/06/14 16:08:07  scowan
00112  * Changed source type.
00113  *
00114  * Revision 1.14  2001/06/13 22:32:06  scowan
00115  * Added to RVC namespace.
00116  *
00117  * Revision 1.13  2001/06/13 15:40:33  scowan
00118  * Changed objtype enum.
00119  * Added make methods.
00120  *
00121  * Revision 1.12  2001/06/12 15:40:35  scowan
00122  * Added comments.
00123  *
00124  * Revision 1.11  2001/05/31 19:27:49  scowan
00125  * Made methods read, write and add.
00126  *
00127  * Revision 1.10  2001/05/25 14:53:29  scowan
00128  * Added missing pure method.
00129  *
00130  * Revision 1.9  2001/05/24 17:37:36  scowan
00131  * Added virtual methods for finding objects.
00132  *
00133  * Revision 1.8  2001/04/24 14:25:16  scowan
00134  * More const.
00135  *
00136  * Revision 1.7  2001/04/23 22:52:10  scowan
00137  * Added find closest methods.
00138  *
00139  * Revision 1.6  2001/04/23 17:46:10  scowan
00140  * Added update extents.
00141  *
00142  * Revision 1.5  2000/12/01 16:04:10  scowan
00143  * Fixed MAC errors.
00144  *
00145  * Revision 1.4  2000/11/24 22:53:35  scowan
00146  * Add set extents virtual method.
00147  *
00148  * Revision 1.3  2000/11/17 15:48:29  scowan
00149  * Removed unnecessary include file.
00150  *
00151  * Revision 1.2  2000/10/19 21:17:48  scowan
00152  * Checked in for vacation.
00153  *
00154  * Revision 1.1  2000/10/02 17:40:21  scowan
00155  * Initial revision
00156  *
00157  * \endif
00158 **/
00159 
00160 //!   \class RVC::TIN rvc/tin.h
00161 //!   \brief Manages RVC::OBJTYPE_TIN RVC objects.  
00162 //!   
00163 //!   The interface currently wraps the MfTIN functions.
00164 //!   
00165 //!   RVC Object Types that this class supports: RVC::OBJTYPE_TIN.
00166 //!
00167 //!   Default RVC Object Type for this class: RVC::OBJTYPE_TIN.
00168 //!
00169 //!   Valid parents for this class:
00170 //!      - RVC::OBJTYPE_File
00171 //!      - RVC::OBJTYPE_Folder
00172 
00173 #ifndef INC_RVC_TIN_H
00174 #define INC_RVC_TIN_H
00175 
00176 #ifndef INC_RVC_GEOMETRC_H
00177    #include <rvc/geometrc.h>
00178 #endif
00179 
00180 #ifndef INC_MI32_RVCTIN_H
00181    #include <mi32/rvctin.h>
00182 #endif
00183 
00184 #ifndef INC_MI32_SIMPLEAR_H
00185    #include <mi32/simplear.h>
00186 #endif
00187 
00188 namespace RVC {
00189 
00190 #ifndef GENERATING_DOXYGEN_OUTPUT
00191 // Forward declarations
00192 class QSEARCHTREE;
00193 #endif // GENERATING_DOXYGEN_OUTPUT
00194 
00195 class TIN : public GEOMETRIC {
00196    public:
00197 
00198       #ifndef GENERATING_DOXYGEN_OUTPUT
00199       class MAKEPARMS;
00200       #endif // GENERATING_DOXYGEN_OUTPUT
00201 
00202       //! Constant iterator class
00203       //!
00204       //! This class is used to iterate through a vector objects elements
00205       //! See methods ElementBegin() and ElementEnd() for obtaining an element iterator
00206       template <class _ELEM>  
00207       class ELEMITERATOR {
00208       public:
00209 
00210          // CONSTRUCTORS
00211 
00212          //! Default constructor
00213          ELEMITERATOR (
00214             ) : 
00215             m_ElemNum(-1),
00216             m_CurrentObj(0)
00217             {}
00218 
00219          //! Idiot constructor for G++
00220          ELEMITERATOR (
00221             int WorthlessValue
00222             ) : 
00223             m_ElemNum(-1),
00224             m_CurrentObj(0)
00225             {}
00226 
00227          //! Internal constructor used by ElementEnd() methods
00228          ELEMITERATOR (
00229             const RVC::TIN* tin,
00230             INT32 ElemNum
00231             ) : 
00232             m_ElemNum(ElemNum),
00233             m_CurrentObj(tin)
00234             {}
00235 
00236          //! Copy constructor
00237          ELEMITERATOR (
00238             const ELEMITERATOR<_ELEM>& rhs
00239             ) : 
00240             m_ElemNum(rhs.m_ElemNum),
00241             m_CurrentObj(rhs.m_CurrentObj),
00242             m_Element(rhs.m_Element)
00243             {}
00244 
00245          //! Internal constructor used by ElementBegin() methods
00246          ELEMITERATOR (
00247             const RVC::TIN* tin
00248             ) :
00249             m_ElemNum(-1),
00250             m_CurrentObj(tin)
00251             {
00252             ERRVALUE err = 0;
00253             do {           //! Scan to the first valid element
00254                m_ElemNum ++;
00255                ERRORPOSNDISABLE disable;
00256                err = m_CurrentObj->Read(m_ElemNum, m_Element);
00257                if (err < 0) m_ElemNum = -1;
00258                } while (err >= 0 && !m_Element.IsValid());
00259             }
00260 
00261          //! Destructor
00262          virtual ~ELEMITERATOR (
00263             ) {}
00264 
00265          //! Assignment
00266          ELEMITERATOR<_ELEM>& operator= (
00267             const ELEMITERATOR<_ELEM>& rhs
00268             ) {
00269             if (this != &rhs) {
00270                m_ElemNum = rhs.m_ElemNum;
00271                m_CurrentObj = rhs.m_CurrentObj;
00272                m_Element = rhs.m_Element;    //!< If LABEL, this can be expensive, so check first
00273                }
00274             return (*this);
00275             }
00276 
00277          //! Dereference
00278          const _ELEM& operator* (
00279             ) const { return (m_Element); }
00280 
00281          //! Dereference arrow
00282          const _ELEM* operator-> (
00283             ) const { return (&**this); }
00284 
00285          //! Pre-increment
00286          ELEMITERATOR<_ELEM>& operator++ (
00287             ) {
00288             ERRVALUE err = 0;
00289             do {           //! Scan to the next valid element
00290                m_ElemNum ++;
00291                ERRORPOSNDISABLE disable;
00292                err = m_CurrentObj->Read(m_ElemNum, m_Element);
00293                if (err < 0) m_ElemNum = -1;
00294                } while (err >= 0 && !m_Element.IsValid());
00295             return (*this);
00296             }        
00297 
00298          //! Comparison for equality
00299          bool operator== (
00300             const ELEMITERATOR<_ELEM>& rhs
00301             ) const { return (m_ElemNum == rhs.m_ElemNum && m_CurrentObj == rhs.m_CurrentObj); }
00302 
00303          //! Comparison for inequality
00304          bool operator!= (
00305             const ELEMITERATOR<_ELEM>& rhs
00306             ) const { return (!(*this == rhs)); }
00307             
00308          INT32 GetElementNumber (
00309             ) const { return (m_ElemNum); }
00310 
00311       protected:
00312          INT32 m_ElemNum;
00313          const TIN *m_CurrentObj;
00314          _ELEM m_Element;
00315          };
00316 
00317       typedef ELEMITERATOR<RVCTINEDGE> EDGEITERATOR;
00318       typedef ELEMITERATOR<RVCTINHULL> HULLITERATOR;
00319       typedef ELEMITERATOR<RVCTINNODE> NODEITERATOR;
00320       typedef ELEMITERATOR<RVCTINTRIANGLE> TRIANGLEITERATOR;
00321       
00322       //! Default constructor
00323       TIN (
00324          );
00325 
00326       //! Copy constructor
00327       TIN (
00328          const RVC::TIN& rhs
00329          );
00330 
00331       //! Destructor
00332       virtual ~TIN (
00333          );
00334 
00335       //! Assignment
00336       RVC::TIN& operator= (
00337          const RVC::TIN& rhs
00338          );
00339 
00340       //! Add an edge to the TIN object
00341       //! @return Number of the added edge element or < 0 if error
00342       INT32 Add (
00343          const RVCTINEDGE& edge
00344          );
00345 
00346       //! Add a hull to the TIN object
00347       //! @return Number of the added hull element or < 0 if error
00348       INT32 Add (
00349          const RVCTINHULL& hull
00350          );
00351 
00352       //! Add a node to the TIN object
00353       //! @return Number of the added node element or < 0 if error
00354       INT32 Add (
00355          const RVCTINNODE& node
00356          );
00357 
00358       //! Add a triangle to the TIN object
00359       //! @return Number of the added triangle element or < 0 if error
00360       INT32 Add (
00361          const RVCTINTRIANGLE& triangle
00362          );
00363          
00364       //! Compute the elevation at a given (x,y) point
00365       //! @return 0 if the point was outside a hull, >0 if elevation was calculated, <0 error
00366       int ComputeElevation (
00367          DPOINT3D& pt                  //!< Point to compute elevation at, result stored in pt.z
00368          );
00369          
00370       //! Compute plane coefficients for a given triangle
00371       ERRVALUE ComputePlaneCoefficients (
00372          INT32 TriangleNum,
00373          double& A,
00374          double& B,
00375          double& C,
00376          double& D
00377          );
00378 
00379       //! Obtain an element iterator to the beginning of the element list
00380       template <class _ELEM> ELEMITERATOR<_ELEM> ElementBegin (
00381          ELEMITERATOR<_ELEM> item
00382          ) const {
00383          return (ELEMITERATOR<_ELEM>(this));
00384          }
00385 
00386       //! Obtain an element iterator to the end of the element list
00387       template <class _ELEM> ELEMITERATOR<_ELEM> ElementEnd (
00388          ELEMITERATOR<_ELEM> item
00389          ) const {
00390          return (ELEMITERATOR<_ELEM>(this, -1));
00391          }
00392 
00393       //! Get MAKEPARM values from current TIN object instance       
00394       ERRVALUE GetMakeParms (
00395          RVC::TIN::MAKEPARMS& MakeParms
00396          ) const;
00397          
00398       //! Obtain next available edge ID for edge ID table
00399       //! @return Next available edge ID
00400       INT32 GetNextEdgeID (
00401          ) const;
00402 
00403       //! Obtain next available node ID for node ID table
00404       //! @return Next available node ID
00405       INT32 GetNextNodeID (
00406          ) const;
00407 
00408       //! Obtain next available triangle ID for triangle ID table
00409       //! @return Next available triangle ID
00410       INT32 GetNextTriangleID (
00411          ) const;
00412       
00413       //! Obtain number of edges in the TIN object
00414       //! @return Number of edges
00415       INT32 GetNumEdges (
00416          ) const;
00417 
00418       //! Obtain number of edges in a hull
00419       //! @return Number of hull edges
00420       INT32 GetNumHullEdges (
00421          INT32 hullnum           //!< Hull to get number of edges of
00422          ) const;
00423 
00424       //! Obtain number of islands in a hull
00425       //! @return Number of hull islands
00426       INT32 GetNumHullIslands (
00427          INT32 hullnum           //!< Hull to get number of islands of
00428          ) const;
00429 
00430       //! Obtain number of hulls in the TIN object
00431       //! @return Number of hulls
00432       INT32 GetNumHulls (
00433          ) const;
00434 
00435       //! Obtain number of edges in a node
00436       //! @return Number of node edges
00437       INT32 GetNumNodeEdges (
00438          INT32 NodeNum           //!< Node to get number of edges of
00439          ) const;
00440 
00441       //! Obtain number of nodes in the TIN object
00442       //! @return Number of nodes
00443       INT32 GetNumNodes (
00444          ) const;
00445 
00446       //! Obtain number of triangles in the TIN object
00447       //! @return Number of triangles
00448       INT32 GetNumTriangles (
00449          ) const;
00450 
00451       //! Obtain current xy tolerance for this object
00452       //! @return Minimum distance between two nodes
00453       double GetTolerance (
00454          ) const;
00455 
00456       //! Create new TIN object given parent object, name, description, creation parameters, and source
00457       ERRVALUE Make (
00458          const RVC::OBJECT& parent,
00459          const RVC::OBJECTNAME& name,
00460          const RVC::OBJECTDESC& desc,
00461          const MAKEPARMS& MakeParms,
00462          const char* Source = 0
00463          );
00464       
00465       //! Create new TIN object given parent object, name, description, creation parameters, and source
00466       ERRVALUE Make (
00467          const RVC::OBJITEM& ObjItem,
00468          const MAKEPARMS& MakeParms,
00469          const char* Source = 0
00470          );
00471       
00472       //! Read a TIN edge element
00473       ERRVALUE Read (
00474          INT32 EdgeNum,          //!< Edge number to read
00475          RVCTINEDGE& Edge        //!< Edge element RETURNED
00476          ) const;
00477 
00478       //! Read a TIN hull element
00479       ERRVALUE Read (
00480          INT32 hullnum,          //!< Hull number ot read
00481          RVCTINHULL& hull        //!< Hull element RETURNED
00482          ) const;
00483 
00484       //! Read a TIN node element
00485       ERRVALUE Read (
00486          INT32 nodenum,          //!< Node number to read
00487          RVCTINNODE& node        //!< Node element RETURNED
00488          ) const;
00489 
00490       //! Read a TIN triangle element
00491       ERRVALUE Read (
00492          INT32 trinum,           //!< Triangle number to read
00493          RVCTINTRIANGLE& triangle   //!< Triangle element RETURNED
00494          ) const;
00495 
00496       //! Read list of edges that make up the hull
00497       ERRVALUE ReadHullEdges (
00498          INT32 hullnum,          //!< Hull number to read edge list of
00499          INT32 start,            //!< Start position to read hull edge list
00500          INT32 count,            //!< Maximum number of edges to read
00501          SIMPLE_ARRAY<RVCTINHULLEDGE>& edges    //!< List of hull edges read into
00502          ) const;
00503 
00504       //! Read list of islands that are in the hull
00505       ERRVALUE ReadHullIslands (
00506          INT32 hullnum,          //!< Hull number to read island list of
00507          INT32 start,            //!< Start position to read hull islands list
00508          INT32 count,            //!< Maximum number of islands to read
00509          SIMPLE_ARRAY<INT32>& islands     //!< List of hull islands read into
00510          ) const;
00511 
00512       //! Read list of edges that are attached to the node
00513       ERRVALUE ReadNodeEdges (
00514          INT32 nodenum,                //!< Node number to read edge list of
00515          SIMPLE_ARRAY<INT32>& EdgeList //!< List of node edges read into
00516          ) const;
00517 
00518       //! Read list of edges that are attached to the node
00519       ERRVALUE ReadNodeEdges (
00520          INT32 nodenum,          //!< Node number to read edge list of
00521          INT32 start,            //!< Start position to read node edge list
00522          INT32 count,            //!< Maximum number of edges to read
00523          SIMPLE_ARRAY<INT32>& Edges //!< List of node edges read into
00524          ) const;
00525 
00526       //! Set next available edge ID for edge ID table
00527       ERRVALUE SetNextEdgeID (
00528          INT32 NextEdgeID
00529          );
00530 
00531       //! Set next available node ID for node ID table
00532       ERRVALUE SetNextNodeID (
00533          INT32 NextNodeID
00534          );
00535 
00536       //! Set next available triangle ID for triangle ID table
00537       ERRVALUE SetNextTriangleID (
00538          INT32 NextTriangleID
00539          );
00540       
00541       //! Set current xy tolerance for this object
00542       ERRVALUE SetTolerance (
00543          double tolerance
00544          );
00545 
00546       //! Swap hull edge lists between two hulls
00547       ERRVALUE SwapHullEdges (
00548          INT32 hullnum1,
00549          INT32 hullnum2
00550          );
00551 
00552       //! Swap node edge lists between two nodes
00553       ERRVALUE SwapNodeEdges (
00554          INT32 node1, 
00555          INT32 node2
00556          );
00557       
00558       //! Write a TIN edge element
00559       //! Does not update element nor object extents
00560       ERRVALUE Write (
00561          INT32 edgenum,             //!< Edge number to write 
00562          const RVCTINEDGE& edge        //!< Edge element to write
00563          );
00564 
00565       //! Write a TIN hull element
00566       //! Does not update element nor object extents
00567       ERRVALUE Write (
00568          INT32 hullnum,             //!< Hull number to write 
00569          const RVCTINHULL& hull        //!< Hull element to write
00570          );
00571 
00572       //! Write a TIN node element
00573       //! Does not update element nor object extents
00574       ERRVALUE Write (
00575          INT32 nodenum,             //!< Node number to write 
00576          const RVCTINNODE& node        //!< Node element to write
00577          );
00578 
00579       //! Write a TIN triangle element
00580       //! Does not update element nor object extents
00581       ERRVALUE Write (
00582          INT32 TriangleNum,            //!< Triangle number to write
00583          const RVCTINTRIANGLE& triangle   //!< Triangle element to write
00584          );
00585 
00586       //! Write hull edge list
00587       //! Does not update element nor object extents
00588       ERRVALUE WriteHullEdges (
00589          INT32 hullnum,             //!< Hull number to write edge list to
00590          const SIMPLE_ARRAY<RVCTINHULLEDGE>& edges    //!< Hull edge list to write
00591          );
00592 
00593       //! Write hull edge list
00594       //! Does not update element nor object extents
00595       ERRVALUE WriteHullEdges (
00596          INT32 hullnum,             //!< Hull number to write edge list to
00597          INT32 total,               //!< Total number of edges for this hull
00598          INT32 start,               //!< Start position to write hull edge list
00599          INT32 count,               //!< Number of edges to write
00600          const SIMPLE_ARRAY<RVCTINHULLEDGE>& edges    //!< Hull edge list to write
00601          );
00602 
00603       //! Write hull island list
00604       //! Does not update element nor object extents
00605       ERRVALUE WriteHullIslands (
00606          INT32 hullnum,             //!< Hull number to write island list to     
00607          INT32 total,               //!< Total number of islands for this hull   
00608          INT32 start,               //!< Start position to write hull island list
00609          INT32 count,               //!< Number of islands to write              
00610          const INT32 *islands       //!< Hull island list to write               
00611          );
00612 
00613       //! Write node edge list
00614       //! Does not update element nor object extents
00615       ERRVALUE WriteNodeEdges (
00616          INT32 nodenum,             //!< Node number to write edge list to
00617          const SIMPLE_ARRAY<INT32>& EdgeList
00618          );
00619 
00620       //! Write node edge list
00621       //! Does not update element nor object extents
00622       ERRVALUE WriteNodeEdges (
00623          INT32 nodenum,             //!< Node number to write edge list to
00624          INT32 NumEdges,            //!< Total number of edges for this node
00625          INT32 start,               //!< Start position to write node edge list
00626          INT32 count,               //!< Number of edges to write
00627          const SIMPLE_ARRAY<INT32>& EdgeList
00628          );
00629 
00630    protected:
00631 
00632       ERRVALUE ClearNodeEdgeList ();
00633       ERRVALUE SetNumEdges (INT32 NewNumEdges);
00634       ERRVALUE SetNumHulls (INT32 NewNumHulls);
00635       ERRVALUE SetNumNodes (INT32 NewNumNodes);
00636       ERRVALUE SetNumTriangles (INT32 NewNumTriangles);
00637 
00638    private:
00639       #ifndef GENERATING_DOXYGEN_OUTPUT
00640    
00641       //! Implementation of RVC::OBJECT virtual methods
00642       virtual ERRVALUE v_CloseObject ();
00643       virtual OBJTYPE v_GetDftObjectType () const;
00644       virtual bool v_IsObjectOpen () const;
00645       virtual ERRVALUE v_OpenObject (OPENMODE OpenFlags, MDLGPARENT parent);
00646 
00647       //! Implementation of RVC::GEOSPATIAL virtual methods
00648       virtual void v_GetExtents (DRECT3D &extents) const;
00649       virtual void v_GetScale (double& xscale, double& yscale) const;
00650       virtual double v_GetZScale () const;
00651       virtual double v_GetZOffset () const;
00652       virtual bool v_HasCapability (int Capability) const;
00653       virtual void v_SetScale (double xscale, double yscale);
00654       virtual void v_SetZOffset (double zoffset);
00655       virtual void v_SetZScale (double zscale);
00656 
00657       //! Implementation of RVC::GEOMETRIC virtual methods
00658       virtual ERRVALUE v_AddSearchTreeElement (INT32 elemnum, ELEMTYPE ElemType, const DRECT2D& Extents);
00659       virtual ERRVALUE v_BuildSearchTree (INT32 InitialNumElements, ELEMTYPE ElemType, const DRECT2D& Extents);
00660       virtual ERRVALUE v_ClearSearchTree (INT32 InitialNumElements, ELEMTYPE ElemType, const DRECT2D& Extents);
00661       virtual ERRVALUE v_CopySearchTreeElement (INT32 SourceElement, INT32 DestElement, ELEMTYPE ElemType, const DRECT2D& Extents);
00662       virtual ERRVALUE v_DeleteSearchTreeElement (INT32 elemnum, ELEMTYPE ElemType);
00663       virtual ERRVALUE v_ExtractTo (RVC::GEOMETRIC& DestObj, RVC::GEOMETRIC::ELEMTRANSLIST& TransList, const TRANS2D_MAPGEN& tmg, RVC::GEOMETRIC::EXTRACTFLAGS ExtractFlags) const;
00664       virtual INT32 v_FindClosestElementLow (ELEMTYPE ElemType, const DPOINT2D& SearchPt, GEOMETRIC::SEARCHFILTER* SearchFilter, double SearchDist, double* DistFromElem) const;
00665       virtual ERRVALUE v_FindElementDrawSet (ELEMTYPE ElemType, const DRECT2D& SearchExtents, SEARCHRESULT& SearchResult) const;
00666       virtual ERRVALUE v_FindElementSearchSet (ELEMTYPE ElemType, const DRECT2D& SearchExtents, SEARCHRESULT& SearchResult) const;
00667       virtual ERRVALUE v_GetElementExtents (ELEMTYPE ElemType, INT32 ElemNum, DRECT3D& Extents) const;
00668       virtual INT32 v_GetNextElementID (ELEMTYPE ElemType) const;
00669       virtual INT32 v_GetNumElements (ELEMTYPE ElemType) const;
00670       virtual POINTTYPE v_GetPointType () const {return (POINTTYPE_3DXYZ);}
00671       virtual INT32 v_GetPointSize () const {return (sizeof(DPOINT3D));}
00672       virtual bool v_IsElementDeleted (const RVC::ELEMENT& Element) const;
00673       virtual bool v_IsEmpty () const;
00674       virtual ERRVALUE v_SaveSearchTrees ();
00675       virtual ERRVALUE v_SetExtents (const DRECT3D &extents);
00676       virtual ERRVALUE v_SetNextElementID (ELEMTYPE ElemType, INT32 NextElementID);
00677       virtual bool v_SetSearchTree (ELEMTYPE ElemType, RVC::QSEARCHTREE* SearchTree, bool ReplaceExisting);
00678       virtual int v_SetupElemTransList (const RVC::GEOMETRIC::ELEMSELECTPARMS& SelectParms, RVC::GEOMETRIC::ELEMTRANSLIST& TransList, RVC::GEOMETRIC::ELEMSELECTFILTER* SelectFilter) const;
00679       virtual bool v_TestElementAgainstRegion (const RVC::ELEMENT& Element, const REGION2D& region, TESTCRITERIA TestMode) const;
00680       virtual bool v_TestElementAgainstRegion (ELEMTYPE ElemType, INT32 ElemNum, const GEOREGION& region, GEOREGION::TESTMODE TestMode) const;
00681       virtual ERRVALUE v_UpdateExtents (const DRECT3D &extents);
00682 
00683       //! No values are unchangeable in header
00684 
00685       int m_TinID;
00686       mutable QSEARCHTREE *m_NodeQTree;
00687       mutable QSEARCHTREE *m_EdgeQTree;
00688       mutable QSEARCHTREE *m_TriQTree;
00689       #endif // GENERATING_DOXYGEN_OUTPUT
00690    };
00691 
00692 
00693 //! Necessary tin object creation parameters    
00694 class TIN::MAKEPARMS : public RVC::GEOMETRIC::MAKEPARMSBASE {
00695    public:
00696       //! Default constructor
00697       MAKEPARMS (
00698          ) :
00699          GEOMETRIC::MAKEPARMSBASE(GEOMETRIC::POINTTYPE_3DXYZ),
00700          m_ZOffset(0.0),
00701          m_NextEdgeID(1),
00702          m_NextNodeID(10),
00703          m_NextTriangleID(1),
00704          m_tolerance(0.0)        //! Need to add at the end of the day
00705          {}
00706 
00707       //! Template constructor
00708       MAKEPARMS (
00709          const RVC::TIN& Object
00710          );
00711 
00712       //! Obtain next TIN edge ID value
00713       //! @return Next TIN edge ID value
00714       INT32 GetNextEdgeID (
00715          ) const {return (m_NextEdgeID);}
00716 
00717       //! Obtain next TIN Node ID value
00718       //! @return Next TIN node ID value
00719       INT32 GetNextNodeID (
00720          ) const {return (m_NextNodeID);}
00721 
00722       //! Obtain next TIN Triangle ID value
00723       //! @return Next TIN triangle ID value
00724       INT32 GetNextTriangleID (
00725          ) const {return (m_NextTriangleID);}
00726 
00727       //! Obtain current xy tolerance for this object
00728       //! @return Minimum distance between two nodes
00729       double GetTolerance (
00730          ) const { return (m_tolerance); }
00731 
00732       //! Get TIN z offset value
00733       //! @return TIN Z offset value
00734       double GetZOffset (
00735          ) const {return (m_ZOffset);}
00736 
00737       //! Set TIN edge next element ID value       
00738       void SetNextEdgeID (
00739          INT32 NextEdgeID
00740          ) {m_NextEdgeID = NextEdgeID;}
00741          
00742       //! Set TIN Node next element ID value       
00743       void SetNextNodeID (
00744          INT32 NextNodeID
00745          ) {m_NextNodeID = NextNodeID;}
00746          
00747       //! Set TIN triangle next element ID value
00748       void SetNextTriangleID (
00749          INT32 NextTriangleID
00750          ) {m_NextTriangleID = NextTriangleID;}
00751          
00752       //! Set current xy tolerance for this object
00753       void SetTolerance (
00754          double tolerance
00755          ) { m_tolerance = tolerance; }
00756          
00757       //! Set TIN Z offset value
00758       void SetZOffset (
00759          double zoffset
00760          ) {m_ZOffset = zoffset;}
00761          
00762    private:
00763       #ifndef GENERATING_DOXYGEN_OUTPUT
00764       double m_ZOffset;
00765       INT32 m_NextEdgeID;
00766       INT32 m_NextNodeID;
00767       INT32 m_NextTriangleID;
00768       double m_tolerance;        //!< Need to add at the end of the day
00769       #endif // GENERATING_DOXYGEN_OUTPUT
00770    };
00771 
00772 }     //! End of RVC namespace
00773 
00774 #endif   //!< INC_RVC_TIN_H

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