Debian Codegraph @

src/atlas/interpolation/method/Ray.h

raw
1 /*
2 * (C) Copyright 2013 ECMWF.
3 *
4 * This software is licensed under the terms of the Apache Licence Version 2.0
5 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6 * In applying this licence, ECMWF does not waive the privileges and immunities
7 * granted to it by virtue of its status as an intergovernmental organisation
8 * nor does it submit to any jurisdiction.
9 */
10
11 #pragma once
12
13 #include <iosfwd>
14
15 #include "atlas/interpolation/Vector3D.h"
16 #include "atlas/util/Point.h"
17
18 namespace atlas {
19 namespace interpolation {
20 namespace method {
21
22 //----------------------------------------------------------------------------------------------------------------------
23
24 /// Ray trace data structure
25
26 struct Ray {
27 Vector3D orig;
28 Vector3D dir;
29
30 /// initializes ray with origin in point and direction to (0,0,0)
31 explicit Ray(const double* p);
32
33 Ray(const double* o, const double* d);
34
35 explicit Ray(const PointXYZ&);
36
37 Ray(const PointXYZ&, const Vector3D&);
38
39 Vector3D operator()(double t) const { return orig + t * dir; }
40
41 void print(std::ostream& s) const;
42
43 friend std::ostream& operator<<(std::ostream& s, const Ray& p);
44 };
45
46 //----------------------------------------------------------------------------------------------------------------------
47
48 } // namespace method
49 } // namespace interpolation
50 } // namespace atlas