Giter Site home page Giter Site logo

Comments (7)

looooo avatar looooo commented on May 24, 2024

@tomkcook do you have any docs/examples for this class?

from pivy.

tomkcook avatar tomkcook commented on May 24, 2024

@looooo for which class?

from pivy.

looooo avatar looooo commented on May 24, 2024

SoCoordinateElement

from pivy.

tomkcook avatar tomkcook commented on May 24, 2024

No. This is what's in the documentation for SoCoordinateElement:

The SoCoordinateElement class is yet to be documented.

FIXME: write doc.

The approach I'm taking comes from SoVertexShape.cpp, SoVertexShape::getVertexData(...).

from pivy.

looooo avatar looooo commented on May 24, 2024

SoVertexShape::getVertexData(...):

 Convenience method that returns the current coordinate and normal
  element. This method is not part of the Open Inventor API.

Do you know what "current" refers to? Maybe someone from the coin-maintainers can help? @VolkerEnderlein

from pivy.

tomkcook avatar tomkcook commented on May 24, 2024

"Current" here refers to the state of scenegraph traversal. This is used in objects such as SoIndexedPointSet which don't have their own vertex data but take the vertex data from the scenegraph state; they refer to the SoCoordinate3 object nearest above them in the scenegraph hierarchy for their coordinate data. The documentation for SoState has a reasonable explanation of how this works.

TBH I'm not sure if this is a bug or how it's expected to work, and if it is a bug, whether it's a bug in Pivy or in Coin3D. I happen to have come at it via Pivy so I filed a ticket here, but I'm happy to be redirected to Coin3D if that's where the problem is.

from pivy.

wwmayer avatar wwmayer commented on May 24, 2024

In the C++ API of Coin3d a convenience macro SO_ENABLE is provided to register an element type to an action type. Since pivy (as far as I can see) lacks of this macro you must implement it yourself as a function:

def SO_ENABLE(action, element):
  action.enableElement(element.getClassTypeId(), element.getClassStackIndex())

An SoEventCallback node internally uses an SoHandleEventAction to transport an SoEvent. So, in order to allow to access the SoCoordinateElement from within your event handler you must add this line to your code

SO_ENABLE(coin.SoHandleEventAction, coin.SoCoordinateElement)

For more details have a look at The Inventor Toolmaker: http://www-evasion.imag.fr/Membres/Francois.Faure/doc/inventorToolmaker/sgi_html/ch02.html#id5444406

from pivy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.