ExtensionLayer.h
1 #pragma once
2 #include "VoxelLayer.h"
3 #include "Vector.h"
4 
5 namespace VoxelFarm
6 {
7  namespace API
8  {
10  {
11  public:
12  virtual void getVoxels(
13  VoxelFarm::CellId cell,
14  double cellOrigin[3],
15  double cellSize,
16  double voxelSize,
17  int blockSize,
18  VoxelFarm::VoxelType* changeFlags,
19  VoxelFarm::MaterialId* materials,
21  bool& empty) = 0;
22  };
23 
25  {
26  public:
27  CExtensionLayer(IExtensionLayer* extension);
28  ~CExtensionLayer();
29  public:
30  IExtensionLayer* extension;
32  virtual void getContourData(
34  CellId cell,
36  ContourVoxelData* data,
38  bool& empty,
39  void* threadContext) override;
40  virtual void* createThreadContext() override
41  {
42  return VF_NEW ThreadContext();
43  };
44  virtual void disposeThreadContext(void* threadContext) override
45  {
46  VF_DELETE(ThreadContext*)threadContext;
47  };
48  int getStatsContourId() override
49  {
50  return STAT_CUSTOM;
51  }
52  public:
54  {
56  MaterialId materials[BLOCK_CUBE_SIZE];
57  VoxelType changeFlags[BLOCK_CUBE_SIZE];
58  };
59  };
60  }
61 
62 }
Contains all classes and functions for the VoxelFarm engine.
A 3D Vector.
Definition: Vector.h:34
int getStatsContourId() override
Returns the stats ID to be used for measuring performance of the getContourData() method...
unsigned __int64 CellId
A 64bit integer that identifies a single world octree Cell.
Definition: mapindex.h:23
An interface for a voxel layer. By implementing this interface, very different modules can contribute...
Definition: VoxelLayer.h:535
const int BLOCK_CUBE_SIZE
Actual number of voxels in a Cell once margins are considered.
Definition: VoxelLayer.h:40
virtual void disposeThreadContext(void *threadContext) override
Destroys the specified thread context.
virtual void * createThreadContext() override
The voxel layer can use this method to return a structure that will be unique for each calling thread...
virtual void getContourData(CellId cell, ContourVoxelData *data, bool &empty, void *threadContext) override
Returns voxel data for the specified cell (IVoxelLayer)