Class PoStreamParticleMotion

  • All Implemented Interfaces:
    Direct Known Subclasses:
    PoStreamLineMotion, PoStreamPointMotion, PoStreamSphereMotion, PoStreamTadpoleMotion

    public class PoStreamParticleMotion
    extends PoBaseStreamLine
    Animation of particles along streamlines on a mesh. This class realizes animation of particle along the list of streamlines starting from startPoints. First, it calculates the geometry of these streamlines according to the fields of the inherited class. Then it calculates a list of positions along the streamlines. Two consecutive positions on streamlines must be separated by a constant timeStep, in order to have an animation which respect the velocity. After that, blinking several frames does the animation. Each frame represents a selection of the calculated positions. This selection and the number of frame are defined by the value of pulseFrequency. For example, if pulseFrequency = 5, one position over 5 is kept in a frame. 5 frames are built, and the animation process will blink by cycling switch-on/switch-off one of these 5 frames. For a streamline made of 20 calculated positions, the 5 frames have the following position's indices:
          Frame 0:          0,5,10,15
          Frame 1:          1,6,11,16
          Frame 2:          2,7,12,17
          Frame 3:          3,8,13,18
          Frame 4:          4,9,14,19
    The first position of each streamline can be shifted in time, after duration of shiftStart from the source point. If isStartRandomized is false, the first position's index of frame 0, is always 0. Otherwise, it has a random value between 0 and pulseFrequency-1. Setting isStartRandomized to true is interesting only when several startPoint are defined, because it prevents each first position of the different streamlines to start simultaneously.

    Blinking from a frame to the next frame can be speeded up or speeded down by the blinkSpeed field. It defines the number of cycles per second. Setting isBlinking to false can stop the animation. In that case, the index of the visualized frame is viewFrame % pulseFrequency.

    File format/default:

    PoStreamParticleMotion {

      pulseFrequency 5
      shiftStart 0.0
      timeStep 1.0
      isStartRandomized true
      isBlinking true
      viewFrame 0
      blinkSpeed 3.0
      startPoints SbVec3f(0,0,0)
      maxLifetime 0 (i.e. infinite)
      maxLength 0 (i.e. infinite)
      minSpeed 0 (i.e. infinite)
      integrationStepLengthFactor 0.3
      integrationMaxStepNumber 0 (i.e. infinite)
      integrationDirection FORWARD
      colors (SbColor(1,0,0)
      coloringType COLOR_INHERITED
      valuesIndex -1
      valuesIndexForCellFilter -1
      vecsIndex -1
      moduleDataMapping NULL
    • Field Detail

      • pulseFrequency

        public final SoSFInt32 pulseFrequency
        Number of frames to be visualized during an animation cycle. 5 by default.
      • shiftStart

        public final SoSFFloat shiftStart
        Duration from which the first position on the streamline is calculated. 0 by default.
      • timeStep

        public final SoSFFloat timeStep
        Time step between 2 consecutive points of a streamline. 1 by default.
      • isStartRandomized

        public final SoSFBool isStartRandomized
        Set it to true prevents each first position of the different streamlines to start simultaneously. true by default.
      • isBlinking

        public final SoSFBool isBlinking
        Stop the animation if isBlinking is false. true by default.
      • viewFrame

        public final SoSFInt32 viewFrame
        Visualized frame index (used only if isBlinking is false). 0 by default.
      • blinkSpeed

        public final SoSFFloat blinkSpeed
        Number of animation's cycles per second. 3.0 by default.