VR-Link API Documentation for HLA 1516
3dExtent.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 
00006 #ifndef _3dExtent_H
00007 #define _3dExtent_H
00008 
00012 
00013 
00014 #include <vlutil/vlMachineTypes.h>
00015 #include "3dPoint.h"
00016 #include <iosfwd>
00017 
00018 #ifdef DtUSE_UTILITIES_NAMESPACE
00019 namespace DtUSE_UTILITIES_NAMESPACE
00020 {
00021 #endif
00022 
00023 class Dt3dChord;
00024 
00045 class DT_DLL_MATRIX Dt3dExtent
00046 {
00047 public:
00048 
00052    Dt3dExtent();
00053 
00055    Dt3dExtent(const Dt3dExtent& orig);
00056 
00059    Dt3dExtent(const double minX, const double maxX,
00060               const double minY, const double maxY,
00061               const double minZ, const double maxZ );
00062 
00066    Dt3dExtent(const Dt3dPoint& p0, const Dt3dPoint& p1);
00067 
00071    Dt3dExtent(const Dt3dChord& lineSeg);
00072 
00073    virtual ~Dt3dExtent();
00074 
00075    Dt3dExtent& operator=(const Dt3dExtent& orig);
00076 
00077    virtual bool operator==(const Dt3dExtent& rhs) const;
00078    virtual bool operator!=(const Dt3dExtent& rhs) const;
00079 
00080 //- -------------- access/manipulate size/shape routines -----------------
00081 
00083 
00084    double minX() const;
00085    double minY() const;
00086    double minZ() const;
00087    double maxX() const;
00088    double maxY() const;
00089    double maxZ() const;
00090 
00091    void setMinX(double x);
00092    void setMinY(double y);
00093    void setMinZ(double z);
00094    void setMaxX(double x);
00095    void setMaxY(double y);
00096    void setMaxZ(double z);
00098    
00100    virtual const Dt3dPoint center() const;
00101 
00103    virtual void setCenter(const Dt3dPoint& p);
00104 
00106    virtual void setFromCenter(const Dt3dPoint& p,
00107                               const double& xDist, 
00108                               const double& yDist, 
00109                               const double& zDist);
00110 
00111 
00113 
00114    double xSize() const;
00115    double ySize() const;
00116    double zSize() const;
00118 
00120    virtual Dt3dPoint maxPoint() const;
00121 
00123    virtual Dt3dPoint minPoint() const;
00124 
00128    bool empty() const;
00129 
00131    virtual void expandToInclude(const Dt3dExtent& otherExtent);
00132 
00134    virtual void expandToInclude(const Dt3dPoint& point);
00135 
00137    virtual void expandToInclude(const Dt3dChord& chord);
00138  
00139 
00140 //- --------------- intersection tests ---------------------------   
00141 //- ---  could be potentially moved to an DtExtentIntersector class ---
00142 
00145    virtual bool contains(const Dt3dExtent& otherExtent) const;
00146 
00149    virtual bool contains(const Dt3dPoint& point) const;
00150    
00153    virtual bool contains(const Dt3dChord& chord) const;
00154   
00157    bool intersects(const Dt3dExtent& otherExtent) const;
00158  
00161    bool doesNotIntersect(const Dt3dExtent& otherExtent) const;
00162  
00166    bool intersects(const Dt3dChord& chord) const;
00167 
00168 protected:
00169 
00175    bool intersectsLineOfChord(const Dt3dChord& chord, 
00176       double& distInChordLengthsFirst, double& distInChordLengthsLast) const;
00177 
00188    bool intersectsSoFar(const double pointVal,
00189       const double rayVal, const double side0, const double side1, 
00190       double &firstTime, double &lastTime) const;
00191 
00192 //- --------------- end intersection tests ---------------------------   
00193 
00194 protected:
00197    void guaranteeValidConstruction();
00198 
00199 protected:
00200    double myMinX;
00201    double myMaxX;
00202    double myMinY;
00203    double myMaxY;
00204    double myMinZ;
00205    double myMaxZ;
00206 
00207 public:
00208 
00210    static Dt3dExtent& nullExtent();
00211 
00212 };
00213 
00214 #define _3dExtent_inl
00215 #include "3dExtent.inl"
00216 #undef _3dExtent_inl
00217 
00218 DT_DLL_MATRIX std::ostream& operator<<(std::ostream& os, const Dt3dExtent& extent);
00219 DT_DLL_MATRIX std::istream& operator>>(std::istream& is, Dt3dExtent& extent);
00220 
00221 #ifdef DtUSE_UTILITIES_NAMESPACE
00222 }
00223 #endif
00224 
00225 
00226 #endif
00227 

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)