Open3D (C++ API)
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
geometry_trampoline.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // The MIT License (MIT)
5 //
6 // Copyright (c) 2018 www.open3d.org
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 // IN THE SOFTWARE.
25 // ----------------------------------------------------------------------------
26 
27 #pragma once
28 
35 
37 #include "pybind/open3d_pybind.h"
38 
39 namespace open3d {
40 
41 template <class GeometryBase = geometry::Geometry>
42 class PyGeometry : public GeometryBase {
43 public:
44  using GeometryBase::GeometryBase;
45  GeometryBase& Clear() override {
46  PYBIND11_OVERLOAD_PURE(GeometryBase&, GeometryBase, );
47  }
48  bool IsEmpty() const override {
49  PYBIND11_OVERLOAD_PURE(bool, GeometryBase, );
50  }
51 };
52 
53 template <class Geometry3DBase = geometry::Geometry3D>
54 class PyGeometry3D : public PyGeometry<Geometry3DBase> {
55 public:
57  Eigen::Vector3d GetMinBound() const override {
58  PYBIND11_OVERLOAD_PURE(Eigen::Vector3d, Geometry3DBase, );
59  }
60  Eigen::Vector3d GetMaxBound() const override {
61  PYBIND11_OVERLOAD_PURE(Eigen::Vector3d, Geometry3DBase, );
62  }
63  Eigen::Vector3d GetCenter() const override {
64  PYBIND11_OVERLOAD_PURE(Eigen::Vector3d, Geometry3DBase, );
65  }
67  const override {
68  PYBIND11_OVERLOAD_PURE(geometry::AxisAlignedBoundingBox,
69  Geometry3DBase, );
70  }
72  PYBIND11_OVERLOAD_PURE(geometry::OrientedBoundingBox, Geometry3DBase, );
73  }
74  Geometry3DBase& Transform(const Eigen::Matrix4d& transformation) override {
75  PYBIND11_OVERLOAD_PURE(Geometry3DBase&, Geometry3DBase, transformation);
76  }
77 };
78 
79 template <class Geometry2DBase = geometry::Geometry2D>
80 class PyGeometry2D : public PyGeometry<Geometry2DBase> {
81 public:
83  Eigen::Vector2d GetMinBound() const override {
84  PYBIND11_OVERLOAD_PURE(Eigen::Vector2d, Geometry2DBase, );
85  }
86  Eigen::Vector2d GetMaxBound() const override {
87  PYBIND11_OVERLOAD_PURE(Eigen::Vector2d, Geometry2DBase, );
88  }
89 };
90 
91 } // namespace open3d
Geometry3DBase & Transform(const Eigen::Matrix4d &transformation) override
Definition: geometry_trampoline.h:74
Definition: geometry_trampoline.h:42
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:164
Eigen::Vector3d GetCenter() const override
Definition: geometry_trampoline.h:63
Eigen::Vector3d GetMinBound() const override
Definition: geometry_trampoline.h:57
A bounding box oriented along an arbitrary frame of reference.
Definition: BoundingVolume.h:44
Eigen::Vector3d GetMaxBound() const override
Definition: geometry_trampoline.h:60
bool IsEmpty() const override
Definition: geometry_trampoline.h:48
GeometryBase & Clear() override
Definition: geometry_trampoline.h:45
Definition: Open3DViewer.h:29
Eigen::Vector2d GetMaxBound() const override
Definition: geometry_trampoline.h:86
geometry::OrientedBoundingBox GetOrientedBoundingBox() const override
Definition: geometry_trampoline.h:71
Definition: geometry_trampoline.h:80
Definition: geometry_trampoline.h:54
geometry::AxisAlignedBoundingBox GetAxisAlignedBoundingBox() const override
Definition: geometry_trampoline.h:66
Eigen::Vector2d GetMinBound() const override
Definition: geometry_trampoline.h:83