diff options
Diffstat (limited to 'libdimensionxx/object.cpp')
-rw-r--r-- | libdimensionxx/object.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libdimensionxx/object.cpp b/libdimensionxx/object.cpp index 61b8b7d..1a43f62 100644 --- a/libdimensionxx/object.cpp +++ b/libdimensionxx/object.cpp @@ -26,12 +26,14 @@ namespace Dimension Object::~Object() { } + // Get the transformation matrix Matrix Object::trans() { return Matrix(dmnsn()->trans); } + // Set the transformation matrix void Object::trans(const Matrix& trans) { @@ -42,14 +44,14 @@ namespace Dimension Array<double> Object::intersections(const Line& l) { - return Array<double>(dmnsn()->intersections_fn(dmnsn(), l.dmnsn())); + return Array<double>((*dmnsn()->intersections_fn)(dmnsn(), l.dmnsn())); } // Whether the point `point' is inside the object bool Object::inside(const Vector& point) { - return dmnsn()->inside_fn(dmnsn(), point.dmnsn()); + return (*dmnsn()->inside_fn)(dmnsn(), point.dmnsn()); } // Return the wrapped object @@ -93,7 +95,7 @@ namespace Dimension bool Object::unique() const { - return m_object.unique(); + return m_object && m_object.unique(); } // Set the wrapped dmnsn_object* |