VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
gdbChordIntersectionRecord.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: gdbChordIntersectionRecord.h,v $ $Revision: 1.1 $ $State: Exp $
7 ** Created: 2/2/10 MEM
8 *********************************************************************/
9 #ifndef gdbChordIntersectionRecord_H_
10 #define gdbChordIntersectionRecord_H_
11 
12 // \file chrdIntRec.h
13 // \brief Contains the DtGdbChordIntersectionRecord class declaration.
14 #include "gdb/gdbDefines.h"
16 #include "geometry/point.h"
17 #include "geometry/surface.h"
18 #include <matrix/vlVector.h>
19 
20 class DtAllTypesPolygon;
21 
22 // Instances of DtGdbChordIntersectionRecord are used to record the
23 // results of chord/primitive intersection attempts.
25 {
26 public:
27 
28  // default constructor
30 
31  DtGdbChordIntersectionRecord(DtPoint& intersectionPoint,
32  double intersectionTime,
33  DtVector& normal,
34  DtSurface* surface,
35  DtAllTypesPolygon* polygon,
36  bool ownPolygon);
37 
38  // destructor
40 
41  // copy constructor
43 
44  // assignment operator
45  // Note: if "orig" owns its own polygon, this will make a copy of the
46  // polygon so that this object can own it's own copy.
48 
49  // clone this object
50  virtual DtIntersectionRecord* clone() const;
51 
52  //debugging aid
53  virtual void dump() const;
54 
55  // The type of record used for the intersection query. Returns
56  // DtIntersectionRecord::GDBCHORD_TYPE
57  virtual DtRecordType type() const;
58 
59  // Get a pointer to the intersecting polygon.
60  DtAllTypesPolygon* polygon();
61  const DtAllTypesPolygon* polygon() const;
62 
63  // \return A boolean indication whether or not the intersection record
64  // owns the polygon it points to or not. If not, then the polygon is not
65  // destroyed when the record is. If it is, then the polygon should only
66  // be referenced while the record is still valid.
67  bool ownPolygon() const;
68 
69  // Set the intersecting polygon.
70  // Makes it's own copy of the given polygon
71  void setPolygon(const DtAllTypesPolygon& arg);
72 
73  // Shares a pointer to someone else's polygon (it better outlast us)
74  void sharePolygon(DtAllTypesPolygon* arg);
75 
76  // Takes over ownership of the given polygon
77  void takePolygon(DtAllTypesPolygon* arg);
78 
79  // Like operator= except that it transfers ownership of the polygon to
80  // another DtGdbChordIntersectionRecord instead of potentially copying it.
81  virtual void copyAndStealPolygonFrom(DtGdbChordIntersectionRecord& donor);
82 
83 protected:
84 
85  // Make a copy of a polygon
86  static DtAllTypesPolygon* copyPolygon(const DtAllTypesPolygon& orig);
87 
88  // Most primitive polygon to get hit.
91 };
92 
94 {
95  return myPolygon;
96 }
98 {
99  return myPolygon;
100 }
101 
103 {
104  return myOwnPolygon;
105 }
106 
107 #endif
Definition: chordIntersectionRecord.h:23
DtAllTypesPolygon * myPolygon
Definition: gdbChordIntersectionRecord.h:89
DtChordIntersectionRecord & operator=(const DtChordIntersectionRecord &orig)
Definition: intersectionRecord.h:16
Definition: allTypesPolygon.h:22
Definition: surface.h:179
#define DT_DLL_gdb
Definition: gdbDefines.h:25
virtual void dump() const
Definition: gdbChordIntersectionRecord.h:24
bool myOwnPolygon
Definition: gdbChordIntersectionRecord.h:90
bool ownPolygon() const
Definition: gdbChordIntersectionRecord.h:102
DtRecordType
Definition: intersectionRecord.h:21
virtual DtIntersectionRecord * clone() const
DtAllTypesPolygon * polygon()
Definition: gdbChordIntersectionRecord.h:93
Definition: point.h:34
virtual DtRecordType type() const

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)