Wm4IntrSegment3Plane3.h

Go to the documentation of this file.
00001 // Wild Magic Source Code
00002 // David Eberly
00003 // http://www.geometrictools.com
00004 // Copyright (c) 1998-2007
00005 //
00006 // This library is free software; you can redistribute it and/or modify it
00007 // under the terms of the GNU Lesser General Public License as published by
00008 // the Free Software Foundation; either version 2.1 of the License, or (at
00009 // your option) any later version.  The license is available for reading at
00010 // either of the locations:
00011 //     http://www.gnu.org/copyleft/lgpl.html
00012 //     http://www.geometrictools.com/License/WildMagicLicense.pdf
00013 // The license applies to versions 0 through 4 of Wild Magic.
00014 //
00015 // Version: 4.0.0 (2006/06/28)
00016 
00017 #ifndef WM4INTRSEGMENT3PLANE3_H
00018 #define WM4INTRSEGMENT3PLANE3_H
00019 
00020 #include "Wm4FoundationLIB.h"
00021 #include "Wm4Intersector.h"
00022 #include "Wm4Segment3.h"
00023 #include "Wm4Plane3.h"
00024 
00025 namespace Wm4
00026 {
00027 
00028 template <class Real>
00029 class WM4_FOUNDATION_ITEM IntrSegment3Plane3
00030     : public Intersector<Real,Vector3<Real> >
00031 {
00032 public:
00033     IntrSegment3Plane3 (const Segment3<Real>& rkSegment,
00034         const Plane3<Real>& rkPlane);
00035 
00036     // object access
00037     const Segment3<Real>& GetSegment () const;
00038     const Plane3<Real>& GetPlane () const;
00039 
00040     // test-intersection query
00041     virtual bool Test ();
00042 
00043     // Find-intersection query.  The point of intersection is
00044     // P = origin + t*direction, with |t| <= e, where e is the segment
00045     // extent.
00046     virtual bool Find ();
00047     Real GetSegmentT () const;
00048 
00049 private:
00050     using Intersector<Real,Vector3<Real> >::IT_EMPTY;
00051     using Intersector<Real,Vector3<Real> >::IT_POINT;
00052     using Intersector<Real,Vector3<Real> >::IT_SEGMENT;
00053     using Intersector<Real,Vector3<Real> >::m_iIntersectionType;
00054 
00055     // the objects to intersect
00056     const Segment3<Real>& m_rkSegment;
00057     const Plane3<Real>& m_rkPlane;
00058 
00059     // information about the intersection set
00060     Real m_fSegmentT;
00061 };
00062 
00063 typedef IntrSegment3Plane3<float> IntrSegment3Plane3f;
00064 typedef IntrSegment3Plane3<double> IntrSegment3Plane3d;
00065 
00066 }
00067 
00068 #endif

Generated on Wed Nov 23 19:01:04 2011 for FreeCAD by  doxygen 1.6.1