Package org.cytoscape.view.model.spacial
Interface NodeSpacialIndex2DEnumerator
- All Superinterfaces:
SpacialIndex2DEnumerator<Long>
Enumerator returned when querying a
Example usage:
NetworkSpacialIndex2D
, used to iterate over the results of the query.
Example usage:
NetworkSpacialIndex2D spacialIndex = networkViewSnapshot.getSpacialIndex2D(); NodeSpacialIndex2DEnumerator enumerator = spacialIndex.queryAllNodes(null); float[] extents = new float[4]; while(enumerator.hasNext()) { // extents will contain the coordinates of the bottom left and top right corners of the rectangle View<CyNode> nodeView = enumerator.nextNodeExtents(extents); float bottomLeftX = extents[SpacialIndex2D.X_MIN]; float bottomLeftY = extents[SpacialIndex2D.Y_MIN]; float topRightX = extents[SpacialIndex2D.X_MAX]; float topRightY = extents[SpacialIndex2D.Y_MAX]; }
- Since:
- 3.9
Cytoscape Backwards Compatibility (SPI Interface): We expect that this interface will be implemented. Therefore to maintain backwards compatibility this interface will only be modified for major version updates.
Module: viewmodel-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>viewmodel-api</artifactId> </dependency>
-
Method Summary
Methods inherited from interface org.cytoscape.view.model.spacial.SpacialIndex2DEnumerator
hasNext, next, nextExtents, size
-
Method Details
-
nextNode
Returns the next node. -
nextNodeExtents
Returns the next node.- Parameters:
extents
- Output parameter that will be loaded with the extents of the node. Must have size at least 4. May be null.- See Also:
SpacialIndex2D.X_MIN
,SpacialIndex2D.X_MAX
,SpacialIndex2D.Y_MIN
,SpacialIndex2D.Y_MAX
-