OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GFX_BOX_F_H_ | 5 #ifndef UI_GFX_BOX_F_H_ |
6 #define UI_GFX_BOX_F_H_ | 6 #define UI_GFX_BOX_F_H_ |
7 | 7 |
8 #include "ui/gfx/point3_f.h" | 8 #include "ui/gfx/point3_f.h" |
9 #include "ui/gfx/vector3d_f.h" | 9 #include "ui/gfx/vector3d_f.h" |
10 | 10 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 92 } |
93 | 93 |
94 const Point3F& origin() const { return origin_; } | 94 const Point3F& origin() const { return origin_; } |
95 void set_origin(const Point3F& origin) { origin_ = origin; } | 95 void set_origin(const Point3F& origin) { origin_ = origin; } |
96 | 96 |
97 // Expands |this| to contain the given point, if necessary. Please note, even | 97 // Expands |this| to contain the given point, if necessary. Please note, even |
98 // if |this| is empty, after the function |this| will continue to contain its | 98 // if |this| is empty, after the function |this| will continue to contain its |
99 // |origin_|. | 99 // |origin_|. |
100 void ExpandTo(const Point3F& point); | 100 void ExpandTo(const Point3F& point); |
101 | 101 |
| 102 // Expands |this| to contain the given box, if necessary. Please note, even |
| 103 // if |this| is empty, after the function |this| will continue to contain its |
| 104 // |origin_|. |
| 105 void ExpandTo(const BoxF& box); |
| 106 |
102 private: | 107 private: |
103 // Expands the box to contain the two given points. It is required that each | 108 // Expands the box to contain the two given points. It is required that each |
104 // component of |min| is less than or equal to the corresponding component in | 109 // component of |min| is less than or equal to the corresponding component in |
105 // |max|. Precisely, what this function does is ensure that after the function | 110 // |max|. Precisely, what this function does is ensure that after the function |
106 // completes, |this| contains origin_, min, max, and origin_ + (width_, | 111 // completes, |this| contains origin_, min, max, and origin_ + (width_, |
107 // height_, depth_), even if the box is empty. Emptiness checks are handled in | 112 // height_, depth_), even if the box is empty. Emptiness checks are handled in |
108 // the public function Union. | 113 // the public function Union. |
109 void ExpandTo(const Point3F& min, const Point3F& max); | 114 void ExpandTo(const Point3F& min, const Point3F& max); |
110 | 115 |
111 Point3F origin_; | 116 Point3F origin_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 b.y() + v.y(), | 151 b.y() + v.y(), |
147 b.z() + v.z(), | 152 b.z() + v.z(), |
148 b.width(), | 153 b.width(), |
149 b.height(), | 154 b.height(), |
150 b.depth()); | 155 b.depth()); |
151 } | 156 } |
152 | 157 |
153 } // namespace gfx | 158 } // namespace gfx |
154 | 159 |
155 #endif // UI_GFX_BOX_F_H_ | 160 #endif // UI_GFX_BOX_F_H_ |
OLD | NEW |