BoundingBox.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: Core
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2011, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeCore/Base.h"
16 #include "CeeCore/Vec3d.h"
17 #include "CeeCore/Mat4d.h"
18 
19 namespace cee {
20 
21 
22 //==================================================================================================
23 //
24 // A bounding box
25 //
26 //==================================================================================================
27 class CEE_CORE_EXPORT BoundingBox
28 {
29 public:
30  BoundingBox();
31  BoundingBox(const Vec3d& min, const Vec3d& max);
32  BoundingBox(const BoundingBox& other);
33  ~BoundingBox();
34 
35  BoundingBox& operator=(const BoundingBox& rhs);
36  BoundingBox operator+(const BoundingBox& rhs);
37 
38  void reset();
39  bool isValid() const;
40 
41  void add(const Vec3d& vertex);
42  void add(const BoundingBox& bb);
43 
44  Vec3d minimum() const;
45  Vec3d maximum() const;
46 
47  Vec3d center() const;
48  Vec3d extent() const;
49  double radius() const;
50 
51  void transform(const Mat4d& matrix);
52 
53 private:
54  CEE_PRIVATE_IMPL(BoundingBox);
55 };
56 
57 } // namespace cee
cee::Str operator+(const char *str1, const cee::Str &str2)
Global operator to allow a const char + a cee::Str.
Definition: Str.cpp:817
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
Axis-aligned bounding box.
Definition: BoundingBox.h:27
Vector class for a 3D double vector.
Definition: Vec3d.h:26
4 dimensional matrix.
Definition: Mat4d.h:26