public RotateCmd() { m_rotateForm = null; m_selectFace = null; m_selectiFeature = null; m_highlightSet = null; }
public override void StopCommand() { //Terminate this preview graphic m_inventorApplication.ActiveView.Update(); //destroy the command dialog //m_insertXportForm.Hide(); m_insertXportForm.Dispose(); m_insertXportForm = null; if (m_highlightSet != null) { this.ClearHighlight(); } if (m_UCS != null) { if (m_UCS.Visible == true) { m_UCS.Visible = false; } } xdistance = 0; ydistance = 0; m_insertplane = 0; m_firstFace = null; m_highlightSet = null; m_secondFace = null; m_xportID = null; base.StopCommand(); }
/// <summary> /// Disposes of some COM objects and exits the environment /// </summary> private void ClosingExporter() { WarnIfUnsaved(false); // Re-enable disabled components if (disabledAssemblyOccurences != null) { EnableComponents(disabledAssemblyOccurences); } disabledAssemblyOccurences = null; // Close add-in Utilities.DisposeDockableWindows(); // Dispose of document if (AsmDocument != null) { Marshal.ReleaseComObject(AsmDocument); } AsmDocument = null; ChildHighlight = null; EnvironmentEnabled = false; }
public static void coloroEntita(PartDocument oDoc, byte r, byte g, byte b, dynamic e) { HighlightSet oHS2 = oDoc.HighlightSets.Add(); oHS2.Color = iApp.TransientObjects.CreateColor(r, g, b); oHS2.AddItem(e); }
/// <summary> /// sub_6C0DA /// </summary> internal static HighlightSet BuildInputKeys(string menuText, out int highlighCount) { HighlightSet highlighSet = new HighlightSet(); int index = 0; for (int idx = 0; idx < menuText.Length; idx++) { if (highlightable_text.MemberOf(menuText[idx]) == true) { if (highlighSet[index].start == -1) { highlighSet[index].start = idx; } else { highlighSet[index].end = idx - 2; index++; highlighSet[index].start = idx; } } } highlighSet[index].end = menuText.Length; highlighCount = index + 1; return(highlighSet); }
/// <summary> /// sub_6C0DA /// </summary> internal static HighlightSet BuildInputKeys(string menuText, out int highlighCount) { HighlightSet highlighSet = new HighlightSet(); int index = 0; for (int idx = 0; idx < menuText.Length; idx++) { if (highlightable_text.MemberOf(menuText[idx]) == true) { if (highlighSet[index].start == -1) { highlighSet[index].start = idx; } else { highlighSet[index].end = idx - 2; index++; highlighSet[index].start = idx; } } } highlighSet[index].end = menuText.Length; highlighCount = index + 1; return highlighSet; }
public static void CreateHighlightSet(List <RigidNode_Base> nodes, HighlightSet highlightSet) { highlightSet.Clear(); foreach (var componentOccurrence in GetComponentOccurrencesFromNodes(nodes)) { highlightSet.AddItem(componentOccurrence); } }
private string m_codenumber;//索引编号寻找iFeature特征 public InsertOutlineCmd() { m_highlightSet = null; m_insertOutlineForm = null; m_selectiFeature = null; m_selectFace = null; m_UCS = null; }
public DeleteCmd() { m_selectFace = null; m_selectiFeature = null; m_deleteCavityForm = null; m_highlightSet = null; deleteName = new string[20]; }
public BoltHolesFormCmd() { m_boltHoleForm = null; m_withThisFace = null; m_highlightSet = null; assembly = System.Reflection.Assembly.GetExecutingAssembly(); FileInfo asmFile = new FileInfo(assembly.Location); deFaultpath = asmFile.DirectoryName + "\\CavityLibrary"; }
public void EnvironmentOpening(AssemblyDocument asmDocument) { blueHighlightSet = asmDocument.CreateHighlightSet(); blueHighlightSet.Color = InventorUtils.GetInventorColor(Color.DodgerBlue); greenHighlightSet = asmDocument.CreateHighlightSet(); greenHighlightSet.Color = InventorUtils.GetInventorColor(Color.LawnGreen); redHighlightSet = asmDocument.CreateHighlightSet(); redHighlightSet.Color = InventorUtils.GetInventorColor(Color.Red); jointEditorHighlight = asmDocument.CreateHighlightSet(); jointEditorHighlight.Color = InventorUtils.GetInventorColor(RobotExporterAddInServer.Instance.AddInSettingsManager.JointHighlightColor); }
private void HightghtSelectFace(Face withThisFace) { m_highlightSet = m_inventorApplication.ActiveDocument.CreateHighlightSet(); Inventor.Color green; green = m_inventorApplication.TransientObjects.CreateColor(0, 255, 0); green.Opacity = 0.3; m_highlightSet.Color = green; m_highlightSet.AddItem(withThisFace); }
public iFeatureFormCmd() { m_editCavityLibrary = null; m_withThisFace = null; m_highlightSet = null; m_Point = null; m_UCS = null; assembly = System.Reflection.Assembly.GetExecutingAssembly(); FileInfo asmFile = new FileInfo(assembly.Location); deFaultpath = asmFile.DirectoryName + "\\CavityLibrary"; }
private void HightghtSelectSurface(ExtrudeFeature surfaceFeature) { m_highlightSet = m_inventorApplication.ActiveDocument.CreateHighlightSet(); Inventor.Color green; green = m_inventorApplication.TransientObjects.CreateColor(0, 255, 0); green.Opacity = 0.3; m_highlightSet.Color = green; m_highlightSet.AddItem(surfaceFeature); }
public EditNetCmd() { m_editNetForm = null; m_selectFace = null; m_selectiFeature = null; m_UCS = null; m_highlightSet = null; assembly = System.Reflection.Assembly.GetExecutingAssembly(); FileInfo asmFile = new FileInfo(assembly.Location); deFaultpath = asmFile.DirectoryName + "\\CavityLibrary"; }
public ConnectCmd() { m_connectCmdDlg = null; m_thisSurface = null; m_connectToSurface = null; m_thisCav = null; m_connectToCav = null; m_UCS = null; m_highlightSet = null; }
public AlignCmd() { m_alignCmdDlg = null; m_thisFace = null; m_withThisFace = null; m_thisiFeature = null; m_withThisiFeature = null; m_UCS = null; m_highlightSet = null; }
public InsertXportCmd() { m_insertXportForm = null; m_firstFace = null; m_secondFace = null; m_highlightSet = null; m_UCS = null; m_xportID = null; assembly = System.Reflection.Assembly.GetExecutingAssembly(); FileInfo asmFile = new FileInfo(assembly.Location); deFaultpath = asmFile.DirectoryName; filepath = deFaultpath + "\\CavityLibrary"; }
private void HighlightSelectEntity(iFeature ifeature) { m_highlightSet = m_inventorApplication.ActiveDocument.CreateHighlightSet(); Inventor.Color green; green = m_inventorApplication.TransientObjects.CreateColor(0, 255, 0); green.Opacity = 0.3; m_highlightSet.Color = green; foreach (Face oFace in ifeature.Faces) { m_highlightSet.AddItem(oFace); } }
/// <summary> /// Gets the assembly document and makes the <see cref="DockableWindows"/> /// </summary> private void OpeningExporter() { //Gets the assembly document and creates dockable windows AsmDocument = (AssemblyDocument)MainApplication.ActiveDocument; Utilities.CreateDockableWindows(MainApplication); ChildHighlight = AsmDocument.CreateHighlightSet(); ChildHighlight.Color = Utilities.GetInventorColor(SynthesisGUI.PluginSettings.InventorChildColor); WheelHighlight = AsmDocument.CreateHighlightSet(); WheelHighlight.Color = Utilities.GetInventorColor(System.Drawing.Color.Green); //Sets up events for selecting and deselecting parts in inventor Utilities.GUI.jointEditorPane1.SelectedJoint += SelectNodes; PluginSettingsForm.PluginSettingsValues.SettingsChanged += ExporterSettings_SettingsChanged; EnvironmentEnabled = true; // Load robot skeleton and prepare UI if (!Utilities.GUI.LoadRobotSkeleton()) { ForceQuitExporter(AsmDocument); return; } disabledAssemblyOccurences = new List <ComponentOccurrence>(); disabledAssemblyOccurences.AddRange(DisableUnconnectedComponents(AsmDocument)); // If fails to load existing data, restart wizard if (!Utilities.GUI.LoadRobotData(AsmDocument)) { Wizard.WizardForm wizard = new Wizard.WizardForm(); wizard.ShowDialog(); if (Properties.Settings.Default.ShowExportOrAdvancedForm) { Form finishDialog = new Wizard.ExportOrAdvancedForm(); finishDialog.ShowDialog(); } PendingChanges = true; // Force save button on since no data has been saved to this file } else { PendingChanges = false; // No changes are pending if data has been loaded } // Hide non-jointed components; // Reload panels in UI Utilities.GUI.ReloadPanels(); Utilities.ShowDockableWindows(); }
public MoveCmd() { m_moveCmdDlg = null; m_selectFace = null; m_selectiFeature = null; m_UCS = null; m_previewClientGraphicsNode = null; m_pointGraphics = null; m_graphicsCoordinateSet = null; m_graphicsColorSet = null; m_graphicsColorIndexSet = null; m_highlightSet = null; }
private void ClearHighlight() { m_highlightSet = null; //PartDocument oPartDoc; //oPartDoc = (PartDocument)m_inventorApplication.ActiveDocument; //PartComponentDefinition oPartCompDef; //oPartCompDef = oPartDoc.ComponentDefinition; //UserCoordinateSystems oUCSs; //oUCSs = oPartCompDef.UserCoordinateSystems; //foreach (UserCoordinateSystem m_UCS in oUCSs) //{ // if (m_UCS.Visible == true) // m_UCS.Visible = false; //} }
private void ClearHighlight() { m_highlightSet = null; PartDocument oPartDoc; oPartDoc = (PartDocument)m_inventorApplication.ActiveDocument; PartComponentDefinition oPartCompDef; oPartCompDef = oPartDoc.ComponentDefinition; UserCoordinateSystems oUCSs; oUCSs = oPartCompDef.UserCoordinateSystems; foreach (UserCoordinateSystem m_UCS in oUCSs) { if (m_UCS.Visible == true) { m_UCS.Visible = false; } } }
/* sub_6C1E9 */ internal static void display_highlighed_text(int highlighed_word, int highlightFgColor, string text, int xOffset, int fgColor, HighlightSet highlights) { if (text.Length > 0) { for (int i = 0; i < text.Length; i++) { if (highlights[highlighed_word].start <= i && highlights[highlighed_word].end >= i && highlightFgColor != 0) { seg041.display_char01(text[i], 1, highlightFgColor, 0, 0x18, xOffset + i); } else if (highlightable_text.MemberOf(text[i]) == true) { seg041.display_char01(text[i], 1, 0, highlightFgColor, 0x18, xOffset + i); } else { seg041.display_char01(text[i], 1, 0, fgColor, 0x18, xOffset + i); } } if (text.Length + xOffset < 0x27) { seg041.display_char01(' ', (0x27 - text.Length - xOffset) + 1, 0, 0, 0x18, xOffset + text.Length); } Display.Update(); } }
private void ClearHighlight() { m_highlightSet = null; }
internal static void display_highlighed_text(int highlighed_word, int highlightFgColor, string text, int xOffset, int fgColor, HighlightSet highlights) /* sub_6C1E9 */ { if (text.Length > 0) { for (int i = 0; i < text.Length; i++) { if (highlights[highlighed_word].start <= i && highlights[highlighed_word].end >= i && highlightFgColor != 0) { seg041.display_char01(text[i], 1, highlightFgColor, 0, 0x18, xOffset + i); } else if (highlightable_text.MemberOf(text[i]) == true) { seg041.display_char01(text[i], 1, 0, highlightFgColor, 0x18, xOffset + i); } else { seg041.display_char01(text[i], 1, 0, fgColor, 0x18, xOffset + i); } } if (text.Length + xOffset < 0x27) { seg041.display_char01(' ', (0x27 - text.Length - xOffset) + 1, 0, 0, 0x18, xOffset + text.Length); } Display.Update(); } }
internal static char displayInput(out bool specialKeyPressed, bool useOverlay, byte accept_ctrlkeys, MenuColorSet colors, string displayInputString, string displayExtraString) { int highlistCount; gbl.displayInput_specialKeyPressed = false; bool var_8F = (colors.foreground != 0) || (colors.highlight != 0); HighlightSet highlights = BuildInputKeys(displayInputString, out highlistCount); if (gbl.menuSelectedWord >= highlistCount) { gbl.menuSelectedWord = 0; } char input_key = '\0'; specialKeyPressed = false; bool stopLoop = false; var timeStart = DateTime.Now; var timeCursorOn = timeStart.AddMilliseconds(300); var timeCursorOff = timeCursorOn.AddMilliseconds(500); if (displayExtraString.Length != 0) { seg041.displayString(displayExtraString, 0, colors.prompt, 0x18, 0); } int displayInputXOffset = displayExtraString.Length; display_highlighed_text(gbl.menuSelectedWord, colors.highlight, displayInputString, displayInputXOffset, colors.foreground, highlights); if (gbl.game_state == GameState.WildernessMap && gbl.bigpic_block_id == 0x79 && gbl.lastDaxBlockId != 0x50) { MapCursor.SetPosition(gbl.area_ptr.current_city); MapCursor.Draw(); MapCursor.Restore(); } do { if (gbl.game_state == GameState.WildernessMap && gbl.bigpic_block_id == 0x79 && gbl.lastDaxBlockId != 0x50 && DateTime.Now >= timeCursorOn) { MapCursor.Draw(); timeCursorOn = timeCursorOff.AddMilliseconds(300); } if ((gbl.area_ptr.picture_fade != 0 || useOverlay == true) && gbl.byte_1D556.curFrame > 0) { ovr030.DrawMaybeOverlayed(gbl.byte_1D556.CurrentPicture(), useOverlay, 3, 3); int delay = gbl.byte_1D556.CurrentDelay() * 100; if ((DateTime.Now.Subtract(timeStart).TotalMilliseconds) >= delay || gbl.area_ptr.picture_fade != 0) { gbl.byte_1D556.NextFrame(); timeStart = DateTime.Now; } } if (gbl.displayInputSecondsToWait > 0 && DateTime.Now.Subtract(timeStart).TotalSeconds >= gbl.displayInputSecondsToWait) { input_key = gbl.displayInputTimeoutValue; stopLoop = true; } else if (seg049.KEYPRESSED() == true) { input_key = (char)seg043.GetInputKey(); if (input_key == 0) { input_key = (char)seg043.GetInputKey(); if (accept_ctrlkeys != 0) { specialKeyPressed = true; stopLoop = true; } } else if (input_key == 0x1B) { stopLoop = true; input_key = '\0'; } else if (input_key == 13) { if (var_8F) { if (highlights[gbl.menuSelectedWord].start != -1) { input_key = displayInputString[highlights[gbl.menuSelectedWord].start]; } else { input_key = '\r'; } stopLoop = true; } } else if (input_key == ',') { if (gbl.menuSelectedWord == 0) { gbl.menuSelectedWord = highlistCount - 1; } else { gbl.menuSelectedWord--; } display_highlighed_text(gbl.menuSelectedWord, colors.highlight, displayInputString, displayInputXOffset, colors.foreground, highlights); } else if (input_key == '.') { gbl.menuSelectedWord++; if (gbl.menuSelectedWord >= highlistCount) { gbl.menuSelectedWord = 0; } display_highlighed_text(gbl.menuSelectedWord, colors.highlight, displayInputString, displayInputXOffset, colors.foreground, highlights); } else { input_key = char.ToUpper(input_key); if (alpha_number_input.MemberOf(input_key) == true) { if (input_key == 0x20) { stopLoop = true; } else { for (int var_62 = 0; var_62 < displayInputString.Length; var_62++) { if (displayInputString[var_62] == input_key) { stopLoop = true; int var_61 = 0; while (highlights[var_61].start != var_62) { var_61++; } gbl.menuSelectedWord = var_61; display_highlighed_text(gbl.menuSelectedWord, colors.highlight, displayInputString, displayInputXOffset, colors.foreground, highlights); } } } } if (accept_ctrlkeys != 0 && number_input.MemberOf(input_key) == true) { if (input_key == 'W') { input_key = '7'; } else { input_key = keypad_ctrl_codes[input_key - 0x31]; } specialKeyPressed = true; stopLoop = true; } } } if (gbl.game_state == GameState.WildernessMap && gbl.bigpic_block_id == 0x79 && gbl.lastDaxBlockId != 0x50 && DateTime.Now >= timeCursorOff) { MapCursor.Restore(); timeCursorOff = timeCursorOn.AddMilliseconds(500); } System.Threading.Thread.Sleep(20); } while (stopLoop == false); gbl.area_ptr.picture_fade = 0; if (gbl.game_state == GameState.WildernessMap && gbl.bigpic_block_id == 0x79 && gbl.lastDaxBlockId != 0x50) { MapCursor.Restore(); } gbl.displayInput_specialKeyPressed = specialKeyPressed; return(input_key); }