123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- //
- //////////////////////////////////////////////////////////////////////////////
- //
- // Copyright 2015 Autodesk, Inc. All rights reserved.
- //
- // Use of this software is subject to the terms of the Autodesk license
- // agreement provided at the time of installation or download, or which
- // otherwise accompanies this software in either electronic or hard copy form.
- //
- //////////////////////////////////////////////////////////////////////////////
- //
- // DESCRIPTION:
- //
- // This file contains the definition for a dynamic array, called
- // AcGeVector2dArray, of objects of type "AcGeVector2d".
- //
- // "Dynamic array" means that the array can grow without bounds,
- // unlike declaring an array of objects of type "AcGeVector2d" in the
- // usual manner. For example declaring "AcGeVector2d myArray[10]"
- // is limited to holding only ten entries.
- //
- // In order to use the class AcGeVector2dArray, you need to understand
- // a couple of simple, yet key, concepts:
- //
- // 1) The logical length of the array.
- // - How many entries have been placed into the array,
- // initially always zero.
- // 2) The physical length of the array.
- // - How many entries the array will hold before it
- // automatically "grows" larger.
- // 3) The grow length of the array.
- // - How much the array will grow when required.
- //
- // The physical length of the array is the actual length of the
- // physically allocated, but perhaps not fully used, array.
- // As a point of clarification, the size in bytes of the array
- // buffer for an array called `myArray' would be:
- //
- // sizeOf(AcGeVector2d) * myArray.physicalLength().
- //
- // The physical length of the array can be zero or any positive
- // integer.
- //
- // The logical length of the array (or just the "length()") reflects
- // how many elements of AcGeVector2d have been placed into the array
- // with, for example, append() or insertAt(). Many member-functions
- // are only valid for indices that are greater than or equal to
- // zero AND less than length(). For example, indexing into the
- // array with the operator[] is only valid for indices in this range.
- //
- // You can explicitly set the logical length() to any value and
- // if the physical length is not large enough the array will grow to
- // that length. Note that if the logical length is explicitly reset
- // to a larger value, then all the entries from the old length up
- // to the new length may contain garbage values, therefor they must be
- // initialized explicitly.
- //
- // The logical length is always less than or equal to the physical
- // length. NOTE that the array ALWAYS starts out empty, i.e., the
- // length() always starts at zero regardless of the initial physical
- // length.
- //
- // If you add an element to the array causing the logical length
- // to become greater than the physical length of the array then
- // the "grow length" determines how much additional space to
- // allocate, and the physical length will increase by the grow length.
- //
- // The grow length must be a positive number, that is, zero is an illegal
- // grow length.
- #ifndef AC_GEVC2DAR_H
- #define AC_GEVC2DAR_H
- #include "adesk.h"
- #include "assert.h"
- #include "gevec2d.h"
- #include "acarray.h"
- typedef AcArray<AcGeVector2d> AcGeVector2dArray;
- #if GE_LOCATED_NEW
- GE_DLLEXPIMPORT
- AcGe::metaTypeIndex AcGeGetMetaTypeIndex(AcGeVector2dArray* pT);
- #endif
- #endif
|