public CadViewPort(String name, CadViewPort other) : this(name, other.parentModel) { Height = other.Height; Width = other.Width; Origin = new Point(other.Origin); ScaleVector = new Vector(other.ScaleVector.x, other.ScaleVector.y, other.ScaleVector.z); Rotation = new Angle(other.Rotation.angle_); }
public Model(ICadNotificationTarget aNotificationTarget) : this() { // Code Documentation Tag 20140603_01 this.NotificationTarget = aNotificationTarget; String defaultViewPortName = "1"; // Code Documentation Tag 20140603_02 var defaultViewPort = new CadViewPort(defaultViewPortName, this); defaultViewPort.Origin.x = 0.0; defaultViewPort.Origin.y = 0.0; //defaultViewPort.Rotation = Angle.radiansFromDegree(-90); // technical debt: bounding boxes for rotated view are still broken // it shows up, for example, doing a fit view on this dataset. this.AddViewPort(defaultViewPortName, defaultViewPort); // Code Documentation Tag 20140603_03 aNotificationTarget.ViewPortAdded(defaultViewPort); }
public NVcad2dViewCanvas(CadViewPort newViewPort) : this() { // Code Documentation Tag 20140603_05 myCadViewPort = newViewPort; myCadViewPort.pairedUIview = this; this.MouseDown += new MouseButtonEventHandler(local_MouseDown); this.MouseMove += new MouseEventHandler(local_MouseMove); this.MouseWheel += new MouseWheelEventHandler(local_MouseWheel); }
public void initializeCustomSettings(CadViewPort newViewPort) { this.Height = 700; this.Width = 900; this.Left = 10; this.Top = 10; this.Caption = "NVCad 视图窗口"; this.IsModal = false; var contentGrid = new Grid(); contentGrid.ColumnDefinitions.Add(new ColumnDefinition()); contentGrid.ColumnDefinitions[0].Width = new GridLength(20); contentGrid.ColumnDefinitions.Add(new ColumnDefinition()); contentGrid.ColumnDefinitions[1].Width = new GridLength(1, GridUnitType.Star); contentGrid.ColumnDefinitions.Add(new ColumnDefinition()); contentGrid.ColumnDefinitions[2].Width = new GridLength(20); contentGrid.RowDefinitions.Add(new RowDefinition()); contentGrid.RowDefinitions[0].Height = new GridLength(20); contentGrid.RowDefinitions.Add(new RowDefinition()); contentGrid.RowDefinitions[1].Height = new GridLength(1, GridUnitType.Star); contentGrid.RowDefinitions.Add(new RowDefinition()); contentGrid.RowDefinitions[2].Height = new GridLength(20); // Code Documentation Tag 20140603_05 primaryCanvas = new NVcad2dViewCanvas(newViewPort); primaryCanvas.Background = Brushes.Bisque; //primaryCanvas.establishTransforms(); contentGrid.Children.Add(primaryCanvas); Grid.SetRow(primaryCanvas, 1); Grid.SetColumn(primaryCanvas, 1); this.Content = contentGrid; }
public void associateCadViewPort(CadViewPort aCVP) { this.primaryCanvas.myCadViewPort = aCVP; }
//static NVcad2dViewWindow() //{ // DefaultStyleKeyProperty.OverrideMetadata(typeof(NVcad2dViewWindow), new FrameworkPropertyMetadata(typeof(NVcad2dViewWindow))); //} public NVcad2dViewWindow(CadViewPort newViewPort) { initializeCustomSettings(newViewPort); Caption = "View " + newViewPort.Name; }
internal void AddViewPort(String Name, CadViewPort newViewPort) { if (!(newViewPort is CadViewPort)) { throw new InvalidGraphicTypeException(newViewPort); } if (allViewPorts.ContainsKey(Name) == true) { throw new ViewNameAlreadyExists(Name); } // Note: we do not expand this.BoundingBox for views. // Very Important. allViewPorts.Add(Name, newViewPort); }
public static NVcad2dViewWindow AddChildWindow(this WindowContainer container, CadViewPort newViewPort) { // Code Documentation Tag 20140603_04 NVcad2dViewWindow newWindow = new NVcad2dViewWindow(newViewPort); container.Children.Add(newWindow); newWindow.Show(); return newWindow; }
public void ViewPortAdded(CadViewPort newViewPort) { // Code Documentation Tag 20140603_03 if (null == cadViews) return; // todo: throw exception cadViews.AddChildWindow(newViewPort); }