/*********************************************************************** * FXRuby -- the Ruby language bindings for the FOX GUI toolkit. * Copyright (c) 2001-2009 by Lyle Johnson. All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * For further information please contact the author by e-mail * at "lyle@lylejohnson.name". ***********************************************************************/ %ignore FXRanged::operator=(const FXRanged& bounds); %rename("empty?") FXRanged::empty() const; %rename("overlaps?") FXRanged::overlaps(const FXRanged& box) const; %rename("contains?") FXRanged::contains(FXfloat x,FXfloat y,FXfloat z) const; %rename("contains?") FXRanged::contains(const FXVec3d& p) const; %rename("contains?") FXRanged::contains(const FXRanged& bounds) const; %rename("contains?") FXRanged::contains(const FXSphered& sphere) const; %rename("intersects?") FXRanged::intersect(const FXVec3d& u,const FXVec3d& v) const; %rename("union") FXRanged::onion(const FXRanged& other) const; /// Range class FXRanged { public: FXVec3d lower; FXVec3d upper; public: // Default constructor FXRanged(); // Copy constructor FXRanged(const FXRanged& bounds); // Initialize FXRanged(FXdouble xlo,FXdouble xhi,FXdouble ylo,FXdouble yhi,FXdouble zlo,FXdouble zhi); // Initialize box to fully contains the given bounding sphere. FXRanged(const FXSphered& sphere); // Assignment FXRanged& operator=(const FXRanged& bounds); %extend { // Indexing with 0 or 1 FXVec3d& __getitem__(FXint i){ if(i<0||1corner(c); } /// Union of two boxes // This is not a typo. // We're calling this method "onion" to work around a bug in SWIG // that mistakes the method name "union" for the C++ keyword of the same // name. FXRanged onion(const FXRanged& other) const { return FX::unite(*self,other); } /// Intersection of two boxes FXRanged intersection(const FXRanged& other) const { return FX::intersect(*self,other); } } };