java.lang.Object
de.grogra.pointcloud.objects.CloudGraphBase
de.grogra.pointcloud.objects.impl.CloudGraph
- All Implemented Interfaces:
NodeContext,ProducingNode,BoundedCloud,Cloud,CloudContext,DisposableField,Manageable,Disposable
Base implementation of a CloudGraphBase
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface de.grogra.imp3d.objects.Cloud
Cloud.Point -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CloudGraph.Typeprotected longstatic final SCOType.Fieldprotected booleanprotected Stringstatic final SCOType.Fieldprotected Nodestatic final SCOType.Fieldprotected booleanprotected intstatic final SCOType.Fieldprotected Stringstatic final SCOType.Fieldprotected booleanFields inherited from class de.grogra.pointcloud.objects.CloudGraphBase
childrenType -
Constructor Summary
ConstructorsConstructorDescriptionCloudGraph(float[] points) CloudGraph(String name, long balancingFactor, long depth, Class type) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPoint(Cloud.Point node) voidvoidaddPoint(IntermediateCloudNode[] nodes) voidaddPoints(Cloud.Point[] nodes) voidaddSize(int a) TODO: this should probably not exists.static longcomputeDepthFromNandD(long n, long d) get the depth of the tree based on the number of leaves n, and the degree of the treestatic CloudListcreate(Aggregate a, Cloud.Point p) createLeaf(Object[] args) args is the set of arguments that the leaf constructor takes in.voiddispose()voiddispose(boolean removeNode) voidbooleaneditable()A cloud is editable if it is possible to add and remove points.voidfieldModified(PersistenceField field, int[] indices, Transaction t) SerializationfloatsToPoint(float[] points) longHere we consider the max degree of the graph as balancing factorClass<? extends PointCloudLeaf> longgetDepth()floatfloatfloatfloatfloatfloatgetNode()intRecompute properly the number of childrenintgetSize()intgetStamp()Returns a stamp for this object.booleanisEmpty()To be part of the graph a cloud need to be added to a node.peek()Should be last but wellfloat[]Convenience methods as most points are/or can be represented as arrays of floatspop()voidpush(Cloud.Point p) voidNaive "rebalancing" the depth of the graph is incremented, All direct IPCN from the root are pushed one layer down.protected voidRemove a given nodeRemove an array of nodesvoidThis delete all the leaves (all their edges) before delete all edges from the pointcloud node to the indtermedate nodes.voidremoveAll(boolean deepRemove) If deep remove is false, only delete the first layer of edges from the pointcloud node toward the leaves.voidsetBalancingFactor(long value) voidsetMaxId(long id) voidsetMinId(long id) voidvoidsetPoints(Cloud.Point[] p) Methods inherited from class de.grogra.pointcloud.objects.CloudGraphBase
getCloud
-
Field Details
-
sourceName
-
childrenClass
-
cloudNode
-
size
protected int size -
balancingFactor
protected long balancingFactor -
initialized
protected transient boolean initialized -
update
protected transient boolean update -
boundariesChanged
protected transient boolean boundariesChanged -
$TYPE
-
sourceName$FIELD
-
childrenClass$FIELD
-
size$FIELD
-
balancingFactor$FIELD
-
depth$FIELD
-
-
Constructor Details
-
CloudGraph
public CloudGraph() -
CloudGraph
public CloudGraph(float[] points) -
CloudGraph
-
-
Method Details
-
editable
public boolean editable()Description copied from interface:CloudA cloud is editable if it is possible to add and remove points. Being able to setPoint does not make the cloud editable as is change either all or none of hte points. -
getNode
-
setNode
-
getSourceName
- Specified by:
getSourceNamein classCloudGraphBase
-
dispose
public void dispose(boolean removeNode) -
dispose
public void dispose() -
createNew
-
computeDepthFromNandD
public static long computeDepthFromNandD(long n, long d) get the depth of the tree based on the number of leaves n, and the degree of the tree- Parameters:
n-d-- Returns:
-
setPoints
-
addPoints
-
addPoint
-
addPoint
- Specified by:
addPointin classCloudGraphBase
-
addPoint
- Specified by:
addPointin classCloudGraphBase
-
createLeaf
args is the set of arguments that the leaf constructor takes in. e.g. for pointcloudpointimpl it is float x, float y, float z- Parameters:
args-- Returns:
-
getChildrenType
- Specified by:
getChildrenTypein classCloudGraphBase- Throws:
ClassNotFoundException
-
remove
Remove a given node -
remove
Remove an array of nodes -
removeAll
public void removeAll()This delete all the leaves (all their edges) before delete all edges from the pointcloud node to the indtermedate nodes. The deletion of the Leaves if required to ensure that no other edges from them to another part of the project graph remains. -
removeAll
public void removeAll(boolean deepRemove) If deep remove is false, only delete the first layer of edges from the pointcloud node toward the leaves. If any node of the point cloud have other edges toward the project graph, they will remains persistent through these edges. In most cases this have the same effect as removeall, but if the point cloud was imported with PLY and some refinement edges exists, the points will keep existing after removeall(false); -
rebalance
public void rebalance()Naive "rebalancing" the depth of the graph is incremented, All direct IPCN from the root are pushed one layer down. (but their layer info is not updated TODO)- Specified by:
rebalancein classCloudGraphBase
-
getBalancindFactor
public long getBalancindFactor()Here we consider the max degree of the graph as balancing factor -
getDepth
public long getDepth() -
setMinId
public void setMinId(long id) -
setMaxId
public void setMaxId(long id) -
getNumberOfPoints
public int getNumberOfPoints()Recompute properly the number of children -
getFirstLeaf
- Specified by:
getFirstLeafin classCloudGraphBase
-
isEmpty
public boolean isEmpty()Description copied from interface:CloudTo be part of the graph a cloud need to be added to a node. This return the cloudNode associated to this cloud if any. -
getPoints
-
recomputeBoundaries
protected void recomputeBoundaries() -
peek
Should be last but well -
pop
-
push
-
pointsToFloat
public float[] pointsToFloat()Description copied from interface:CloudConvenience methods as most points are/or can be represented as arrays of floats -
floatsToPoint
-
getMinimumX
public float getMinimumX() -
getMinimumY
public float getMinimumY() -
getMinimumZ
public float getMinimumZ() -
getMaximumX
public float getMaximumX() -
getMaximumY
public float getMaximumY() -
getMaximumZ
public float getMaximumZ() -
create
-
getCenter
-
produceNode
-
addSize
public void addSize(int a) TODO: this should probably not exists. Find a better way to update the size when merging/ spliting clouds -
fieldModified
Serialization -
getStamp
public int getStamp()Description copied from interface:ManageableReturns a stamp for this object. Each modification to this object increments the stamp. The initial stamp is non-negative.- Returns:
- a stamp
-
manageableReadResolve
-
manageableWriteReplace
-
disposeField
public void disposeField() -
getManageableType
-
getSize
public int getSize() -
setBalancingFactor
public void setBalancingFactor(long value) -
getChildrenClass
-