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 #ifndef SSINGLETOPOLOGY_H
00075 #define SSINGLETOPOLOGY_H
00076 
00077 
00078 
00079 
00080 #include "SLineTopology.h"
00081 #include "SSetTopology.h"
00082 #include "SSingleTopologyMod.h"
00083 
00089 class SSingleTopology :  public SSetTopology, public SLineTopology {
00090   TYPEINFO2(SSingleTopology, "single", SSetTopology, SLineTopology);
00091   friend class SSingleTopologyMod;
00092  public:
00095   SSingleTopology();
00098   virtual ~SSingleTopology() {};
00099 
00102   virtual STopologyMod &getModifier() 
00103     { return _mod; };
00104 
00113   virtual bool intersectsWith(const STopology &container, 
00114             const STopology &top, 
00115             int ownPos, int topPos) const;
00116 
00126   virtual bool contains(const STopology &container,
00127       const STopology &top, 
00128       int ownPos, int topPos) const;
00129 
00134   virtual int getCount() const { return 1; };
00135 
00140   virtual int getIDAt(int pos) const { 
00141     
00142     return -1; 
00143   }
00144   
00149   virtual int getPos(int ID) const {
00150     
00151     return 0; 
00152   }
00153 
00158   virtual bool isPosFree(int pos) const {
00159     
00160     return (false);
00161   }
00162 
00167   virtual leda_list<int> getFreePos() const {
00168     
00169     return _free;
00170   }
00171   
00177   virtual bool canEmbedAt(const STopology &top, int pos) const { 
00178     
00179     return(false);
00180   }
00181   
00187   virtual leda_list<int> canEmbedAt(const STopology &top) const {
00188     
00189     return _free;
00190   }
00191 
00197   virtual void embed(const STopology& top, int pos, int ID) {
00198     
00199   }
00200   
00204   virtual void remove(int ID) {
00205     
00206   }
00207 
00208   virtual bool fitsInto(const STopology *top) const
00209     { return true; }
00210 
00211  private:
00212   SSingleTopologyMod _mod;
00213   leda_list<int> _free;
00214 };
00215 
00216 #endif //SSINGLETOPOLOGY_H
00217 
00218 
00219 
00220 
00221 
00222 
00223 
00224 
00225 
00226 
00227 
00228 
00229 
00230 
00231 
00232