cee::ug::HitItem
-
class HitItem
Small class containing the data for a hit of an intersection between a ray and a part in an UnstructGridModel.
int winCoordX = 0, winCoordY = 0; cee::Ray ray = m_viewer->view()->camera().rayFromWindowCoordinates(winCoordX, winCoordY); cee::ug::HitItem hitItem; bool hitSomething = ugModel->rayIntersect(ray, &hitItem);
See also
Ray and UnstructGridModel
Public Types
Public Functions
-
HitItem()
Constructs an empty hit item.
-
ItemType itemType() const
Returns the item type.
Available item types are PART, CUTTING_PLANE, ISOSURFACE and ISOVOLUME.
See also
-
void setItemType(ItemType itemType)
Sets the item type.
Available item types are PART, CUTTING_PLANE, ISOSURFACE and ISOVOLUME.
See also
-
int itemId() const
Returns the id/index of the hit item.
If the hit item is a part, the part id is returned. If the hit item was a cutting plane, isosurface or isovolume, -1 is returned. Use itemIndex() instead. Check itemType() for which item type that was hit.
-
void setItemId(int itemId)
Sets the part id for parts or index of item for cutting planes, isosurfaces and isovolumes.
-
size_t itemIndex() const
Returns the index of the item.
-
void setItemIndex(size_t itemIndex)
Sets the item index. This is the (local) index of the part, cutting plane, isosurface or isovolume.
-
int stateId() const
Returns the state id of the hit item.
-
void setStateId(int stateId)
Sets the state id.
-
size_t frameIndex() const
Returns the frame index of the hit item.
-
void setFrameIndex(size_t frameIndex)
Sets the geometry index.
-
size_t geometryIndex() const
Returns the global geometry index, used to e.g. get the geometry from a DataState.
-
void setGeometryIndex(size_t geometryIndex)
Sets the geometry index.
-
int partId() const
Returns the part id, used to e.g.
get the part from a DataGeometry
If itemType is PART, this will be the same as itemId(). If itemType is CUTTING_PLANE, ISOSURFACE or ISOVOLUME, this is the id of the DataPart in which the intersected element is located in.
-
void setPartId(int partId)
Sets the id of the DataPart that was hit (or has the element hit in a cut/iso/particle trace)
-
size_t elementIndex() const
Returns the zero based index of the selected element.
The index refers to the DataElements of the DataPart with the id specified in partId().
-
void setElementIndex(size_t elementIndex)
Sets the zero based index of the hit element.
-
size_t nodeIndex() const
Returns the zero based index of the closest node to the hit intersection point.
-
void setNodeIndex(size_t nodeIndex)
Sets the zero based node index of the closest node.
-
size_t elementLocalNodeIndex() const
Returns the local (within the element) node index that was hit.
See Element for more info.
-
void setElementLocalNodeIndex(size_t localNodeIndex)
Sets the local (within the element) node index that was hit.
See Element for more info.
-
size_t elementLocalSurfaceIndex() const
Returns the local (within the element) surface index that was hit.
See Element for more info.
-
void setElementLocalSurfaceIndex(size_t surfaceIndex)
Sets the local (within the element) surface index that was hit.
See Element for more info.
-
size_t edgeNodeStartIndex() const
Returns the zero based node index of first node of the closest edge.
-
void setEdgeNodeStartIndex(size_t nodeIndex)
Sets the zero based node index of the closest node.
-
size_t edgeNodeEndIndex() const
Returns the zero based node index of last node of the closest edge.
-
void setEdgeNodeEndIndex(size_t nodeIndex)
Sets the zero based node index of the closest node.
-
void setIntersectionPointNormal(const Vec3d &intersectionPointNormal)
Sets the intersection point’s normal.
-
size_t triangleIndex() const
Sets the triangle index of the hit item.
The triangle index is the index in the display model of the object.
If this is a normal part (type == PART), this index corresponds to the output from the VisualizationPartQuery::visibleTriangles() method.
For cutting planes, isosurfaces and isovolumes, this index corresponds to the triangles in CuttingPlaneData, IsosurfaceData or IsovolumeData.
-
void setTriangleIndex(size_t triangleIndex)
Sets the intersection point’s normal.
-
double distanceAlongRay() const
Returns the distance along the ray.
-
void setDistanceAlongRay(double distance)
Sets the distance along the ray.
-
HitItem()