This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Indoor/geo/volume/BoundingVolumeCircle2.h
2018-10-25 11:50:12 +02:00

49 lines
1.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* © Copyright 2014 Urheberrechtshinweis
* Alle Rechte vorbehalten / All Rights Reserved
*
* Programmcode ist urheberrechtlich geschuetzt.
* Das Urheberrecht liegt, soweit nicht ausdruecklich anders gekennzeichnet, bei Frank Ebner.
* Keine Verwendung ohne explizite Genehmigung.
* (vgl. § 106 ff UrhG / § 97 UrhG)
*/
#ifndef BOUDINGVOLUMECIRCLE2_H
#define BOUDINGVOLUMECIRCLE2_H
#include <vector>
#include "BoundingVolume.h"
#include "../Circle2.h"
class BoundingVolumeCircle2 : public Circle2 {
public:
BoundingVolumeCircle2() {;}
BoundingVolumeCircle2(const Circle2& c) : Circle2(c) {;}
float getVolumeSize() const {
return M_PI * (radius*radius);
}
bool intersects(const Ray2 ray) const {
return Circle2::intersects(ray);
}
/** construct a volume around the given point-set */
static BoundingVolumeCircle2 fromVertices(const std::vector<Point2>& verts) {
BoundingVolumeCircle2 bvs;
bvs.adjustToPointSet(verts);
return bvs;
}
static BoundingVolumeCircle2 join(const BoundingVolumeCircle2 a, const BoundingVolumeCircle2 b) {
return BoundingVolumeCircle2(Circle2::join(a, b));
}
};
#endif // BOUDINGVOLUMECIRCLE2_H