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

Method IsInside

Modules/DataTypesExt/src/mitkCone.cpp:37–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37bool mitk::Cone::IsInside(const Point3D &worldPoint) const
38{
39 // transform point from world to object coordinates
40 ScalarType p[4];
41 p[0] = worldPoint[0];
42 p[1] = worldPoint[1];
43 p[2] = worldPoint[2];
44 p[3] = 1;
45
46 GetGeometry()->GetVtkTransform()->GetInverse()->TransformPoint(p, p);
47
48 p[1] += 1; // translate point, so that it fits to the formula below, which describes a cone that has its cone vertex
49 // at the origin
50 return (sqrt(p[0] * p[0] + p[2] * p[2]) <= p[1] * 0.5) && (p[1] <= 2); // formula to calculate if a given point is
51 // inside a cone that has its cone vertex at
52 // the origin, is aligned on the second axis,
53 // has a radius of one an a height of two
54}
55
56mitk::ScalarType mitk::Cone::GetVolume()
57{

Callers 15

ItkImageProcessingMethod · 0.45
FillDistanceImageMethod · 0.45
CheckOverObjectMethod · 0.45
FillRegionMethod · 0.45
CalculateExtremaWorldMethod · 0.45
GenerateDataMethod · 0.45

Calls 3

GetGeometryFunction · 0.85
TransformPointMethod · 0.80
GetVtkTransformMethod · 0.45

Tested by 2