Go to the documentation of this file. 1 #ifndef GEOLIB_SHAPE_H_
2 #define GEOLIB_SHAPE_H_
39 virtual bool intersect(
const Ray& r,
float t0,
float t1,
double& distance)
const;
virtual bool intersect(const Ray &r, float t0, float t1, double &distance) const
intersect: currently always throws a logic error
virtual void setMesh(const Mesh &mesh)
set the Mesh Any child classes should throw a std::logic_error in case the mesh should not be changed...
Vector3 bounding_box_max_cache_
virtual bool empty() const
empty Test whether the shape(mesh) is empty.
static ShapePtr read(std::istream &input)
read serialised data from an input stream and create a shape
virtual const Mesh & getMesh() const
return the mesh defining the shape
virtual bool write(std::ostream &output) const
write, serialise the shape
virtual double getMaxRadius() const
Calculate the maximum distance from the origin of the shape to any point of the shape.
static const std::string TYPE
virtual Box getBoundingBox() const
Returns the smallest box which includes all mesh points. Box is not rotated, but matches the axis of ...
Vector3 bounding_box_min_cache_
virtual bool contains(const Vector3 &p) const
Determines whether a point p lies within the shape.
Mesh mesh_
Should not be read or written to directly in general. Use setMesh and getMesh to write respectively r...
bool bounding_box_cache_valid_
A geometric description of a shape.
virtual Shape * clone() const