Helper class for generating a path on an UnstructGridModel model and for sampling a scalar value along this path.
SurfacePathQuery will also produce a surface path for points on a cutting plane. All points need to be one the same cutting plane.
Mixing hits on parts AND cutting plane in the same query is not supported.
This is useful for creating length plot of a scalar vs. length on the surface of the model.
SurfacePathQuery(UnstructGridModel *model, size_t frameIndex, PointType pointType, std::vector<cee::ug::HitItem> items)
Creates a SurfacePathQuery object with the given settings.
The frameIndex and the model specifies which DataState to use. The pointType specifies what kind of identifiers that are in the items, and the items specify each point that will be intersected on the path. All items must be either on parts or on a cutting plane. Part items and cutting plane items cannot be mixed in the same query instance.
bool generatePath(std::vector<Vec3d> *points)
Generates a path using the parameters passed to the constructor and update the points vector with the computed path.
If no path was possible, the method will return false.
bool getScalarResultValues(int scalarResultId, std::vector<double> *length, std::vector<double> *results)
Returns the scalar result values with the given scalarResultId on the path generated by generatePath().
If successful, the length vector will contain the length along the path from the starting point at each item, and the results will contain the interpolated scalar value at the item.
Note! generatePath() should be called prior to this method.
void enableSampling(bool enable)
Toggles path point sampling.
When sampling is on, the path is created on a regularly spaced collection of points. When sampling is off, the path is created by joining points of intersection with the meshes.
Sampling is always enabled for items on a cutting plane.
- SurfacePathQuery(UnstructGridModel *model, size_t frameIndex, PointType pointType, std::vector<cee::ug::HitItem> items)