Exemple #1
0
        /// <summary>
        /// Get the concrete Value of a Field Value
        /// </summary>
        /// <returns>The VTK value.</returns>
        /// <param name="val">Value.</param>
        public VTKValue ParseAllFieldValues(VTKFieldValue fieldVal)
        {
            VTKValue val = new VTKValue();

            val.NbValues = fieldVal.NbTuples * fieldVal.NbValuesPerTuple;
            val.Value    = VTKInterop.VTKParser_parseAllFieldValues(m_parser, fieldVal.NativePtr);
            val.Format   = fieldVal.Format;

            return(val);
        }
Exemple #2
0
        /// <summary>
        /// Gets the field values descriptor.
        /// </summary>
        /// <returns>The field values descriptor.</returns>
        /// <param name="clbk">The callback delegate function to use.</param>
        private List <VTKFieldValue> GetFieldValueDescriptors(DelGetFieldValueDescriptor clbk)
        {
            List <VTKFieldValue> list = new List <VTKFieldValue>();

            unsafe
            {
                UInt32  nbVal;
                IntPtr *desc = clbk(m_parser, &nbVal);
                for (UInt32 i = 0; i < nbVal; i++)
                {
                    VTKFieldValue fieldValue = new VTKFieldValue();
                    fieldValue.Format           = VTKInterop.VTKParser_getFieldFormat(desc[i]);
                    fieldValue.NbTuples         = VTKInterop.VTKParser_getFieldNbTuples(desc[i]);
                    fieldValue.NbValuesPerTuple = VTKInterop.VTKParser_getFieldNbValuesPerTuple(desc[i]);
                    fieldValue.Name             = Marshal.PtrToStringAnsi(VTKInterop.VTKParser_getFieldName(desc[i]));
                    fieldValue.NativePtr        = desc[i];
                    list.Add(fieldValue);
                }
                VTKInterop.VTKParser_free((IntPtr)desc);
            }
            return(list);
        }