public PrinterModelNode(PrinterSizeProfile.CaseType casetype) { Micro1Case = new Micro1CaseNode(); ProCase = new ProCaseNode(); Micro1Case.Visible = false; ProCase.Visible = false; AddChildElement(Micro1Case); AddChildElement(ProCase); SetCase(casetype); }
public void SetCaseType(PrinterSizeProfile.CaseType casetype) { if (CurrentCaseType == casetype) { return; } CurrentCaseType = casetype; UpdateTexture(); }
public PrinterSizeProfile(PrinterSizeProfile.CaseType case_type, Vector3D shell_size, Vector2D printBedSize, float fluff_height, StackedBoundingBox WarningRegion, StackedBoundingBox PrintableRegion, Range UnhomedSafeZRange, Vector3D HomeLocation, Vector2D BackCornerPosition, Vector2D BackCornerPositionBoxTop, float BoxTopLimitZ, float ABSWarningDim, float ZAfterProbing, float ZAfterG33, SerializableDictionary <int, RectCoordinates> G32ProbePoints) { this.case_type = case_type; this.shell_size = shell_size; this.printBedSize = printBedSize; this.fluff_height = fluff_height; this.WarningRegion = WarningRegion; this.PrintableRegion = PrintableRegion; this.UnhomedSafeZRange = UnhomedSafeZRange; this.HomeLocation = HomeLocation; this.ABSWarningDim = ABSWarningDim; this.ZAfterProbing = ZAfterProbing; this.ZAfterG33 = ZAfterG33; this.BackCornerPosition = BackCornerPosition; this.BackCornerPositionBoxTop = BackCornerPositionBoxTop; this.BoxTopLimitZ = BoxTopLimitZ; this.G32ProbePoints = G32ProbePoints; }
public PrinterSizeProfile(PrinterSizeProfile other) { case_type = other.case_type; shell_size = other.shell_size; printBedSize = other.printBedSize; fluff_height = other.fluff_height; PrintableRegion = new StackedBoundingBox(other.PrintableRegion); WarningRegion = new StackedBoundingBox(other.WarningRegion); UnhomedSafeZRange = other.UnhomedSafeZRange; HomeLocation = other.HomeLocation; ABSWarningDim = other.ABSWarningDim; ZAfterProbing = other.ZAfterProbing; ZAfterG33 = other.ZAfterG33; BackCornerPosition = other.BackCornerPosition; BackCornerPositionBoxTop = other.BackCornerPositionBoxTop; BoxTopLimitZ = other.BoxTopLimitZ; G32ProbePoints = new SerializableDictionary <int, RectCoordinates>(other.G32ProbePoints); }
public void SizeFromPrinterProfile(PrinterSizeProfile sizeProfile) { PrinterModelCaseType = sizeProfile.case_type; M3D.Model.Utils.Vector3 ext = PrinterModel.ShellModel.Ext; PrinterTypeAdjustments.Scale.X = sizeProfile.shell_size.x / ext.X; PrinterTypeAdjustments.Scale.Y = sizeProfile.shell_size.y / ext.Y; PrinterTypeAdjustments.Scale.Z = sizeProfile.shell_size.z / ext.X; PrinterTransformation.Translation.Z = PrinterModel.ZOffset; ObjectToPrinterSpace.Translation.X = sizeProfile.printBedSize.x / -2f; ObjectToPrinterSpace.Translation.Y = sizeProfile.printBedSize.y / -2f; ObjectToPrinterSpace.Translation.Z = (float)(sizeProfile.shell_size.z / -2.0 + sizeProfile.fluff_height * (double)PrinterTypeAdjustments.Scale.Z); GridSizeAdjustments.Scale.X = sizeProfile.printBedSize.x / 100f; GridSizeAdjustments.Scale.Y = sizeProfile.printBedSize.y / 100f; PrinterBedWidth = sizeProfile.printBedSize.x; PrinterBedLength = sizeProfile.printBedSize.y; SetPrintableExts(sizeProfile.printBedSize.x, sizeProfile.printBedSize.y, 110f); PrinterCenter = new M3D.Model.Utils.Vector3(sizeProfile.HomeLocation.x, sizeProfile.HomeLocation.y, 0.0f); var num = PrinterModel.GUICaseSize / sizeProfile.shell_size.z; PrinterTransformation.Scale = new M3D.Model.Utils.Vector3(num, num, num); PrinterBoundsConst = sizeProfile; CreateBoundsGeometry(ObjectToPrinterSpace); }
public void SetCase(PrinterSizeProfile.CaseType casetype) { if (current != null && casetype == current.CaseType) { return; } if (current != null) { current.Visible = false; } switch (casetype) { case PrinterSizeProfile.CaseType.Micro1Case: current = Micro1Case; break; case PrinterSizeProfile.CaseType.ProCase: current = ProCase; break; } current.Visible = true; }
public PrinterViewSceneGraph(GUIHost host, SettingsManager.GridUnit initialGridUnits, PrinterSizeProfile.CaseType initialCaseType) : base(123456) { RelativeX = 0.0f; RelativeY = 0.0f; RelativeWidth = 1f; RelativeHeight = 1f; ViewPointPos = new M3D.Model.Utils.Vector3(0.0f, 0.0f, 10f); ModelList = new List <ModelTransformPair>(); CameraLookAtPos = new M3D.Model.Utils.Vector3(0.0f, -10f, 0.0f); AddChildElement3D(new LightNode(0, 0, new Vector4(0.0f, 400f, 1000f, 1f), new Color4(0.2f, 0.2f, 0.2f, 1f), new Color4(1f, 1f, 1f, 1f), new Color4(1f, 1f, 1f, 1f))); AddChildElement3D(new LightNode(1, 1, new Vector4(0.0f, 20f, -400f, 1f), new Color4(0.0f, 0.0f, 0.0f, 1f), new Color4(1f, 1f, 1f, 1f), new Color4(0.3f, 0.3f, 0.3f, 1f))); OpenGLCoordinateSystem = new TransformationNode(0, origin) { Rotation = new M3D.Model.Utils.Vector3(-90f, 0.0f, 0.0f) }; AddChildElement3D(OpenGLCoordinateSystem); PrinterTiltTransform = new TransformationNode(0, OpenGLCoordinateSystem); OpenGLCoordinateSystem.AddChildElement(PrinterTiltTransform); PrinterTransformation = new TransformationNode(0, PrinterTiltTransform); PrinterTypeAdjustments = new TransformationNode(3011, PrinterTransformation); var num = 1.1f; PrinterTypeAdjustments.Scale = new M3D.Model.Utils.Vector3(num, num, 1f); PrinterTransformation.AddChildElement(PrinterTypeAdjustments); PrinterModel = new PrinterModelNode(initialCaseType); PrinterTypeAdjustments.AddChildElement(PrinterModel); ObjectToPrinterSpace = new TransformationNode(3005, PrinterTransformation) { Translation = new M3D.Model.Utils.Vector3(0.0f, 0.0f, 0.0f) }; PrinterTransformation.AddChildElement(ObjectToPrinterSpace); GridSizeAdjustments = new TransformationNode(3012, ObjectToPrinterSpace); ObjectToPrinterSpace.AddChildElement(GridSizeAdjustments); Grid = new GridObjectNode(3003, 100f, 100f); Grid.SetUnits(initialGridUnits); Grid.Visible = false; Grid.Emission = new Color4(1f, 1f, 1f, 1f); GridSizeAdjustments.AddChildElement(Grid); var texturedFloorNode = new TexturedFloorNode(3004); var bitmap = new Bitmap(Resources.shadowtexture); var texture = 0; Element3D.CreateTexture(ref texture, bitmap); bitmap.Dispose(); texturedFloorNode.Create(new M3D.Model.Utils.Vector3(0.0f, 0.0f, -76f), 450f, 240f, texture); OpenGLCoordinateSystem.AddChildElement(texturedFloorNode); PrinterTiltTransform.AddChildElement(PrinterTransformation); }