CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
OdPolyPolygon3d.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24//:> OdPolyPolygon3d.h: interface for the OdPolyPolygon3d class.
25//
27
28#if !defined(AFX_OdPolyPolygon3d_H__0D83A6B9_F93A_4801_AB9B_47B6648AE23B__INCLUDED_)
29#define AFX_OdPolyPolygon3d_H__0D83A6B9_F93A_4801_AB9B_47B6648AE23B__INCLUDED_
30
31#include "TD_PackPush.h"
32
33#if defined(_MSC_VER)
34#pragma warning (push)
35#pragma warning ( disable : 4512 ) // assignment operator could not be generated
36#endif
37
38#include "RxObject.h"
39#include "OdArray.h"
40#include "Ge/GePoint3d.h"
41#include "Int32Array.h"
42
52{
53 OdGePoint3dArray m_Points; // Points defining the polygons.
54 OdInt32Array m_Counts; // Counts of points in each polygon.
55
56public:
58 virtual ~OdPolyPolygon3d() {}
59
63 void newContour() { m_Counts.append(0); }
64
69 void addToCurrentContour(const OdGePoint3d& point) { m_Points.append(point); m_Counts[m_Counts.size() - 1]++; }
70
72 {
73 if ( m_Counts.size() )
74 {
75 for ( int i = 0; i < m_Counts[m_Counts.size()-1]; i++)
76 {
77 m_Points.removeLast();
78 }
79 m_Counts.removeLast();
80 }
81 }
82
88 void setGrowLength(OdInt32 growLength)
89 { m_Points.setGrowLength(growLength); m_Counts.setGrowLength(growLength/10 > 0 ? growLength/10 : 1); }
90
92 void setGrowLenght(OdInt32 growLength) { setGrowLength(growLength); }
93
97 OdGePoint3dArray& points() { return m_Points; }
101 const OdGePoint3dArray& points() const { return m_Points; }
105 OdInt32Array& counts() { return m_Counts; }
109 const OdInt32Array& counts() const { return m_Counts; }
110};
111
112#if defined(_MSC_VER)
113#pragma warning (pop)
114#endif
115
116#include "TD_PackPop.h"
117
118#endif // !defined(AFX_OdPolyPolygon3d_H__0D83A6B9_F93A_4801_AB9B_47B6648AE23B__INCLUDED_)
119
int OdInt32
OdArray & setGrowLength(int growLength)
Definition: OdArray.h:1906
OdArray & removeLast()
Definition: OdArray.h:1894
size_type size() const
Definition: OdArray.h:1247
size_type append(const T &value)
Definition: OdArray.h:1725
OdGePoint3dArray & points()
const OdInt32Array & counts() const
OdInt32Array & counts()
const OdGePoint3dArray & points() const
virtual ~OdPolyPolygon3d()
void setGrowLenght(OdInt32 growLength)
void setGrowLength(OdInt32 growLength)
void addToCurrentContour(const OdGePoint3d &point)
void removeLastContour()