1 #include "CutModel2FigureSphere.h"
3 //----------------------------------------------------------------------------
4 //----------------------------------------------------------------------------
5 //----------------------------------------------------------------------------
6 CutModel2FigureSphere::CutModel2FigureSphere()
8 _vtksphere = vtkSphereSource::New();
9 _vtksphere->SetThetaResolution (20);
10 _vtksphere->SetPhiResolution (20);
12 //----------------------------------------------------------------------------
13 CutModel2FigureSphere::~CutModel2FigureSphere() // virtual
17 //----------------------------------------------------------------------------
18 bool CutModel2FigureSphere::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 CutModel2FigureSphere::GetTheoricVolume() // virtual
37 double piTMP=3.14159265;
38 return (4.0/3.0) * piTMP * (_sx/2)*(_sy/2)*(_sz/2);
40 //----------------------------------------------------------------------------
41 char *CutModel2FigureSphere::GetName() // virtual
46 vtkPolyData* CutModel2FigureSphere::getPolyData(){
47 return _vtksphere->GetOutput();