| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# 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
    00029 #include "csextern.h"
    00030
    00031 #include "csgeom/vector2.h"
    00032 #include "csgeom/vector3.h"
    00033
    00037 class csSegment2
    00038 {
    00039 private:
    00041   csVector2 start;
    00043   csVector2 end;
    00044
    00045 public:
    00047   csSegment2 (const csVector2& s, const csVector2& e) { start = s; end = e; }
    00049   csSegment2 () { }
    00051   ~csSegment2 () { }
    00052
    00054   inline void Set (const csVector2& s, const csVector2& e)
    00055   { start = s; end = e; }
    00056
    00058   inline void SetStart (const csVector2& s) { start = s; }
    00059
    00061   inline void SetEnd (const csVector2& e) { end = e; }
    00062
    00064   inline const csVector2& Start () const { return start; }
    00065
    00067   inline const csVector2& End () const { return end; }
    00068
    00070   inline csVector2& Start () { return start; }
    00071
    00073   inline csVector2& End () { return end; }
    00074 };
    00075
    00079 class csSegment3
    00080 {
    00081 private:
    00083   csVector3 start;
    00085   csVector3 end;
    00086
    00087 public:
    00089   csSegment3 (const csVector3& s, const csVector3& e) { start = s; end = e; }
    00091   csSegment3 () { }
    00092
    00094   inline void Set (const csVector3& s, const csVector3& e)
    00095   { start = s; end = e; }
    00096
    00098   inline void SetStart (const csVector3& s) { start = s; }
    00099
    00101   inline void SetEnd (const csVector3& e) { end = e; }
    00102
    00104   inline const csVector3& Start () const { return start; }
    00105
    00107   inline const csVector3& End () const { return end; }
    00108
    00110   inline csVector3& Start () { return start; }
    00111
    00113   inline csVector3& End () { return end; }
    00114 };
    00115
    00118 #endif // __CS_SEGMENT_H__