00001 // This is gel/vsol/vsol_surface_3d.h 00002 #ifndef vsol_surface_3d_h_ 00003 #define vsol_surface_3d_h_ 00004 //***************************************************************************** 00005 //: 00006 // \file 00007 // \brief Abstract surface in 3D space 00008 // 00009 // \author François BERTEL 00010 // \date 2000-05-04 00011 // 00012 // \verbatim 00013 // Modifications 00014 // 2000-05-04 François BERTEL Creation 00015 // 2001-07-03 Peter Vanroose Replaced vnl_double_3 by vgl_vector_3d 00016 // 2004-09-06 Peter Vanroose Added safe cast methods to region_3d 00017 // 2004-10-09 Peter Vanroose Inlined all 1-line methods in class decl 00018 // \endverbatim 00019 //***************************************************************************** 00020 00021 #include <vsol/vsol_spatial_object_3d.h> 00022 #include <vsol/vsol_point_3d_sptr.h> 00023 #include <vgl/vgl_vector_3d.h> 00024 class vsol_region_3d; 00025 00026 class vsol_surface_3d : public vsol_spatial_object_3d 00027 { 00028 public: 00029 //*************************************************************************** 00030 // Initialization 00031 //*************************************************************************** 00032 00033 //--------------------------------------------------------------------------- 00034 //: Destructor 00035 //--------------------------------------------------------------------------- 00036 virtual ~vsol_surface_3d() {} 00037 00038 //*************************************************************************** 00039 // virtuals of vsol_spatial_object_3d 00040 //*************************************************************************** 00041 00042 virtual vsol_surface_3d* cast_to_surface(void) { return this; } 00043 virtual vsol_surface_3d const* cast_to_surface(void) const { return this; } 00044 00045 virtual vsol_region_3d *cast_to_region(void) {return 0;} 00046 virtual vsol_region_3d const* cast_to_region(void) const {return 0;} 00047 00048 //*************************************************************************** 00049 // Basic operations 00050 //*************************************************************************** 00051 00052 //--------------------------------------------------------------------------- 00053 //: Is `p' in `this' ? 00054 //--------------------------------------------------------------------------- 00055 virtual bool in(const vsol_point_3d_sptr &p) const=0; 00056 00057 //--------------------------------------------------------------------------- 00058 //: Return the unit normal vector at point `p'. 00059 // REQUIRE: in(p) 00060 //--------------------------------------------------------------------------- 00061 virtual vgl_vector_3d<double> normal_at_point(const vsol_point_3d_sptr &p) const=0; 00062 00063 //: Return a platform independent string identifying the class 00064 virtual vcl_string is_a() const { return vcl_string("vsol_surface_3d"); } 00065 00066 //: Return true if the argument matches the string identifying the class or any parent class 00067 virtual bool is_class(const vcl_string& cls) const { return cls==is_a(); } 00068 }; 00069 00070 #endif // vsol_surface_3d_h_