https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Ball.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "GeometryBase.h"
13#include "libmesh/point.h"
14#include "libmesh/sphere.h"
15
16class LineSegment;
17
34class Ball : public GeometryBase
35{
36public:
37 Ball(const libMesh::Point & c, libMesh::Real r) : _c(c), _r(r) {}
38
39 ~Ball() override = default;
40
41 const libMesh::Point & center() const { return _c; }
42 libMesh::Real radius() const { return _r; }
43
47 bool intersect(const LineSegment & line_segment) const override;
48
52 Ball computeBoundingBall() const override;
53
54#if LIBMESH_DIM > 2
56#endif
57
58private:
61};
Ball primitive: a circle in 2D or a sphere in 3D.
Definition Ball.h:35
libMesh::Real _r
Definition Ball.h:60
const libMesh::Point & center() const
Definition Ball.h:41
libMesh::Point _c
Definition Ball.h:59
libMesh::Sphere toSphere() const
Definition Ball.h:55
bool intersect(const LineSegment &line_segment) const override
Check if a line segment intersects this ball.
Definition Ball.C:19
Ball(const libMesh::Point &c, libMesh::Real r)
Definition Ball.h:37
Ball computeBoundingBall() const override
return the ball itself
Definition Ball.C:46
~Ball() override=default
libMesh::Real radius() const
Definition Ball.h:42
Base class for geometry primitives.
The LineSegment class is used by the LineMaterialSamplerBase class and for some ray tracing stuff.
Definition LineSegment.h:31
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real