VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
polygon2D.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: polygon2D.h,v $ $Revision: 1.6 $ $State: Exp $
7 ******************************************************************************/
8 #ifndef polygon2D_H_
9 #define polygon2D_H_
10 
11 //
12 // \file polygon2D.h
13 // \brief This file contains all the classes related to the 2 dimensional
14 // geometric polygon class.
15 //
16 
18 #include "geometry/point.h"
19 #include "geometry/extent.h"
20 #include <vlutil/vlConfig.h>
21 #include <vector>
22 
23 // The DtPolygon2D class represents a 2 dimensional polygon
25 {
26 public:
27 
28  typedef std::vector<DtPoint> DtVertexContainer;
29  typedef std::vector<DtPoint>::iterator DtVertexIter;
30  typedef std::vector<DtPoint>::const_iterator DtVertexConstIter;
31 
32  typedef DtChord DtEdge;
33 
34 
35  DtPolygon2D(const DtVertexContainer& polygonVertices);
36  DtPolygon2D(const DtExtent& extent);
37 
38  virtual ~DtPolygon2D();
39 
40 private:
41  // Copy constructor and Assignment operator not implemented
42  DtPolygon2D(const DtPolygon2D& original);
43  const DtPolygon2D& operator=(const DtPolygon2D& original);
44 
45 public:
46 
47  unsigned int numberOfVertices() const;
48 
49  bool getVertex(DtPoint& vertex, unsigned int vertexIndex) const;
50  DtPoint vertex(unsigned int vertexIndex) const;
51 
52  bool setVertex(unsigned int vertexIndex, const DtPoint& newVertex);
53 
54  DtVertexConstIter verticesBegin() const;
55  DtVertexConstIter verticesEnd() const;
56 
57  DtPoint verticesFront() const;
58  DtPoint verticesBack() const;
59 
60  unsigned int numberOfEdges() const;
61 
62  DtEdge edge(unsigned int edgeIndex) const;
63  bool getEdge(unsigned int edgeIndex, DtEdge& edgeToGet) const;
64 
65  DtExtent extent() const;
66 
67  const DtVertexContainer& vertices() const;
68 
69 protected:
70  bool testInvariant() const;
71 
72  bool isValidVertexIndex(unsigned int vertexIndex) const;
73 
74  bool isValidEdgeIndex(unsigned int edgeIndex) const;
75 
76 private:
78 };
79 
80 
81 #endif
82 
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
DtChord DtEdge
Definition: polygon2D.h:32
Definition: polygon2D.h:24
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
#define DT_DLL_geometry
Definition: geometryDefines.h:23
DtVertexContainer myVertices
Definition: polygon2D.h:77
std::vector< DtPoint >::iterator DtVertexIter
Definition: polygon2D.h:29
Contains the declaration of the DtExtent class.
std::vector< DtPoint > DtVertexContainer
Definition: polygon2D.h:28
std::vector< DtPoint >::const_iterator DtVertexConstIter
Definition: polygon2D.h:30
Definition: point.h:34

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)