Package gaiasky.data.octreegen.generator
Class OctreeGeneratorMag
java.lang.Object
gaiasky.data.octreegen.generator.OctreeGeneratorMag
- All Implemented Interfaces:
IOctreeGenerator
public class OctreeGeneratorMag extends java.lang.Object implements IOctreeGenerator
Implements a f: mag -> level bijective map, where octree nodes in a level are filled with
magnitude-sorted stars until one of them is saturated before proceeding to lower
levels. This uses more memory than the outdated
OctreeGeneratorPart
but
it generally produces an artifact-free octree. The technique is called MS-LOD.-
Field Summary
Fields inherited from interface gaiasky.data.octreegen.generator.IOctreeGenerator
logger
-
Constructor Summary
Constructors Constructor Description OctreeGeneratorMag(OctreeGeneratorParams params)
-
Method Summary
Modifier and Type Method Description OctreeNode
generateOctree(java.util.List<IParticleRecord> catalog)
int
getDiscarded()
java.lang.Long
getPositionOctantId(double x, double y, double z, int level)
Gets the id of the node which corresponds to the given xyz positionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
OctreeGeneratorMag
-
-
Method Details
-
generateOctree
- Specified by:
generateOctree
in interfaceIOctreeGenerator
-
getDiscarded
public int getDiscarded()- Specified by:
getDiscarded
in interfaceIOctreeGenerator
-
getPositionOctantId
public java.lang.Long getPositionOctantId(double x, double y, double z, int level)Gets the id of the node which corresponds to the given xyz position- Parameters:
x
- Position in xy
- Position in yz
- Position in zlevel
- Level- Returns:
- Id of node which contains the position. The id is a long where the two least significant digits indicate the level and the rest of digit positions indicate the index in the level of the position.
-