zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
 
//:> OdPolyPolygon3d.h: interface for the OdPolyPolygon3d class.
//
//////////////////////////////////////////////////////////////////////
 
#if !defined(AFX_OdPolyPolygon3d_H__0D83A6B9_F93A_4801_AB9B_47B6648AE23B__INCLUDED_)
#define AFX_OdPolyPolygon3d_H__0D83A6B9_F93A_4801_AB9B_47B6648AE23B__INCLUDED_
 
#include "TD_PackPush.h"
 
#if defined(_MSC_VER)
#pragma warning (push)
#pragma warning ( disable : 4512 )  // assignment operator could not be generated
#endif
 
#include "RxObject.h"
#include "OdArray.h"
#include "Ge/GePoint3d.h"
#include "Int32Array.h"
 
/** \details
    This class implements multi-polygon objects.
    
    \remarks
    These objects are typically used for TrueType font outlines.
    
    <group Other_Classes>
*/
class OdPolyPolygon3d
{
    OdGePoint3dArray m_Points; // Points defining the polygons.
    OdInt32Array     m_Counts; // Counts of points in each polygon.
 
public:
  OdPolyPolygon3d() {}
    virtual ~OdPolyPolygon3d() {}
 
  /** \details
    Adds a new 3D polygon to this PolyPolygon object.
  */
    void newContour() { m_Counts.append(0); }
 
  /** \details
    Appends a point to the last polygon of this PolyPolygon object.
    \param point [in]  New point.
  */
  void addToCurrentContour(const OdGePoint3d& point) { m_Points.append(point); m_Counts[m_Counts.size() - 1]++; }
 
  void removeLastContour() 
  { 
    if ( m_Counts.size() )
    {
      for ( int i = 0; i < m_Counts[m_Counts.size()-1]; i++)
      {
        m_Points.removeLast(); 
      }
      m_Counts.removeLast();
    }
  } 
 
  /** \details
    Sets the GrowLength for the m_Points array.
    \remarks
    The GrowLength for the m_Counts array is set to 1/10 this value.
  */
    void setGrowLength(OdInt32 growLength) 
  { m_Points.setGrowLength(growLength); m_Counts.setGrowLength(growLength/10 > 0 ? growLength/10 : 1); }
 
  /*!DOM*/
  void setGrowLenght(OdInt32 growLength) { setGrowLength(growLength); }
    
  /** \details
    Returns the points defining the polygons.
  */
    OdGePoint3dArray& points() { return m_Points; }
    const OdGePoint3dArray& points() const { return m_Points; }
  /** \details
    Returns the counts of points defining the polygons.
  */
    OdInt32Array& counts() { return m_Counts; }
    const OdInt32Array& counts() const { return m_Counts; }
};
 
#if defined(_MSC_VER)
#pragma warning (pop)
#endif
 
#include "TD_PackPop.h"
 
#endif // !defined(AFX_OdPolyPolygon3d_H__0D83A6B9_F93A_4801_AB9B_47B6648AE23B__INCLUDED_)