Label information moving method, device and equipment

By responding to user operations in QCustomPlot, moving the annotation points and text boxes, and adjusting the moving distance of the text boxes according to the shortest distance of the curve, the problem of curve overlay and text overlap is solved, improving the readability of graphics and text.

CN119672177APending Publication Date: 2025-03-21CHENGDU GONGDING TECHNOLOGY CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411742004.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

In QCustomPlot, due to the complexity of curve data, multiple curves and multiple text annotation information will lead to text occlusion curves, and text overlapping problems are prone to occur when moving the text box, affecting the editing and reading of the graphics.

Method used

A method for moving label information is provided, in response to the user's movement operation of the label point, determine the target point on the curve, move the label point to the target point, and obtain the moving distance. Based on the moving distance and the shortest distance between the label text box and the curve, determine the movement distance of the label text box and move the label text box according to that distance.

Benefits of technology

Through this method, users can flexibly adjust the position of the label text box to ensure that the label information does not interfere with the main content of the graphics, improve the readability of the graphics and text, and avoid text occlusion and overlap problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672177A_ABST
    Figure CN119672177A_ABST
Patent Text Reader

Abstract

The invention provides an annotation information moving method, device and equipment, and relates to the technical field of computers.The method comprises the steps that in response to a moving operation of a user on an annotation point, a target point position corresponding to the moving operation is determined on a curve; moving the marking point to the target point position, and acquiring a moving distance of moving the marking point; based on the moving distance and the shortest distance between the marked textbox and the curve in the moving direction of the marking point, determining the moving distance of the marked textbox in the moving direction of the marking point; and moving the labeled textbox according to the moving distance of the labeled textbox in the moving direction of the labeling point. According to the horizontal axis information of the mouse moving marking point, the numerical point closest to the original marking point is obtained, the specific mode of obtaining the moving distance of the marking point based on the mouse position coordinate point is limited, and the situation that a text box covers a curve is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device and equipment for moving annotation information. Background Art

[0002] Currently, QCustomPlot can add text information to the canvas area that displays data curves. The text information supports Chinese and English input, and users can customize the input content. However, due to the complexity of the curve data, there are often multiple curves, and correspondingly there will also be multiple text annotation information, which often results in the text covering the curve when moving the text annotation information. Summary of the invention

[0003] In order to solve the above technical problems, the present application provides a method, device and equipment for moving annotation information to solve the problem in the prior art that curves are easily covered by annotations.

[0004] To achieve the above technical objectives, this application provides the following technical solutions:

[0005] In a first aspect, an embodiment of the present specification provides a method for moving annotation information, including:

[0006] In response to the user's movement operation on the marked point, determining a target point position corresponding to the movement operation on the curve;

[0007] Move the annotation point to the target point and obtain the moving distance of the annotation point, where the annotation point is the intersection of the annotation box connecting line and the curve, the annotation box connecting line is the line segment connecting the curve and the annotation text box, and the annotation text box is used to add text information of the annotation curve;

[0008] Based on the moving distance and the shortest distance that the annotation text box coincides with the curve in the moving direction of the annotation point, determining the distance that the annotation text box moves in the moving direction of the annotation point, wherein the distance that the annotation text box moves in the moving direction of the annotation point is less than the shortest distance;

[0009] Moves the label text box according to the distance it moves in the direction of the label point.

[0010] In one implementation, based on the moving distance and the shortest distance between the annotation text box and the curve in the moving direction of the annotation point, determining the moving distance of the annotation text box in the moving direction of the annotation point includes:

[0011] Compare the moving distance and the shortest distance between the marked text box and the curve in the moving direction of the marked point;

[0012] If the moving distance is less than the shortest distance, the distance that the annotation text box moves in the direction of the annotation point is the moving distance; if the moving distance is greater than the shortest distance, the distance that the annotation text box moves in the direction of the annotation point is the shortest distance.

[0013] In one implementation, determining a target point corresponding to a moving operation on a curve includes:

[0014] Get the mouse position coordinates after the move operation;

[0015] Compare the coordinates of the points on the curve, and determine the front and back points of the mouse position coordinate point in the original point, where the original point is the data point used to generate the curve;

[0016] If the distance between the mouse position coordinate point and the front point is less than the distance between the mouse position coordinate point and the rear point, the target point is determined to be the front point; if the distance between the mouse position coordinate point and the front point is greater than the distance between the mouse position coordinate point and the rear point, the target point is determined to be the rear point.

