Beispiel #1
0
        /// <summary>
        /// Applies a transform directly to position and normal channels. Node transforms are unaffected.
        /// </summary>
        internal void TransformContents(ref Matrix xform)
        {
            // Transform positions
            var updateBuffer = new Vector3[positions.Count];

            positions.CopyTo(updateBuffer, 0);
            Vector3.Transform(updateBuffer, ref xform, updateBuffer);
            positions.Clear();
            foreach (var pos in updateBuffer)
            {
                positions.Add(pos);
            }

            foreach (var geom in geometry)
            {
                // Transform all vectors too
                var geomBuffer = new Vector3[geom.Vertices.VertexCount];
                foreach (var channel in geom.Vertices.Channels)
                {
                    if (channel.Name.StartsWith("Normal") ||
                        channel.Name.StartsWith("Binormal") ||
                        channel.Name.StartsWith("Tangent"))
                    {
                        channel.Items.CopyTo(geomBuffer, 0);
                        Vector3.TransformNormal(geomBuffer, ref xform, geomBuffer);
                        channel.Items.Clear();
                        foreach (var item in geomBuffer)
                        {
                            channel.Items.Add(item);
                        }
                    }
                }
            }
        }
Beispiel #2
0
        public override void OnRemovingRange(RangeRegionCancelEventArgs e)
        {
            base.OnRemovingRange(e);

            RangeRegionChangingEventArgs regionChanging = new RangeRegionChangingEventArgs(e.RangeRegion, new SourceGrid.RangeRegion(), new SourceGrid.RangeRegion());
            PositionCollection           exploredPos    = new PositionCollection();

            do
            {
                regionChanging.RegionToExclude.Clear();
                regionChanging.RegionToInclude.Clear();

                PositionCollection positions = e.RangeRegion.GetCellsPositions();
                for (int i = 0; i < positions.Count; i++)
                {
                    if (exploredPos.Contains(positions[i]) == false)
                    {
                        CellContext cellContext = new CellContext(Grid, positions[i]);
                        Grid.Controller.OnSelectionRemoving(cellContext, regionChanging);
                        exploredPos.Add(positions[i]);
                    }
                }

                regionChanging.CurrentRegion.Add(regionChanging.RegionToInclude);
                regionChanging.CurrentRegion.Remove(regionChanging.RegionToExclude);
            } while (!regionChanging.RegionToExclude.IsEmpty() || !regionChanging.RegionToInclude.IsEmpty());
        }
Beispiel #3
0
		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		public PositionCollection GetCellsPositions()
		{
			PositionCollection l_List = new PositionCollection();
			for (int r = Start.Row; r <= End.Row; r++)
				for (int c = Start.Column; c <= End.Column; c++)
					l_List.Add(new Position(r,c));

			return l_List;
		}
Beispiel #4
0
 public void AddPosition(Position position)
 {
     try
     {
         position.Insert(_managerId);
         _positions.Add(position);
     } catch (Exception) {
         throw;
     }
 }
        protected override Entity OnAdd()
        {
            var newItem = new Position();

            using (var frm = new frmPosition_Add())
            {
                frm.ItemData = newItem;
                if (frm.ShowDialog() != DialogResult.OK)
                {
                    return(null);
                }
            }

            App.LogAction("Payroll Position", "Created Position: " + newItem.Description);

            ItemDataCollection.Add(newItem);
            return(newItem);
        }
Beispiel #6
0
        /// <summary>
        /// Returns the union of all the selected range as Position collection
        /// </summary>
        /// <returns></returns>
        public PositionCollection GetCellsPositions()
        {
            if (m_PositionListCache == null)
            {
                m_PositionListCache = new PositionCollection();
                for (int i = 0; i < m_RangeList.Count; i++)
                {
                    PositionCollection l_tmp = m_RangeList[i].GetCellsPositions();
                    for (int j = 0; j < l_tmp.Count; j++)
                    {
                        if (m_PositionListCache.Contains(l_tmp[j]) == false)
                        {
                            m_PositionListCache.Add(l_tmp[j]);
                        }
                    }
                }
            }

            return(m_PositionListCache);
        }
Beispiel #7
0
		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		public PositionCollection GetCellsPositions()
		{
			PositionCollection l_List = new PositionCollection();
			for (int r = Start.Row; r <= End.Row; r++)
				for (int c = Start.Column; c <= End.Column; c++)
					l_List.Add(new Position(r,c));

			return l_List;
		}