VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
chordUtilities.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2005 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: chordUtilities.h,v $ $Revision: 1.6 $ $State: Exp $
7 ******************************************************************************/
8 #ifndef chordUtilities_H_
9 #define chordUtilities_H_
10 
11 //
12 // \file chordUtilities.h
13 // \brief Contains utility functions for chords, such as intersection, distance from,
14 // and the closest point to.
15 //
16 
18 #include "geometry/point.h"
19 
20 class DtChord;
21 
22 
23 // The DtChordIntersectionResult enum contains the different possible intersection
24 // values between two chords.
25 typedef enum
26 {
33 
34 
35 // A helper function designed to turn the intersection result above into a
36 // simple bool when a simple yes/no intersection result is desired.
38 
39 // If two segments have an angle between them less than this value
40 // they are treated as parallel.
42 
43 
44 // Calculate if the projections onto the x-y plane of another segment
45 // and this segment intersect.
47  const DtChord& chord2);
49  const DtPoint& chord1EndPoint1, const DtChord& chord2);
51  const DtPoint& chord2EndPoint0, const DtPoint& chord2EndPoint1);
53  const DtPoint& chord1EndPoint1, const DtPoint& chord2EndPoint0, const DtPoint& chord2EndPoint1);
54 
55 // Calculate if the projections onto the x-y plane of two chords, and see if the
56 // projections intersect. Calculate the closest point on each chord's
57 // projection to the other chord's projection. If the two chords intersect,
58 // then the closest point is the intersection point.
59 //
60 // \param distanceSquared The distance between the two chords squared,
61 // \param thisX/thisY hold the closest points on chord1
62 // \param otherX/otherY hold the closest point on chord2.
64  const DtChord& chord2, double& distanceSquared, double& chord1X, double& chord1Y,
65  double& chord2X, double& chord2Y);
66 
67 
68 DT_DLL_geometry double DtPointChordDistanceInXY(double pointX, double pointY,
69  double end0X, double end0Y,
70  double end1X, double end1Y);
71 
72 DT_DLL_geometry double DtPointChordDistanceInXY(double pointX, double pointY,
73  double end0X, double end0Y,
74  double end1X, double end1Y,
75  double& outX, double& outY);
76 
77 
78 DT_DLL_geometry void DtClosestPoint(const DtChord& chord, const DtPoint& pointOfInterest,
79  DtPoint& closestPoint, double& distance);
80 
81 DT_DLL_geometry void DtClosestPoint(const DtPoint& chordEndPoint0, const DtPoint& chordEndPoint1,
82  const DtPoint& pointOfInterest, DtPoint& closestPoint, double& distance);
83 
84 
85 DT_DLL_geometry void DtClosestPointInXY(const DtChord& chord, const DtPoint& pointOfInterest,
86  DtPoint& closestPnt, double& distance);
87 
88 DT_DLL_geometry void DtClosestPointInXY(const DtPoint& chordEndPoint0, const DtPoint& chordEndPoint1,
89  const DtPoint& pointOfInterest, DtPoint& closestPnt, double& distance);
90 
91 // Finds the closest approach between the two specified chords in 3D.
92 // The points on each chord are passed back in chord1Point and chord2Point.
93 // The time value (0 - 1.0) along each chord of the points are passed back
94 // in chord1T and chord2T.
95 // \return The square of the distance at the closest approach.
97  const DtChord& chord2,
98  double& chord1T,
99  double& chord2T,
100  DtPoint& chord1Point,
101  DtPoint& chord2Point);
102 
103 #endif
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
DT_DLL_geometry double DtClosestApproachChordToChord(const DtChord &chord1, const DtChord &chord2, double &chord1T, double &chord2T, DtPoint &chord1Point, DtPoint &chord2Point)
DT_DLL_geometry DtChordIntersectionResult DtIntersectInXY(const DtChord &chord1, const DtChord &chord2)
Definition: chordUtilities.h:31
DT_DLL_geometry void DtClosestPoint(const DtChord &chord, const DtPoint &pointOfInterest, DtPoint &closestPoint, double &distance)
DT_DLL_geometry bool DtChordsIntersect(DtChordIntersectionResult intersectionResult)
Definition: chordUtilities.h:29
Definition: chordUtilities.h:28
#define DT_DLL_geometry
Definition: geometryDefines.h:23
DT_DLL_geometry double theParallelAngle()
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
Definition: chordUtilities.h:30
DT_DLL_geometry double DtPointChordDistanceInXY(double pointX, double pointY, double end0X, double end0Y, double end1X, double end1Y)
DtChordIntersectionResult
Definition: chordUtilities.h:25
Definition: chordUtilities.h:27
Definition: point.h:34
DT_DLL_geometry void DtClosestPointInXY(const DtChord &chord, const DtPoint &pointOfInterest, DtPoint &closestPnt, double &distance)

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)