triangle.h

Go to the documentation of this file.
00001 #ifndef TRIANGLE_CLASS
00002 #define TRIANGLE_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : triangle                                                          *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 1992-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "geometric_dll.h"
00019 
00020 // forward.
00021 class cartesian_line;
00022 class cartesian_point;
00023 
00024 namespace geometric {
00025 
00027 
00028 class GEOMETRIC_CLASS_STYLE triangle
00029 {
00030 public:
00031   triangle();
00032   triangle(const cartesian_point &vertex1, const cartesian_point &vertex2,
00033           const cartesian_point &vertex3);
00034   triangle(const triangle &to_copy);
00035   ~triangle();
00036 
00037   triangle &operator =(const triangle &to_copy);
00038 
00039   bool inside(const cartesian_point &where) const;
00040 
00041   double area() const;
00042 
00043   line<double> side_1_2() const;
00044   line<double> side_2_3() const;
00045   line<double> side_3_1() const;
00046 
00047   cartesian_point vertex_1() const;
00048   cartesian_point vertex_2() const;
00049   cartesian_point vertex_3() const;
00050 
00051   void vertex_1(const cartesian_point &to_set);
00052   void vertex_2(const cartesian_point &to_set);
00053   void vertex_3(const cartesian_point &to_set);
00054 
00055 protected:
00056   cartesian_point *_vertex_1;
00057   cartesian_point *_vertex_2;
00058   cartesian_point *_vertex_3;
00059 };
00060 
00061 } // namespace.
00062 
00063 #endif
00064 

Generated on Fri Nov 28 04:29:15 2008 for HOOPLE Libraries by  doxygen 1.5.1