This class is used to generate DataNodeSet's from the current DataSource of an UnstructGridModel. More...
Public Types | |
enum | NodePositionCriterion { FRONT = 0x01, ON = 0x02, BACK = 0x04 } |
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() More... | |
typedef int | NodePositionCriteria |
Bit-mask made up of NodePositionCriterion which specifies which nodes will be accepted based on the corresponding plane. More... | |
Public Member Functions | |
DataNodeSetGenerator (const UnstructGridModel &model, size_t frameIndex) | |
Creates the generator. More... | |
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. More... | |
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. More... | |
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. More... | |
PtrRef< DataNodeSet > | createAllNodes (int setId) |
Creates a DataNodeSet with all nodes in the given frame. More... | |
This class is used to generate DataNodeSet's from the current DataSource of an UnstructGridModel.
The class offers methods to create sets based on spatial constraints, both in world coordinates and in screen coordinates.
Bit-mask made up of NodePositionCriterion which specifies which nodes will be accepted based on the corresponding plane.
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()
Enumerator | |
---|---|
FRONT |
Constant indicating in front of plane. |
ON |
Constant indicating on the plane. |
BACK |
Constant indicating behind plane. |
cee::ug::DataNodeSetGenerator::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 > cee::ug::DataNodeSetGenerator::createAllNodes | ( | int | setId | ) |
Creates a DataNodeSet with all nodes in the given frame.
PtrRef< DataNodeSet > cee::ug::DataNodeSetGenerator::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.
PtrRef< DataNodeSet > cee::ug::DataNodeSetGenerator::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 > cee::ug::DataNodeSetGenerator::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.