1 #include "CutModelFigureSphere.h"
3 //----------------------------------------------------------------------------
4 //----------------------------------------------------------------------------
5 //----------------------------------------------------------------------------
6 CutModelFigureSphere::CutModelFigureSphere()
8 _vtksphere = vtkSphereSource::New();
9 _vtksphere->SetThetaResolution (20);
10 _vtksphere->SetPhiResolution (20);
12 //----------------------------------------------------------------------------
13 CutModelFigureSphere::~CutModelFigureSphere() // virtual
17 //----------------------------------------------------------------------------
18 bool CutModelFigureSphere::IfPointInside(double x, double y, double z) // virtual
25 _inversModel->MultiplyPoint (in, out);
28 if (sqrt( out[0]*out[0] + out[1]*out[1] + out[2]*out[2] )<0.5 )
34 //----------------------------------------------------------------------------
35 double CutModelFigureSphere::GetTheoricVolume() // virtual
37 double piTMP=3.14159265;
38 return (4.0/3.0) * piTMP * (_sx/2)*(_sy/2)*(_sz/2);
40 //----------------------------------------------------------------------------
41 const char *CutModelFigureSphere::GetName() // virtual
46 vtkPolyData* CutModelFigureSphere::getPolyData(){
47 return _vtksphere->GetOutput();