CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csgeom/segment.h

Go to the documentation of this file.
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 
00028 #include "csgeom/vector2.h"
00029 #include "csgeom/vector3.h"
00030 
00034 class csSegment2
00035 {
00036 private:
00038   csVector2 start;
00040   csVector2 end;
00041 
00042 public:
00044   csSegment2 (const csVector2& s, const csVector2& e) { start = s; end = e; }
00046   csSegment2 () { }
00048   ~csSegment2 () { }
00049 
00051   void Set (const csVector2& s, const csVector2& e)
00052   { start = s; end = e; }
00053 
00055   void SetStart (const csVector2& s) { start = s; }
00056 
00058   void SetEnd (const csVector2& e) { end = e; }
00059 
00061   const csVector2& Start () const { return start; }
00062 
00064   const csVector2& End () const { return end; }
00065 
00067   csVector2& Start () { return start; }
00068 
00070   csVector2& End () { return end; }
00071 };
00072 
00076 class csSegment3
00077 {
00078 private:
00080   csVector3 start;
00082   csVector3 end;
00083 
00084 public:
00086   csSegment3 (const csVector3& s, const csVector3& e) { start = s; end = e; }
00088   csSegment3 () { }
00089 
00091   void Set (const csVector3& s, const csVector3& e)
00092   { start = s; end = e; }
00093 
00095   void SetStart (const csVector3& s) { start = s; }
00096 
00098   void SetEnd (const csVector3& e) { end = e; }
00099 
00101   const csVector3& Start () const { return start; }
00102 
00104   const csVector3& End () const { return end; }
00105 
00107   csVector3& Start () { return start; }
00108 
00110   csVector3& End () { return end; }
00111 };
00112 
00115 #endif // __CS_SEGMENT_H__

Generated for Crystal Space by doxygen 1.2.18