Exemplo n.º 1
0
        /// <summary>
        /// Initialize the small multiple
        /// </summary>
        /// <param name="parser">The VTK Parser</param>
        /// <param name="subDataset">The SubDataset bound to this VTK view</param>
        /// <param name="dimensions">The dimensions in use</param>
        /// <param name="dataProvider">The application data provider (a.k.a, Main)</param>
        /// <returns></returns>
        public unsafe bool Init(VTKParser parser, SubDataset subDataset, Vector3Int dimensions, IDataProvider dataProvider)
        {
            subDataset.AddListener(this);
            m_subDataset   = subDataset;
            m_dataProvider = dataProvider;

            //Copy the variables
            m_dimensions = dimensions;

            VTKStructuredPoints descPts = parser.GetStructuredPointsDescriptor();

            m_descPts = descPts;

            float maxAxis = (float)Math.Max(descPts.Spacing[0] * m_dimensions[0],
                                            Math.Max(descPts.Spacing[1] * m_dimensions[1],
                                                     descPts.Spacing[2] * m_dimensions[2]));

            m_spacing = new Vector3();
            for (int i = 0; i < 3; i++)
            {
                m_spacing[i] = (float)(descPts.Spacing[i] / maxAxis);
            }

            UpdateTF();

            return(true);
        }
Exemplo n.º 2
0
 protected void LinkToSM()
 {
     //Update position / rotation / scaling
     lock (this)
     {
         OnRotationChange(m_sd, m_sd.Rotation);
         OnPositionChange(m_sd, m_sd.Position);
         OnScaleChange(m_sd, m_sd.Scale);
         OnNameChange(m_sd, m_sd.Name);
         m_sd.AddListener(this);
         m_sdChanged = true;
     }
 }