Space Engineers
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Properties | List of all members
Sandbox.Engine.Voxels.MyOctreeStorage Class Reference
Inheritance diagram for Sandbox.Engine.Voxels.MyOctreeStorage:
Sandbox.Engine.Voxels.MyStorageBase VRage.ModAPI.IMyStorage Sandbox.Engine.Voxels.IMyStorage VRage.ModAPI.IMyStorage

Classes

struct  ChunkHeader
 

Public Types

enum  ChunkTypeEnum : ushort {
  ChunkTypeEnum.StorageMetaData = 1, ChunkTypeEnum.MaterialIndexTable = 2, ChunkTypeEnum.MacroContentNodes = 3, ChunkTypeEnum.MacroMaterialNodes = 4,
  ChunkTypeEnum.ContentLeafProvider = 5, ChunkTypeEnum.ContentLeafOctree = 6, ChunkTypeEnum.MaterialLeafProvider = 7, ChunkTypeEnum.MaterialLeafOctree = 8,
  ChunkTypeEnum.DataProvider = 9, ChunkTypeEnum.EndOfFile = ushort.MaxValue
}
 

Public Member Functions

 MyOctreeStorage ()
 
 MyOctreeStorage (IMyStorageDataProvider dataProvider, Vector3I size)
 
override IMyStorage Copy ()
 
override void DebugDraw (MyVoxelBase referenceVoxelMap, MyVoxelDebugDrawMode mode)
 
void Voxelize (MyStorageDataTypeFlags data)
 For debugging/testing only! This can be very slow for large storage. More...
 
override unsafe ContainmentType IntersectInternal (ref BoundingBox box, bool lazy)
 
override unsafe bool IntersectInternal (ref LineD line)
 
- Public Member Functions inherited from Sandbox.Engine.Voxels.MyStorageBase
void InitWriteCache (int prealloc=128)
 
bool CleanCachedChunks ()
 
bool WritePending (bool force=false)
 
void GetStats (out WriteCacheStats stats)
 
 MyStorageBase ()
 
unsafe bool ChangeMaterials (Dictionary< byte, byte > map)
 
void Save (out byte[] outCompressedData)
 Gets compressed voxel data More...
 
void Reset (MyStorageDataTypeFlags dataToReset)
 Resets the data specified by flags to values from data provider, or default if no provider is assigned. More...
 
void OverwriteAllMaterials (MyVoxelMaterialDefinition material)
 
void WriteRange (MyStorageData source, MyStorageDataTypeFlags dataToWrite, ref Vector3I voxelRangeMin, ref Vector3I voxelRangeMax)
 Writes range of content and/or materials from cache to storage. Note that this can only write to LOD0 (higher LODs must be computed based on that). More...
 
void ReadRange (MyStorageData target, MyStorageDataTypeFlags dataToRead, int lodIndex, ref Vector3I lodVoxelRangeMin, ref Vector3I lodVoxelRangeMax)
 Reads range of content and/or materials from specified LOD. If you want to write data back later, you must read LOD0 as that is the only writable one. More...
 
void ReadRange (MyStorageData target, MyStorageDataTypeFlags dataToRead, int lodIndex, ref Vector3I lodVoxelRangeMin, ref Vector3I lodVoxelRangeMax, ref MyVoxelRequestFlags requestFlags)
 
ContainmentType Intersect (ref BoundingBox box, bool lazy)
 
bool Intersect (ref LineD line)
 
void Reset ()
 
virtual void CloseInternal ()
 
void Close ()
 
StoragePin Pin ()
 
void Unpin ()
 
- Public Member Functions inherited from VRage.ModAPI.IMyStorage
void PinAndExecute (Action< IMyStorage > action)
 Pins the voxel storage to prevent closing, then executes specified action. Unpins when action completes. More...
 

Public Attributes

const int LeafLodCount = 4
 
const int LeafSizeInVoxels = 1 << LeafLodCount
 

Protected Member Functions

override void ResetInternal (MyStorageDataTypeFlags dataToReset)
 
override void OverwriteAllMaterialsInternal (MyVoxelMaterialDefinition material)
 
override void LoadInternal (int fileVersion, Stream stream, ref bool isOldFormat)
 
