gevc2dar.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. //////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Copyright 2015 Autodesk, Inc. All rights reserved.
  5. //
  6. // Use of this software is subject to the terms of the Autodesk license
  7. // agreement provided at the time of installation or download, or which
  8. // otherwise accompanies this software in either electronic or hard copy form.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. //
  12. // DESCRIPTION:
  13. //
  14. // This file contains the definition for a dynamic array, called
  15. // AcGeVector2dArray, of objects of type "AcGeVector2d".
  16. //
  17. // "Dynamic array" means that the array can grow without bounds,
  18. // unlike declaring an array of objects of type "AcGeVector2d" in the
  19. // usual manner. For example declaring "AcGeVector2d myArray[10]"
  20. // is limited to holding only ten entries.
  21. //
  22. // In order to use the class AcGeVector2dArray, you need to understand
  23. // a couple of simple, yet key, concepts:
  24. //
  25. // 1) The logical length of the array.
  26. // - How many entries have been placed into the array,
  27. // initially always zero.
  28. // 2) The physical length of the array.
  29. // - How many entries the array will hold before it
  30. // automatically "grows" larger.
  31. // 3) The grow length of the array.
  32. // - How much the array will grow when required.
  33. //
  34. // The physical length of the array is the actual length of the
  35. // physically allocated, but perhaps not fully used, array.
  36. // As a point of clarification, the size in bytes of the array
  37. // buffer for an array called `myArray' would be:
  38. //
  39. // sizeOf(AcGeVector2d) * myArray.physicalLength().
  40. //
  41. // The physical length of the array can be zero or any positive
  42. // integer.
  43. //
  44. // The logical length of the array (or just the "length()") reflects
  45. // how many elements of AcGeVector2d have been placed into the array
  46. // with, for example, append() or insertAt(). Many member-functions
  47. // are only valid for indices that are greater than or equal to
  48. // zero AND less than length(). For example, indexing into the
  49. // array with the operator[] is only valid for indices in this range.
  50. //
  51. // You can explicitly set the logical length() to any value and
  52. // if the physical length is not large enough the array will grow to
  53. // that length. Note that if the logical length is explicitly reset
  54. // to a larger value, then all the entries from the old length up
  55. // to the new length may contain garbage values, therefor they must be
  56. // initialized explicitly.
  57. //
  58. // The logical length is always less than or equal to the physical
  59. // length. NOTE that the array ALWAYS starts out empty, i.e., the
  60. // length() always starts at zero regardless of the initial physical
  61. // length.
  62. //
  63. // If you add an element to the array causing the logical length
  64. // to become greater than the physical length of the array then
  65. // the "grow length" determines how much additional space to
  66. // allocate, and the physical length will increase by the grow length.
  67. //
  68. // The grow length must be a positive number, that is, zero is an illegal
  69. // grow length.
  70. #ifndef AC_GEVC2DAR_H
  71. #define AC_GEVC2DAR_H
  72. #include "adesk.h"
  73. #include "assert.h"
  74. #include "gevec2d.h"
  75. #include "acarray.h"
  76. typedef AcArray<AcGeVector2d> AcGeVector2dArray;
  77. #if GE_LOCATED_NEW
  78. GE_DLLEXPIMPORT
  79. AcGe::metaTypeIndex AcGeGetMetaTypeIndex(AcGeVector2dArray* pT);
  80. #endif
  81. #endif