VoxelLayer.h
1 /************************************************************
2 * (C) Voxel Farm Inc. 2015
3 */
4 
5 #pragma once
6 
7 #include "time.h"
8 #include "mapindex.h"
9 #include "scene.h"
10 #include <vector>
11 #include <minmax.h>
12 #include <math.h>
13 
14 #define VECTOR_OVERFLOW
15 
17 namespace VoxelFarm
18 {
19 #ifdef VECTOR_OVERFLOW
20  const double VECTOR_MIN_VALUE = -1.0;
22  const double VECTOR_MAX_VALUE = 2.0;
23 #else
24  const double VECTOR_MIN_VALUE = 0.0;
26  const double VECTOR_MAX_VALUE = 1.0;
27 #endif
28  const double VECTOR_MAX_CODE = 255.0 / (VECTOR_MAX_VALUE - VECTOR_MIN_VALUE);
29  const double VECTOR_DEFAULT_VALUE = ((int)(floor((VECTOR_MAX_CODE*(0.5-VECTOR_MIN_VALUE)) + 0.5))) / VECTOR_MAX_CODE + VECTOR_MIN_VALUE;
30 
32  const int BLOCK_DIMENSION = 40;
34  const int BLOCK_MARGIN = 2;
36  const int BLOCK_DATA_SIZE = BLOCK_DIMENSION*BLOCK_DIMENSION*BLOCK_DIMENSION;
38  const int BLOCK_SIZE = (BLOCK_DIMENSION + 2*BLOCK_MARGIN);
40  const int BLOCK_CUBE_SIZE = BLOCK_SIZE*BLOCK_SIZE*BLOCK_SIZE;
42  const int MAX_BLOCK_LOD = LEVELS - 2;//
43 
44  typedef unsigned char VoxelType;
45  typedef unsigned short MaterialId;
46 
47  const VoxelType VOXEL_HAS_MATERIAL = 0x01;
48  const VoxelType VOXEL_HAS_VECTOR = 0x02;
49  const VoxelType VOXEL_HAS_ROTATION = 0x04;
50 
52  unsigned char encodeVectorCoord(double coord);
54  double decodeVectorCoord(unsigned char coord);
55 
56  // Voxel data
57  struct Voxel
58  {
59  VoxelType type;
60  MaterialId material;
61  unsigned char vx;
62  unsigned char vy;
63  unsigned char vz;
64  unsigned char rx;
65  unsigned char ry;
66  unsigned char rz;
67  };
68 
70  template <int xDim, int yDim, int zDim, typename IdxType> IdxType getCellBlockIndex(int x, int y, int z)
71  {
72  return IdxType((xDim * yDim * z) + (yDim * x) + y);
73  }
74 
75  template <int xDim, int yDim, int zDim, typename IdxType>
76  class VoxelData
77  {
78  public:
79  enum { cSize = xDim * yDim * zDim };
80  enum { cAxes = 3 };
81  enum { cDimX = xDim };
82  enum { cDimY = yDim };
83  enum { cDimZ = zDim };
84  struct Index
85  {
86  Index() : index(0) {}
87  Index(int idx) : index(static_cast<IdxType>(idx)) {}
88  Index(int x, int y, int z) : index(IdxType(getCellBlockIndex<xDim, yDim, zDim, IdxType>(x, y, z))) {}
89  operator IdxType() const
90  {
91  return index;
92  }
93  IdxType index;
94  };
95 
96  void setVoxel(const Index& index, const Voxel& voxel);
97  void getVoxel(const Index& index, Voxel& voxel) const;
98 
99  void setType(
100  const Index& index,
101  VoxelType type);
102  void addType(
103  const Index& index,
104  VoxelType type);
105  void removeType(
106  const Index& index,
107  VoxelType type);
108  VoxelType getType(
109  const Index& index) const;
110  bool hasType(
111  const Index& index,
112  VoxelType type) const;
113 
115  void setMaterial(
117  const Index& index,
119  MaterialId material);
121  void setVector(
123  const Index& index,
125  double dx,
127  double dy,
129  double dz);
131  void setVector(
133  const Index& index,
135  unsigned char dx,
137  unsigned char dy,
139  unsigned char dz);
141  void setRotation(
143  const Index& index,
145  double dx,
147  double dy,
149  double dz);
151  void setRotation(
153  const Index& index,
155  unsigned char dx,
157  unsigned char dy,
159  unsigned char dz);
161  MaterialId getMaterial(
163  const Index& index) const;
165  void getVector(
167  const Index& index,
169  double& dx,
171  double& dy,
173  double& dz) const;
175  void getVector(
177  const Index& index,
179  float& dx,
181  float& dy,
183  float& dz) const;
185  void getVector(
187  const Index& index,
189  unsigned char& dx,
191  unsigned char& dy,
193  unsigned char& dz) const;
195  void getRotation(
197  const Index& index,
199  double& dx,
201  double& dy,
203  double& dz) const;
205  void getRotation(
207  const Index& index,
209  float& dx,
211  float& dy,
213  float& dz) const;
215  void getRotation(
217  const Index& index,
219  unsigned char& dx,
221  unsigned char& dy,
223  unsigned char& dz) const;
224 
226  void clear();
227  void copy(const VoxelData<xDim, yDim, zDim, IdxType>& source);
228 
230  VoxelType* getTypes()
231  {
232  return types;
233  }
234  MaterialId* getMaterials()
235  {
236  return materials;
237  }
238  const MaterialId* getMaterials() const
239  {
240  return materials;
241  }
242  static int getMaterialsSize()
243  {
244  return sizeof(MaterialId) * cSize;
245  }
246  unsigned char* getVectors()
247  {
248  return (unsigned char*)vectors;
249  }
250  const unsigned char* getVectors() const
251  {
252  return (unsigned char*)vectors;
253  }
254  static int getVectorsSize()
255  {
256  return sizeof(unsigned char) * cAxes * cSize;
257  }
258  unsigned char* getRotations()
259  {
260  return (unsigned char*)vectors;
261  }
262  const unsigned char* getRotations() const
263  {
264  return (unsigned char*)rotations;
265  }
266  static int getRotationsSize()
267  {
268  return sizeof(unsigned char) * cAxes * cSize;
269  }
270  private:
271  VoxelType types[cSize];
272  MaterialId materials[cSize];
273  unsigned char vectors[cSize][cAxes];
274  unsigned char rotations[cSize][cAxes];
275  public:
276  enum { cSerialSize = cSize*(sizeof(VoxelType) + sizeof(MaterialId) + cAxes + cAxes) };
277  void serialize(unsigned char* buffer) const;
278  void unserialize(unsigned char* buffer);
279  };
280 
281  template <int xDim, int yDim, int zDim, typename IdxType>
282  void VoxelData<xDim, yDim, zDim, IdxType>::setVoxel(const Index& index, const Voxel& voxel)
283  {
284  types[index] = voxel.type;
285  materials[index] = voxel.material;
286  vectors[index][0] = voxel.vx;
287  vectors[index][1] = voxel.vy;
288  vectors[index][2] = voxel.vz;
289  rotations[index][0] = voxel.rx;
290  rotations[index][1] = voxel.ry;
291  rotations[index][2] = voxel.rz;
292  }
293 
294  template <int xDim, int yDim, int zDim, typename IdxType>
295  void VoxelData<xDim, yDim, zDim, IdxType>::getVoxel(const Index& index, Voxel& voxel) const
296  {
297  voxel.type = types[index];
298  voxel.material = materials[index];
299  voxel.vx = vectors[index][0];
300  voxel.vy = vectors[index][1];
301  voxel.vz = vectors[index][2];
302  voxel.rx = rotations[index][0];
303  voxel.ry = rotations[index][1];
304  voxel.rz =rotations[index][2];
305  }
306 
307  template <int xDim, int yDim, int zDim, typename IdxType>
308  void VoxelData<xDim, yDim, zDim, IdxType>::setType(const Index& index, VoxelType type)
309  {
310  types[index] = type;
311  }
312 
313  template <int xDim, int yDim, int zDim, typename IdxType>
314  void VoxelData<xDim, yDim, zDim, IdxType>::addType(const Index& index, VoxelType type)
315  {
316  types[index] |= type;
317  }
318 
319  template <int xDim, int yDim, int zDim, typename IdxType>
320  void VoxelData<xDim, yDim, zDim, IdxType>::removeType(const Index& index, VoxelType type)
321  {
322  types[index] &= ~type;
323  }
324 
325  template <int xDim, int yDim, int zDim, typename IdxType>
326  VoxelType VoxelData<xDim, yDim, zDim, IdxType>::getType(const Index& index) const
327  {
328  return types[index];
329  }
330 
331  template <int xDim, int yDim, int zDim, typename IdxType>
332  bool VoxelData<xDim, yDim, zDim, IdxType>::hasType(const Index& index, VoxelType type) const
333  {
334  return (types[index] & type) != 0;
335  }
336 
337  template <int xDim, int yDim, int zDim, typename IdxType>
338  void VoxelData<xDim, yDim, zDim, IdxType>::setMaterial(const Index& index, MaterialId material)
339  {
340  materials[index] = material;
341  types[index] |= VOXEL_HAS_MATERIAL;
342  /*
343  if (material != VOXEL_NIL && material != VOXEL_ONLY_COORDS && material != VOXEL_EMPTY)
344  types[index] |= VOXEL_HAS_MATERIAL;
345  else
346  types[index] &= ~VOXEL_HAS_MATERIAL;
347  */
348  }
349 
350  template <int xDim, int yDim, int zDim, typename IdxType>
351  void VoxelData<xDim, yDim, zDim, IdxType>::setVector(const Index& index, double dx, double dy, double dz)
352  {
353  // dx, dy and dx range from 0 to 1. Must be converted to a 8 bit integer so they can be stored in a voxel
354  vectors[index][0] = encodeVectorCoord(dx);
355  vectors[index][1] = encodeVectorCoord(dy);
356  vectors[index][2] = encodeVectorCoord(dz);
357 
358  types[index] |= VOXEL_HAS_VECTOR;
359  }
360 
361  template <int xDim, int yDim, int zDim, typename IdxType>
362  void VoxelData<xDim, yDim, zDim, IdxType>::setVector(const Index& index, unsigned char dx, unsigned char dy, unsigned char dz)
363  {
364  vectors[index][0] = dx;
365  vectors[index][1] = dy;
366  vectors[index][2] = dz;
367 
368  types[index] |= VOXEL_HAS_VECTOR;
369  }
370 
371  template <int xDim, int yDim, int zDim, typename IdxType>
372  void VoxelData<xDim, yDim, zDim, IdxType>::setRotation(const Index& index, double dx, double dy, double dz)
373  {
374  // dx, dy and dx range from 0 to 1. Must be converted to a 8 bit integer so they can be stored in a voxel
375  rotations[index][0] = (unsigned char)(255.0*dx);
376  rotations[index][1] = (unsigned char)(255.0*dy);
377  rotations[index][2] = (unsigned char)(255.0*dz);
378  types[index] |= VOXEL_HAS_VECTOR;
379  }
380 
381  template <int xDim, int yDim, int zDim, typename IdxType>
382  void VoxelData<xDim, yDim, zDim, IdxType>::setRotation(const Index& index, unsigned char dx, unsigned char dy, unsigned char dz)
383  {
384  rotations[index][0] = dx;
385  rotations[index][1] = dy;
386  rotations[index][2] = dz;
387  types[index] |= VOXEL_HAS_VECTOR;
388  }
389 
390  template <int xDim, int yDim, int zDim, typename IdxType>
392  {
393  return materials[index];
394  }
395 
396  template <int xDim, int yDim, int zDim, typename IdxType>
397  void VoxelData<xDim, yDim, zDim, IdxType>::getVector(const Index& index, double& dx, double& dy, double& dz) const
398  {
399  dx = decodeVectorCoord(vectors[index][0]);
400  dy = decodeVectorCoord(vectors[index][1]);
401  dz = decodeVectorCoord(vectors[index][2]);
402  }
403 
404  template <int xDim, int yDim, int zDim, typename IdxType>
405  void VoxelData<xDim, yDim, zDim, IdxType>::getVector(const Index& index, float& dx, float& dy, float& dz) const
406  {
407  dx = (float)decodeVectorCoord(vectors[index][0]);
408  dy = (float)decodeVectorCoord(vectors[index][1]);
409  dz = (float)decodeVectorCoord(vectors[index][2]);
410  }
411 
412  template <int xDim, int yDim, int zDim, typename IdxType>
413  void VoxelData<xDim, yDim, zDim, IdxType>::getVector(const Index& index, unsigned char& dx, unsigned char& dy, unsigned char& dz) const
414  {
415  dx = vectors[index][0];
416  dy = vectors[index][1];
417  dz = vectors[index][2];
418  }
419 
420  template <int xDim, int yDim, int zDim, typename IdxType>
421  void VoxelData<xDim, yDim, zDim, IdxType>::getRotation(const Index& index, double& dx, double& dy, double& dz) const
422  {
423  dx = rotations[index][0] / 255.0;
424  dy = rotations[index][1] / 255.0;
425  dz = rotations[index][2] / 255.0;
426  }
427 
428  template <int xDim, int yDim, int zDim, typename IdxType>
429  void VoxelData<xDim, yDim, zDim, IdxType>::getRotation(const Index& index, float& dx, float& dy, float& dz) const
430  {
431  dx = rotations[index][0] / 255.0f;
432  dy = rotations[index][1] / 255.0f;
433  dz = rotations[index][2] / 255.0f;
434  }
435 
436  template <int xDim, int yDim, int zDim, typename IdxType>
437  void VoxelData<xDim, yDim, zDim, IdxType>::getRotation(const Index& index, unsigned char& dx, unsigned char& dy, unsigned char& dz) const
438  {
439  dx = rotations[index][0];
440  dy = rotations[index][1];
441  dz = rotations[index][2];
442  }
443 
444  template <int xDim, int yDim, int zDim, typename IdxType>
446  {
447  memset(types, 0, cSize*sizeof(VoxelType));
448  //memset(materials, 0, cSize*sizeof(MaterialId));
449  //memset(vectors, 0, 3*cSize);
450  //memset(rotations, 0, 3*cSize);
451  }
452 
453  template <int xDim, int yDim, int zDim, typename IdxType>
455  {
456  memcpy(types, source.types, cSize*sizeof(VoxelType));
457  memcpy(materials, source.materials, cSize*sizeof(MaterialId));
458  memcpy(vectors, source.vectors, 3*cSize);
459  memcpy(rotations, source.rotations, 3*cSize);
460  }
461 
462 
464  struct StatTracker
465  {
467  time_t time;
469  unsigned int count;
470  };
471 
473  enum StatId
474  {
475  STAT_VOXELS,
476  STAT_TRIANGLES,
477  STAT_TRIANGLES_MEDIUM_0,
478  STAT_TRIANGLES_MEDIUM_1,
479  STAT_TRIANGLES_MEDIUM_2,
480  STAT_TRIANGLES_MEDIUM_3,
481  STAT_TRIANGLES_BILLBOARDS,
482  STAT_TERRAIN,
483  STAT_INSTANCES,
484  STAT_WATER,
485  STAT_SANDBOX,
486  STAT_ARCH,
487  STAT_CUSTOM,
488  STAT_CUSTOM_JOB_PLAN,
489  STAT_CUSTOM_JOB_RUN,
490  STAT_CONTOUR,
491  STAT_MESH,
492  STAT_GENERATION,
493  STAT_CONTOUR_LOOP,
494  STAT_LSYS_RUN,
495  STAT_CONTOUR_LOOP_IDLE,
496  STAT_SCENE_DELTA,
497  STAT_SCENE_DELTA_REQUEST,
498  STAT_SCENE_UPDATE,
499  STAT_SCENE_ADD_1,
500  STAT_SCENE_ADD_2,
501  STAT_SCENE_ADD_3,
502  STAT_SCENE_ADD_4,
503  STAT_SCENE_ADD_1_FAN,
504  STAT_SCENE_ADD_2_FAN,
505  STAT_SCENE_ADD_3_FAN,
506  STAT_SCENE_ADD_4_FAN,
507  STAT_SCENE_REPAIR_1,
508  STAT_SCENE_REPAIR_2,
509  STAT_SCENE_REPAIR_3,
510  STAT_SCENE_REPAIR_4,
511  STAT_SCENE_REPAIR_1_FAN,
512  STAT_SCENE_REPAIR_2_FAN,
513  STAT_SCENE_REPAIR_3_FAN,
514  STAT_SCENE_REPAIR_4_FAN,
515  STAT_SCENE_REMOVE_1,
516  STAT_SCENE_REMOVE_2,
517  STAT_SCENE_REMOVE_3,
518  STAT_SCENE_REMOVE_4,
519  STAT_SCENE_REMOVE_1_FAN,
520  STAT_SCENE_REMOVE_2_FAN,
521  STAT_SCENE_REMOVE_3_FAN,
522  STAT_SCENE_REMOVE_4_FAN,
523  STAT_MAT_INSTANCES,
524  STAT_MAT_INSTANCE_TRIANGLES,
525  STAT_SCENE_CLEAR_USER_1,
526  STAT_NULL
527  };
528 
530  typedef StatTracker LODStats[LEVELS][STAT_NULL];
531 
533 
536  {
537  public:
539  virtual void getContourData(
541  CellId cell,
543  ContourVoxelData* data,
545  bool& empty,
546  void* threadContext) = 0;
548  virtual void planJobs(Scene* scene) {};
550  virtual void runJobs() {};
552  virtual void* createThreadContext()
553  {
554  return NULL;
555  }
557  virtual void disposeThreadContext(void* threadContext) {}
559  virtual int getStatsContourId()
560  {
561  return STAT_CUSTOM;
562  }
564  virtual int getStatsPlanJobsId()
565  {
566  return STAT_CUSTOM_JOB_PLAN;
567  }
569  virtual int getStatsRunJobsId()
570  {
571  return STAT_CUSTOM_JOB_RUN;
572  }
574  virtual bool isCacheable()
575  {
576  return true;
577  }
578  };
579 
581  class IMask
582  {
583  public:
585  virtual double getMaskValue(
587  double x,
589  double y,
591  double z) = 0;
592  };
593 
595  void adjustCellCoordinates(CellId& cell, int& x, int& y, int& z);
596 
597  const int VOXEL_BITS_MATERIAL = 16;
598 
600  const int VOXEL_NIL = ~(-1 << VOXEL_BITS_MATERIAL);
602  const int VOXEL_ONLY_COORDS = VOXEL_NIL - 1;
603  const int VOXEL_EMPTY = 0;
604 
605  template <int xDim, int yDim, int zDim, typename IdxType>
606  void VoxelData<xDim, yDim, zDim, IdxType>::serialize(unsigned char* buffer) const
607  {
608  int pos = 0;
609  memcpy(buffer, types, cSize*sizeof(VoxelType));
610  pos += cSize*sizeof(VoxelType);
611  for (int i = 0; i < cSize; i++)
612  {
613  MaterialId* dest = (MaterialId*)&buffer[pos];
614  if ((types[i] & VOXEL_HAS_MATERIAL) != 0)
615  {
616  *dest = materials[i];
617  }
618  else
619  {
620  *dest = 0;
621  }
622  pos += sizeof(MaterialId);
623  }
624  for (int channel = 0; channel < 3; channel++)
625  for (int i = 0; i < cSize; i++)
626  if ((types[i] & VOXEL_HAS_VECTOR) != 0)
627  {
628  buffer[pos++] = vectors[i][channel];
629  }
630  else
631  {
632  buffer[pos++] = 0;
633  }
634  for (int channel = 0; channel < 3; channel++)
635  for (int i = 0; i < cSize; i++)
636  if ((types[i] & VOXEL_HAS_ROTATION) != 0)
637  {
638  buffer[pos++] = rotations[i][channel];
639  }
640  else
641  {
642  buffer[pos++] = 0;
643  }
644  }
645 
646  template <int xDim, int yDim, int zDim, typename IdxType>
647  void VoxelData<xDim, yDim, zDim, IdxType>::unserialize(unsigned char* buffer)
648  {
649  int pos = 0;
650  memcpy(types, buffer, cSize*sizeof(VoxelType));
651  pos += cSize*sizeof(VoxelType);
652  memcpy(materials, &buffer[pos], cSize*sizeof(MaterialId));
653  pos += cSize*sizeof(MaterialId);
654  for (int channel = 0; channel < 3; channel++)
655  for (int i = 0; i < cSize; i++)
656  {
657  vectors[i][channel] = buffer[pos++];
658  }
659  for (int channel = 0; channel < 3; channel++)
660  for (int i = 0; i < cSize; i++)
661  {
662  rotations[i][channel] = buffer[pos++];
663  }
664  }
665 
666  struct DebugPoint
667  {
668  int type;
669  double x;
670  double y;
671  double z;
672  };
673  struct DebugLine
674  {
675  DebugPoint p0;
676  DebugPoint p1;
677  };
678  extern TVector<DebugPoint> debugPoints;
679  extern TVector<DebugLine> debugLines;
680  extern ExternalMutex::Mutex debugLock;
681 
682 }
const int BLOCK_DIMENSION
Number of voxels along one Cell Dim.
Definition: VoxelLayer.h:32
unsigned char encodeVectorCoord(double coord)
It encodes a double coord in an unsigned char one.
const int BLOCK_MARGIN
Number of voxels a Cell will overlap to its neighbors.
Definition: VoxelLayer.h:34
virtual void planJobs(Scene *scene)
This is called when a new scene is discovered. It can be used to create objects that will be later re...
Definition: VoxelLayer.h:548
Contains all classes and functions for the VoxelFarm engine.
virtual void disposeThreadContext(void *threadContext)
Destroys the specified thread context.
Definition: VoxelLayer.h:557
An interface for a 3D mask. A mask can be used to control the application of other features...
Definition: VoxelLayer.h:581
const int BLOCK_SIZE
Actual number of voxels in one Cell Dim once the margin is considered.
Definition: VoxelLayer.h:38
time_t time
Used to track elapsed time.
Definition: VoxelLayer.h:467
IdxType getCellBlockIndex(int x, int y, int z)
Return the index into the cell blocks for a given x, y, z offset.
Definition: VoxelLayer.h:70
MaterialId getMaterial(const Index &index) const
Gets the value of a voxel material.
Definition: VoxelLayer.h:391
const int MAX_BLOCK_LOD
Maximum level to retain block data.
Definition: VoxelLayer.h:42
virtual void runJobs()
Execute any additional generation task.
Definition: VoxelLayer.h:550
VoxelType * getTypes()
Raw data interfaces.
Definition: VoxelLayer.h:230
void setRotation(const Index &index, double dx, double dy, double dz)
Sets the rotation of the voxel using doubles.
Definition: VoxelLayer.h:372
void adjustCellCoordinates(CellId &cell, int &x, int &y, int &z)
Checks the provided coordinates to make sure the fall within the cell's range. If they are outside ra...
virtual bool isCacheable()
Returns true if the layer's output can be cached. Return true if the output for a cell will always be...
Definition: VoxelLayer.h:574
unsigned __int64 CellId
A 64bit integer that identifies a single world octree Cell.
Definition: mapindex.h:23
void clear()
Initializes the blocks.
Definition: VoxelLayer.h:445
unsigned int count
Used to count occurrences.
Definition: VoxelLayer.h:469
Cells Scene
A Scene is a set of cells.
Definition: scene.h:12
An interface for a voxel layer. By implementing this interface, very different modules can contribute...
Definition: VoxelLayer.h:535
void getVector(const Index &index, double &dx, double &dy, double &dz) const
Gets the interior point of the voxel as doubles.
Definition: VoxelLayer.h:397
const int BLOCK_CUBE_SIZE
Actual number of voxels in a Cell once margins are considered.
Definition: VoxelLayer.h:40
const int BLOCK_DATA_SIZE
Number of voxels in a Cell.
Definition: VoxelLayer.h:36
void getRotation(const Index &index, double &dx, double &dy, double &dz) const
Gets the rotation of the voxel as doubles.
Definition: VoxelLayer.h:421
StatTracker LODStats[LEVELS][STAT_NULL]
Used to track stats across all LOD.
Definition: VoxelLayer.h:530
StatId
Enummerates different stat IDs supported by the system.
Definition: VoxelLayer.h:473
double decodeVectorCoord(unsigned char coord)
It decodes an unsigned char coord in a double one.
const int VOXEL_ONLY_COORDS
A special material ID that specified material information is undefined, only voxel coordinates should...
Definition: VoxelLayer.h:602
void setMaterial(const Index &index, MaterialId material)
Sets the material of the voxel.
Definition: VoxelLayer.h:338
virtual int getStatsContourId()
Returns the stats ID to be used for measuring performance of the getContourData() method...
Definition: VoxelLayer.h:559
virtual void * createThreadContext()
The voxel layer can use this method to return a structure that will be unique for each calling thread...
Definition: VoxelLayer.h:552
const double VECTOR_MIN_VALUE
How much the vector can overfloat the voxel.
Definition: VoxelLayer.h:21
virtual int getStatsPlanJobsId()
Returns the stats ID to be used for measuring performance of the planJobs() method.
Definition: VoxelLayer.h:564
An object to track stats. Contains two different counters.
Definition: VoxelLayer.h:464
void setVector(const Index &index, double dx, double dy, double dz)
Sets the internal point in the voxel using doubles.
Definition: VoxelLayer.h:351
virtual int getStatsRunJobsId()
Returns the stats ID to be used for measuring performance of the runJobs() method.
Definition: VoxelLayer.h:569
const int VOXEL_NIL
A special material ID that specified no information is defined for the voxel.
Definition: VoxelLayer.h:600