[0017] In one embodiment, after the annotation text box is moved according to the distance the annotation text box is moved, the method further includes:

[0018] Determine the first target point with the shortest distance from the moved annotation point in the annotation text box;

[0019] Draw a label box connecting line between the first target point and the moved label point.

[0020] In one embodiment, the method further comprises:

[0021] In response to a user's moving operation on the annotation text box, determining a target frame position of the annotation text box;

[0022] Move the annotation text box to the target frame position, and determine the second target point with the shortest distance from the annotation point on the moved annotation text box;

[0023] Draw a label box connecting line between the second target point and the label point.

[0024] In one embodiment, before responding to the user's operation of moving the annotation point, the method further includes:

[0025] When the flag state bit is in the marking state, the curve background canvas is set to a non-draggable state, wherein the flag state bit includes an untriggered state, a marking state, and a completed state, which are used to distinguish the marking operations of the mouse moving event and the mouse releasing event.

[0026] In one embodiment, the method further comprises:

[0027] When the user does not select the annotation text box or the annotation point by operating the mouse, the flag state bit is determined to be in the untriggered state;

[0028] When the user operates the mouse to select the annotation text box or the annotation point, the flag state is determined to be in the annotation state;

[0029] After the movement of the annotation text box is completed, the flag status bit is determined to be in the completed state.

[0030] In a second aspect, an embodiment of the present specification provides a device for moving annotation information, including:

[0031] A first determining unit, configured to determine a target point position corresponding to the moving operation on the curve in response to a user's moving operation on the marked point;

[0032] A moving unit is used to move the annotation point to a target point and obtain a moving distance of the moving annotation point, wherein the annotation point is an intersection of the annotation box connecting line and the curve, the annotation box connecting line is a line segment connecting the curve and the annotation text box, and the annotation text box is used to add text information of the annotation curve;

[0033] A second determining unit is used to determine the distance that the annotation text box moves in the direction of movement of the annotation point based on the moving distance and the shortest distance that the annotation text box coincides with the curve in the direction of movement of the annotation point, wherein the distance that the annotation text box moves in the direction of movement of the annotation point is less than the shortest distance;

[0034] The processing unit is used to move the annotation text box according to the distance the annotation text box moves in the direction of the annotation point movement.

[0035] In one implementation, the second determining unit is specifically configured to:

[0036] Compare the moving distance and the shortest distance between the marked text box and the curve in the moving direction of the marked point;

[0037] If the moving distance is less than the shortest distance, the distance that the annotation text box moves in the direction of the annotation point is the moving distance; if the moving distance is greater than the shortest distance, the distance that the annotation text box moves in the direction of the annotation point is the shortest distance.

[0038] In one implementation, the first determining unit is specifically configured to:

[0039] Get the mouse position coordinates after the move operation;

[0040] Compare the coordinates of the points on the curve, and determine the front and back points of the mouse position coordinate point in the original point, where the original point is the data point used to generate the curve;

[0041] If the distance between the mouse position coordinate point and the front point is less than the distance between the mouse position coordinate point and the rear point, the target point is determined to be the front point; if the distance between the mouse position coordinate point and the front point is greater than the distance between the mouse position coordinate point and the rear point, the target point is determined to be the rear point.

[0042] In one embodiment, the processing unit is further configured to:

[0043] Determine the first target point with the shortest distance from the moved annotation point in the annotation text box;

[0044] Draw a label box connecting line between the first target point and the moved label point.

[0045] In one implementation, the first determining unit is further configured to:

[0046] In response to a user's moving operation on the annotation text box, determining a target frame position of the annotation text box;

[0047] The processing unit is also used to:

[0048] Move the annotation text box to the target frame position, and determine the second target point with the shortest distance from the annotation point on the moved annotation text box;

[0049] Draw a label box connecting line between the second target point and the label point.

[0050] In one implementation, the first determining unit is further configured to:

[0051] When the flag state bit is in the marking state, the curve background canvas is set to a non-draggable state, wherein the flag state bit includes an untriggered state, a marking state, and a completed state, which are used to distinguish the marking operations of the mouse moving event and the mouse releasing event.

[0052] In one implementation, the first determining unit is further configured to:

[0053] When the user does not select the annotation text box or the annotation point by operating the mouse, the flag state bit is determined to be in the untriggered state;

[0054] When the user operates the mouse to select the annotation text box or the annotation point, the flag state is determined to be in the annotation state;

[0055] After the movement of the annotation text box is completed, the flag status bit is determined to be in the completed state.

[0056] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for moving annotation information of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0057] In a fourth aspect, an embodiment of the present specification provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the annotation information moving method as described in any one of the above items is implemented.

[0058] In a fifth aspect, an embodiment of the present specification provides a computer program product or a computer program, wherein the computer program product includes a computer program, and the computer program is stored in a computer-readable storage medium; the processor of the computer device reads the computer program from the computer-readable storage medium, and when the processor executes the computer program, it implements the vehicle air conditioning control method as described in any one of the above items.

[0059] It can be seen from the above technical solution that the present application provides a method, device and equipment for moving annotation information. The method responds to the user's moving operation on the annotation point, first determines the target point corresponding to the moving operation on the curve, then moves the annotation point to the target point, and obtains the moving distance of the moving annotation point, and based on the moving distance and the shortest distance that the annotation text box coincides with the curve in the moving direction of the annotation point, determines the distance that the annotation text box moves in the moving direction of the annotation point, and finally moves the annotation text box according to the distance that the annotation text box moves in the moving direction of the annotation point. Users can adjust the position of the annotation text box at any time according to their needs, so that the annotation results are more in line with the actual situation. The flexible movement method can help users better adjust the relationship between the annotation and the target object, ensure that the annotation information does not interfere with the main content of the graphics, and improve the readability of the graphics and text. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0061] Figure 1 A flowchart of a method for moving annotation information provided in an embodiment of this specification;

[0062] Figure 2 A flowchart of another method for moving annotation information provided in an embodiment of this specification;

[0063] Figure 3 A schematic diagram of a specific process of a method for moving annotation information provided in an embodiment of this specification;

[0064] Figure 4 Create a schematic diagram for the canvas area curve;

[0065] Figure 5 Create schematic diagrams for annotation information;

[0066] Figure 6 It is a schematic diagram of the movement of the marked points;

[0067] Figure 7 Move the schematic diagram for the annotation text box;

[0068] Figure 8 A schematic diagram of the structure of a marking information mobile device provided for an implementation manner of this specification;

[0069] Fig. 9 A schematic diagram of the structure of an electronic device provided for an implementation manner of this specification. DETAILED DESCRIPTION

[0070] Unless otherwise defined, the technical terms or scientific terms used in the embodiments of this specification shall have the common meanings understood by persons with ordinary skills in the field to which this specification belongs. The words "first", "second" and similar words used in the embodiments of this specification do not indicate any order, quantity or importance, but are only used to avoid confusion of constituent elements.

[0071] Unless the context requires otherwise, throughout the specification, "plurality" means "at least two", and "including" is interpreted as an open, inclusive meaning, that is, "including, but not limited to". In the description of the specification, the terms "one embodiment", "some embodiments", "exemplary embodiments", "examples", "specific examples" or "some examples" are intended to indicate that a particular feature, structure, material or characteristic associated with the embodiment or example is included in at least one embodiment or example of the specification. The schematic representation of the above terms does not necessarily refer to the same embodiment or example.

[0072] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0073] Overview

[0074] As mentioned in the background technology, QCustomPlot can add text information in the canvas area showing the data curve. The text information supports Chinese and English input. However, due to the complexity of the curve data, there are often multiple curves, and correspondingly there will be multiple text annotation information, which often leads to the situation where the text blocks the curve. In addition, when moving the text box, it is more likely that the text blocks the curve and the text overlaps, making it difficult to edit and read the graphics, affecting the user experience.

[0075] Therefore, it is necessary to provide a method for moving annotation information to avoid the problem of annotation text covering the curve.

[0076] In order to solve the problem that the curve is easily covered by the annotation information in the traditional method, in the technical solution of the present application, the target point corresponding to the moving operation is first determined on the curve, and then the annotation point is moved to the target point, and the moving distance of the moving annotation point is obtained, and based on the moving distance and the shortest distance that the annotation text box coincides with the curve in the moving direction of the annotation point, the distance that the annotation text box moves in the moving direction of the annotation point is determined, and finally the annotation text box is moved according to the distance that the annotation text box moves in the moving direction of the annotation point. Users can adjust the position of the annotation text box at any time according to their needs, so that the annotation results are more in line with the actual situation. The flexible movement method can help users better adjust the relationship between the annotation and the target object, ensure that the annotation information does not interfere with the main content of the graphics, and improve the readability of graphics and text.

[0077] Based on the above-mentioned inventive concept, the annotation information moving method provided in the implementation manner of this specification is exemplarily described below.

[0078] Exemplary Methods

[0079] The embodiment of this specification provides a method for moving annotation information, such as Figure 1 As shown, including:

[0080] S101 : In response to a user's moving operation on a marked point, a target point position corresponding to the moving operation is determined on a curve.

[0081] In specific implementation, after the user moves the annotation point, the target point to which the user intends to move the annotation point is determined from the points on the curve, where the annotation point is a point on the curve used to prompt the user to mark the point marked by the annotation text box, and is also the connection point between the annotation text box and the curve.

[0082] Specifically, when moving, the closest point on the curve is found according to the coordinate point of the mouse position to which the user drags the mouse, and its position is determined as the target point.

[0083] In a possible implementation, after obtaining the coordinate point of the user's mouse position, the original points of the curve are traversed, and the points whose coordinates are closest to the coordinate point of the mouse position and located on both sides of the coordinate point are found. The data points whose coordinates are smaller than the coordinate point of the mouse position are taken as the front points; and the data points whose coordinates are larger than the coordinate point of the mouse position are taken as the back points. In this embodiment, the original point refers to the point corresponding to the original data used to generate the curve. Since this type of point relies on the original data and has the meaning of being marked in the curve, in this embodiment, it is preferred to place the marked point on the original point. Of course, it can also be placed at other positions of the curve, and the embodiment of the present invention does not limit this. After determining the front point and the rear point, use Euclidean distance or other distance measurement methods to calculate the distance between the mouse position coordinate point and the front point; then calculate the distance between the mouse position coordinate point and the rear point; compare the distance between the mouse position coordinate point and the front point with the distance between the mouse position coordinate point and the rear point. If the distance between the mouse position coordinate point and the front point is less than the distance between the mouse position coordinate point and the rear point, set the target point to the position of the front point; if the distance between the mouse position coordinate point and the front point is greater than the distance between the mouse position coordinate point and the rear point, set the target point to the position of the rear point.

[0084] When calculating coordinate points, you can choose to refer to the horizontal axis coordinate, the vertical axis coordinate, or consider the horizontal and vertical axis coordinates comprehensively. Specifically, you can choose based on the pixel value occupied by the horizontal or vertical coordinates in the current canvas area. If the pixel value occupied by the horizontal axis is greater than the pixel value occupied by the vertical axis, the calculation is based on the horizontal axis. If the pixel value occupied by the horizontal axis is less than the pixel value occupied by the vertical axis, the calculation is based on the vertical axis. If the pixel value occupied by the horizontal axis is equivalent to the pixel value occupied by the vertical axis, the horizontal and vertical axis coordinates are considered comprehensively.

[0085] In one embodiment, the mouse position after the movement is obtained according to the mouse movement event of Qt and converted into a coordinate point (i.e., a local coordinate system point), recorded as point a, and then the curve data points are traversed, and the horizontal coordinate of point a is compared to find the previous point b and the following point c in the original point, and the coordinate distance L between the two points a and b is calculated. ab The coordinate distance between points ac and L ac , if L ab Less than L ac , then the final confirmation point of the mark movement is point b. If L ab Greater than L ac The final confirmation point of the annotation movement is point c, the annotation point is set to the final confirmation point coordinate information, and the annotation text is updated to the horizontal and vertical coordinate information of the final annotation point.

[0086] S102: Move the marking point to the target point, and obtain the moving distance of the moving marking point.

[0087] In specific implementation, the annotation point is moved to the target point, and then the straight-line distance between the target point and the annotation point before the movement is calculated. The moving distance is used to move the corresponding annotation text box on the annotation point in the subsequent steps.

[0088] S103 : Determine the distance that the annotation text box moves in the direction in which the annotation point moves based on the moving distance and the shortest distance that the annotation text box overlaps with the curve in the direction in which the annotation point moves.

[0089] In specific implementation, the annotation text box can be of any shape, such as a circle or a square, and this is not limited in the embodiment of the present invention.

[0090] In one embodiment, after the annotation point is moved, the annotation text, the connecting dotted line between the annotation point and the annotation text will also be translated as a whole (according to the horizontal axis distance moved by the annotation point). The principle of the annotation text is to try not to block the curve. For example, if the annotation point is moved 5px to the left, the annotation information text box will also be translated 5px to the left, but at this time the annotation text box will block the curve. If it is only moved 3px, it will not, so the annotation text information will only move 3px.

