No announcement yet.

mousePressed callback in example EclipseMeshViz

  • Filter
  • Time
  • Show
Clear All
new posts

  • mousePressed callback in example EclipseMeshViz

    Dear Mike,

    I delete the codes for fence slice editing in the example EclipseMeshViz to test the mousePressed callback.

    Iuse the following code to get the detail at mouse point:

    const SoPickedPoint* pickedPoint = eventCB->getPickedPoint();
    if (pickedPoint != NULL)
    const SoDetail* detail = pickedPoint->getDetail();

    I found that the SoDetail here is SoFaceDetail, but not MoFaceDetailI. Why?

    Thank you!

  • #2
    If the picked node is a MeshVizXLM representation that uses faces, e.g. MoMeshSkin, then it should be possible to cast the SoPickDetail to one of the MoFaceDetail sub-classes. For example, if the mesh is based on MiVolumeMeshHexahedronIjk, the pick detail will be an MoFaceDetailIjk.

    You can check if the picked node is an appropriate one by looking at the 'tail' of the pick path. For example:
      const SoPickedPoint* pick = eventCB->getPickedPoint();
      if (pick) {
        SoPath* path = pick->getPath();
        SoNode* node = path->getTail();
        std::cout << "Picked: " << node->getTypeId().getName().getString() << std::endl;