override void SaveInternal (Stream stream)
 
override void ReadRangeInternal (MyStorageData target, ref Vector3I targetWriteOffset, MyStorageDataTypeFlags dataToRead, int lodIndex, ref Vector3I lodVoxelCoordStart, ref Vector3I lodVoxelCoordEnd, ref MyVoxelRequestFlags flags)
 
unsafe override void WriteRangeInternal (MyStorageData source, MyStorageDataTypeFlags dataToWrite, ref Vector3I voxelRangeMin, ref Vector3I voxelRangeMax)
 
- Protected Member Functions inherited from Sandbox.Engine.Voxels.MyStorageBase
void SaveCompressedData (out byte[] compressedData)
 

Properties

override IMyStorageDataProvider DataProvider [get, set]
 
- Properties inherited from Sandbox.Engine.Voxels.MyStorageBase
bool CachedWrites [get, set]
 
bool HasPendingWrites [get]
 
bool HasCachedChunks [get]
 
abstract IMyStorageDataProvider DataProvider [get, set]
 
bool Shared [get, protected set]
 
bool MarkedForClose [get]
 
bool Pinned [get]
 
MyVoxelGeometry Geometry [get]
 
Vector3I Size [get, protected set]
 
bool Closed [get]
 
- Properties inherited from VRage.ModAPI.IMyStorage
bool Closed [get]
 Returns true if voxel storage was closed More...
 
bool MarkedForClose [get]
 Returns true if the voxel storage is marked for a pending close More...
 
Vector3I Size [get]
 The size of the voxel storage, in voxels More...
 
- Properties inherited from Sandbox.Engine.Voxels.IMyStorage
new Vector3I Size [get]
 
MyVoxelGeometry Geometry [get]
 
IMyStorageDataProvider DataProvider [get]
 
bool Closed [get]
 
