#include "CutModelFigureSphere.h" //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- CutModelFigureSphere::CutModelFigureSphere() { _vtksphere = vtkSphereSource::New(); _vtksphere->SetThetaResolution (20); _vtksphere->SetPhiResolution (20); } //---------------------------------------------------------------------------- CutModelFigureSphere::~CutModelFigureSphere() // virtual { _vtksphere->Delete(); } //---------------------------------------------------------------------------- bool CutModelFigureSphere::IfPointInside(double x, double y, double z) // virtual { double in[4],out[4]; in[0]=x; in[1]=y; in[2]=z; in[3]=1; _inversModel->MultiplyPoint (in, out); bool result=false; if (sqrt( out[0]*out[0] + out[1]*out[1] + out[2]*out[2] )<0.5 ) { result=true; } return result; } //---------------------------------------------------------------------------- double CutModelFigureSphere::GetTheoricVolume() // virtual { double piTMP=3.14159265; return (4.0/3.0) * piTMP * (_sx/2)*(_sy/2)*(_sz/2); } //---------------------------------------------------------------------------- const char *CutModelFigureSphere::GetName() // virtual { return "Sphere"; } vtkPolyData* CutModelFigureSphere::getPolyData(){ return _vtksphere->GetOutput(); }