![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2006 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: sphere.h,v $ $Revision: 1.1 $ $State: Exp $ 00007 ******************************************************************************/ 00008 #ifndef sphere_H_ 00009 #define sphere_H_ 00010 00011 #include "geometry/geometryDefines.h" 00012 #include "geometry/point.h" 00013 #include "geometry/tdbextent.h" 00014 00015 // 00016 // \file sphere.h 00017 // \brief DtSphere 00018 // 00019 00020 // \brief Representation of a simple mathematical sphere. 00021 // \note The radius component of the center point is \b always greater than zero. 00022 class DT_DLL_geometry DtSphere 00023 { 00024 public: 00025 DtSphere(DtPoint newCenter, double newRadius); 00026 00027 virtual ~DtSphere(); 00028 00029 // This class is copyable and assignable. Because the implementations are so 00030 // simple, the compiler generated ones are sufficient. 00031 // DtSphere(const DtSphere& original); 00032 // const DtSphere& operator=(const DtSphere& original); 00033 00034 double radius() const; 00035 bool setRadius(double newRadius); 00036 00037 DtPoint center() const; 00038 void setCenter(DtPoint& newCenter); 00039 00040 protected: 00041 00042 bool testInvariant() const; 00043 00044 private: 00045 00046 double myRadius; 00047 DtPoint myCenter; 00048 }; 00049 00050 // \return The extent of the provided sphere. 00051 DT_DLL_geometry DtExtent extentOfSphere(const DtSphere& sphere); 00052 00053 #endif