Class ParSLMesh

  • All Implemented Interfaces:
    Pointer

    public class ParSLMesh
    extends Struct
    Triangle mesh generated by the library.

    The vertex data is owned by streamlines context and becomes invalid on any subsequent call to the API. The annotations, spine_lengths, and random_offsets fields are NULL unless their corresponding flags have been set in ParSLConfig.

    Layout

    
     struct parsl_mesh {
         uint32_t num_vertices;
         uint32_t num_triangles;
         uint32_t * triangle_indices;
         parsl_position * positions;
         parsl_annotation * annotations;
         float * spine_lengths;
         float * random_offsets;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • NUM_VERTICES, NUM_TRIANGLES, TRIANGLE_INDICES, POSITIONS, ANNOTATIONS, SPINE_LENGTHS, RANDOM_OFFSETS

        The struct member offsets.
    • Constructor Detail

      • ParSLMesh

        public ParSLMesh​(java.nio.ByteBuffer container)
        Creates a ParSLMesh instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • num_vertices

        public int num_vertices()
        Returns the value of the num_vertices field.
      • num_triangles

        public int num_triangles()
        Returns the value of the num_triangles field.
      • triangle_indices

        public java.nio.IntBuffer triangle_indices​(int capacity)
        Returns a IntBuffer view of the data pointed to by the triangle_indices field.
        Parameters:
        capacity - the number of elements in the returned buffer
      • spine_lengths

        @Nullable
        public java.nio.FloatBuffer spine_lengths()
        Returns a FloatBuffer view of the data pointed to by the spine_lengths field.
      • random_offsets

        @Nullable
        public java.nio.FloatBuffer random_offsets()
        Returns a FloatBuffer view of the data pointed to by the random_offsets field.
      • create

        public static ParSLMesh create​(long address)
        Returns a new ParSLMesh instance for the specified memory address.
      • createSafe

        @Nullable
        public static ParSLMesh createSafe​(long address)
        Like create, but returns null if address is NULL.
      • create

        public static ParSLMesh.Buffer create​(long address,
                                              int capacity)
        Create a ParSLMesh.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static ParSLMesh.Buffer createSafe​(long address,
                                                  int capacity)
        Like create, but returns null if address is NULL.
      • nnum_vertices

        public static int nnum_vertices​(long struct)
        Unsafe version of num_vertices().
      • nnum_triangles

        public static int nnum_triangles​(long struct)
        Unsafe version of num_triangles().
      • ntriangle_indices

        public static java.nio.IntBuffer ntriangle_indices​(long struct,
                                                           int capacity)
        Unsafe version of triangle_indices.
      • nspine_lengths

        @Nullable
        public static java.nio.FloatBuffer nspine_lengths​(long struct)
        Unsafe version of spine_lengths.
      • nrandom_offsets

        @Nullable
        public static java.nio.FloatBuffer nrandom_offsets​(long struct)
        Unsafe version of random_offsets.