00001 /********************************************************************************* 00002 * 00003 * Razor! Engine - A modular C++ presentation engine 00004 * 00005 * $Id: Geometry.h,v 1.1 2003/01/26 10:43:18 teacy Exp $ 00006 * 00007 * Copyright (c) 2000-2003 Tilo Christ. All Rights Reserved. 00008 * 00009 * Permission is hereby granted, free of charge, to any person obtaining a 00010 * copy of this software and associated documentation files (the "Software"), 00011 * to deal in the Software without restriction, including without limitation 00012 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00013 * and/or sell copies of the Software, and to permit persons to whom the Software 00014 * is furnished to do so, subject to the following conditions: 00015 * 00016 * The above copyright notice and this permission notice shall be included in all 00017 * copies or substantial portions of the Software. 00018 * 00019 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 00020 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 00021 * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 00022 * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00023 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00024 * 00025 **********************************************************************************/ 00026 00027 #ifndef GEOMETRY_H 00028 #define GEOMETRY_H 00029 00030 #include <PalmOS.h> 00031 #include "RazorSections.h" 00032 00033 00034 typedef struct {int x, y;} xy; 00035 typedef struct {int x, y, z;} xyz; 00036 00037 00038 00039 /** 00040 * A collection of geometric functions 00041 */ 00042 class Geometry 00043 { 00044 public: 00045 00046 /** 00047 * Determine a rectangle that encompasses two other rectangles. 00048 * 00049 * @param rect1Bound the bounds of rectangle #1 00050 * @param rect2Bound the bounds of rectangle #2 00051 * @param resultBound the bounds of the encompassing rectangle. 00052 * rect1Bound, or rect2Bound, and resultBound may safely point to the same RectangleType structure. 00053 */ 00054 static void uniteBounds(RectangleType *rect1Bound, RectangleType *rect2Bound, RectangleType *resultBound); 00055 00056 00057 00058 private: 00059 Geometry(); 00060 ~Geometry(); 00061 }; 00062 00063 #endif