CutModelFigureSphere Class Reference

#include <CutModelFigureSphere.h>

Inheritance diagram for CutModelFigureSphere:
Inheritance graph
[legend]
Collaboration diagram for CutModelFigureSphere:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CutModelFigureSphere ()
virtual ~CutModelFigureSphere ()
virtual bool IfPointInside (double x, double y, double z)
virtual double GetTheoricVolume ()
virtual char * GetName ()
virtual vtkPolyData * getPolyData ()
virtual void SetPosition (double x, double y, double z)
virtual void SetScale (double sx, double sy, double sz)
virtual void SetRotation (double alfa, double beta, double teta)
virtual void SetSpacing (double spcX, double spcY, double spcZ)
virtual void SetVtkTransform (vtkTransform *transform)
virtual void SetInversVtkTransform (vtkTransform *inverstransform)

Protected Attributes

double _sx
double _sy
double _sz
vtkTransform * _inversModel
vtkTransform * _matrixModel

Private Attributes

vtkSphereSource * _vtksphere

Detailed Description

Definition at line 7 of file CutModelFigureSphere.h.


Constructor & Destructor Documentation

CutModelFigureSphere::CutModelFigureSphere (  ) 

Definition at line 6 of file CutModelFigureSphere.cxx.

References _vtksphere.

00007 {
00008         _vtksphere              = vtkSphereSource::New();
00009         _vtksphere->SetThetaResolution (20);
00010         _vtksphere->SetPhiResolution (20);
00011 }

CutModelFigureSphere::~CutModelFigureSphere (  )  [virtual]

Definition at line 13 of file CutModelFigureSphere.cxx.

References _vtksphere.

00014 {
00015         _vtksphere->Delete();
00016 }


Member Function Documentation

char * CutModelFigureSphere::GetName (  )  [virtual]

Definition at line 41 of file CutModelFigureSphere.cxx.

00042 {
00043         return "Sphere";
00044 }

vtkPolyData * CutModelFigureSphere::getPolyData (  )  [virtual]

Implements CutModelFigure.

Definition at line 46 of file CutModelFigureSphere.cxx.

References _vtksphere.

00046                                               {
00047         return _vtksphere->GetOutput();
00048 }

double CutModelFigureSphere::GetTheoricVolume (  )  [virtual]

Implements CutModelFigure.

Definition at line 35 of file CutModelFigureSphere.cxx.

References CutModelFigure::_sx, CutModelFigure::_sy, and CutModelFigure::_sz.

00036 {
00037         double piTMP=3.14159265;
00038         return (4.0/3.0) * piTMP * (_sx/2)*(_sy/2)*(_sz/2);
00039 }

bool CutModelFigureSphere::IfPointInside ( double  x,
double  y,
double  z 
) [virtual]

Implements CutModelFigure.

Definition at line 18 of file CutModelFigureSphere.cxx.

References CutModelFigure::_inversModel.

00019 {
00020         double in[4],out[4];
00021         in[0]=x;
00022         in[1]=y;
00023         in[2]=z;
00024         in[3]=1;
00025         _inversModel->MultiplyPoint (in, out);
00026 
00027         bool result=false;
00028         if (sqrt( out[0]*out[0] + out[1]*out[1] + out[2]*out[2] )<0.5 )
00029         {
00030                 result=true;
00031         }
00032         return result;
00033 }

virtual void CutModelFigure::SetInversVtkTransform ( vtkTransform *  inverstransform  )  [inline, virtual, inherited]

Definition at line 56 of file CutModelFigure.h.

References CutModelFigure::_inversModel.

Referenced by CutModelData::ExecuteCut(), and CutModelData::ExecuteUnCut().

00056                                                                          {
00057                 _inversModel = inverstransform;
00058         }

Here is the caller graph for this function:

virtual void CutModelFigure::SetPosition ( double  x,
double  y,
double  z 
) [inline, virtual, inherited]

Definition at line 14 of file CutModelFigure.h.

References CutModelFigure::_px, CutModelFigure::_py, and CutModelFigure::_pz.

00014                                                              {
00015                 _px = x;
00016                 _py = y;
00017                 _pz = z;
00018         }

virtual void CutModelFigure::SetRotation ( double  alfa,
double  beta,
double  teta 
) [inline, virtual, inherited]

Definition at line 26 of file CutModelFigure.h.

References CutModelFigure::_alfa, CutModelFigure::_beta, and CutModelFigure::_teta.

00026                                                                          {
00027         _alfa = alfa;
00028                 _beta = beta;
00029                 _teta = teta;
00030         }

virtual void CutModelFigure::SetScale ( double  sx,
double  sy,
double  sz 
) [inline, virtual, inherited]

Definition at line 20 of file CutModelFigure.h.

References CutModelFigure::_sx, CutModelFigure::_sy, and CutModelFigure::_sz.

00020                                                                 {
00021                 _sx = sx;
00022                 _sy = sy;
00023                 _sz = sz;
00024         }

virtual void CutModelFigure::SetSpacing ( double  spcX,
double  spcY,
double  spcZ 
) [inline, virtual, inherited]

Definition at line 32 of file CutModelFigure.h.

References CutModelFigure::_spcX, CutModelFigure::_spcY, and CutModelFigure::_spcZ.

00032                                                                         {
00033                 _spcX = spcX;
00034                 _spcY = spcY;
00035                 _spcZ = spcZ;
00036         }               

virtual void CutModelFigure::SetVtkTransform ( vtkTransform *  transform  )  [inline, virtual, inherited]

Definition at line 38 of file CutModelFigure.h.

References CutModelFigure::_alfa, CutModelFigure::_beta, CutModelFigure::_px, CutModelFigure::_py, CutModelFigure::_pz, CutModelFigure::_sx, CutModelFigure::_sy, CutModelFigure::_sz, and CutModelFigure::_teta.

Referenced by CutModelData::ExecuteCut(), and CutModelData::ExecuteUnCut().

00038                                                              {
00039                 double *orient = transform->GetOrientation();
00040                 _alfa = orient[0];
00041                 _beta = orient[1];
00042                 _teta = orient[2];
00043 
00044                 double *scale = transform->GetScale();
00045                 _sx = scale[0];
00046                 _sy = scale[1];
00047                 _sz = scale[2];
00048 
00049                 double *position = transform->GetPosition();
00050                 _px = position[0];
00051                 _py = position[1];
00052                 _pz = position[2];
00053 
00054 
00055         }

Here is the caller graph for this function:


Member Data Documentation

vtkTransform* CutModelFigure::_inversModel [protected, inherited]
vtkTransform* CutModelFigure::_matrixModel [protected, inherited]

Definition at line 80 of file CutModelFigure.h.

double CutModelFigure::_sx [protected, inherited]
double CutModelFigure::_sy [protected, inherited]
double CutModelFigure::_sz [protected, inherited]
vtkSphereSource* CutModelFigureSphere::_vtksphere [private]

Definition at line 17 of file CutModelFigureSphere.h.

Referenced by CutModelFigureSphere(), getPolyData(), and ~CutModelFigureSphere().


The documentation for this class was generated from the following files:

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1