00001 #include "fconstsphereregion.h" 00002 00003 00004 00005 FConstSphereRegion::FConstSphereRegion(double constValue,double outsideValue,double radius,double center1,double center2,double center3) 00006 { 00007 m_constValue = constValue; 00008 m_outsideValue = outsideValue; 00009 m_radius = radius; 00010 m_center1 = center1; 00011 m_center2 = center2; 00012 m_center3 = center3; 00013 } 00014 00015 double FConstSphereRegion::operator() (const VecDouble &p, const unsigned int component) const 00016 { 00017 Point3D P; 00018 P[0] = p(0) - m_center1; 00019 P[1] = p(1) - m_center2; 00020 P[2] = p(2) - m_center3; 00021 00022 if (sqrt(P[0]*P[0] + P[1]*P[1] + P[2]*P[2]) < m_radius) 00023 { 00024 return m_constValue; 00025 } 00026 else 00027 return m_outsideValue; 00028 }