library of assembled shared sources

http://lass.cocamware.com

plane_3d.h

Go to the documentation of this file.
00001 /** @file
00002  *  @author Bram de Greve (bramz@users.sourceforge.net)
00003  *  @author Tom De Muer (tomdemuer@users.sourceforge.net)
00004  *
00005  *  *** BEGIN LICENSE INFORMATION ***
00006  *  
00007  *  The contents of this file are subject to the Common Public Attribution License 
00008  *  Version 1.0 (the "License"); you may not use this file except in compliance with 
00009  *  the License. You may obtain a copy of the License at 
00010  *  http://lass.sourceforge.net/cpal-license. The License is based on the 
00011  *  Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover 
00012  *  use of software over a computer network and provide for limited attribution for 
00013  *  the Original Developer. In addition, Exhibit A has been modified to be consistent 
00014  *  with Exhibit B.
00015  *  
00016  *  Software distributed under the License is distributed on an "AS IS" basis, WITHOUT 
00017  *  WARRANTY OF ANY KIND, either express or implied. See the License for the specific 
00018  *  language governing rights and limitations under the License.
00019  *  
00020  *  The Original Code is LASS - Library of Assembled Shared Sources.
00021  *  
00022  *  The Initial Developer of the Original Code is Bram de Greve and Tom De Muer.
00023  *  The Original Developer is the Initial Developer.
00024  *  
00025  *  All portions of the code written by the Initial Developer are:
00026  *  Copyright (C) 2004-2007 the Initial Developer.
00027  *  All Rights Reserved.
00028  *  
00029  *  Contributor(s):
00030  *
00031  *  Alternatively, the contents of this file may be used under the terms of the 
00032  *  GNU General Public License Version 2 or later (the GPL), in which case the 
00033  *  provisions of GPL are applicable instead of those above.  If you wish to allow use
00034  *  of your version of this file only under the terms of the GPL and not to allow 
00035  *  others to use your version of this file under the CPAL, indicate your decision by 
00036  *  deleting the provisions above and replace them with the notice and other 
00037  *  provisions required by the GPL License. If you do not delete the provisions above,
00038  *  a recipient may use your version of this file under either the CPAL or the GPL.
00039  *  
00040  *  *** END LICENSE INFORMATION ***
00041  */
00042 
00043 
00044 /** @struct lass::prim::Plane3D
00045  *  @brief A 3D hyper plane.
00046  *  @author BdG
00047  *  @date 2003
00048  *
00049  *  I assume if you look to this class, you'll wonder ... "where the heck did all the code go?"
00050  *  Hah, I'll tell ya.  There are more than one possible models for representing a plane.  We can
00051  *  use a cartesian equation N.P + S = 0, or we can use a parametric equation P = S + x*U + y*V.
00052  *  This class let's you choose what implementation you want: a pure partesian model, a pure
00053  *  parametric model, or a model that combines both.  This is done by moving all code to
00054  *  implemenations impl::Plane3DCartesian, impl::Plane3DParametric or impl::Plane3DCombined of
00055  *  which this class with inherent accoring the model you've chosen.  You can select the one you
00056  *  want by specifying the template parameter @c EquationPolicy.  You can either use Cartesian
00057  *  (which is the default), Parametric or Combined.  Each of them will model the plane
00058  *  differently.  They all provide the same interface, but might have different results.  They
00059  *  might have different memory footprints, different performances, and are optimized for
00060  *  different purposes.  Cartesian will select an implementation that only uses the cartesian
00061  *  equation and will be the smallest and the fastest for most purposes (that's why it is the
00062  *  default :).  For texture mapping, you might more like the Parametric model, because it has
00063  *  better support for direction vectors, but it'll have to calculate the normal on the spot if
00064  *  you need it.  Combined is the workhorse for heavy duties and implements both.  Plus, it
00065  *  buffers the reciprocal direction vectors, so finding the parameters (x, y) of a point on the
00066  *  plane can happen faster.
00067  *
00068  *  @section common_interface common interface
00069  *
00070  *  Anyway, let me give you some general info on this whole Plane3D thing.  Though there are
00071  *  three different implemntations, they all show the same interface.  We'll explore them by this
00072  *  common
00073  *  interface:
00074  *
00075  *  @subsection type_definitions type definitions
00076  *
00077  *  - @c TSelf: the type of @c this
00078  *  - @c TImpl: type of implemantion, can be impl::Plane3DCartesian, impl::Plane3DParametric or
00079  *              impl::Plane3DCombined.
00080  *  - @c TNormalizingPolicy: the type you've used as NormalizingPolicy.
00081  *  - @c TPoint: type of a afine point in space.
00082  *  - @c TVector: type of a vector in space.
00083  *  - @c TUV: a pair of values (u, v) for the parametric equation P = S + u*U + v*V.
00084  *  - @c TValue: same as util::CallTraits<T>::TValue.
00085  *  - @c TParam: same as util::CallTraits<T>::TParam.
00086  *  - @c TReference: same as util::CallTraits<T>::TReference.
00087  *  - @c TConstReference: same as util::CallTraits<T>::TConstReference.
00088  *  - @c TNumTraits: same as num::NumTraits<T>.
00089  *
00090  *  @subsection constructors
00091  *
00092  *  @par Plane3D():
00093  *  the default constructor brings the plane in an invalid state.  normal and/or direction vectors
00094  *  will have zero length, which indicates for this invalid state.
00095  *
00096  *  @par Plane3D(const TPoint& iSupport, const TPoint& iPointU, const TPoint& iPointV):
00097  *  construct a plane through three points.  The parametric equation P = S + u*U + v*V is going to
00098  *  be constructed as following: iSupport will be the support point S, and direction vectors U and
00099  *  V will be drawn from the support point to iPointU and iPointV: U = iPointU - iSupport and V =
00100  *  iPointV - iSupport.  The cartesian equation N.P + d == 0 is constructed as following: the normal
00101  *  N = U x V.  d is determined by demaning that N.iSupport + d == 0.
00102  *
00103  *  @par Plane3D(const TPoint& iSupport, const TVector& iDirU, const TVector& iDirV):
00104  *  constructs a plane through one support point and two direction vectors (the parametric equation,
00105  *  anyone? :).  For the parametric equation P = S + u*U + v*V, we have iSupport for S, iDirU for U
00106  *  and iDirV for V.  Again the cartesian equation N.P + d == 0 is given by N = U x V and
00107  *  N.iSupport + d == 0.
00108  *
00109  *  @par Plane3D(const TPoint& iSupport, const TVector& iNormal):
00110  *  constructs a plane through a support point and a normal vector.  For the parametric equation
00111  *  P = S + u*U + v*V, we have iSupport for S, but U and V we have to get a little dirty.  We have
00112  *  to find two vectors U and V so that iNormal = U x V.  See Plane3DCommonImpl::generateDirections
00113  *  on how we do that.  The cartesian N.P + d == 0 is simple, we have iNormal for N and d can be
00114  *  found by N.iSupport + d == 0.
00115  *
00116  *  @par Plane3D(const TVector& iNormal, TParam iD):
00117  *  construct a plane by a normal vector and fourth value (cartesian equation? :).  For the
00118  *  parametric equation P = S + u*U + v*V, all have to generated: for S we use the point -iD*iNormal
00119  *  that is the closest point of the plane to the origin, U and V we've generated again with our
00120  *  little trick Plane3DCommonImpl::generateDirections.  For the cartesian equation N.P + d == 0, we
00121  *  of course use N = iNormal and d = iD.
00122  *
00123  *  @subsection accessors
00124  *
00125  *  After constructions, all vectors are normalized depending on the NormalizingPolicy you've
00126  *  choosen.  if the normal vector N is scaled, then d is scaled as well, so it still represents
00127  *  the same plane.
00128  *
00129  *  Now, we have a series of accessors that give you access to the internal data of the plane,
00130  *  including support point, direction vectors, normal vector, ...  Only Plane3DCombined will be
00131  *  able to pull these directly from its internals, but the others don't have all data aboard, so
00132  *  they have to generate them.  Be carefull, because it's not always what you suspect.
00133  *
00134  *  @par const TPoint support():
00135  *  returns the support point of the plane.  If you used a support point for the construction of the
00136  *  plane, models Plane3DParametric and Plane3DCombined will give you back this original one,
00137  *  exactly till the last bit.  Plane3DCartesian doesn't keep track of support points, so it has to
00138  *  create one if you ask for it.  It uses -d*N, the point of the plane that is closest to the
00139  *  origin.  Mind you that this one probably will not be the same as the original one, totally
00140  *  different even!  Of course, if you used a cartesian equation to construct the plane (without any
00141  *  support point), then all three models need to generate a support point at some point: -d*N.  In*
00142  *  that case, all three models @e will return the same support point.
00143  *
00144  *  @par void getDirections(TVector& oDirU, TVector& oDirV):
00145  *  get the direction vectors of the plane.  almost same story as for support().  If you've created
00146  *  the plane by two direction vectors or through three points (which leads to two direction
00147  *  vectors), then models Plane3DParametric and Plane3DCombined will give you back these originals
00148  *  (for Unnormalized planes only!  but in case of Normalized planes, they still correspond with the
00149  *  original directions).  Plane3DCartesian has to regenerate them by using
00150  *  Plane3DCommonImpl::generateDirections, and hence it can end up with total different directions!
00151  *  (of the same plane of course).  In case you've feeded the plane with a normal vector instead of
00152  *  direction vectors, all have to generate them and end up with the same ones.
00153  *
00154  *  @par const TVector directionU():
00155  *  same story as getDirections(oDirU, oDirV), but only returns direction U.  In case of
00156  *  Plane3DCartesian, it calls getDirections(oDirU, oDirV) itselfs, but throws away half of the
00157  *  result.  Hence, it's pretty slow, certainly if you also call dirV(), cause it does the same
00158  *  thing.  And then you end up with two hidden calls to getDirections(oDirU, oDirV) (which means
00159  *  expensive generation of direction vectors), while you could have had the same result by calling
00160  *  getDirections(oDirU, oDirV) once yourself but at half the price.  So, the tip is: DO use
00161  *  getDirections(oDirU, oDirV) if you can and need them both, and certainly if you're dealing with
00162  *  the Plane3DCartesian model.
00163  *
00164  *  @par const TVector directionV():
00165  *  same story as directionU(), but returns V instead and throws away U.
00166  *
00167  *  @par void getReciprocals(TVector& oReciprocalU, TVector& oReciprocalV):
00168  *  gets the reciprocals for the direction vectors.  These reciprocals can be used to find back
00169  *  (u, v) in the parametric equation P = S + u*U + v*V for given P.  u = oReciprocalU * (P - S) and
00170  *  v = oReciprocalV * (P - S).  In fact, they are used by TUV uv(const TPoint& iPoint) which is
00171  *  described below :)  I'm not going to get in detail how get these reciprocals, but I will tell
00172  *  you that only Plane3DCombined has these stored on board, and can return them or use them without
00173  *  to generate them.  Plane3DParametric does has to generate them on the spot, and so does
00174  *  Plane3DCartesian.  However, for Plane3DCartesian it is even worse, because before it can create
00175  *  reciprocals, it has to create direction vectors first!
00176  *
00177  *  @par const TVector reciprocalU():
00178  *  same story as getReciprocals(oReciprocalU, oReciprocalV), but returns only oReciprocalU.  same
00179  *  remark as on const TVector dirU(): if it has to  generate it, it has to generate both
00180  *  reciprocals, so it might be faster to use getReciprocals(oReciprocalU, oReciprocalV).
00181  *
00182  *  @par const TVector reciprocalV():
00183  *  same story as reciprocalV(), but returns the other one.
00184  *
00185  *  @par void getCartesian(TVector& oNormal, TReference oD):
00186  *  gets normal vector and d-value for the cartesian equation.  Now, this is the first one
00187  *  Plane3DCartesian has aboard itself.  Plane3DCombined also has it, but now it's up to
00188  *  Plane3DParametric to generate some stuff :)  Though, it's less worse than the other way around.
00189  *  This is because the parametric equation contains more information that the normal vector, and
00190  *  doesn't have to 'invent' anything like Plane3DCartesian has to do to return support point or
00191  *  direction vectors.  Actually, in theory, all three models should return the same normal and
00192  *  d-value.  In practice however, we have to deal with numerical imprecisions.  so the result of
00193  *  Plane3DParametric can differ a little in the last bits.  not a big difference, but enough to be
00194  *  inequal.
00195  *
00196  *  @par const TVector normal():
00197  *  returns only the normal vector of the cartesian equation.  For Plane3DParametric we have again
00198  *  the same remark as for getDirections and getReciprocals: it uses getCartesian anyway, so that
00199  *  might be faster if you both need the normal and d-value.
00200  *
00201  *  @par TValue d():
00202  *  same as normal(), but returns only the value d instead of the normal vector.
00203  *
00204  *  @par const XYZ majorAxis() const
00205  *  Return the major axis of the normal vector.
00206  *  The major axis is the one with the largest (absolute) component value.  e.g. if the normal
00207  *  vector is (-1, 4, -8), this will be the @e z axis because abs(-8) > abs(4) > abs(-1).
00208  *  In case there's more than one major axis possible, the "highest" index is choosen.  e.g.
00209  *  if the normal vector is (1, 1, 0), then @e y axis will be choosen, because @e y has a higher
00210  *  index than @e x .
00211 
00212  *
00213  *  @subsection methods_cartesian cartesian methods
00214  *
00215  *  So far the accessors.  let's get to cooler stuff.  For most of this stuff, we need the cartesian
00216  *  equation.  Plane3DCartesian and Plane3DCombined have it on board, but Plane3DParametric will
00217  *  have to generate it each call.  Keep that in mind!
00218  *
00219  *  @par Side classify(const TPoint& iPoint):
00220  *  tells at which side of the plane we can find the point iPoint: the front (sFront), the back
00221  *  (sBack), or right on the surface (sSurface). the front is the side where the normal sticks or
00222  *  points to.  The back is the other one. iPoint is exactly one the surface if N.iPoint + d == 0.
00223  *  Since we need the parametric equation, Plane3DParametric might have a performance hit here.
00224  *
00225  *  @par TValue equation(const TPoint& iPoint):
00226  *  fills in the point iPoint in the cartesian equation and returns the resutl.  N.iPoint + d will
00227  *  usually not be equal to zero (it's only zero for points on the plane).  This method returns what
00228  *  it is equal to. i.e. it returns N.iPoint + d.  For Normalized planes this is the same as the
00229  *  distance of iPoint to the plane, but not for Unnormalized planes, keep that in mind!  If you
00230  *  need the distance, used signedDistances(iPoint) as described below.  Again you might have a
00231  *  performance hit for the Plane3DParametric model because of the need of the cartesian equation.
00232  *
00233  *  @par TValue signedDistance(const TPoint& iPoint):
00234  *  returns the distance of the point to the plane, but signed. it will be positive for points in
00235  *  front of the plane, and negative for the ones in the back (also see: classify(iPoint)).  The
00236  *  real (unsigned) distances is simply the absolute value of the result.  For Normalized planes
00237  *  signedDistances(iPoint) will be equal to equation(iPoint).  But for Unnormalized planes
00238  *  signedDistances still divides through the normal's length Again performance hit for
00239  *  Plane3DParametric because of the need of the cartesian equation.
00240  *
00241  *  @par TValue squaredDistance(const TPoint& iPoint):
00242  *  returns the distance of iPoint to the plane but squared.  Not much more to tell, realy :)  Again
00243  *  performance hit for Plane3DParametric because of the cartesian equation.
00244  *
00245  *  @par TVector reject(const TPoint& iPoint):
00246  *  returns rejection of iPoint by the plane.  This is a bit tricky to explain.  If you have a
00247  *  support point S, then this rejection is the part of (iPoint - S) that is parallel to the normal
00248  *  vector (or orthogonal to the plane).  This would be the same as the rejection of (iPoint - S)
00249  *  (given by reject(iPoint - S), see below). But more descriptive might be: it is the vector you
00250  *  have to add to the projection of this point on the plane (given by project(iPoint), see below),
00251  *  to get back iPoint: iPoint == project(iPoint) + reject(iPoint). Again performance hit for
00252  *  Plane3DParametric because of the cartesian equation.
00253  *
00254  *  @par TVector reject(const TVector& iVector):
00255  *  returns rejection of iVector by the plane.  This is already somewhat easier.  the rejection of
00256  *  iVector is that part of iVector that is parallel to the normal vector of the plane.  You can µ
00257  *  also say that it is the orthogonal projection of iVector on the normal vector.  Or the part of
00258  *  iVector that is orthogonal to the plane.   Again performance hit for Plane3DParametric because
00259  *  of the cartersian equation.
00260  *
00261  *  @par TPoint project(const TPoint& iPoint):
00262  *  return the orthogonal projection of iPoint on the plane.  It is the point on the plane that is
00263  *  the closest one to iPoint.  If you draw a line through iPoint parallel to the normal vector,
00264  *  this projection is the point where this line intersects the plane.  It is know that iPoint ==
00265  *  project(iPoint) + reject(iPoint).  Again performance hit for Plane3DParametric because of the
00266  *  cartesian equation.
00267  *
00268  *  @par TVector project(const TVector& iVector):
00269  *  return the orthogonal projection of iVector on the plane.  It is the part of iVector that is parallel to the plane, or orthogonal to
00270  *  the normal vector.  It is known that iVector == project(iVector) + reject(iVector).  Again
00271  *  performance hit for Plane3DParametric because of the cartesian equation.
00272  *
00273  *  @par TPoint reflect(const TPoint& iPoint):
00274  *  return the reflection of iPoint in the plane.  It is the point at the same distance of the
00275  *  plane, but at the exact opposite side of the plane.  If you draw a line through iPoint parallel
00276  *  to the normal vector, it's the only other point on that line that is at the same (absolute)
00277  *  distance of the plane. If you walk from iPoint to the intersection point of the line and the
00278  *  plane, and you walk further the same distance again, you arrive at reflection of iPoint.  It is
00279  *  known that reflect(iPoint) == project(iPoint) - reject(iPoint).  Again performance hit for
00280  *  Plane3DParametric because of the cartesian equation.
00281  *
00282  *  @par TVector reflect(const TVector& iVector):
00283  *  return the reflection of iVector in the plane. It's the vector of which the orthogonal part to
00284  *  the plane is flipped.  It is know that reflect(iVector) == project(iVector) - reject(iVector).
00285  *  Again performance hit for Plane3DParametric because of the cartesian equation.
00286  *
00287  *  @subsection cartesian_methods cartesian methods
00288  *
00289  *  So far functions for the cartesian boys.  Now some stuff for parametric fellows. It's about how
00290  *  we can get a point of the plane if we now its two parametrs u and v, and how we can find u and v
00291  *  if we know a point of the plane.
00292  *
00293  *  @par TPoint point(TValue iU, TValue iV):
00294  *  return a point of the parametric equation P = S + iU * dirU + iV * dirV.  In case of
00295  *  Plane3DCartesian, we have the same remarks as for getDirections(oDirU, oDirV): not only we have
00296  *  a performance hit, we probably also have to deal with totally different direction vectors than
00297  *  the ones we have put in the constructor.
00298  *
00299  *  @par TPoint point(TUV iUV):
00300  *  return a point of the parametric equation P = S + iUV.x * dirU + iUV.y * dirV.  Pretty much the
00301  *  same thing as the one above, but packs both values in one pair iUV.  Same remarks on
00302  *  Plane3DCartesian.
00303  *
00304  *  @par TUV uv(const TPoint& iPoint):
00305  *  returns a pair a values (u, v) so that iPoint == S + u * dirU + v * dirV.  In theory, if you put
00306  *  these back in point(u, v), you should end up with iPoint again: point(uv(iPoint)) == iPoint ?
00307  *  Well, this is not totally true First of all, even in theory, it can only be true if iPoint is a
00308  *  point of the plane. if iPoint is not on the plane, then uv(iPoint) will give you the parameters
00309  *  of the point on the plane that is closest to iPoint.  And that point is the projection of
00310  *  iPoint.  So, the most you can say is that point(uv(iPoint)) == project(iPoint) ?  Yes, but IN
00311  *  THEORY!  In practice, however, numerical imprecisions will probably give you a slightly
00312  *  different result.  You'll be very close, but the last bits will differ enough to make the them
00313  *  inequal.  But with some epsilons, you'll be alright.  Some performance remarks:  Only
00314  *  Plane3DCombined has the necessary reciprocals for the direction vectors on board (remember the
00315  *  getReciprocals() discussion?  well, here it we have it :) Plane3DParametric does not, and will
00316  *  have to recreate them on each call.  This _might_ and probably will be quite costly.  For
00317  *  Plane3DCartesian, you're totally screwed: not only do we have to genereate the reciprocals, but
00318  *  we also have to generate the direction vectors we want to create reciprocals of!  So, you'll pay
00319  *  twice.  And above all, it won't be the reciprocals of the direction vectors you've put it.
00320  *
00321  *  @subsection misc_methods misc. methods
00322  *
00323  *  @par void flip():
00324  *  flips the plane so that the front becomes the back and the back becomes the front.  For the
00325  *  cartesian equation, this is done by negating the normal and d: N = -N and d = -d.  Of the parametric
00326  *  equation, direction vector U is flipped:
00327  *  U = -U.
00328  *
00329  *  @par bool isValid():
00330  *  returns true if the interal data represents a valid plane, and false if not.  A plane is valid
00331  *  if none of the direction vectors nor the normal vector are zero vectors.  And above of that,
00332  *  the direction vectors may not be colinear. Of course, we only test internal data.  We will not
00333  *  generate direction vectors (in case of Plane3DCartesian), just to test the if they are valid.
00334  *  We can safely do that, because we know that if the normal vector is valid, then the generated
00335  *  directions will be too.
00336  */
00337 
00338 
00339 
00340 #ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_PLANE_3D_H
00341 #define LASS_GUARDIAN_OF_INCLUSION_PRIM_PLANE_3D_H
00342 
00343 #include "prim_common.h"
00344 #include "equation_policy.h"
00345 #include "normalizing_policy.h"
00346 #include "point_2d.h"
00347 #include "point_3dh.h"
00348 #include "xyz.h"
00349 #include "impl/plane_3d_impl.h"
00350 #include "../num/floating_point_comparison.h"
00351 
00352 
00353 
00354 namespace lass
00355 {
00356 namespace prim
00357 {
00358 
00359 template <typename T, class EquationPolicy = Cartesian, class NormalizingPolicy = Normalized>
00360 class Plane3D: public impl::Plane3DImpl<T, EquationPolicy, NormalizingPolicy>::Type
00361 {
00362 public:
00363 
00364     typedef Plane3D<T, EquationPolicy, NormalizingPolicy> TSelf;
00365     typedef typename impl::Plane3DImpl<T, EquationPolicy, NormalizingPolicy>::Type TImpl;
00366 
00367     typedef typename TImpl::TPoint  TPoint;
00368     typedef typename TImpl::TVector TVector;
00369     typedef typename TImpl::TParam  TParam;
00370     typedef typename TImpl::TValue  TValue;
00371     typedef typename TImpl::TReference  TReference;
00372     typedef typename TImpl::TConstReference TConstReference;
00373     typedef typename TImpl::TNumTraits TNumTraits;
00374 
00375     template <typename U>
00376     struct Rebind
00377     {
00378         typedef Plane3D<U, EquationPolicy, NormalizingPolicy> Type;
00379     };
00380 
00381     Plane3D();
00382     Plane3D(const TPoint& iSupport, const TPoint& iPointU, const TPoint& iPointV);
00383     Plane3D(const TPoint& iSupport, const TVector& iDirU, const TVector& iDirV);
00384     Plane3D(const TVector& iNormal, const TPoint& iSupport);
00385     Plane3D(const TVector& iNormal, TParam iD);
00386 
00387     const Side classify(const TPoint& iPoint) const;
00388     const TValue signedDistance(const TPoint& iPoint) const;
00389     const TValue squaredDistance(const TPoint& iPoint) const;
00390 
00391     const Side classify(const TPoint& iPoint, TParam iRelativeTolerance) const;
00392     const TValue signedDistance(const TPoint& iPoint, TParam iRelativeTolerance) const;
00393     const TValue squaredDistance(const TPoint& iPoint, TParam iRelativeTolerance) const;
00394 
00395     const XYZ majorAxis() const;
00396 
00397     /*
00398     typedef NormalizingPolicy TNormalizingPolicy;
00399 
00400     typedef Point3D<T> TPoint;
00401     typedef TPoint::TVector TVector;
00402     typedef Point2D<T> TUV;
00403 
00404     typedef TPoint::TValue TValue;
00405     typedef TPoint::TParam TParam;
00406     typedef TPoint::TReference TReference;
00407     typedef TPoint::TConstReference TConstReference;
00408     typedef TPoint::TNumTraits TNumTraits;
00409 
00410     enum { dimension = TPoint::dimension };
00411 
00412     const TPoint support() const;
00413     void getDirections(TVector& oDirU, TVector& oDirV) const;
00414     const TVector directionU() const;
00415     const TVector directionV() const;
00416 
00417     void getReciprocals(TVector& oReciprocalU, TVector& oReciprocalV) const;
00418     const TVector reciprocalU() const;
00419     const TVector reciprocalV() const;
00420 
00421     void getCartesian(TVector& oNormal, TReference oD) const;
00422     const TVector& normal() const;
00423     TConstReference d() const;
00424     const XYZ majorAxis() const;
00425 
00426     Side classify(const TPoint& iPoint) const;
00427     TValue equation(const TPoint& iPoint) const;
00428     TValue signedDistance(const TPoint& iPoint) const;
00429     TValue squaredDistance(const TPoint& iPoint) const;
00430 
00431     TVector reject(const TPoint& iPoint) const;
00432     TVector reject(const TVector& iVector) const;
00433     TPoint project(const TPoint& iPoint) const;
00434     TVector project(const TVector& iVector) const;
00435     TPoint reflect(const TPoint& iPoint) const;
00436     TVector reflect(const TVector& iVector) const;
00437 
00438     TPoint point(TParam iU, TParam iV) const;
00439     TPoint point(const TUV& iUV) const;
00440     TUV uv(const TPoint& iPoint) const;
00441 
00442     void flip();
00443     bool isValid() const;
00444     */
00445 };
00446 
00447 template <typename T>
00448 io::XmlOStream& operator<<(io::XmlOStream& ioOStream, const Plane3D<T, Cartesian>& iPlane);
00449 template <typename T>
00450 io::XmlOStream& operator<<(io::XmlOStream& ioOStream, const Plane3D<T, Parametric>& iPlane);
00451 template <typename T>
00452 io::XmlOStream& operator<<(io::XmlOStream& ioOStream, const Plane3D<T, Combined>& iPlane);
00453 
00454 }
00455 
00456 }
00457 
00458 #include "plane_3d.inl"
00459 
00460 //#ifdef LASS_GUARDIAN_OF_INCLUSION_PRIM_LINE_3D_H
00461 //#include "line_3d_plane_3d.h"
00462 //#endif
00463 
00464 #ifdef LASS_GUARDIAN_OF_INCLUSION_PRIM_LINE_SEGMENT_3D_H
00465 #   include "line_segment_3d_plane_3d.h"
00466 #endif
00467 
00468 #ifdef LASS_GUARDIAN_OF_INCLUSION_PRIM_RAY_3D_H
00469 #   include "plane_3d_ray_3d.h"
00470 #endif
00471 
00472 #ifdef LASS_GUARDIAN_OF_INCLUSION_PRIM_TRANSFORMATION_3D_H
00473 #   include "plane_3d_transformation_3d.h"
00474 #endif
00475 
00476 #endif
00477 
00478 // --- END OF FILE ------------------------------------------------------------------------------

Generated on Mon Nov 10 14:20:40 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo