| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * Plane.hpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Apr 7, 2010
|
|---|
| 5 | * Author: crueger
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef PLANE_HPP_
|
|---|
| 9 | #define PLANE_HPP_
|
|---|
| 10 |
|
|---|
| 11 | #include <memory>
|
|---|
| 12 |
|
|---|
| 13 | class Vector;
|
|---|
| 14 |
|
|---|
| 15 | class Plane
|
|---|
| 16 | {
|
|---|
| 17 | typedef std::auto_ptr<Vector> vec_ptr;
|
|---|
| 18 | public:
|
|---|
| 19 | Plane(const Vector &y1, const Vector &y2, const Vector &y3);
|
|---|
| 20 | Plane(const Vector &y1, const Vector &y2, double _offset);
|
|---|
| 21 | Plane(const Vector &_normalVector, double _offset=0);
|
|---|
| 22 | Plane(const Vector &_normalVector, const Vector &_offsetVector);
|
|---|
| 23 | virtual ~Plane();
|
|---|
| 24 |
|
|---|
| 25 | // Accessor Functions
|
|---|
| 26 | /**
|
|---|
| 27 | * returns normal Vector for a plane
|
|---|
| 28 | */
|
|---|
| 29 | Vector getNormal();
|
|---|
| 30 | /**
|
|---|
| 31 | * returns the distance of the plane from the origin
|
|---|
| 32 | */
|
|---|
| 33 | double getOffset();
|
|---|
| 34 | /**
|
|---|
| 35 | * returns a vector that points on the plane.
|
|---|
| 36 | * Same as getOffset()*getNormal();
|
|---|
| 37 | */
|
|---|
| 38 | Vector getOffsetVector();
|
|---|
| 39 |
|
|---|
| 40 | // some calculations
|
|---|
| 41 | Vector GetIntersection(const Vector &Origin, const Vector &LineVector);
|
|---|
| 42 |
|
|---|
| 43 | private:
|
|---|
| 44 | vec_ptr normalVector;
|
|---|
| 45 | double offset;
|
|---|
| 46 | };
|
|---|
| 47 |
|
|---|
| 48 | #endif /* PLANE_HPP_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.