contrib/gel/vtol/vtol_topology_cache.h
Go to the documentation of this file.
00001 #ifndef vtol_topology_cache_h_
00002 #define vtol_topology_cache_h_
00003 //:
00004 // \file
00005 // \brief Cache inferiors of TopologyObject
00006 //
00007 //  The vtol_topology_cache is a class used to cache vertices, edges, faces, blocks, etc.
00008 //
00009 // \author
00010 //     William A. Hoffman
00011 //     ported by Luis E. Galup
00012 //
00013 //-----------------------------------------------------------------------------
00014 
00015 #include <vtol/vtol_topology_object.h>
00016 #include <vcl_vector.h>
00017 #include <vul/vul_timestamp.h>
00018 
00019 class vtol_vertex;
00020 class vtol_edge;
00021 class vtol_zero_chain;
00022 class vtol_one_chain;
00023 class vtol_face;
00024 class vtol_two_chain;
00025 class vtol_block;
00026 class vtol_topology_object;
00027 
00028 //:
00029 // This class keeps a cache of various topology object lists
00030 
00031 class vtol_topology_cache : public vul_timestamp
00032 {
00033   //: private default constructor
00034   vtol_topology_cache();
00035   //: private constructor
00036   vtol_topology_cache(vtol_topology_object* to_be_cached);
00037   //: private destructor
00038   ~vtol_topology_cache();
00039 
00040   //accessors
00041 
00042   //: set the source
00043   void set_source(vtol_topology_object *to_be_cached);
00044 
00045   //: get the vertices
00046   void vertices(vertex_list&);
00047   //: get the zero chains
00048   void zero_chains(zero_chain_list&);
00049   //: get the edges
00050   void edges(edge_list&);
00051   //: get the one chains
00052   void one_chains(one_chain_list&);
00053   //: get the faces
00054   void faces(face_list&);
00055   //: get the two chains
00056   void two_chains(two_chain_list&);
00057   //: get the blocks
00058   void blocks(block_list&);
00059 
00060   // cache utilities
00061 
00062   //: validate the cache
00063   void validate_cache();
00064   //: clear the cache
00065   void clear_cache();
00066 
00067  private:
00068 
00069   //members
00070   vtol_topology_object* source_;
00071 
00072   vcl_vector<vtol_vertex*>* vertices_;
00073   vcl_vector<vtol_zero_chain*>* zerochains_;
00074   vcl_vector<vtol_edge*>* edges_;
00075   vcl_vector<vtol_one_chain*>*  onechains_;
00076   vcl_vector<vtol_face*>*  faces_;
00077   vcl_vector<vtol_two_chain*>*  twochains_;
00078   vcl_vector<vtol_block*>*  blocks_;
00079 
00080   //friend classes
00081   friend class vtol_vertex;
00082   friend class vtol_zero_chain;
00083   friend class vtol_edge;
00084   friend class vtol_one_chain;
00085   friend class vtol_face;
00086   friend class vtol_two_chain;
00087   friend class vtol_block;
00088   friend class vtol_topology_object;
00089 };
00090 
00091 #endif // vtol_topology_cache_h_