Пример #1
0
 /// <summary>
 /// Fills the unstructured grid cell buffer.
 /// </summary>
 /// <param name="nbCells">Nb cells.</param>
 /// <param name="ptValues">Point values.</param>
 /// <param name="cellValues">Cell values.</param>
 /// <param name="cellTypes">Cell types.</param>
 /// <param name="buffer">Buffer.</param>
 /// <param name="destFormat">Destination format.</param>
 public unsafe void FillUnstructuredGridCellBuffer(UInt32 nbCells, VTKValue ptValues, VTKValue cellValues, VTKValue cellTypes, IntPtr buffer, VTKValueFormat destFormat = VTKValueFormat.VTK_NO_VALUE_FORMAT)
 {
     unsafe
     {
         VTKInterop.VTKParser_fillUnstructuredGridCellBuffer(m_parser, nbCells, ptValues.Value, (Int32 *)cellValues.Value, (Int32 *)cellTypes.Value, buffer, destFormat);
     }
 }
Пример #2
0
 /// <summary>
 /// Gets the cell construction descriptor.
 /// </summary>
 /// <returns>The cell construction descriptor.</returns>
 /// <param name="nbCells">Nb cells.</param>
 /// <param name="cellValues">Cell values.</param>
 /// <param name="cellTypes">Cell types.</param>
 public static VTKCellConstruction GetCellConstructionDescriptor(UInt32 nbCells, VTKValue cellValues, VTKValue cellTypes)
 {
     unsafe
     {
         return(VTKInterop.VTKParser_getCellConstructionDescriptor(nbCells, (Int32 *)cellValues.Value, (Int32 *)cellTypes.Value));
     }
 }
Пример #3
0
        /// <summary>
        /// Parse all the Unstructured Grid Points available in this dataset.
        /// Use FillUnstructuredGridCellBuffer for getting triangle composition of these cells
        /// </summary>
        /// <returns>A VTKValue of these points.</returns>
        public VTKValue ParseAllUnstructuredGridPoints()
        {
            VTKValue          val = new VTKValue();
            VTKPointPositions pos = VTKInterop.VTKParser_getUnstructuredGridPointDescriptor(m_parser);

            val.Value    = VTKInterop.VTKParser_parseAllUnstructuredGridPoints(m_parser);
            val.NbValues = pos.NbPoints * 3;
            return(val);
        }
Пример #4
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);
        }
Пример #5
0
        /// <summary>
        /// Get the values of Cell Types for understanding how to merge the points described in ParseAllUnstructuredGridCellsComposition.
        /// Use FillUnstructuredGridCellBuffer for getting triangle composition of these cells
        /// </summary>
        /// <returns>A VTKValue of all the cell types of this dataset. Format : VTK_INT</returns>
        public VTKValue ParseAllUnstructuredGridCellTypesDescriptor()
        {
            VTKCellTypes desc = VTKInterop.VTKParser_getUnstructuredGridCellTypesDescriptor(m_parser);
            VTKValue     res  = new VTKValue();

            res.Format = VTKValueFormat.VTK_INT;
            unsafe
            {
                res.Value = VTKInterop.VTKParser_parseAllUnstructuredGridCellTypes(m_parser);
            }
            res.NbValues = desc.NbCells;

            return(res);
        }
Пример #6
0
        /// <summary>
        /// Get the values of Cell composition for unstructured grid. Use TODO for getting triangle composition of these cells
        /// </summary>
        /// <returns>A VTKValue of the cell composition. Format : VTK_INT</returns>
        public VTKValue ParseAllUnstructuredGridCellsComposition()
        {
            VTKCells desc = VTKInterop.VTKParser_getUnstructuredGridCellDescriptor(m_parser);
            VTKValue res  = new VTKValue();

            unsafe
            {
                res.Value = VTKInterop.VTKParser_parseAllUnstructuredGridCellsComposition(m_parser);
            }
            res.NbValues = desc.WholeSize;
            res.Format   = VTKValueFormat.VTK_INT;

            return(res);
        }
Пример #7
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);
        }
Пример #8
0
 /// <summary>
 /// Gets the structured points descriptor.
 /// </summary>
 /// <returns>The structured points descriptor.</returns>
 public VTKStructuredPoints GetStructuredPointsDescriptor()
 {
     return((VTKStructuredPoints)Marshal.PtrToStructure(VTKInterop.VTKParser_getStructuredPointsDescriptor(m_parser), typeof(VTKStructuredPoints)));
 }
Пример #9
0
 /// <summary>
 /// Gets the type of the dataset.
 /// </summary>
 /// <returns>The dataset type.</returns>
 public VTKDatasetType GetDatasetType()
 {
     return(VTKInterop.VTKParser_getDatasetType(m_parser));
 }
Пример #10
0
 /// <summary>
 /// Parse the VTK file object for getting information (without retrieving values).
 /// </summary>
 public bool Parse()
 {
     return(VTKInterop.VTKParser_parse(m_parser) != 0);
 }
Пример #11
0
 /// <summary>
 /// Constructor. Initialize the Parser without parsing anything
 /// </summary>
 /// <param name="path">The Path.</param>
 public VTKParser(String path)
 {
     m_parser = VTKInterop.VTKParser_new(path);
 }