Text archives Help
- From: vpegorar@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r329 - trunk/Model/Primitives
- Date: Mon, 16 May 2005 19:11:36 -0600 (MDT)
Author: vpegorar
Date: Mon May 16 19:11:35 2005
New Revision: 329
Modified:
trunk/Model/Primitives/Heightfield.cc
Log:
Array allocation macros have been put in the Heightfield.cc file
Modified: trunk/Model/Primitives/Heightfield.cc
==============================================================================
--- trunk/Model/Primitives/Heightfield.cc (original)
+++ trunk/Model/Primitives/Heightfield.cc Mon May 16 19:11:35 2005
@@ -4,13 +4,38 @@
#include <Core/Geometry/BBox.h>
#include <Core/Math/MiscMath.h>
#include <Core/Math/MinMax.h>
-#include <Core/Malloc/ArrayAllocation.h>
#include <Core/Geometry/PointVector.h>
#include <fstream>
#include <iostream>
using namespace Manta;
using namespace std;
+
+
+#define ALLOCATE2DARRAY(array, nx, ny, type) \
+{ \
+ unsigned int i; \
+ type * ar = new type[(nx) * (ny)]; \
+ \
+ (array) = new type * [nx]; \
+ for(i=0; i<(unsigned int)(nx); i++) \
+ { \
+ (array)[i] = ar + i*(ny); \
+ } \
+}
+
+#define DELETE2DARRAY(array, nx) \
+{ \
+ unsigned int i; \
+ \
+ for(i=0; i<(unsigned int)(nx); i++) \
+ { \
+ delete [] (array)[i]; \
+ } \
+ delete [] (array); \
+ (array) = NULL; \
+}
+
//
--------------------------------------------------------------------------------------
- [MANTA] r329 - trunk/Model/Primitives, vpegorar, 05/16/2005
Archive powered by MHonArc 2.6.16.