java.lang.Object
de.grogra.persistence.ShareableBase
de.grogra.imp.registry.EmbeddedSharedObject
de.grogra.imp3d.objects.CloudArray
de.grogra.pointcloud.objects.impl.CloudList
- All Implemented Interfaces:
NodeContext
,ProducingNode
,BoundedCloud
,Cloud
,CloudContext
,DisposableField
,Manageable
,Shareable
,Disposable
An extension of a Cloud array to view point as list.
It also implements some methods for applying clustering tools.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class de.grogra.imp.registry.EmbeddedSharedObject
EmbeddedSharedObject.GetExtFromMimeType
Nested classes/interfaces inherited from interface de.grogra.imp3d.objects.Cloud
Cloud.Point
-
Field Summary
FieldsFields inherited from class de.grogra.imp3d.objects.CloudArray
cloudNode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPoint
(ArrayPoint point) Adds a point to this point cloud.void
void
addPoints
(Cloud.Point[] points) static CloudList
create
(Aggregate a, Cloud.Point p) boolean
editable()
A cloud is editable if it is possible to add and remove points.floatsToPoint
(float[] f) Returns the center position of this point cloud as a point object.float
Returns the center x position of this point cloud.float
Returns the center y position of this point cloud.float
Returns the center z position of this point cloud.float
getExtremum
(char dimension, char operator) Returns the extremum value of this point cloud.float
Returns the maximum x position of this point cloud.float
Returns the maximum y position of this point cloud.float
Returns the maximum z position of this point cloud.Serialization managementfloat
Returns the minimum x position of this point cloud.float
Returns the minimum y position of this point cloud.float
Returns the minimum z position of this point cloud.int
Returns the number of points in this point cloud.Returns the list of points of this point cloud.float
getValue
(int index, char dimension) Returns the x, y or z coordinate at the given index.boolean
True if the object is not "empty" as its persistence depends how the mimetype write content, a java object with some value could be defined as "empty"boolean
isEmpty()
To be part of the graph a cloud need to be added to a node.peek()
float[]
Parallel versionpop()
Add Object to graphvoid
push
(Cloud.Point p) void
void
setListPoints
(List<ArrayPoint> points) void
static void
setPointCloudOfPoints
(CloudList pointCloud, List<ArrayPoint> points) Sets the given point cloud as point cloud of all given points.void
setPoints
(float[] points) void
setPoints
(Cloud.Point[] points) Methods inherited from class de.grogra.imp3d.objects.CloudArray
dispose, dispose, disposeField, getCloud, getExtension, getNode, getObjectType, getPointsAsFloat, getResourceDirectoryName, pointsToFloat
Methods inherited from class de.grogra.imp.registry.EmbeddedSharedObject
getProvider, getProvider, initProvider, manageableReadResolve, manageableWriteReplace
Methods inherited from class de.grogra.persistence.ShareableBase
addReference, appendReferencesTo, fieldModified, getStamp, removeReference
-
Field Details
-
$TYPE
-
points$FIELD
-
-
Constructor Details
-
CloudList
public CloudList()A constructor to get an empty point cloud. The point cloud will have a default color and an empty list of points. -
CloudList
-
CloudList
-
CloudList
A constructor to get a point cloud with a list of points. The color will be a default color.- Parameters:
points
- The list of points for the point cloud
-
CloudList
public CloudList(float[] f)
-
-
Method Details
-
setNode
- Specified by:
setNode
in interfaceNodeContext
- Overrides:
setNode
in classCloudArray
-
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.- Specified by:
editable
in interfaceCloud
- Overrides:
editable
in classCloudArray
-
createNew
- Specified by:
createNew
in interfaceCloud
- Overrides:
createNew
in classCloudArray
-
getNumberOfPoints
public int getNumberOfPoints()Returns the number of points in this point cloud.- Specified by:
getNumberOfPoints
in interfaceCloud
- Overrides:
getNumberOfPoints
in classCloudArray
- Returns:
- The number of points in this point cloud
-
addPoint
Adds a point to this point cloud. The point cloud reference of the point is replaced with this point cloud.- Parameters:
point
- The point to add
-
getPoints
Returns the list of points of this point cloud.- Specified by:
getPoints
in interfaceCloud
- Overrides:
getPoints
in classCloudArray
- Returns:
- The list of points in this point cloud
-
getCenter
Returns the center position of this point cloud as a point object. This method does not return the point with the most-centric position, it returns a position with the average position of all points in the point cloud instead.- Specified by:
getCenter
in interfaceBoundedCloud
- Overrides:
getCenter
in classCloudArray
- Returns:
- The center position of this point cloud as a point object
-
getCenterX
public float getCenterX()Returns the center x position of this point cloud.- Overrides:
getCenterX
in classCloudArray
- Returns:
- The center x position of this point cloud
-
getCenterY
public float getCenterY()Returns the center y position of this point cloud.- Overrides:
getCenterY
in classCloudArray
- Returns:
- The center y position of this point cloud
-
getCenterZ
public float getCenterZ()Returns the center z position of this point cloud.- Overrides:
getCenterZ
in classCloudArray
- Returns:
- The center z position of this point cloud
-
getMinimumX
public float getMinimumX()Returns the minimum x position of this point cloud.- Specified by:
getMinimumX
in interfaceBoundedCloud
- Overrides:
getMinimumX
in classCloudArray
- Returns:
- The minimum x position of this point cloud
-
getMaximumX
public float getMaximumX()Returns the maximum x position of this point cloud.- Specified by:
getMaximumX
in interfaceBoundedCloud
- Overrides:
getMaximumX
in classCloudArray
- Returns:
- The maximum x position of this point cloud
-
getMinimumY
public float getMinimumY()Returns the minimum y position of this point cloud.- Specified by:
getMinimumY
in interfaceBoundedCloud
- Overrides:
getMinimumY
in classCloudArray
- Returns:
- The minimum y position of this point cloud
-
getMaximumY
public float getMaximumY()Returns the maximum y position of this point cloud.- Specified by:
getMaximumY
in interfaceBoundedCloud
- Overrides:
getMaximumY
in classCloudArray
- Returns:
- The maximum y position of this point cloud
-
getMinimumZ
public float getMinimumZ()Returns the minimum z position of this point cloud.- Specified by:
getMinimumZ
in interfaceBoundedCloud
- Overrides:
getMinimumZ
in classCloudArray
- Returns:
- The minimum z position of this point cloud
-
getMaximumZ
public float getMaximumZ()Returns the maximum z position of this point cloud.- Specified by:
getMaximumZ
in interfaceBoundedCloud
- Overrides:
getMaximumZ
in classCloudArray
- Returns:
- The maximum z position of this point cloud
-
getExtremum
public float getExtremum(char dimension, char operator) Returns the extremum value of this point cloud. The requested extremum value is specified with the given dimension and the given operator. To get a minimum value, the operator must be '-'. To get a maximum value, the operator must be '+'. To get a minimum in x, y or z direction, the dimension parameter must be 'x', 'y' or 'z'.- Parameters:
dimension
- Must be 'x', 'y' or 'z' to get the correct dimensionoperator
- Must be '-' to get a minimum or '+' to get a maximum- Returns:
- The minimum or maximum value in the requested dimension
-
getValue
public float getValue(int index, char dimension) Returns the x, y or z coordinate at the given index. The dimension parameter must be 'x', 'y' or 'z' to get the x, y or z coordinate. If the dimension parameter is wrong or the index is outside the point list, an exception is thrown.- Parameters:
index
- The index of the returned pointdimension
- The dimension (x, y, or z) of the returned point- Returns:
- The dimension value of the requested point
- Throws:
IllegalArgumentException
- If the index is < 0, too high or the dimension parameter is invalid
-
setPointCloudOfPoints
Sets the given point cloud as point cloud of all given points.- Parameters:
pointCloud
- The point cloud to set in all pointspoints
- The list of points where to set the point cloud
-
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.- Specified by:
isEmpty
in interfaceCloud
- Overrides:
isEmpty
in classCloudArray
-
setPoints
- Specified by:
setPoints
in interfaceCloud
- Overrides:
setPoints
in classCloudArray
-
setPoints
public void setPoints(float[] points) - Overrides:
setPoints
in classCloudArray
-
addPoints
- Specified by:
addPoints
in interfaceCloud
- Overrides:
addPoints
in classCloudArray
-
addPoint
- Specified by:
addPoint
in interfaceCloud
- Overrides:
addPoint
in classCloudArray
-
remove
- Specified by:
remove
in interfaceCloud
- Overrides:
remove
in classCloudArray
-
remove
- Specified by:
remove
in interfaceCloud
- Overrides:
remove
in classCloudArray
-
removeAll
public void removeAll()- Specified by:
removeAll
in interfaceCloud
- Overrides:
removeAll
in classCloudArray
-
setListPoints
-
getListPoints
-
peek
- Specified by:
peek
in interfaceCloud
- Overrides:
peek
in classCloudArray
-
pop
- Specified by:
pop
in interfaceCloud
- Overrides:
pop
in classCloudArray
-
push
- Specified by:
push
in interfaceCloud
- Overrides:
push
in classCloudArray
-
pointsToFloat
public float[] pointsToFloat()Parallel version- Specified by:
pointsToFloat
in interfaceCloud
- Overrides:
pointsToFloat
in classCloudArray
-
floatsToPoint
- Specified by:
floatsToPoint
in interfaceCloud
- Overrides:
floatsToPoint
in classCloudArray
-
getMimeType
Description copied from class:CloudArray
Serialization management- Overrides:
getMimeType
in classCloudArray
-
hasContent
public boolean hasContent()Description copied from class:EmbeddedSharedObject
True if the object is not "empty" as its persistence depends how the mimetype write content, a java object with some value could be defined as "empty"- Overrides:
hasContent
in classCloudArray
-
create
-
produceNode
Description copied from class:CloudArray
Add Object to graph- Specified by:
produceNode
in interfaceProducingNode
- Overrides:
produceNode
in classCloudArray
-
getManageableType
- Specified by:
getManageableType
in interfaceManageable
- Overrides:
getManageableType
in classCloudArray
-