VR-Forces 4.0.4 Class Documentation
include/gdb/netwrkSeg.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2001 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: netwrkSeg.h,v $ $Revision: 1.21 $ $State: Exp $
00007 *******************************************************************************/
00008 // \file netwrkSeg.h
00009 // \brief Contains the DtNetworkSegment class declaration.
00010 
00011 #ifndef netwrkSeg_H_
00012 #define netwrkSeg_H_
00013 
00014 #include "gdb/gdbDefines.h"
00015 #include <vlutil/vlConfig.h>
00016 #include "geometry/chord.h"
00017 #include "gdb/specMgr.h"
00018 #include "gdb/netwrkElemnt.h"
00019 #include <vlutil/vlString.h>
00020 
00021 class DtNetworkEdge;
00022 
00023 //
00024 // DtNetworkSegment represents a section of a network that is approximated
00025 // by a line segment. 
00026 class DT_DLL_gdb DtNetworkSegment : public DtNetworkElement
00027 {
00028 public:
00029 
00030    // default constructor
00031    DtNetworkSegment();
00032 
00033    // destructor
00034    virtual ~DtNetworkSegment();
00035 
00036    // copy constructor
00037    DtNetworkSegment(const DtNetworkSegment& orig);
00038 
00039    // assignment operator
00040    DtNetworkSegment& operator=(const DtNetworkSegment& orig);
00041 
00042    // get/set chord
00043    virtual const DtChord chord() const;
00044    virtual void setPoints(int pt1, int pt2);
00045    virtual void increaseIndex(int val);
00046 
00047    // get/set parent edge
00048    virtual DtNetworkEdge* parentEdge();
00049    virtual const DtNetworkEdge* parentEdge() const;
00050    virtual void setParentEdge(DtNetworkEdge* edge);
00051 
00052    virtual DtString type();
00053 
00054    // first and last endpoint, as traversing forward
00055    virtual DtPoint endpoint0() const;
00056    virtual DtPoint endpoint1() const;
00057 
00058    virtual double length() const;
00059 
00060    // get specification
00061    virtual const DtSpecification& specification() const;
00062 
00063    // get boundary values
00064    virtual double minX() const;
00065    virtual double maxX() const;
00066    virtual double minY() const;
00067    virtual double maxY() const;
00068    virtual double minZ() const;
00069    virtual double maxZ() const;
00070 
00071    // Get the distance to a specified point
00072    // 
00073    // \param point the point to find the distance to
00074    // \return the distance to the specified point
00075    virtual double distanceToPoint(const DtPoint& point) const;
00076 
00077    // Get the distance in XY to the specified point
00078    // 
00079    // \param point the point to find the distance to
00080    // \return the distance (in the X,Y plane) to the specified point
00081    virtual double distanceToPointInXY(const DtPoint& pointIn) const;
00082 
00083    // Calculate if the projections onto the x-y plane of another segment 
00084    // and this segment intersect.  
00085    virtual bool xyIntersects(const DtNetworkSegment& seg) const;
00086 
00087    // Calculate if the projections onto the x-y plane of another segment 
00088    // and this segment intersect.  
00089    // \param distanceSquared The distance between the two segments squared,
00090    // \param thisX
00091    // \param thisY hold the closest points on this segment
00092    // \param otherX/otherY hold the closest point on the network segment.  
00093    virtual bool xyIntersects(const DtNetworkSegment& seg,
00094                              double& distanceSquared,
00095                              double& thisX, 
00096                              double& thisY,
00097                              double& otherX, 
00098                              double& otherY) const;
00099 
00100    // Find the closest point on the segment to another point
00101    // 
00102    // \param pointIn the point to find the closest point to
00103    // \param pointOut the closest point to the specified point
00104    // \param distance the distance from the closest point to the specified point
00105    // \deprecated TerrainToolkit 3.9
00106    virtual void closestPoint(const DtPoint& pointIn, 
00107                              DtPoint& closestPnt, 
00108                              double& distance) const;
00109 
00110    // Find the closest point, in 2D (x,y), on the segment to another point
00111    // 
00112    // \param pointIn the point to find the closest point to
00113    // \param pointOut the closest point, in 2D, to the specified point
00114    // \param distance the distance, in 2D, from the closest point to the specified point
00115    // \deprecated TerrainToolkit 3.9
00116    virtual void closestPointInXY(const DtPoint& pointIn, 
00117                                  DtPoint& pointOut, 
00118                                  double& distance) const;
00119 protected:
00120    int myIndex1;
00121    int myIndex2;
00122 
00123    DtNetworkEdge*             myParentEdge;
00124 
00125    static const double        theParallelAngle;
00126 };
00127 
00128 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)