Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

segment.h

00001 /*
00002     Copyright (C) 2000 by Jorrit Tyberghein
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifndef __CS_SEGMENT_H__
00020 #define __CS_SEGMENT_H__
00021 
00022 #include "csgeom/vector2.h"
00023 #include "csgeom/vector3.h"
00024 
00028 class csSegment2
00029 {
00030 private:
00032   csVector2 start;
00034   csVector2 end;
00035 
00036 public:
00038   csSegment2 (const csVector2& s, const csVector2& e) { start = s; end = e; }
00040   csSegment2 () { }
00042   ~csSegment2 () { }
00043 
00045   void Set (const csVector2& s, const csVector2& e)
00046   { start = s; end = e; }
00047 
00049   void SetStart (const csVector2& s) { start = s; }
00050 
00052   void SetEnd (const csVector2& e) { end = e; }
00053 
00055   const csVector2& Start () const { return start; }
00056 
00058   const csVector2& End () const { return end; }
00059 
00061   csVector2& Start () { return start; }
00062 
00064   csVector2& End () { return end; }
00065 };
00066 
00070 class csSegment3
00071 {
00072 private:
00074   csVector3 start;
00076   csVector3 end;
00077 
00078 public:
00080   csSegment3 (const csVector3& s, const csVector3& e) { start = s; end = e; }
00082   csSegment3 () { }
00083 
00085   void Set (const csVector3& s, const csVector3& e)
00086   { start = s; end = e; }
00087 
00089   void SetStart (const csVector3& s) { start = s; }
00090 
00092   void SetEnd (const csVector3& e) { end = e; }
00093 
00095   const csVector3& Start () const { return start; }
00096 
00098   const csVector3& End () const { return end; }
00099 
00101   csVector3& Start () { return start; }
00102 
00104   csVector3& End () { return end; }
00105 };
00106 
00107 #endif // __CS_SEGMENT_H__

Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000