00001 /***************************************************************** 00002 * base_vis_ref_image.H 00003 *****************************************************************/ 00004 #ifndef _JOT_MESH_BASE_VIS_REF_IMAGE_H 00005 #define _JOT_MESH_BASE_VIS_REF_IMAGE_H 00006 00007 #include "disp/view.H" 00008 00009 using namespace mlib; 00010 00011 class Bsimplex; 00012 class Bface; 00013 class BaseVisRefImage; 00014 /***************************************************************** 00015 * BaseVisRefImageFactory: 00016 * 00017 * class that can produce a usable BaseVisRefImage as needed. 00018 * (i.e., it produces a derived type rather than an instance 00019 * of the pure virtual base class BaseVisRefImage). 00020 *****************************************************************/ 00021 class BaseVisRefImageFactory { 00022 public: 00023 // nothing to construct 00024 virtual ~BaseVisRefImageFactory() {} 00025 00026 // raison d'etre: 00027 virtual BaseVisRefImage* produce(CVIEWptr&) = 0; 00028 }; 00029 00030 /********************************************************************** 00031 * BaseVisRefImage 00032 * 00033 * An abstract base class that describes the functionality needed from 00034 * a VisRefImage 00035 **********************************************************************/ 00036 class BaseVisRefImage { 00037 public: 00038 virtual ~BaseVisRefImage() {} 00039 00040 // No public constructor. Instead, use the following to lookup the 00041 // BaseVisRefImage associated w/ a view. (If the view could know about 00042 // this type, we would probably just store the it on the view.) 00043 static BaseVisRefImage* lookup(CVIEWptr& v); 00044 00045 virtual void vis_update() = 0; 00046 virtual Bsimplex* vis_simplex(CNDCpt& ndc) const = 0; 00047 virtual Bface* vis_intersect(CNDCpt& ndc, mlib::Wpt& obj_pt) const = 0; 00048 00049 virtual void debug(CNDCpt& p) const {} 00050 00051 protected: 00052 00053 // factory for producing usable instance of pure virtual base class 00054 // BaseVisRefImage: 00055 static BaseVisRefImageFactory* _factory; 00056 00057 // associates a BaseVisRefImage with a view: 00058 static HASH _hash; 00059 }; 00060 00061 #endif // _JOT_MESH_BASE_VIS_REF_IMAGE_H 00062 00063 // end of file base_ref_image.H