From 6e7e008ed35ccc8a492d8f13b7a7e162f9416327 Mon Sep 17 00:00:00 2001 From: mtarini Date: Tue, 16 Mar 2004 03:08:02 +0000 Subject: [PATCH] first commit --- vcg/space/space.h | 76 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 vcg/space/space.h diff --git a/vcg/space/space.h b/vcg/space/space.h new file mode 100644 index 00000000..b57c6b64 --- /dev/null +++ b/vcg/space/space.h @@ -0,0 +1,76 @@ +/**************************************************************************** +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program 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 General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ +/**************************************************************************** + History + +$Log: not supported by cvs2svn $ + +****************************************************************************/ + +#ifndef __VCGLIB_SPACE +#define __VCGLIB_SPACE + + +#include + +namespace vcg { +/*@{*/ + /** + This class represents the interface for any spatial objects. + (points, lines, rays, segments, planes, triangles, axis aligned box). + It consists in (the declaration of) a set of functions and types that + each such object mush have. + */ + +template class Point; +template class Box; + +template +class Space { +public: + /// Dimension is a constant determines the dimension of the space. + enum {Dimension=N}; + /// the type used as scalar. Typically, float or double, but char or int are possible too. + typedef S ScalarType; + /// type used as point Type + typedef Point PointType; + /// the ... + typedef ParamType; + + /// returns the bounding box of the object + Box const BBox() const; + + /// given a point, return the closest point + PointType ClosestPoint(PointType const &p) const; + + PointType LocalToGlobal(ParamType); + + ParamType GlobalToLocal(ParamType); +}; // end class definition + +/*@}*/ + + + +} // end namespace +#endif \ No newline at end of file