bool Shared [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from Sandbox.Engine.Voxels.MyStorageBase
static MyStorageBase LoadFromFile (string absoluteFilePath, Dictionary< byte, byte > modifiers=null)
 
static void ResetCache ()
 
static MyStorageBase Load (string name)
 
static MyStorageBase Load (byte[] memoryBuffer)
 
- Static Public Attributes inherited from Sandbox.Engine.Voxels.MyStorageBase
static bool UseStorageCache = true
 
- Protected Attributes inherited from Sandbox.Engine.Voxels.MyStorageBase
const string STORAGE_TYPE_NAME_CELL = "Cell"
 
const int STORAGE_TYPE_VERSION_CELL = 2
 
const string STORAGE_TYPE_NAME_OCTREE = "Octree"
 
const int STORAGE_TYPE_VERSION_OCTREE = 1
 
byte[] m_compressedData
 
readonly FastResourceLock m_storageLock = new FastResourceLock()
 
byte m_defaultMaterial = MyDefinitionManager.Static.GetDefaultVoxelMaterialDefinition().Index
 
- Events inherited from Sandbox.Engine.Voxels.MyStorageBase
RangeChangedDelegate RangeChanged
 
- Events inherited from Sandbox.Engine.Voxels.IMyStorage
RangeChangedDelegate RangeChanged
 please use RangeChanged on voxelbase if possible More...
 

Detailed Description

Definition at line 19 of file MyOctreeStorage.cs.

Member Enumeration Documentation

Enumerator
StorageMetaData 
MaterialIndexTable 
MacroContentNodes 
MacroMaterialNodes 
ContentLeafProvider 
ContentLeafOctree 
MaterialLeafProvider 
MaterialLeafOctree 
DataProvider 
EndOfFile 

Definition at line 23 of file MyOctreeStorage.cs.

Constructor & Destructor Documentation

Sandbox.Engine.Voxels.MyOctreeStorage.MyOctreeStorage ( )
inline

Definition at line 94 of file MyOctreeStorage.cs.

Sandbox.Engine.Voxels.MyOctreeStorage.MyOctreeStorage ( IMyStorageDataProvider  dataProvider,
Vector3I  size 
)
inline

Definition at line 96 of file MyOctreeStorage.cs.

Member Function Documentation

override IMyStorage Sandbox.Engine.Voxels.MyOctreeStorage.Copy ( )
inlinevirtual

Reimplemented from Sandbox.Engine.Voxels.MyStorageBase.

Definition at line 307 of file MyOctreeStorage.cs.

override void Sandbox.Engine.Voxels.MyOctreeStorage.DebugDraw ( MyVoxelBase  referenceVoxelMap,
MyVoxelDebugDrawMode  mode 
)
inlinevirtual

Reimplemented from Sandbox.Engine.Voxels.MyStorageBase.

Definition at line 389 of file MyOctreeStorage.cs.

override unsafe ContainmentType Sandbox.Engine.Voxels.MyOctreeStorage.IntersectInternal ( ref BoundingBox  box,
bool  lazy 
)
inlinevirtual

Implements Sandbox.Engine.Voxels.MyStorageBase.

Definition at line 1138 of file MyOctreeStorage.cs.

override unsafe bool Sandbox.Engine.Voxels.MyOctreeStorage.IntersectInternal ( ref LineD  line)
inlinevirtual

Implements Sandbox.Engine.Voxels.MyStorageBase.

Definition at line 1216 of file MyOctreeStorage.cs.

override void Sandbox.Engine.Voxels.MyOctreeStorage.LoadInternal ( int  fileVersion,
Stream  stream,
ref bool  isOldFormat 
)
inlineprotectedvirtual

Implements Sandbox.Engine.Voxels.MyStorageBase.

Definition at line 178 of file MyOctreeStorage.cs.

override void Sandbox.Engine.Voxels.MyOctreeStorage.OverwriteAllMaterialsInternal ( MyVoxelMaterialDefinition  material)
inlineprotectedvirtual

Implements Sandbox.Engine.Voxels.MyStorageBase.

Definition at line 173 of file MyOctreeStorage.cs.

override void Sandbox.Engine.Voxels.MyOctreeStorage.ReadRangeInternal ( MyStorageData  target,
ref Vector3I  targetWriteOffset,
MyStorageDataTypeFlags  dataToRead,
int  lodIndex,
ref Vector3I  lodVoxelCoordStart,
ref Vector3I  lodVoxelCoordEnd,
ref MyVoxelRequestFlags  flags 
)
inlineprotectedvirtual

Implements Sandbox.Engine.Voxels.MyStorageBase.

Definition at line 318 of file MyOctreeStorage.cs.

override void Sandbox.Engine.Voxels.MyOctreeStorage.ResetInternal ( MyStorageDataTypeFlags  dataToReset)
inlineprotectedvirtual

Implements Sandbox.Engine.Voxels.MyStorageBase.

Definition at line 125 of file MyOctreeStorage.cs.

override void Sandbox.Engine.Voxels.MyOctreeStorage.SaveInternal ( Stream  stream)
inlineprotectedvirtual

Implements Sandbox.Engine.Voxels.MyStorageBase.

Definition at line 288 of file MyOctreeStorage.cs.

void Sandbox.Engine.Voxels.MyOctreeStorage.Voxelize ( MyStorageDataTypeFlags  data)
inline

For debugging/testing only! This can be very slow for large storage.

Definition at line 492 of file MyOctreeStorage.cs.

unsafe override void Sandbox.Engine.Voxels.MyOctreeStorage.WriteRangeInternal ( MyStorageData  source,
MyStorageDataTypeFlags  dataToWrite,
ref Vector3I  voxelRangeMin,
ref Vector3I  voxelRangeMax 
)
inlineprotectedvirtual

Implements Sandbox.Engine.Voxels.MyStorageBase.

Definition at line 353 of file MyOctreeStorage.cs.

Member Data Documentation

const int Sandbox.Engine.Voxels.MyOctreeStorage.LeafLodCount = 4

Definition at line 59 of file MyOctreeStorage.cs.

const int Sandbox.Engine.Voxels.MyOctreeStorage.LeafSizeInVoxels = 1 << LeafLodCount

Definition at line 60 of file MyOctreeStorage.cs.

Property Documentation

override IMyStorageDataProvider Sandbox.Engine.Voxels.MyOctreeStorage.DataProvider
getset

Definition at line 81 of file MyOctreeStorage.cs.


The documentation for this class was generated from the following files: