Drawing annotation information generation method and device, storage medium and electronic equipment
By automatically recognizing annotation styles based on mouse position and line segment relationships in drawing software, the inefficiency caused by frequent changes in annotation styles is solved, enabling fast and accurate annotation generation and improving user efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CAXA TECH
- Filing Date
- 2022-11-23
- Publication Date
- 2026-06-12
Smart Images

Figure CN115830183B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer graphics, and more specifically, to a method, apparatus, storage medium, and electronic device for generating drawing annotation information. Background Technology
[0002] In computer-aided design software, annotation is a common method used to add explanations and insights to the graphic structure of a design. For designers, annotation makes their designs clearer, more complete, and helps in identifying existing logical relationships and eliminating errors. For implementers, appropriate annotation allows users of the drawings to understand the designer's thought process, including specific specifications and parameters. Annotation enables better collaboration between the design and implementation departments, reduces communication costs, and minimizes the number of errors.
[0003] Commonly used dimensioning methods include linear dimensioning, arc length dimensioning, radius dimensioning, and angle dimensioning. Linear dimensioning is a particularly common type, appearing in vast quantities in actual engineering drawings and thus used very frequently. However, generating linear dimensions requires selecting a style, and only dimensions of that style can be generated on the drawing. Changing the style necessitates deselecting the current style and selecting a new one. Due to the high demand for linear dimensions, frequent changes to their styles significantly increase the workload for staff, thus reducing their efficiency.
[0004] There is currently no effective solution to the problem that the generation of annotations in related technologies requires frequent changes to the annotation style, which reduces the efficiency of users' work. Summary of the Invention
[0005] This application provides a method, apparatus, storage medium, and electronic device for generating drawing annotation information, in order to solve the problem in related technologies where frequent changes to annotation styles are required when generating annotations, leading to reduced user work efficiency.
[0006] According to one aspect of this application, a method for generating drawing annotation information is provided. The method includes: obtaining the current position of the mouse pointer in the drawing interface, and determining the line segment to which annotations are to be added based on the current position to obtain a target line segment; determining the positional relationship between the current position and the target line segment, determining candidate styles for target annotation information based on the positional relationship, and generating candidate annotation information under the candidate styles, wherein the target annotation information is used to annotate the target line segment, the candidate styles include annotation lines, and the candidate annotation information consists of annotation lines and annotation values; and, upon receiving a click instruction, determining the candidate annotation information as the target annotation information for the target line segment.
[0007] Optionally, generating candidate annotation information under a candidate style includes: determining the annotation lines in the candidate style, wherein the annotation lines include at least one of the following: parallel annotation lines, horizontal annotation lines, and vertical annotation lines, where parallel annotation lines are parallel to the target line segment, vertical annotation lines are parallel to the vertical baseline of the drawing interface, and horizontal annotation lines are parallel to the horizontal baseline of the drawing interface; calculating the length of the annotation line based on the length of the annotation line and the target line segment to obtain a candidate length value; and annotating the candidate length value in the annotation line to obtain candidate annotation information.
[0008] Optionally, determining the candidate styles for target annotation information based on positional relationships includes: generating a target rectangle with the target line segment as the diagonal; if the current position is inside the target rectangle, determining the candidate styles corresponding to the current position according to a first lookup table, wherein the first lookup table includes multiple current positions and candidate styles corresponding to each current position; if the current position is outside the target rectangle, determining the candidate styles corresponding to the current position according to a second lookup table, wherein the second lookup table includes multiple current positions and candidate styles corresponding to each current position.
[0009] Optionally, after generating a target rectangle with the target line segment as the diagonal, the method further includes: determining the angle between the target line segment and the vertical baseline of the drawing interface to obtain a first angle value; obtaining multiple candidate lookup tables and obtaining the angle interval associated with each candidate lookup table; determining the angle interval in which the first angle value is located to obtain the target angle interval, and obtaining the candidate lookup table associated with the target angle interval to obtain a first lookup table and a second lookup table.
[0010] Optionally, the current position of the mouse pointer in the drawing interface is obtained, and the line segment to which the annotation is to be added is determined based on the current position. The target line segment is obtained by: determining the line segment that is closest to the mouse pointer among multiple line segments in the drawing interface.
[0011] Optionally, the target line segment includes a starting point. Determining candidate styles for target annotation information based on positional relationships includes: determining the angle between the line segment formed by the current position and the starting point and the target line segment, obtaining the target angle value; if the target angle value is less than or equal to a second angle value, determining the annotation line in the candidate style as a parallel annotation line, wherein the parallel annotation line is parallel to the target line segment; if the target angle value is greater than the second angle value, determining whether the target angle value is greater than a third angle value, wherein the third angle value is greater than the second angle value; if the target angle value is greater than the third angle value, displaying a prompt message, wherein the prompt message is used to inform the user that candidate style generation failed; if the target angle value is less than or equal to the third angle value, determining whether the current position is below the target line segment; if the current position is below the target line segment, determining the annotation line in the candidate style as a vertical annotation line, wherein the vertical annotation line is parallel to the vertical baseline of the drawing interface; if the current position is above the target line segment, determining the annotation line in the candidate style as a horizontal annotation line, wherein the horizontal annotation line is parallel to the horizontal baseline of the drawing interface.
[0012] Optionally, the target line segment includes a starting point. Determining the candidate styles of target annotation information based on positional relationships includes: determining the angle between the line segment formed by the current position and the starting point and the vertical baseline in the drawing interface to obtain a first target angle value; if the first target angle value is less than or equal to a fourth angle value, determining the annotation line in the candidate styles to be a vertical annotation line, wherein the fourth angle value is less than the second angle value; determining the angle between the line segment formed by the current position and the starting point and the horizontal baseline in the drawing interface to obtain a second target angle value; if the second target angle value is less than or equal to the fourth angle value, determining the annotation line in the candidate styles to be a horizontal annotation line.
[0013] According to another aspect of this application, a device for generating drawing annotation information is provided. The device includes: a first acquisition unit, configured to acquire the current position of the mouse pointer in the drawing interface, and determine the line segment to be annotated based on the current position to obtain a target line segment; a first determination unit, configured to determine the positional relationship between the current position and the target line segment, determine candidate styles for target annotation information based on the positional relationship, and generate candidate annotation information under the candidate styles, wherein the target annotation information is used to annotate the target line segment, the candidate styles include annotation lines, and the candidate annotation information consists of annotation lines and annotation values; and a second determination unit, configured to determine the candidate annotation information as the target annotation information for the target line segment upon receiving a click instruction.
[0014] According to another aspect of the present invention, a computer storage medium is also provided for storing a program, wherein the program, when running, controls the device where the computer storage medium is located to execute a method for generating drawing annotation information.
[0015] According to another aspect of the present invention, an electronic device is also provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is configured to execute the computer-readable instructions, wherein the computer-readable instructions execute a method for generating drawing annotation information.
[0016] This application employs the following steps: obtaining the current position of the mouse pointer in the drawing interface, and determining the line segment to be annotated based on the current position to obtain the target line segment; determining the positional relationship between the current position and the target line segment, determining candidate styles for target annotation information based on the positional relationship, and generating candidate annotation information under the candidate styles, wherein the target annotation information is used to annotate the target line segment, the candidate styles include annotation lines, and the candidate annotation information consists of annotation lines and annotation values; upon receiving a click instruction, the candidate annotation information is determined as the target annotation information for the target line segment. This solves the problem in related technologies where frequent changes to annotation styles are required when generating annotations, leading to reduced user work efficiency. By determining the positional relationship between the current mouse position and the target line segment, and using the aforementioned positional relationship and the click position when the user clicks the drawing interface again, the desired annotation style is determined. Furthermore, by automatically recognizing the annotations the user needs to generate based on the user's mouse position, the effect of quickly, flexibly, and accurately generating the annotations required by the user is achieved, improving the user's drawing efficiency. Attached Figure Description
[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0018] Figure 1 This is a flowchart of a method for generating drawing annotation information according to an embodiment of this application;
[0019] Figure 2 This is a schematic diagram of multiple preset annotation styles provided according to embodiments of this application;
[0020] Figure 3 This is a schematic diagram of the candidate annotation styles provided according to the embodiments of this application;
[0021] Figure 4 This is a schematic diagram of an optional drawing interface provided according to an embodiment of this application;
[0022] Figure 5 This is a schematic diagram of optional cursor positions provided according to embodiments of this application;
[0023] Figure 6This is a schematic diagram of a drawing annotation information generation device provided according to an embodiment of this application. Detailed Implementation
[0024] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.
[0028] According to an embodiment of this application, a method for generating drawing annotation information is provided.
[0029] Figure 1 This is a flowchart of a method for generating drawing annotation information according to an embodiment of this application. For example... Figure 1 As shown, the method includes the following steps:
[0030] Step S102: Obtain the current position of the mouse pointer in the drawing interface, and determine the line segment to be annotated based on the current position to obtain the target line segment.
[0031] Specifically, after completing the drawing of engineering drawings using drawing tools, it is usually necessary to add annotations to the drawings. At this time, when adding annotations, the target line segment to be annotated should be determined first, and the current position of the user's mouse pointer should be obtained in real time after the target line segment is determined. The annotation style that the user wants to generate can be determined by the real-time position of the mouse and the position of the target line segment.
[0032] It should be noted that when there are multiple line segments in the drawing interface, the target line segment can be determined by selecting the line segments, or by determining the distance relationship between the mouse position and the position of each line segment.
[0033] Step S104: Determine the positional relationship between the current position and the target line segment, determine the candidate style of the target annotation information based on the positional relationship, and generate candidate annotation information under the candidate style. The target annotation information is used to annotate the target line segment. The candidate style includes annotation lines, and the candidate annotation information consists of annotation lines and annotation values.
[0034] Specifically, after determining the target line segment and the current position of the mouse pointer at a certain moment, a candidate style can be determined from multiple preset annotation styles based on the positional relationship between the current mouse position and the target line segment.
[0035] It should be noted that the candidate styles are the styles of the annotation lines in the target annotation information. Figure 2 This is a schematic diagram of multiple preset annotation styles provided according to embodiments of this application, such as... Figure 2 As shown, each preset annotation style consists of annotation lines. Multiple preset annotation styles can be horizontal styles where the annotation lines are parallel to the target line segment, horizontal styles where the annotation lines are horizontal to the drawing interface, and vertical styles where the annotation lines are perpendicular to the drawing interface.
[0036] After determining the candidate style, the length information value of the target line under the candidate style can be determined, and the length information value can be combined with the candidate style to obtain the candidate annotation information generated according to the current position of the mouse. Thus, the current candidate annotation information can be displayed in real time according to the user's mouse position.
[0037] Step S106: Upon receiving a click instruction, the candidate annotation information is determined as the target annotation information of the target line segment.
[0038] Specifically, when a click instruction is received from a user, it indicates that the user believes the currently displayed candidate annotation information is the annotation information that the user wants to add. Therefore, when a click instruction is received, the currently generated candidate annotation information can be determined as the target annotation information of the target line segment, thereby achieving the effect of conveniently and accurately annotating the target line segment.
[0039] The method for generating drawing annotation information provided in this application obtains the target line segment by acquiring the current position of the mouse pointer in the drawing interface and determining the line segment to be annotated based on the current position; determining the positional relationship between the current position and the target line segment; determining candidate styles for target annotation information based on the positional relationship; and generating candidate annotation information under the candidate styles. The target annotation information is used to annotate the target line segment, the candidate styles include annotation lines, and the candidate annotation information consists of annotation lines and annotation values. Upon receiving a click instruction, the candidate annotation information is determined as the target annotation information for the target line segment. This solves the problem in related technologies where frequent changes to annotation styles are required when generating annotations, leading to reduced user efficiency. By determining the positional relationship between the current mouse position and the target line segment, and using this positional relationship along with the user's click position when clicking the drawing interface again, the desired annotation style is determined. Furthermore, by automatically recognizing the annotations the user needs based on the user's mouse position, the method achieves the effect of quickly, flexibly, and accurately generating the annotations required by the user, thus improving the user's drawing efficiency.
[0040] Optionally, in the method for generating drawing annotation information provided in the embodiments of this application, generating candidate annotation information under a candidate style includes: determining the annotation lines in the candidate style, wherein the annotation lines include at least one of the following: parallel annotation lines, horizontal annotation lines, and vertical annotation lines, wherein the parallel annotation lines are parallel to the target line segment, the vertical annotation lines are parallel to the vertical baseline of the drawing interface, and the horizontal annotation lines are parallel to the horizontal baseline in the drawing interface; calculating the length of the annotation lines based on the length of the annotation lines and the target line segment to obtain a candidate length value; and annotating the candidate length value in the annotation lines to obtain candidate annotation information.
[0041] Specifically, such as Figure 2 As shown, when generating candidate styles, you can choose from three preset styles, including... Figure 2 The annotation lines are categorized into parallel, horizontal, and vertical styles. After determining the style, it's necessary to further determine the annotation values within the candidate styles, obtaining candidate annotation values. These candidate annotation values are used to determine the length of the target line under the candidate styles.
[0042] For example, Figure 3 This is a schematic diagram of the candidate annotation styles provided according to the embodiments of this application, such as... Figure 3 As shown, when the length of the target line segment is 5, the label line is perpendicular, and the angle between the label line and the target line segment is 30 degrees, the length value of the label line is 4. The length value is then marked on the label line to obtain candidate label information.
[0043] Optionally, in the method for generating drawing annotation information provided in this application embodiment, determining the candidate style of the target annotation information based on the positional relationship includes: generating a target rectangle with the target line segment as the diagonal; when the current position is inside the target rectangle, determining the candidate style corresponding to the current position according to a first lookup table, wherein the first lookup table includes multiple current positions and a candidate style corresponding to each current position; when the current position is outside the target rectangle, determining the candidate style corresponding to the current position according to a second lookup table, wherein the second lookup table includes multiple current positions and a candidate style corresponding to each current position.
[0044] Specifically, Figure 4 This is a schematic diagram of an optional drawing interface provided according to an embodiment of this application, such as... Figure 4 As shown, after confirming the current position of the user's mouse, it is necessary to determine whether the current position is inside or outside the target matrix, and determine the candidate style that the user wants to generate based on different positions.
[0045] It should be noted that a first lookup table and a second lookup table can be generated in advance. The first lookup table can include multiple positional information inside the target rectangle and the candidate style corresponding to each positional information. Similarly, the second lookup table can include multiple positional information outside the target rectangle and the candidate style corresponding to each positional information. At this time, after obtaining the current position of the mouse, the candidate style to be generated can be determined from the two lookup tables based on the positional information.
[0046] Optionally, in the method for generating drawing annotation information provided in the embodiments of this application, after generating a target rectangle with the target line segment as the diagonal, the method further includes: determining the angle between the target line segment and the vertical baseline of the drawing interface to obtain a first angle value; obtaining multiple candidate lookup tables and obtaining the angle interval associated with each candidate lookup table; determining the angle interval in which the first angle value is located to obtain a target angle interval, and obtaining the candidate lookup table associated with the target angle interval to obtain a first lookup table and a second lookup table.
[0047] Specifically, after generating the target rectangle, it is necessary to determine the candidate lookup table corresponding to the target line segment based on the degree of inclination of the target line segment in the drawing interface, that is, the angle between the target line segment and the vertical baseline of the drawing interface. In this case, the first lookup table and the second lookup table will be different if the first angle value is different. That is, the candidate style corresponding to each position information will also be different if the first angle value is different. Therefore, it is necessary to first determine the angle interval to which the first angle value belongs, and determine the candidate lookup table corresponding to the angle interval as the first lookup table and the second lookup table.
[0048] Optionally, in the method for generating drawing annotation information provided in the embodiments of this application, obtaining the current position of the mouse pointer in the drawing interface and determining the line segment to be annotated based on the current position to obtain the target line segment includes: determining the line segment closest to the mouse pointer among multiple line segments in the drawing interface to obtain the target line segment.
[0049] Specifically, when determining the target line segment, it can be determined based on the distance between the mouse pointer and multiple line segments. For example, the line segment closest to the mouse pointer among multiple line segments can be determined as the target line segment. When the position of the mouse pointer is moved, the target line segment will be updated accordingly, and the label will also change accordingly.
[0050] Optionally, in the method for generating drawing annotation information provided in this application embodiment, the target line segment includes a starting point. Determining the candidate style of the target annotation information based on the positional relationship includes: determining the angle between the line segment formed by the current position and the starting point and the target line segment to obtain the target angle value; if the target angle value is less than or equal to a second angle value, determining that the annotation line in the candidate style is a parallel annotation line, wherein the parallel annotation line is parallel to the target line segment; if the target angle value is greater than the second angle value, determining whether the target angle value is greater than a third angle value, wherein the third angle value is greater than the second angle value. If the target included angle value is greater than the third included angle value, a prompt message is displayed, indicating that the candidate style generation failed. If the target included angle value is less than or equal to the third included angle value, it is determined whether the current position is below the target line segment. If the current position is below the target line segment, the annotation line in the candidate style is determined to be a vertical annotation line, which is parallel to the vertical baseline of the drawing interface. If the current position is above the target line segment, the annotation line in the candidate style is determined to be a horizontal annotation line, which is parallel to the horizontal baseline of the drawing interface.
[0051] Specifically, after selecting the target line segment, you need to arbitrarily select one of the two endpoints of the target line segment as the starting point of the annotation. After selecting the starting point, a annotation line segment can be generated based on the current position of the mouse cursor and the starting point, and the angle between the line segment and the target line segment can be determined. The target angle is the angle with the starting point as the vertex.
[0052] Furthermore, after generating the target angle, it is necessary to determine whether the angle is less than the second angle value. If the target angle value is less than or equal to the second angle value, it indicates that the distance between the target line segment and the annotation line segment is relatively close. Therefore, it can be determined that the user wants to generate a parallel annotation line that is parallel to the target line segment. Thus, it can be determined that the annotation line in the candidate style is a parallel annotation line.
[0053] If the target angle value is greater than the second angle value, it is necessary to determine whether the target angle value is greater than the third angle value. If the target angle value is greater than the third angle value, a prompt message should be displayed, which is used to inform the user that the generation of candidate styles failed.
[0054] Specifically, Figure 5 This is a schematic diagram illustrating optional cursor positions according to embodiments of this application, such as... Figure 5 As shown, when the target included angle value is greater than the third included angle value, it indicates that the distance between the user's current mouse position and the target line segment is too far, making it impossible to accurately determine the annotation style that the user wants to generate. Therefore, a tooltip can be generated at the mouse cursor to inform the user that the candidate style generation failed and that the cursor position needs to be adjusted to regenerate.
[0055] Furthermore, when the target angle value is between the second and third angle values, the current annotation style needs to be determined based on the current mouse cursor position. It can be determined whether the current mouse cursor position is below the target line segment. If the current mouse cursor position is below the target line segment, the annotation line in the candidate style is determined to be a vertical annotation line; if the current position is above the target line segment, the annotation line in the candidate style is determined to be a horizontal annotation line. Thus, by jointly determining the candidate style based on the target angle value and the mouse cursor position information, the accuracy of generating target annotation information is improved.
[0056] Optionally, in the method for generating drawing annotation information provided in this application embodiment, the target line segment includes a starting point. Determining the candidate style of the target annotation information based on the positional relationship includes: determining the angle between the line segment formed by the current position and the starting point and the vertical baseline in the drawing interface to obtain a first target angle value; if the first target angle value is less than or equal to a fourth angle value, determining the annotation line in the candidate style as a vertical annotation line, wherein the fourth angle value is less than a second angle value; determining the angle between the line segment formed by the current position and the starting point and the horizontal baseline in the drawing interface to obtain a second target angle value; if the second target angle value is less than or equal to the fourth angle value, determining the annotation line in the candidate style as a horizontal annotation line.
[0057] Specifically, in certain special cases, a user may want to define a dimension as a perpendicular line, but because the target line segment is very close to the vertical baseline, the system may define the perpendicular dimension the user wants to generate as a parallel dimension, resulting in an abnormal dimension. In this case, the angle between the line segment formed by the current mouse position and the starting point and the vertical baseline in the drawing interface can be determined to obtain the first target angle value. If this angle value is less than the fourth angle value, regardless of whether the angle between the line segment formed by the current mouse position and the starting point and the target line segment is less than the second angle value, the dimension line in the candidate style will be determined as a perpendicular dimension line.
[0058] Similarly, if the angle between the line segment formed by the current mouse position and the starting point and the horizontal baseline in the drawing interface is less than or equal to the fourth angle value, regardless of whether the angle between the line segment formed by the current mouse position and the starting point and the target line segment is less than the second angle value, the annotation line in the candidate style will be determined as a horizontal annotation line, thereby improving the accuracy of generating user annotations.
[0059] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0060] This application also provides an apparatus for generating drawing annotation information. It should be noted that this apparatus can be used to execute the drawing annotation information generation method provided in this application. The following describes the drawing annotation information generation apparatus provided in this application.
[0061] Figure 6 This is a schematic diagram of a drawing annotation information generation device provided according to an embodiment of this application. For example... Figure 6 As shown, the device includes: a first acquisition unit 61, a first determination unit 62, and a second determination unit 63.
[0062] The first acquisition unit 61 is used to acquire the current position of the mouse pointer in the drawing interface, and determine the line segment to be annotated based on the current position to obtain the target line segment.
[0063] The first determining unit 62 is used to determine the positional relationship between the current position and the target line segment, determine the candidate style of the target annotation information according to the positional relationship, and generate candidate annotation information under the candidate style. The target annotation information is used to annotate the target line segment, the candidate style includes annotation lines, and the candidate annotation information consists of annotation lines and annotation values.
[0064] The second determining unit 63 is used to determine the candidate annotation information as the target annotation information of the target line segment when a click instruction is received.
[0065] The drawing annotation information generation device provided in this application embodiment obtains the current position of the mouse pointer in the drawing interface through the first acquisition unit 61, and determines the line segment to be annotated based on the current position to obtain the target line segment. The first determination unit 62 determines the positional relationship between the current position and the target line segment, determines the candidate style of the target annotation information based on the positional relationship, and generates candidate annotation information under the candidate style. The target annotation information is used to annotate the target line segment, the candidate style includes a label line, and the candidate annotation information consists of a label line and a label value. When a click instruction is received, the second determination unit 63 determines the candidate annotation information as the target annotation information of the target line segment. This solves the problem in related technologies where the annotation style needs to be frequently changed when generating annotations, resulting in reduced user work efficiency. By determining the positional relationship between the current mouse position and the target line segment, and by using the above positional relationship and the click position when the user clicks the drawing interface again, the style of the annotation that the user wants to generate is jointly determined. Then, by automatically recognizing the annotation that the user needs to generate based on the user's mouse position, the effect of quickly, flexibly, and accurately generating the annotation required by the user is achieved, improving the user's drawing efficiency.
[0066] Optionally, in the drawing annotation information generation device provided in this application embodiment, the first determining unit 62 includes: a first determining module, used to determine the annotation lines in the candidate styles, wherein the annotation lines include at least one of the following: parallel annotation lines, horizontal annotation lines, and vertical annotation lines, the parallel annotation lines are parallel to the target line segment, the vertical annotation lines are parallel to the vertical reference line of the drawing interface, and the horizontal annotation lines are parallel to the horizontal reference line of the drawing interface; a calculation module, used to calculate the length of the annotation line based on the length of the annotation line and the target line segment to obtain a candidate length value; and an annotation module, used to annotate the candidate length value in the annotation line to obtain candidate annotation information.
[0067] Optionally, in the drawing annotation information generation device provided in the embodiments of this application, the first determining unit 62 includes: a generation module, used to generate a target rectangle with the target line segment as the diagonal; a second determining module, used to determine the candidate style corresponding to the current position according to a first lookup table when the current position is inside the target rectangle, wherein the first lookup table includes multiple current positions and candidate styles corresponding to each current position; and a third determining module, used to determine the candidate style corresponding to the current position according to a second lookup table when the current position is outside the target rectangle, wherein the second lookup table includes multiple current positions and candidate styles corresponding to each current position.
[0068] Optionally, in the drawing annotation information generation device provided in the embodiments of this application, the device further includes: a third determining unit, used to determine the angle between the target line segment and the vertical baseline of the drawing interface to obtain a first angle value; a second obtaining unit, used to obtain multiple candidate lookup tables and obtain the angle interval associated with each candidate lookup table; and a judging unit, used to judge the angle interval in which the first angle value is located to obtain the target angle interval and obtain the candidate lookup table associated with the target angle interval to obtain a first lookup table and a second lookup table.
[0069] Optionally, in the drawing annotation information generation device provided in the embodiments of this application, the first acquisition unit 61 includes: a fourth determination unit, used to determine the line segment that is closest to the mouse pointer among multiple line segments in the drawing interface, and obtain the target line segment.
[0070] Optionally, in the drawing annotation information generation device provided in this application embodiment, the target line segment includes a starting point, and the first determining unit 62 includes: a fourth determining module, used to determine the angle between the line segment formed by the current position and the starting point and the target line segment, to obtain a target angle value; a fifth determining module, used to determine that the annotation line in the candidate style is a parallel annotation line when the target angle value is less than or equal to a second angle value, wherein the parallel annotation line is parallel to the target line segment; a first judging module, used to judge whether the target angle value is greater than a third angle value when the target angle value is greater than a second angle value, wherein the third angle value is greater than the second angle value; and a display unit, used to display the target line segment on the target line segment. If the included angle value is greater than the third included angle value, a prompt message is displayed, indicating that the generation of candidate styles failed. The second judgment module is used to determine whether the current position is below the target line segment if the target included angle value is less than or equal to the third included angle value. The sixth determination module is used to determine that the annotation line in the candidate style is a vertical annotation line if the current position is below the target line segment, wherein the vertical annotation line is parallel to the vertical baseline of the drawing interface. The seventh determination module is used to determine that the annotation line in the candidate style is a horizontal annotation line if the current position is above the target line segment, wherein the horizontal annotation line is parallel to the horizontal baseline of the drawing interface.
[0071] Optionally, in the drawing annotation information generation device provided in this application embodiment, the target line segment includes a starting point, and the first determining unit 62 includes: an eighth determining module, used to determine the angle between the line segment formed by the current position and the starting point and the vertical baseline in the drawing interface, to obtain a first target angle value; a ninth determining module, used to determine that the annotation line in the candidate style is a vertical annotation line when the first target angle value is less than or equal to a fourth angle value, wherein the fourth angle value is less than a second angle value; a tenth determining module, used to determine the angle between the line segment formed by the current position and the starting point and the horizontal baseline in the drawing interface, to obtain a second target angle value; and an eleventh determining module, used to determine that the annotation line in the candidate style is a horizontal annotation line when the second target angle value is less than or equal to the fourth angle value.
[0072] The above-mentioned drawing annotation information generation device includes a processor and a memory. The first acquisition unit 61, the first determination unit 62, the second determination unit 63, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.
[0073] The processor contains a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured. By adjusting kernel parameters, the problem of frequent changes to annotation styles during annotation generation, which reduces user efficiency, can be solved.
[0074] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0075] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements the method for generating drawing annotation information.
[0076] This invention provides a processor for running a program, wherein the program executes the method for generating drawing annotation information during runtime.
[0077] This invention provides an electronic device, including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the aforementioned method for generating drawing annotation information. The device described herein can be a server, PC, PAD, mobile phone, etc.
[0078] This application also provides a computer program product that, when executed on a data processing device, is adapted to execute a program that initializes the generation method steps for drawing annotation information as follows.
[0079] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0080] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0081] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0082] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0083] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0084] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0085] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0086] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0087] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for generating drawing annotation information, characterized in that, include: Obtain the current position of the mouse pointer in the drawing interface, and determine the line segment to be annotated based on the current position to obtain the target line segment; Determine the positional relationship between the current position and the target line segment, determine the candidate style of the target annotation information based on the positional relationship, and generate candidate annotation information under the candidate style. The target annotation information is used to annotate the target line segment, the candidate style includes annotation lines, and the candidate annotation information consists of annotation lines and annotation values. The process of determining candidate styles for target annotation information based on the positional relationship includes: generating a target rectangle with the target line segment as the diagonal; determining the candidate style corresponding to the current position according to a first lookup table when the current position is inside the target rectangle, wherein the first lookup table includes multiple current positions and candidate styles corresponding to each current position; and determining the candidate style corresponding to the current position according to a second lookup table when the current position is outside the target rectangle, wherein the second lookup table includes multiple current positions and candidate styles corresponding to each current position. Upon receiving a click instruction, the candidate annotation information is determined as the target annotation information for the target line segment.
2. The method according to claim 1, characterized in that, Generating candidate annotation information under the candidate style includes: The annotation lines in the candidate styles are determined, wherein the annotation lines include at least one of the following: parallel annotation lines, horizontal annotation lines, and vertical annotation lines, wherein the parallel annotation lines are parallel to the target line segment, the vertical annotation lines are parallel to the vertical reference line of the drawing interface, and the horizontal annotation lines are parallel to the horizontal reference line in the drawing interface. The length of the annotation line is calculated based on the length of the annotation line and the length of the target line segment to obtain a candidate length value; The candidate length value is marked in the annotation line to obtain the candidate annotation information.
3. The method according to claim 1, characterized in that, After generating a target rectangle using the target line segment as its diagonal, the method further includes: Determine the angle between the target line segment and the vertical baseline of the drawing interface to obtain the first angle value; Obtain multiple candidate reference tables and the associated angle interval for each candidate reference table; Determine the included angle interval where the first included angle value is located, obtain the target included angle interval, and obtain the candidate lookup table associated with the target included angle interval, thus obtaining the first lookup table and the second lookup table.
4. The method according to claim 1, characterized in that, Obtain the current position of the mouse pointer in the drawing interface, and determine the line segment to be annotated based on the current position. The target line segment includes: The target line segment is obtained by identifying the line segment that is closest to the mouse pointer among multiple line segments in the drawing interface.
5. The method according to claim 1, characterized in that, The target line segment includes a starting point, and the candidate styles for determining the target annotation information based on the positional relationship include: Determine the angle between the line segment formed by the current position and the starting point and the target line segment to obtain the target angle value; If the target included angle value is less than or equal to the second included angle value, the annotation line in the candidate style is determined to be a parallel annotation line, wherein the parallel annotation line is parallel to the target line segment; If the target included angle value is greater than the second included angle value, determine whether the target included angle value is greater than the third included angle value, wherein the third included angle value is greater than the second included angle value; If the target included angle value is greater than the third included angle value, a prompt message is displayed, wherein the prompt message is used to inform the user that the generation of the candidate style failed; If the target included angle value is less than or equal to the third included angle value, determine whether the current position is below the target line segment; When the current position is below the target line segment, the annotation line in the candidate style is determined to be a vertical annotation line, wherein the vertical annotation line is parallel to the vertical reference line of the drawing interface; When the current position is above the target line segment, the annotation line in the candidate style is determined to be a horizontal annotation line, wherein the horizontal annotation line is parallel to the horizontal baseline in the drawing interface.
6. The method according to claim 1, characterized in that, The target line segment includes a starting point, and the candidate styles for determining the target annotation information based on the positional relationship include: Determine the angle between the line segment formed by the current position and the starting point and the vertical baseline in the drawing interface to obtain the first target angle value; If the first target included angle value is less than or equal to the fourth included angle value, the annotation line in the candidate style is determined to be a vertical annotation line, wherein the fourth included angle value is less than the second included angle value; Determine the angle between the line segment formed by the current position and the starting point and the horizontal baseline in the drawing interface to obtain the second target angle value; If the included angle value of the second target is less than or equal to the included angle value of the fourth target, the annotation line in the candidate style is determined to be a horizontal annotation line.
7. A device for generating drawing annotation information, characterized in that, include: The first acquisition unit is used to acquire the current position of the mouse pointer in the drawing interface, and determine the line segment to be annotated based on the current position to obtain the target line segment; The first determining unit is configured to determine the positional relationship between the current position and the target line segment, determine the candidate style of target annotation information based on the positional relationship, and generate candidate annotation information under the candidate style. The target annotation information is used to annotate the target line segment, the candidate style includes annotation lines, and the candidate annotation information consists of annotation lines and annotation values. The first determining unit includes: a generating module, used to generate a target rectangle with the target line segment as the diagonal; a second determining module, used to determine a candidate style corresponding to the current position according to a first lookup table when the current position is inside the target rectangle, wherein the first lookup table includes multiple current positions and a candidate style corresponding to each current position; and a third determining module, used to determine a candidate style corresponding to the current position according to a second lookup table when the current position is outside the target rectangle, wherein the second lookup table includes multiple current positions and a candidate style corresponding to each current position. The second determining unit is used to determine the candidate annotation information as the target annotation information of the target line segment when a click instruction is received.
8. A computer storage medium, characterized in that, The computer storage medium is used to store a program, wherein the program, when running, controls the device where the computer storage medium is located to execute the method for generating drawing annotation information as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method for generating drawing annotation information according to any one of claims 1 to 6.