rtsettings.h

来自「此文件包含了在linux下实现tpr-tree索引的源代码」· C头文件 代码 · 共 123 行

H
123
字号
// -*- Mode: C++ -*-//--------------------------------------------------------------------//      rtsettings.h//      ------------//      Encapsulates all the variables controling the algorithms////      Class hierarchy://      RTsettings////      TPR-tree - Index for continuously moving objects//      July 2001 release, Aalborg University//#ifndef RTSETTINGS_H#define RTSETTINGS_H#define TPR_MAX_DIMS  3        // Maximum number of dimensions in TPR-tree//------------------------------------------------ //    RTsettings //    Set... methods are responsible to make sure that all settings are//    consistent (some combinations of settings may not make//    sence). They return bool to indicate if the setting is legal.//class RTsettings{public:         //  Necessary enum types   //   enum TreeType  {tTPRtree, tRtree, tOpttree};   enum LoadAlgorithm {aNormal, aNormalHilbert, aDual, aDualHilbert,                        aDualSpeed, aVelocity, aCSD, aCDS, aDSC, aSDC, aRatio};   enum SplitAlgorithm {saOld, saNoOverlap};   enum ChoosesubtreeAlgorithm {cstArea, cstOverlap};   enum UnionMode      {unInsCT, unInsRefT};   //  Default settings   //    RTsettings () :            dims       (2),      treetype   (tTPRtree),      loadalg    (aRatio),      splitalg   (saOld),      unionmode  (unInsCT),      choosesubtreealg (cstOverlap)      {}         //  Get... methods    //   int             GetDims         () const { return dims;        }    LoadAlgorithm   GetLoadAlg      () const { return loadalg;     }   TreeType        GetTreeType     () const { return treetype;    }   SplitAlgorithm  GetSplitAlg     () const { return splitalg;    }   UnionMode       GetUnionMode    () const { return unionmode;   }   ChoosesubtreeAlgorithm GetChoosesubtreeAlg () const { return choosesubtreealg; }   // Additional accessor methods   //      bool IsDSAlg () const       {         return loadalg == aCSD || loadalg == aCDS ||                loadalg == aDSC || loadalg == aSDC;      }   bool IsCTUnionMode () const { return unionmode != unInsRefT; }   //  Set... Methods   //   bool SetDims     (int d)      {         if (d > TPR_MAX_DIMS) return false;         dims = d;         return true;      }   bool SetTreeType (TreeType t)       {         treetype = t;         if (t == tRtree || t ==tOpttree) SetLoadAlg (aNormal);         return true;      }   bool SetLoadAlg (LoadAlgorithm a)       {         loadalg = a;          return true;      }   bool SetUnionMode (UnionMode um)       {         unionmode = um;          return true;      }   bool SetSplitAlg (SplitAlgorithm a)       {         splitalg = a;          return true;      }   bool SetChoosesubtreeAlg (ChoosesubtreeAlgorithm a)       {         choosesubtreealg = a;          return true;      }   protected:   int                    dims;         // number of spatial dimensions   LoadAlgorithm          loadalg;         TreeType               treetype;   SplitAlgorithm         splitalg;   UnionMode              unionmode;   ChoosesubtreeAlgorithm choosesubtreealg;};//------------------------------------------------ extern RTsettings Settings;#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?