diff options
author | click <none@none> | 2010-08-27 01:52:05 +0200 |
---|---|---|
committer | click <none@none> | 2010-08-27 01:52:05 +0200 |
commit | 7686d6ee57038e848f75130563fc78c1adebc1a2 (patch) | |
tree | 258a7a6db03e3479a0219ace8cfc3ec3ba53a1be /dep/g3dlite/source/Rect2D.cpp | |
parent | 1d3deae555f0ec523d77875bd5a307ab9bd19742 (diff) |
Core/Dependency: Upgrade G3d-library to v8.0-release (patched version!)
Note: Due to issues with G3D (normally requiring X11 and the ZIP-library),
the sourcetree version contains a modified version. The applied patch is
commited to the repository for future reference.
--HG--
branch : trunk
Diffstat (limited to 'dep/g3dlite/source/Rect2D.cpp')
-rw-r--r-- | dep/g3dlite/source/Rect2D.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/dep/g3dlite/source/Rect2D.cpp b/dep/g3dlite/source/Rect2D.cpp new file mode 100644 index 00000000000..e4148315a58 --- /dev/null +++ b/dep/g3dlite/source/Rect2D.cpp @@ -0,0 +1,41 @@ +/** + @file Rect2D.cpp + + @maintainer Morgan McGuire, http://graphics.cs.williams.edu + + @created 2003-11-13 + @created 2009-11-16 + + Copyright 2000-2009, Morgan McGuire. + All rights reserved. + */ + +#include "G3D/platform.h" +#include "G3D/Rect2D.h" +#include "G3D/Any.h" +#include "G3D/stringutils.h" + +namespace G3D { + +/** \param any Must either Rect2D::xywh(#, #, #, #) or Rect2D::xyxy(#, #, #, #)*/ +Rect2D::Rect2D(const Any& any) { + any.verifyName("Rect2D"); + any.verifyType(Any::ARRAY); + any.verifySize(4); + if (toUpper(any.name()) == "RECT2D::XYWH") { + *this = Rect2D::xywh(any[0], any[1], any[2], any[3]); + } else { + any.verifyName("Rect2D::xyxy"); + *this = Rect2D::xyxy(any[0], any[1], any[2], any[3]); + } +} + + +/** Converts the Rect2D to an Any. */ +Rect2D::operator Any() const { + Any any(Any::ARRAY, "Rect2D::xywh"); + any.append(x0(), y0(), width(), height()); + return any; +} + +} |