[0091] Specifically, assuming that the annotation text box is a rectangular box, and the curve is represented by a series of data points or equations, the distance between the edge of the text box and the curve can be calculated and recorded as the shortest distance. This can be done by the following steps: Calculate the distance between the four sides (top, bottom, left, and right) of the text box and the curve. For each side, find the point closest to the side in the curve, that is, the first target point, and calculate the distance between the point and the side in the direction of the annotation point. For multiple points on the curve, the Euclidean distance or other minimum distance calculation methods can be used to select the shortest distance as the minimum overlap distance between the text box and the curve in the direction of the annotation point movement, that is, the shortest distance. If the moving distance is less than the shortest distance, the distance moved by the annotation text box is the moving distance; if the moving distance is greater than the shortest distance, the distance moved by the annotation text box is the shortest distance.

[0092] In one embodiment, if the marked point is moved horizontally, the distance L of the marked point after the marked point is moved is calculated. X If the annotation point is moving to the left, then on the vertical axis of the data coordinate point of the curve area on the left side of the annotation text box, select the point between the upper left point and the lower left point of the annotation text box, from right to left, find the first point on the left side and convert it to the distance L from the left side of the text box Max ; If there is no coincidence point, L Max is the distance from the text box to the left side of the canvas area. If L X Less than L Max , then the label text box moves L X Distance; if L X Greater than L Max, then the label text box moves L Max distance.

[0093] Similarly, if the annotation point is moving to the right, select the point between the upper right point and the lower right point of the annotation text box on the vertical axis of the curve area data coordinate point on the right side of the annotation text box, from left to right, find the first point on the right side and convert it to the distance L from the right side of the text box RMax , if there is no coincidence point L RMax is the distance from the text box to the right side of the canvas area. If L X Less than L RMax , then the label text box moves L X Distance; if L X Greater than L RMax , then the label text box moves L RMax distance.

[0094] S104, moving the annotation text box according to the distance the annotation text box moves in the direction of movement of the annotation point.

[0095] During specific implementation, the annotation text box is moved in the direction of movement of the annotation point according to the distance of movement of the annotation text box calculated above.

[0096] In this step, after moving the annotation text box, you can also draw an annotation box connecting line between the moved annotation text box and the moved annotation point (i.e., the first target point). The annotation box connecting line can be a solid line or a dotted line. The dotted line is used as an example for explanation below.

[0097] In one embodiment, the dotted line connecting the annotation point and the annotation text box can be drawn by calculating the shortest path between the annotation point and the text box. Based on the above minimum distance calculation, we can draw the dotted line from the annotation point to the nearest edge of the text box. Use a dotted line style to connect the annotation point and the text box to clearly distinguish between the conventional solid line connection and the connection of the annotation box. The dotted line is usually composed of short dashes, and the length and spacing of the dashes can be set as needed.

[0098] This embodiment provides a method for moving annotation information, first determining the target point corresponding to the moving operation on the curve, then moving the annotation point to the target point, and obtaining the moving distance of the moving annotation point, and based on the moving distance and the shortest distance that the annotation text box coincides with the curve in the moving direction of the annotation point, determining the distance that the annotation text box moves in the moving direction of the annotation point, and finally moving the annotation text box according to the distance that the annotation text box moves in the moving direction of the annotation point. Users can adjust the position of the annotation text box at any time according to needs, so that the annotation result is more in line with the actual situation. Flexible movement methods can help users better adjust the relationship between the annotation and the target object, ensure that the annotation information does not interfere with the main content of the graphics, and improve the readability of the graphics and text. At the same time, since the annotation point is limited to be adjusted only near the original point, it helps to maintain the accuracy and consistency of the annotation and avoid the annotation information being out of touch with the original curve or data.

[0099] In this embodiment, the annotation point may not be moved, and the annotation text box may be moved alone, such as Figure 2 FIG. 1 is a flow chart of another method for moving annotation information provided by an embodiment of the present invention, which specifically includes:

[0100] S201 : In response to a user's moving operation on a marked text box, determine a target position of the marked text box.

[0101] In specific implementation, after the user moves the annotation text box, the target position of the annotation text box is determined according to the mouse position coordinate point to which the user drags the mouse. In specific determination, the calculation method is the same as step S103, firstly, the moving distance of the annotation text box is determined according to the user's moving operation, and then the distance between the edge of the text box and the curve is calculated and recorded as the shortest distance. If the moving distance of the annotation text box is less than the shortest distance, the moving distance of the annotation text box is the moving distance; if the moving distance of the annotation text box is greater than the shortest distance, the moving distance of the annotation text box is the shortest distance.

