MCPcopy Create free account
hub / github.com/MITK/MITK / IsInside

Method IsInside

Modules/DataTypesExt/src/mitkCylinder.cpp:35–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35bool mitk::Cylinder::IsInside(const Point3D &worldPoint) const
36{
37 // transform point from world to object coordinates
38 ScalarType p[4];
39 p[0] = worldPoint[0];
40 p[1] = worldPoint[1];
41 p[2] = worldPoint[2];
42 p[3] = 1;
43
44 GetGeometry()->GetVtkTransform()->GetInverse()->TransformPoint(p, p);
45
46 mitk::ScalarType v = pow(p[0], 2) + pow(p[2], 2);
47 bool retval = (v <= 1) && (p[1] >= -1) && (p[1] <= 1);
48 return retval;
49}
50
51mitk::ScalarType mitk::Cylinder::GetVolume()
52{

Callers

nothing calls this directly

Calls 3

GetGeometryFunction · 0.85
TransformPointMethod · 0.80
GetVtkTransformMethod · 0.45

Tested by

no test coverage detected