The class offers methods to create sets based on spatial constraints, both in world coordinates and in screen coordinates.
Bit-mask used to specify which nodes to include with regards to the plane.
These values are then combined into the NodePositionCriteria used in createFromPlane()
Constant indicating in front of plane.
Constant indicating on the plane.
Constant indicating behind plane.
- enumerator FRONT
typedef int NodePositionCriteria
Bit-mask made up of NodePositionCriterion which specifies which nodes will be accepted based on the corresponding plane.
DataNodeSetGenerator(const UnstructGridModel &model, size_t frameIndex)
Creates the generator.
You specify the model and frameIndex to use.
The normal usage of this class is to create it on the stack whenever you need it.
PtrRef<DataNodeSet> createFromRegion(int setId, int x, int y, unsigned int width, unsigned int height, const vis::View &view)
Creates a DataNodeSet with all nodes that are within the given region of the screen.
The x and y coordinates must be specified in OpenGL style coordinates, which means a right-handed coordinate system with the origin in the lower left corner of the window. The width and height are in pixels.
PtrRef<DataNodeSet> createFromPolygon(int setId, const std::vector<Vec2f> &polygonInWindowCoordinates, const vis::View &view)
Creates a DataNodeSet with all nodes that are within the given polygon of the screen.
The polygon is described by polygonInWindowCoordinates which contains the points defining the polygon outer contour. The array should contain all nodes in the polygon in the right order. Polygon edges will be created between 0 -> 1, 1 -> 2, …. n -> 0, so there is no need to repeat the first node in order to close the polygon (polygon will be closed).
The coordinates defining the polygon must be specified in OpenGL style coordinates, which means a right handed coordinate system with the origin in the lower left corner of the window.
Example: (100,100), (200, 100), (200, 200), (200, 100) This defines a square with lower left corner of (100, 100) and sides 100 long.
PtrRef<DataNodeSet> createFromPlane(int setId, const Plane &plane, NodePositionCriteria criteria)
Creates a DataNodeSet from a given plane, according to given criteria on the node’s position with respect to the plane: ON, FRONT and/or BACK.
The node position is determined with the plane normal. Nodes that meet the given criteria are added the generated set.
- enum NodePositionCriterion