[0102] S202: Move the annotation text box to the target box position, and determine a second target point with the shortest distance from the annotation point on the moved annotation text box.

[0103] In specific implementation, the annotation text box is moved according to the calculated moving distance of the annotation text box, and the second target point is determined in a similar manner to the calculation in step S103.

[0104] S203: Draw a labeling box connecting line between the second target point and the labeling point.

[0105] During specific implementation, a labeling frame connecting line is drawn between the second target point and the labeling point. The labeling frame connecting line may be a solid line or a dashed line. The dashed line is taken as an example for description below.

[0106] In one embodiment, the dotted line connecting the annotation point and the annotation text box can be drawn by calculating the shortest path between the annotation point and the text box. Based on the above minimum distance calculation, we can draw the dotted line from the annotation point to the nearest edge of the text box. Use a dotted line style to connect the annotation point and the text box to clearly distinguish between the conventional solid line connection and the connection of the annotation box. The dotted line is usually composed of short dashes, and the length and spacing of the dashes can be set as needed.

[0107] In this embodiment, a method for moving annotation information is provided. Figure 3 This is a specific flow chart of a method for moving annotation information provided by an embodiment of the present invention, which specifically includes:

[0108] S301, obtaining a user's mouse operation instruction.

[0109] Specifically, it checks whether the current user has pressed the mouse. If not, no processing is performed.

[0110] S302: Determine whether a marking text box or a marking point is currently selected.

[0111] Specifically, Figure 4 , Figure 5 , Figure 6 , Figure 7 As shown, when the annotation signal tagEnable is TRUE, it means that it has been selected; if there is a signal, it means that the annotation text box or annotation point can be moved at present. At this time, the flag status is set. The flag status bit includes the untriggered state, the annotation state and the completed state, which are used to distinguish the annotation operations of the mouse movement event and the mouse release event. When the mouse has currently selected the annotation text, the flag status bit is set to the annotation state. Correspondingly, when the mouse has not selected the annotation text box or the annotation point, the flag status bit is set to the untriggered state. After the annotation text box is moved, the flag status bit is set to the uncompleted state. Since the canvas itself is dragged, in order to ensure the visual effect and prevent the annotation and the canvas from moving together, it is necessary to set the canvas to be non-draggable when the flag status bit is the annotation state. In this step, the current mouse style can be further set to achieve better results; after setting the flag bit, the continuous refresh function of the annotation position is completed in the overloaded mouse movement event.

[0112] S303. Based on the coordinates of the curve background canvas area, limit the movable distance of the annotation text box.

[0113] Specifically, the effective position point of the annotation is calculated according to the coordinates and width and height of the canvas area to ensure that the annotation does not exceed the border of the canvas area during the movement process, resulting in incomplete display of the content.

[0114] S304: When moving the marked point, determine the target point position.

[0115] S305, calculating the shortest distance between the annotation text box and the curve in the moving direction of the annotation point.

[0116] S306: Move the annotation text box according to the distance the annotation text box moves in the direction in which the annotation point moves.

[0117] This embodiment provides a method for moving annotation information, first determining the target point corresponding to the moving operation on the curve, then moving the annotation point to the target point, and obtaining the moving distance of the moving annotation point, and based on the moving distance and the shortest distance at which the annotation text box overlaps with the curve, determining the moving distance of the annotation text box, and finally moving the annotation text box according to the moving distance of the annotation text box. Users can adjust the position of the annotation text box at any time according to their needs, so that the annotation result is more in line with the actual situation. The flexible moving method can help users better adjust the relationship between the annotation and the target object, ensure that the annotation information does not interfere with the main content of the graphics, and improve the readability of the graphics and text.

[0118] Exemplary Devices

[0119] In an exemplary embodiment of the present specification, a label information mobile device 800 is also provided. Figure 8 As shown, including:

[0120] The first determining unit 801 is used to determine a target point position corresponding to the moving operation on the curve in response to the user's moving operation on the marked point;

[0121] The moving unit 802 is used to move the annotation point to the target point and obtain the moving distance of the moving annotation point, wherein the annotation point is the intersection of the annotation box connecting line and the curve, the annotation box connecting line is the line segment connecting the curve and the annotation text box, and the annotation text box is used to add text information of the annotation curve;

[0122] A second determining unit 803 is used to determine the distance that the annotation text box moves in the direction of movement of the annotation point based on the moving distance and the shortest distance that the annotation text box coincides with the curve in the direction of movement of the annotation point, wherein the distance that the annotation text box moves in the direction of movement of the annotation point is less than the shortest distance;

