cee::ug::SurfacePathQuery Class Reference

Helper class for generating a path on a UnstructGridModel model and for sampling a scalar value along this path. More...

Public Types

enum  PointType { NODE, ELEMENT, COORDINATE }
 Enum specifying what kind of items that are in use. More...
 

Public Member Functions

 SurfacePathQuery (UnstructGridModel *model, size_t frameIndex, PointType pointType, std::vector< cee::ug::HitItem > items)
 Creates a SurfacePathQuery object with the given settings. More...
 
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. More...
 
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(). More...
 
void enableSampling (bool enable)
 Toggles path point sampling. More...
 

Detailed Description

Helper class for generating a path on a 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.

Member Enumeration Documentation

Enum specifying what kind of items that are in use.

Enumerator
NODE 

The items specify nodes.

ELEMENT 

The items specify elements.

COORDINATE 

The items specify coordinates.

Constructor & Destructor Documentation

cee::ug::SurfacePathQuery::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.

Member Function Documentation

void cee::ug::SurfacePathQuery::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.

bool cee::ug::SurfacePathQuery::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 cee::ug::SurfacePathQuery::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.