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.Type
protected long
static final SCOType.Field
protected boolean
protected String
static final SCOType.Field
protected Node
static final SCOType.Field
protected boolean
protected int
static final SCOType.Field
protected String
static final SCOType.Field
protected boolean
Fields 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 TypeMethodDescriptionvoid
addPoint
(Cloud.Point node) void
void
addPoint
(IntermediateCloudNode[] nodes) void
addPoints
(Cloud.Point[] nodes) void
addSize
(int a) TODO: this should probably not exists.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 treestatic CloudList
create
(Aggregate a, Cloud.Point p) createLeaf
(Object[] args) args is the set of arguments that the leaf constructor takes in.void
dispose()
void
dispose
(boolean removeNode) void
boolean
editable()
A cloud is editable if it is possible to add and remove points.void
fieldModified
(PersistenceField field, int[] indices, Transaction t) SerializationfloatsToPoint
(float[] points) long
Here we consider the max degree of the graph as balancing factorClass<? extends PointCloudLeaf>
long
getDepth()
float
float
float
float
float
float
getNode()
int
Recompute properly the number of childrenint
getSize()
int
getStamp()
Returns a stamp for this object.boolean
isEmpty()
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()
void
push
(Cloud.Point p) void
Naive "rebalancing" the depth of the graph is incremented, All direct IPCN from the root are pushed one layer down.protected void
Remove a given nodeRemove an array of nodesvoid
This delete all the leaves (all their edges) before delete all edges from the pointcloud node to the indtermedate nodes.void
removeAll
(boolean deepRemove) If deep remove is false, only delete the first layer of edges from the pointcloud node toward the leaves.void
setBalancingFactor
(long value) void
setMaxId
(long id) void
setMinId
(long id) void
void
setPoints
(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:Cloud
A 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:
getSourceName
in 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:
addPoint
in classCloudGraphBase
-
addPoint
- Specified by:
addPoint
in 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:
getChildrenType
in 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:
rebalance
in 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:
getFirstLeaf
in classCloudGraphBase
-
isEmpty
public boolean isEmpty()Description copied from interface:Cloud
To 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:Cloud
Convenience 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:Manageable
Returns 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
-