00001 /** 00002 * \file SpherePatch3D.h \brief Simple 3D sphere patch class. 00003 * 00004 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00005 * 00006 */ 00007 #ifndef IMPALGEBRA_SPHERE_PATCH_3D_H 00008 #define IMPALGEBRA_SPHERE_PATCH_3D_H 00009 00010 #include "Sphere3D.h" 00011 #include "Plane3D.h" 00012 00013 IMPALGEBRA_BEGIN_NAMESPACE 00014 00015 /** 00016 A patch of a sphere is defined as all points above the plane and on the sphere. 00017 \ingroup uninitialized_default 00018 \ingroup noncomparable 00019 */ 00020 class IMPALGEBRAEXPORT SpherePatch3D { 00021 public: 00022 SpherePatch3D(){} 00023 //! Constructor 00024 /** 00025 /param[in] sph the sphere to cut a patch from 00026 /param[in] crossing_plane the plane that crosses the sphere 00027 */ 00028 SpherePatch3D(const SphereD<3> &sph, const Plane3D& crossing_plane); 00029 //! Return true if the point is contained in the patch 00030 /** Note that the point must be on the sphere (this is not necessarily 00031 checked). 00032 */ 00033 bool get_contains(const VectorD<3> &p) const; 00034 Plane3D get_plane() const {return crossing_plane_;} 00035 SphereD<3> get_sphere() const {return SphereD<3>(sph_);} 00036 void show(std::ostream &out=std::cout) const { 00037 sph_.show(); 00038 crossing_plane_.show(); 00039 } 00040 //! Get a point which is on the boundary of the patch 00041 VectorD<3> get_boundary_point() const; 00042 protected: 00043 SphereD<3> sph_; 00044 Plane3D crossing_plane_; 00045 }; 00046 00047 IMP_AREA_GEOMETRY_METHODS(SpherePatch3D, 00048 IMP_NOT_IMPLEMENTED;, 00049 { 00050 return get_bounding_box(g.get_sphere()); 00051 }); 00052 00053 00054 IMPALGEBRA_END_NAMESPACE 00055 00056 #endif /* IMPALGEBRA_SPHERE_PATCH_3D_H */