[0123] The processing unit 804 is configured to move the annotation text box according to the distance the annotation text box moves in the direction in which the annotation point moves.

[0124] In one implementation, the second determining unit 803 is specifically configured to:

[0125] Compare the moving distance and the shortest distance between the marked text box and the curve in the moving direction of the marked point;

[0126] If the moving distance is less than the shortest distance, the distance that the annotation text box moves in the direction of the annotation point is the moving distance; if the moving distance is greater than the shortest distance, the distance that the annotation text box moves in the direction of the annotation point is the shortest distance.

[0127] In one implementation, the first determining unit 801 is specifically configured to:

[0128] Get the mouse position coordinates after the move operation;

[0129] Compare the coordinates of the points on the curve, and determine the front and back points of the mouse position coordinate point in the original point, where the original point is the data point used to generate the curve;

[0130] If the distance between the mouse position coordinate point and the front point is less than the distance between the mouse position coordinate point and the rear point, the target point is determined to be the front point; if the distance between the mouse position coordinate point and the front point is greater than the distance between the mouse position coordinate point and the rear point, the target point is determined to be the rear point.

[0131] In one implementation, the processing unit 804 is further configured to:

[0132] Determine the first target point with the shortest distance from the moved annotation point in the annotation text box;

[0133] Draw a label box connecting line between the first target point and the moved label point.

[0134] In one embodiment, the first confirmation unit 801 yuan is also used for:

[0135] In response to a user's moving operation on the annotation text box, determining a target frame position of the annotation text box;

[0136] The processing unit is also used to:

[0137] Move the annotation text box to the target frame position, and determine the second target point with the shortest distance from the annotation point on the moved annotation text box;

[0138] Draw a label box connecting line between the second target point and the label point.

[0139] In one implementation, the first determining unit 801 is further configured to:

[0140] When the flag state bit is in the marking state, the curve background canvas is set to a non-draggable state, wherein the flag state bit includes an untriggered state, a marking state, and a completed state, which are used to distinguish the marking operations of the mouse moving event and the mouse releasing event.

[0141] In one implementation, the first determining unit 801 is further configured to:

[0142] When the user does not select the annotation text box or the annotation point by operating the mouse, the flag state bit is determined to be in the untriggered state;

[0143] When the user operates the mouse to select the annotation text box or the annotation point, the flag state is determined to be in the annotation state;

[0144] After the movement of the annotation text box is completed, the flag status bit is determined to be in the completed state.

[0145] The annotation information moving device provided in this embodiment belongs to the same application concept as the annotation information moving method provided in the above embodiments of this application, and can execute the annotation information moving method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the annotation information moving method. For technical details not fully described in this embodiment, please refer to the specific processing content of the annotation information moving method provided in the above embodiments of this application, and will not be repeated here.

[0146] Exemplary Devices

[0147] In an exemplary embodiment of the present specification, an electronic device is also provided, such as Fig. 9 As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 communicate with each other through the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute the annotation information moving method, which includes:

[0148] In response to a user's movement operation on the marked point, determining a target point position corresponding to the movement operation on the curve;

[0149] Move the annotation point to the target point, and obtain the moving distance of the annotation point, wherein the annotation point is the intersection of the annotation box connecting line and the curve, and the annotation box connecting line is a line segment connecting the curve and the annotation text box;

[0150] Based on the moving distance and the shortest distance between the annotation text box and the curve in the moving direction of the annotation point, determine the distance that the annotation text box moves in the moving direction of the annotation point, wherein the distance that the annotation text box moves in the moving direction of the annotation point is less than the shortest distance;

[0151] The annotation text box is moved according to the distance the annotation text box moves in the direction of movement of the annotation point.

[0152] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0153] Exemplary computer program products and storage media

[0154] In addition to the above-mentioned methods and devices, the vehicle air-conditioning control method provided in the embodiments of this specification may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the annotation information moving method according to various embodiments of this specification described in the above "Exemplary Method" section of this specification.

[0155] The computer program product can be written in any combination of one or more programming languages ​​to write program codes for executing the operations of the embodiments of this specification, and the programming languages ​​include object-oriented programming languages, such as Java, C++, etc., and also include conventional procedural programming languages, such as "C" language or similar programming languages.

