]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/figureCuttingSphereModel.cxx
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / figureCuttingSphereModel.cxx
1 #include "figureCuttingSphereModel.h"
2
3 //----------------------------------------------------------------------------
4 //----------------------------------------------------------------------------
5 //----------------------------------------------------------------------------
6 figureCuttingSphereModel::figureCuttingSphereModel()
7 {
8 }
9 //----------------------------------------------------------------------------
10 figureCuttingSphereModel::~figureCuttingSphereModel() // virtual
11 {
12 }
13 //----------------------------------------------------------------------------
14 bool figureCuttingSphereModel::IfPointInside(double x, double y, double z) // virtual
15 {
16         double in[4],out[4];
17         in[0]=x;
18         in[1]=y;
19         in[2]=z;
20         in[3]=1;
21         _inversModel->MultiplyPoint (in, out);
22
23         bool result=false;
24         if (sqrt( out[0]*out[0] + out[1]*out[1] + out[2]*out[2] )<0.5 )
25         {
26                 result=true;
27         }
28         return result;
29 }
30 //----------------------------------------------------------------------------
31 double figureCuttingSphereModel::GetTheoricVolume() // virtual
32 {
33         double piTMP=3.14159265;
34         return (4.0/3.0) * piTMP * (_sx/2)*(_sy/2)*(_sz/2);
35 }
36 //----------------------------------------------------------------------------
37 char *figureCuttingSphereModel::GetName() // virtual
38 {
39         return "Sphere";
40 }