public static SceneObject BuildScanSO(SOFactory factory, FScene scene, TypedAttribSet attributes) { ScanSO so = new ScanSO(); factory.RestoreDMeshSO(scene, attributes, so); return(so); }
public static SceneObject BuildTrimLoopSO(SOFactory factory, FScene scene, TypedAttribSet attributes) { TrimLoopSO so = new TrimLoopSO(); so.Create(scene.DefaultCurveSOMaterial); factory.RestorePolyCurveSOType(scene, attributes, so); return(so); }
public static PrintMeshSettings RestorePrintMeshSettings(SOFactory factory, TypedAttribSet attributes) { PrintMeshSettings settings = new PrintMeshSettings(); TypedAttribSet attribs = factory.find_struct(attributes, PrintSettingsStruct); if (attribs == null) { throw new Exception("PrintMeshSO.RestorePrintMeshSettings: PrintMeshSettings struct not found!"); } if (factory.check_key_or_debug_print(attribs, AttrPrintSettingsVersion)) { settings.Version = (int)attribs[AttrPrintSettingsVersion]; } if (factory.check_key_or_debug_print(attribs, AttrPrintSettingsObjectType)) { settings.ObjectType = (PrintMeshSettings.ObjectTypes)(int) attribs[AttrPrintSettingsObjectType]; } if (factory.check_key_or_debug_print(attribs, AttrPrintSettingsOpenMode)) { settings.OpenMeshMode = (PrintMeshSettings.OpenMeshModes)(int) attribs[AttrPrintSettingsOpenMode]; } if (factory.check_key_or_debug_print(attribs, AttrPrintSettingsNoVoids)) { settings.NoVoids = (bool)attribs[AttrPrintSettingsNoVoids]; } if (factory.check_key_or_debug_print(attribs, AttrPrintSettingsShellOnly)) { settings.OuterShellOnly = (bool)attribs[AttrPrintSettingsShellOnly]; } if (factory.check_key_or_debug_print(attribs, AttrPrintSettingsClearanceXY)) { settings.Clearance = (float)attribs[AttrPrintSettingsClearanceXY]; } if (factory.check_key_or_debug_print(attribs, AttrPrintSettingsOffsetXY)) { settings.OffsetXY = (float)attribs[AttrPrintSettingsOffsetXY]; } return(settings); }
public static SceneObject Build(SOFactory factory, FScene scene, TypedAttribSet attributes) { PrintMeshSO so = new PrintMeshSO(); factory.RestoreDMeshSO(scene, attributes, so); if (attributes.ContainsKey(AttrSourceFilePath)) { so.SourceFilePath = attributes[AttrSourceFilePath] as string; } PrintMeshSettings settings = null; try { settings = RestorePrintMeshSettings(factory, attributes); } catch { } if (settings != null) { so.Settings = settings; } return(so); }
public static SceneObject BuildLengthenPivotSO(SOFactory factory, FScene scene, TypedAttribSet attributes) { LengthenPivotSO so = new LengthenPivotSO(); so.Create(scene.PivotSOMaterial); factory.RestorePivotSOType(scene, attributes, so); if (factory.find_struct(attributes, PivotOriginalLegPoint) != null) { Frame3f frameL = factory.RestoreFrame(attributes, PivotOriginalLegPoint); so.InitialLegPtL = frameL.Origin; } else { so.InitialLegPtL = Vector3d.Zero; } return(so); }