[0156] In addition, an embodiment of the present specification also provides a computer-readable storage medium on which a computer program is stored, and the computer program is executed by a processor to execute the steps of the annotation information moving method according to various embodiments of the present specification described in the above "Exemplary Method" section of the present specification.

[0157] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this specification can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0158] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0159] The above-mentioned embodiments only express several implementation methods of this specification, and the descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the solutions provided by the embodiments of this specification. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of this specification, which all belong to the protection scope of this specification. Therefore, the protection scope of the patent of this specification shall be based on the attached claims.

Claims

1. A method for moving annotation information, characterized in that: include: In response to a user's movement operation on the marked point, determining a target point position corresponding to the movement operation on the curve; Move the annotation point to the target point, and obtain the moving distance of the annotation point, wherein the annotation point is the intersection of the annotation box connecting line and the curve, and the annotation box connecting line is a line segment connecting the curve and the annotation text box; Based on the moving distance and the shortest distance between the annotation text box and the curve in the moving direction of the annotation point, determine the distance that the annotation text box moves in the moving direction of the annotation point, wherein the distance that the annotation text box moves in the moving direction of the annotation point is less than the shortest distance; The annotation text box is moved according to the distance the annotation text box moves in the direction of movement of the annotation point.

2. The method according to claim 1, characterized in that The determining, based on the moving distance and the shortest distance between the annotation text box and the curve in the moving direction of the annotation point, a moving distance of the annotation text box in the moving direction of the annotation point includes: Compare the moving distance and the shortest distance between the annotation text box and the curve in the moving direction of the annotation point; If the moving distance is less than the shortest distance, the distance that the annotation text box moves in the direction of movement of the annotation point is the moving distance; if the moving distance is greater than the shortest distance, the distance that the annotation text box moves in the direction of movement of the annotation point is the shortest distance.

3. The method according to claim 1, characterized in that Determining a target point corresponding to the moving operation on the curve includes: Get the mouse position coordinates after the move operation; Comparing the coordinates of the points on the curve, determining the front point and the rear point of the mouse position coordinate point in the original point, wherein the original point is the data point used to generate the curve; If the distance between the mouse position coordinate point and the front point is less than the distance between the mouse position coordinate point and the rear point, the target point is determined to be the front point; if the distance between the mouse position coordinate point and the front point is greater than the distance between the mouse position coordinate point and the rear point, the target point is determined to be the rear point.

4. The method according to claim 1, characterized in that: After moving the annotation text box according to the distance the annotation text box is moved, the method further includes: Determine, on the annotation text box, a first target point that has the shortest distance from the moved annotation point; A labeling box connecting line is drawn between the first target point and the moved labeling point.

5. The method according to claim 1, characterized in that The method further comprises: In response to the user's moving operation on the annotation text box, determining a target frame position of the annotation text box; Move the annotation text box to the target frame position, and determine a second target point with the shortest distance from the annotation point on the moved annotation text box; A label box connecting line is drawn between the second target point and the label point.

6. The method according to claim 1, characterized in that Before responding to the user's operation of moving the annotation point, the method further includes: When the flag state bit is in the marking state, the curve background canvas is set to a non-draggable state, wherein the flag state bit includes an untriggered state, a marking state, and a completed state, and is used to distinguish the marking operations of the mouse moving event and the mouse releasing event.

7. The method according to claim 6, characterized in that The method further comprises: When the user does not select the annotation text box or the annotation point by operating the mouse, determining that the flag state bit is in the untriggered state; When the user operates the mouse to select the annotation text box or the annotation point, determining that the flag state bit is the annotation state; After the movement of the annotation text box is completed, the flag status bit is determined to be the completion status.

8. A device for moving annotation information, characterized in that: include: A first determining unit, configured to determine a target point position corresponding to the moving operation on the curve in response to a user's moving operation on the marked point; A moving unit, used to move the annotation point to the target point and obtain a moving distance of the annotation point, wherein the annotation point is an intersection of a annotation box connecting line and the curve, the annotation box connecting line is a line segment connecting the curve and an annotation text box, and the annotation text box is used to add text information to annotate the curve; A second determining unit is used to determine the distance that the annotation text box moves in the direction of movement of the annotation point based on the moving distance and the shortest distance that the annotation text box overlaps with the curve in the direction of movement of the annotation point, wherein the distance that the annotation text box moves in the direction of movement of the annotation point is less than the shortest distance; The processing unit is used to move the annotation text box according to the distance that the annotation text box moves in the direction of movement of the annotation point.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the annotation information moving method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the annotation information moving method according to any one of claims 1 to 7.