Methods and systems for adjusting the position of nodes in a mind map, and computer equipment.
By constructing an edge box in the mind map and calculating the distance, and moving the second node to avoid occlusion, the problem of node overlap is solved, enabling rapid adjustment of node positions and achieving non-overlapping operation.
Patent Information
- Application Number
- CN202211648408.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2042-12-21
AI Technical Summary
Nodes in mind maps are prone to overlapping or obscuring each other, especially when users perform actions such as creating new nodes or expanding/hiding child nodes. Existing technologies struggle to quickly and effectively adjust node positions to avoid obscuring.
By constructing a first edgebox and a second edgebox, calculating the distance between them, and moving the second node when the distance is negative, the node is avoided from occluding itself.
Quickly correct any occlusion or overlap between nodes, ensuring that nodes do not overlap after position adjustment and are as close to their original positions as possible.
Smart Images

Figure CN115951803B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method and system for adjusting the position of nodes in a mind map, as well as a computer device. Background Technology
[0002] Mind maps, also known as brain maps, tree diagrams, branch diagrams, or mind maps, are visual aids for thinking. In mind maps or other types of diagram applications, because nodes can be placed arbitrarily, overlapping between nodes is easily possible. Furthermore, user-created nodes, or interactive operations such as collapsing or expanding nodes, can change the previously fixed relative positions of nodes, causing them to overlap or obscure each other.
[0003] Therefore, the overlap or occlusion between nodes is a problem that urgently needs to be solved. Summary of the Invention
[0004] In view of this, it is necessary to provide a method, system, and computer equipment for adjusting the position of mind map nodes, which can quickly adjust the occlusion of nodes in a mind map.
[0005] In a first aspect, embodiments of this application provide a method for adjusting the position of mind map nodes, the method comprising:
[0006] In response to user actions, the mind map displays hidden child nodes of existing nodes or creates new nodes based on existing nodes. The existing nodes or the existing nodes and the new nodes include first nodes and second nodes. The mind map also includes preset anchor points.
[0007] A first bounding box and a second bounding box are constructed for the first node and the second node, respectively. The first node includes an adjustment label, and the second node is the node among the remaining nodes that is closest to the preset anchor point. The remaining nodes are the nodes among the existing nodes excluding the first node, or the remaining nodes are the nodes among the existing nodes and the new nodes excluding the first node.
[0008] Calculate the first distance between the first edgebox and the second edgebox; and
[0009] When the first distance is negative, move the second node according to the first distance.
[0010] Secondly, embodiments of this application provide a computer device, the computer device comprising:
[0011] Memory, used to store program instructions; and
[0012] A processor is used to execute the program instructions to implement the method for adjusting the position of mind map nodes as described above.
[0013] Thirdly, embodiments of this application provide a mind map node position adjustment system, the mind map node position adjustment system comprising:
[0014] The node module is used to respond to user operations, display hidden child nodes of existing nodes in the mind map or create new nodes based on existing nodes. The existing nodes or the existing nodes and the new nodes include first nodes and second nodes. The mind map also includes preset anchor points.
[0015] A construction module is used to construct a first bounding box and a second bounding box for the first node and the second node, respectively. The first node includes an adjustment label, and the second node is the node among the remaining nodes that is closest to the preset anchor point. The remaining nodes are the nodes among the existing nodes excluding the first node, or the remaining nodes are the nodes among the existing nodes and the new nodes excluding the first node.
[0016] The calculation module is used to calculate the first distance between the first edgebox and the second edgebox; and
[0017] An execution module is used to move the second node according to the first distance when the first distance is negative.
[0018] The aforementioned method, system, and computer equipment for adjusting the position of mind map nodes construct a first bounding box for all unobstructed first nodes and a second bounding box for the second node closest to a preset anchor point. When the first and second bounding boxes intersect, the second node is moved according to a first distance between them to prevent it from obscuring the first node. By adjusting the position of some nodes in the mind map, moving them a small distance quickly corrects occlusion or overlap between nodes. When a user creates a new node or interacts with nodes in the mind map (i.e., expands or hides child nodes), the method can detect occlusion between all nodes and prevent it by finely adjusting the position of the second node. The algorithm quickly corrects the position of some nodes to ensure that no two nodes overlap and that nodes are as close to their original positions as possible. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating a method for adjusting the position of mind map nodes provided in an embodiment of this application.
[0021] Figure 2 The first sub-flowchart of the method for adjusting the position of mind map nodes provided in the embodiments of this application.
[0022] Figure 3 The second sub-flowchart of the method for adjusting the position of mind map nodes provided in the embodiments of this application.
[0023] Figure 4 The third sub-flowchart of the method for adjusting the position of mind map nodes provided in the embodiments of this application.
[0024] Figure 5 The fourth sub-flowchart of the method for adjusting the position of mind map nodes provided in the embodiments of this application.
[0025] Figure 6 The fifth sub-flowchart of the method for adjusting the position of mind map nodes provided in the embodiments of this application.
[0026] Figure 7 The sixth sub-flowchart of the method for adjusting the position of mind map nodes provided in the embodiments of this application.
[0027] Figure 8 The seventh sub-flowchart of the method for adjusting the position of mind map nodes provided in the embodiments of this application.
[0028] Figure 9 This is a schematic diagram illustrating an application scenario of the method for adjusting the position of mind map nodes provided in this embodiment.
[0029] Figure 10 for Figure 9 The diagram shown is a schematic of the second node of the mind map.
[0030] Figure 11 for Figure 10 A schematic diagram of the second upper part of the second edge box of the second node shown.
[0031] Figure 12 for Figure 4 The diagram shows the movement of the second upper part.
[0032] Figure 13 for Figure 4 The diagram shown illustrates the alignment of the second upper part with the first lower part.
[0033] Figure 14 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application.
[0034] Figure 15 This is a schematic diagram of the internal structure of the mind map node position adjustment system provided in the embodiments of this application.
[0035] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0037] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar planned objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data are interchangeable where appropriate; in other words, the described embodiments are implemented according to a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, may also include other content; 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.
[0038] It should be noted that the use of terms such as "first" and "second" in this application is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" and "second" may explicitly or implicitly include one or more of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0039] Please refer to the following: Figure 1 and Figure 9 , Figure 1 A flowchart illustrating a method for adjusting the position of mind map nodes provided in an embodiment of this application. Figure 9 This diagram illustrates an application scenario of the mind map node position adjustment method provided in this embodiment. The mind map node position adjustment method is applied to mind maps or flowcharts and other graph applications to correct occlusion or overlap between nodes.
[0040] by Figure 9 Taking the application scenario shown as an example, the adjustment platform 30 is used to execute the method of adjusting the position of mind map nodes. The relevant functions of the adjustment platform 30 can be implemented by a single device, multiple devices working together, or one or more functional modules within a single device; no specific limitations are made here. It is understood that the above functions can be network elements in hardware devices, software functions running on dedicated hardware, a combination of hardware and software, or virtualization functions instantiated on a platform (e.g., a cloud platform).
[0041] The specific steps for adjusting the position of nodes in a mind map are as follows.
[0042] Step S102: In response to the user's operation, display the hidden child nodes of existing nodes in the mind map or create new nodes based on existing nodes.
[0043] Users can view and interact with nodes in the mind map by adjusting platform 30. The mind map includes several existing nodes, which may include the main body and hidden child nodes, or the main body and displayed child nodes, or only the main body. In this embodiment, hidden child nodes are child nodes of the existing node that are not yet visible, and displayed child nodes are child nodes of the existing node that are already visible. During node adjustment, both hidden and displayed child nodes move relative to the corresponding main body. That is, when a node needs to be moved or adjusted, the main body and either hidden or displayed child nodes of the existing node will move together as a whole.
[0044] Platform 30 responds to user actions by expanding hidden child nodes of existing nodes in the mind map, turning them into visible child nodes. However, showing hidden child nodes may obscure already visible nodes. Platform 30 also responds to user actions by creating new nodes in the mind map, but these new nodes may also obscure existing nodes. Therefore, after responding to user actions, adjustments need to be made to the obscured nodes in the mind map.
[0045] In this embodiment, existing nodes include a first node and a second node, or existing nodes and new nodes include both a first node and a second node. That is, all nodes in the mind map include both a first node and a second node. When a user creates a new node, all nodes in the mind map include both existing nodes and the new node.
[0046] The mind map also includes preset anchor points. In this embodiment, the preset anchor point is a pre-defined fixed point, such as the root node of the mind map. It is understood that the root node is a fixed node in the mind map. Preferably, the root node of the mind map is used as the preset anchor point. Furthermore, a point of the root node, such as the center point, can be used as the preset anchor point. In some feasible embodiments, the preset anchor point can be the centroid or geometric center of all existing nodes in the mind map, a preset point in the mind map, or the midpoint of the visible window; no limitation is made here.
[0047] Step S104: Construct a first edgebox and a second edgebox for the first node and the second node, respectively.
[0048] The adjustment platform 30 constructs a first edgebox along the edge of the first node and a second edgebox along the edge of the second node. In this embodiment, the first node includes an adjustment label, indicating that the existing node is not covered by other existing nodes and does not require adjustment. The second node is the node among the remaining nodes that is closest to the preset anchor point. The remaining nodes are either the existing nodes excluding the first node, or the remaining nodes are either the existing nodes or new nodes excluding the first node. It can be understood that the remaining nodes are all the existing nodes remaining after removing the first node from the mind map. The first node includes at least one existing node, and the second node includes only one existing node. That is, the number of first nodes is at least one, and the number of second nodes is one. At least one first node corresponds to one first edgebox, and one second node corresponds to one second edgebox. That is, regardless of the number of first nodes, all first nodes construct only one first edgebox.
[0049] In this embodiment, the first edge box and the second edge box can be referred to as HVLineSegmentBox, or simply HVB.
[0050] The specific process of constructing the first edgebox and the second edgebox for the first node and the second node respectively will be described in detail below.
[0051] Step S106: Calculate the first distance between the first edge box and the second edge box.
[0052] Adjust platform 30 to calculate the distance between the first edge box and the second edge box as the first distance.
[0053] The specific process for calculating the first distance between the first and second edge boxes will be described in detail below.
[0054] Step S108: When the first distance is negative, move the second node according to the first distance.
[0055] When the first distance is negative, it indicates that the first and second bounding boxes intersect. That is, the first and second nodes overlap or overlap. The adjustment platform 30 moves the second node according to the first distance. After the second node has been moved, the adjustment platform 30 adds an adjustment label to the second node, converting the second node into a first node. The specific process of moving the second node according to the first distance will be described in detail below.
[0056] When the first distance is positive, it indicates that the first and second bounding boxes are separate; when the first distance is exactly zero, it indicates that the first and second bounding boxes are adjacent. Whether the first and second bounding boxes are separate or adjacent, there is no need to move the second node. The adjustment platform 30 directly adds an adjustment label to the second node, converting it into the first node.
[0057] After converting the second node into the first node, the adjustment platform 30 selects the existing node closest to the preset anchor point from the remaining nodes as the new second node and constructs a new second bounding box for the new second node. This process of adjusting and moving all second nodes sequentially ensures that no node in the mind map is obscured. Understandably, the adjustment platform 30 calculates the distance between all remaining nodes and the preset anchor point, sorts the remaining nodes according to the distance, and sequentially selects the existing node closest to the preset anchor point as the second node, processing the existing nodes closer to the preset anchor point first, and then processing the existing nodes farther away one by one.
[0058] In this embodiment, the spatial complexity of the spatial movement process is O(N), and the time complexity is O(NLogN). Here, N represents the total number of existing nodes or existing nodes and new nodes in the mind map.
[0059] In the above embodiments, a first bounding box is constructed for all un-covered first nodes, and a second bounding box is constructed for the second node closest to a preset anchor point. When the first and second bounding boxes intersect, the second node is moved according to a first distance between the first and second bounding boxes to prevent the second node from covering the first node. By adjusting the position of some nodes in the mind map, moving the nodes by a small distance, the occlusion or overlap between nodes is quickly corrected. When a user creates a new node or interacts with nodes in the mind map (i.e., expands or hides child nodes), the method for adjusting the position of mind map nodes can detect all occlusions between nodes and prevent occlusion between nodes by finely adjusting the position of the second node. The algorithm quickly corrects the position of some nodes so that no two nodes overlap and the nodes are as close to their original positions as possible.
[0060] Please refer to the following: Figure 2 This is the first sub-flowchart of the method for adjusting the position of mind map nodes provided in this application embodiment. Before executing step S104, the method for adjusting the position of mind map nodes further includes the following steps.
[0061] Step S202: Calculate the second distance between each existing node and the preset anchor point.
[0062] The platform 30 calculates the distance between each existing node and the preset anchor point as the second distance. It can be understood that each existing node corresponds to a second distance.
[0063] Step S204: Add adjustment labels to the existing node corresponding to the smallest second distance in the second distance, so that the existing node becomes the first node.
[0064] The adjustment platform 30 selects the existing node with the smallest second distance from all existing nodes based on the second distance value, and adds an adjustment label to this existing node, making it the first node. It's understandable that among all nodes in the mind map, the existing node closest to the preset anchor point is considered by default to be the node that does not need adjustment.
[0065] In the above embodiments, the existing node corresponding to the smallest second distance is taken as the first node, that is, the existing node closest to the preset anchor point is taken as the first node, which can minimize the movement of existing nodes near the preset anchor point.
[0066] Please refer to the following: Figure 3 This is the second sub-flowchart of the method for adjusting the position of mind map nodes provided in the embodiments of this application. Step S104 specifically includes the following steps.
[0067] Step S302: Draw several first vertical lines and several second vertical lines along the direction parallel to the first straight line Y, respectively, for the first node and the second node.
[0068] The adjustment platform 30 draws several first vertical lines for the first node along a direction parallel to the first straight line Y, and several second vertical lines for the second node. Specifically, the adjustment platform 30 draws first vertical lines along the edge of the first node and second vertical lines along the edge of the second node. It can be understood that the first and second vertical lines are parallel. The several first vertical lines include a first left vertical line and a first right vertical line. The several second vertical lines include a second left vertical line and a second right vertical line. That is, the first vertical line to the left of the first node is the first left vertical line, and the first vertical line to the right of the first node is the first right vertical line; the second vertical line to the left of the second node is the second left vertical line, and the second vertical line to the right of the second node is the second right vertical line.
[0069] In this embodiment, the first straight line Y is parallel to the vertical direction of the mind map.
[0070] Step S304: Draw several first horizontal lines and several second horizontal lines along the direction parallel to the second straight line X, respectively, for the first node and the second node.
[0071] The adjustment platform 30 draws several first horizontal lines for the first node and several second horizontal lines for the second node along a direction parallel to the second straight line X. Specifically, the adjustment platform 30 draws first horizontal lines at the edges of the first node and second horizontal lines at the edges of the second node along a direction parallel to the second straight line X. It can be understood that the first and second horizontal lines are parallel. The several first horizontal lines include a first upper horizontal line and a first lower horizontal line. The several second horizontal lines include a second upper horizontal line and a second lower horizontal line. That is, the first horizontal line above the first node is the first upper horizontal line, and the first horizontal line below the first node is the first lower horizontal line; the second horizontal line above the second node is the second upper horizontal line, and the second horizontal line below the second node is the second lower horizontal line.
[0072] In this embodiment, the second straight line X is parallel to the horizontal direction of the mind map. It can be understood that the second straight line X is perpendicular to the first straight line Y.
[0073] Step S306: Connect the first vertical line and the first horizontal line to form a first edge frame.
[0074] The adjustment platform 30 connects the first vertical line and the first horizontal line to form a first edge frame. Specifically, the adjustment platform 30 can sequentially connect the first left vertical line, the first lower horizontal line, the first right vertical line, and the first upper horizontal line to form a closed first edge frame. That is, the first edge frame is composed of alternating first left vertical lines, first upper horizontal lines, first right vertical lines, and first lower horizontal lines. If the first node includes displayed or hidden child nodes, the first edge frame will surround the displayed or hidden child nodes. In some feasible embodiments, the order in which the adjustment platform 30 connects the first vertical line and the first horizontal line is not limited to this, and is not restricted here.
[0075] Step S308: Connect the second vertical line and the second horizontal line to form the second edge frame.
[0076] The adjustment platform 30 connects the second vertical line and the second horizontal line to form a second edge frame. Specifically, the adjustment platform can sequentially connect the second left vertical line, the second lower horizontal line, the second right vertical line, and the second upper horizontal line to form a closed second edge frame. That is, the second edge frame is composed of alternating second left vertical lines, second upper horizontal lines, second right vertical lines, and second lower horizontal lines. If the second node includes displayed or hidden child nodes, the second edge frame will surround the displayed or hidden child nodes. Figure 10 Taking the second node as an example, the second node includes a body and display child nodes, and a second border box surrounds the body and display child nodes. In some feasible embodiments, the order in which the platform 30 connects the second vertical line and the second horizontal line is not limited to this, and is not limited here.
[0077] Please refer to the following: Figure 4 This is the third sub-flowchart of the method for adjusting the position of mind map nodes provided in the embodiments of this application. Step S106 specifically includes the following steps.
[0078] Step S402: Divide the first edge box into several first parts.
[0079] The adjustment platform 30 divides the first edge frame into several first parts. Each first part includes several first vertical lines and several first horizontal lines. In this embodiment, the adjustment platform 30 can divide the first edge frame into four first parts. Specifically, all the first vertical lines and first horizontal lines located in the upper part of the first edge frame constitute the first upper part, all the first vertical lines and first horizontal lines located in the lower part of the first edge frame constitute the first lower part, all the first vertical lines and first horizontal lines located in the left part of the first edge frame constitute the first left part, and all the first vertical lines and first horizontal lines located in the right part of the first edge frame constitute the first right part.
[0080] Step S404: Divide the second edge box into several second parts.
[0081] The adjustment platform 30 divides the second edge box into several second parts. Each second part includes several second vertical lines and several second horizontal lines. In this embodiment, the adjustment platform 30 can divide the second edge box into four second parts. All the second vertical lines and second horizontal lines located at the upper part of the second edge box constitute the second upper part; all the second vertical lines and second horizontal lines located at the lower part of the second edge box constitute the second lower part; all the second vertical lines and second horizontal lines located at the left part of the second edge box constitute the second left part; and all the second vertical lines and second horizontal lines located at the right part of the second edge box constitute the second right part. Figure 10 Taking the second node as an example, the second upper part of the second edge box is as follows: Figure 11 As shown, the second upper part of the second edge box includes a second upper horizontal line, a second left vertical line, and a second upper horizontal line connected in sequence. Each of the first or second parts can be referred to as HVLineSegments, or simply HVL.
[0082] In this embodiment, each second part corresponds one-to-one with each first part. Specifically, the first upper part corresponds to the second lower part, the first lower part corresponds to the second upper part, the first left part corresponds to the second right part, and the first right part corresponds to the second left part.
[0083] Step S406: Calculate the distance the second part moves along the direction parallel to the first straight line Y or along the direction parallel to the second straight line X.
[0084] The platform 30 calculates the distance the second part moves along the direction parallel to the first straight line Y or the direction parallel to the second straight line X. Each movement ensures that the projections of the endpoint of the second part onto the corresponding endpoint of the first part on the first straight line Y or the second straight line X coincide.
[0085] In this embodiment, the second upper part and the second lower part can only move along a direction parallel to the second straight line X, and the second left part and the second right part can only move along a direction parallel to the first straight line Y. When the second upper part moves along a direction parallel to the second straight line X, the projections of the endpoints of the second upper part and the first lower part onto the second straight line X are successively coincided; when the second lower part moves along a direction parallel to the second straight line X, the projections of the endpoints of the second lower part and the first upper part onto the second straight line X are successively coincided; when the second left part moves along a direction parallel to the first straight line Y, the projections of the endpoints of the second left part and the first right part onto the first straight line Y are successively coincided; when the second right part moves along a direction parallel to the first straight line Y, the projections of the endpoints of the second right part and the first left part onto the first straight line Y are successively coincided.
[0086] In this embodiment, the first straight line Y includes opposite first and second directions, and the second straight line X includes opposite third and fourth directions. Specifically, the first direction is the direction that moves upwards, the second direction is the direction that moves downwards, the third direction is the direction that moves to the left, and the fourth direction is the direction that moves to the right. When the second upper and lower parts move along a direction parallel to the second straight line X, the second upper or lower part can only move along the third or fourth direction; when the second left and second right parts move along a direction parallel to the first straight line Y, the second left or second right part can only move along the first or second direction. That is, once each second part has selected a direction of movement, it cannot move in the opposite direction. Figure 12 As shown, the upper part is the first lower part, and the lower part is the second upper part. The second upper part moves in the fourth direction along the direction parallel to the second straight line X until the endpoints coincide.
[0087] In this embodiment, before calculating the movement distance of the second part along the direction parallel to the first straight line Y or the direction parallel to the second straight line X, the platform 30 is adjusted to align the second part with the first part. Specifically, the second upper part and the second lower part are moved along the direction parallel to the second straight line X so that the left endpoint of the second upper part or the second lower part is on the same straight line as the right endpoint of the first lower part or the first upper part, or the right endpoint of the second upper part or the second lower part is on the same straight line as the left endpoint of the first lower part or the first upper part; the second left part and the second right part are moved along the direction parallel to the first straight line Y so that the upper endpoint of the second left part or the second right part is on the same straight line as the lower endpoint of the first right part or the first left part, or the lower endpoint of the second left part or the second right part is on the same straight line as the upper endpoint of the first right part or the first left part. Figure 13 As shown, the upper part is the first lower part, and the lower part is the second upper part. The second upper part moves in the fourth direction along the direction parallel to the second straight line X until the right endpoint of the second upper part is on the same straight line as the left endpoint of the first lower part.
[0088] Step S408: When the projections of the endpoints of the second part and the corresponding endpoints of the first part onto the first straight line Y or the second straight line X coincide, calculate the projection distance between the projections of the endpoints of the second part and the corresponding endpoints of the first part onto the second straight line X or the first straight line Y.
[0089] When the projections of the endpoint of the second part and the corresponding endpoint of the first part onto the first straight line Y or the second straight line X coincide, the adjustment platform 30 calculates the projection distance between the projections of the endpoint of the second part and the corresponding endpoint of the first part onto the second straight line X or the first straight line Y.
[0090] In this embodiment, when the projections of the second upper endpoint and the first lower endpoint on the second straight line X coincide, the projection distance between the projections of the second upper endpoint and the first lower endpoint on the first straight line Y is calculated; when the projections of the second lower endpoint and the first upper endpoint on the second straight line X coincide, the projection distance between the projections of the second lower endpoint and the first upper endpoint on the first straight line Y is calculated; when the projections of the second left endpoint and the first right endpoint on the first straight line Y coincide, the projection distance between the projections of the second left endpoint and the first right endpoint on the second straight line X is calculated; when the projections of the second right endpoint and the first left endpoint on the first straight line Y coincide, the projection distance between the projections of the second right endpoint and the first left endpoint on the second straight line X is calculated.
[0091] In this embodiment, the adjustment platform 30 subtracts the projection of the second part's endpoint on the second straight line X or the first straight line Y from the projection of the first part's endpoint on the second straight line X or the first straight line Y to obtain the projection distance. Specifically, the adjustment platform 30 calculates the projection distance using the projections of the closest endpoints of the first and second parts on the second straight line X or the first straight line Y. The projection distance includes positive and negative values. A positive projection distance indicates that the first and second edge boxes do not intersect; a negative projection distance indicates that the first and second edge boxes intersect.
[0092] In some feasible implementations, the projection distance can be maintained using a min-heap, and only two projection distances are updated during each move.
[0093] Step S410: When the sum of the moving distance and the projected distance is the minimum, the moving distance and the projected distance are taken as the first distance.
[0094] In this embodiment, each time the second part moves, the adjustment platform 30 calculates the moving distance and the projected distance accordingly. Specifically, the absolute value of the negative projected distance is taken and combined with the moving distance to form a vector, generating a composite distance containing two directions. The projected distance can be represented as abs(min(0, projected distance)). The first distance is inserted into a sequence, and the composite distance with the minimum modulus is finally calculated as the movement progresses. When the sum of the moving distance and the projected distance is minimized, the adjustment platform 30 uses the moving distance and the projected distance as the first distance.
[0095] Please refer to the following: Figure 5 This is the fourth sub-flowchart of the method for adjusting the position of mind map nodes provided in the embodiments of this application. Step S406 specifically includes the following steps.
[0096] Step S502: Calculate the endpoint distance between the projection of the endpoint of the second part onto the first straight line Y or the second straight line X and the projection of the endpoint of the first part onto the first straight line Y or the second straight line X.
[0097] Adjust platform 30 to calculate the endpoint distance between the projections of the endpoints of the second part onto the first straight line Y or the second straight line X and the projections of the endpoints of the first part onto the first straight line Y or the second straight line X.
[0098] Step S504: Select the smallest endpoint distance from the endpoint distances in sequence according to the min-heap, and calculate the sum of all the smallest endpoint distances as the moving distance.
[0099] To quickly identify overlapping endpoints, platform 30 uses a min-heap data structure to maintain endpoint distances. Platform 30 sequentially selects the smallest endpoint distance from the pool of endpoint distances. Specifically, after two endpoints overlap, the endpoint distances corresponding to these two endpoints are removed from the min-heap, and the endpoint distances of the next endpoint are added back to the min-heap.
[0100] The specific steps for moving the second node according to the first distance are as follows: After calculating the first distance, the platform 30 is adjusted to move the second edge box according to the magnitude and direction of the moving distance and the magnitude and direction of the projection distance in the first distance, so that the first edge box and the second edge box do not intersect.
[0101] In the above embodiments, each movement of the second left vertical line generates a sub-horizontal distance, and each movement of the second top horizontal line generates a sub-vertical distance. By continuously generating sub-horizontal and sub-vertical distances, the minimum sub-horizontal and minimum sub-vertical distances can be obtained. The movable horizontal and vertical distances of the opposite portions of the first and second edge frames, i.e., the second left vertical line and the second top horizontal line of the second edge frame, are calculated. After moving according to the first distance, one endpoint of the first and second edge frames coincides.
[0102] Please refer to the following: Figure 6 and Figure 7 , Figure 6 This is the fifth sub-flowchart of the method for adjusting the position of mind map nodes provided in the embodiments of this application. Figure 7 This is the sixth sub-flowchart of the method for adjusting the position of mind map nodes provided in this application embodiment. After executing step S108, the method for adjusting the position of mind map nodes further includes the following steps.
[0103] Step S602: Add an adjustment label to the second node to transform the second node into the first node.
[0104] After moving the second node based on the first distance, the moved second node no longer overlaps or covers the first node. Accordingly, the adjustment platform 30 adds an adjustment tag to the moved second node to make it appear as the first node. It is understood that the adjustment tag also indicates that the existing node has been adjusted to be uncovered by other nodes and does not require further adjustment.
[0105] Step S604: Merge the first edge box and the second edge box to form a new first edge box.
[0106] The adjustment platform 30 merges the second edgebox into the first edgebox to form a new first edgebox. Specifically, this includes the following steps.
[0107] Step S702: Insert the second part into the first part to form a new first part.
[0108] The adjustment platform 30 inserts the second part into the first part to form a new first part. Specifically, the adjustment platform 30 inserts the second upper part into the first upper part to form a new first upper part; inserts the second lower part into the first lower part to form a new first lower part; inserts the second left part into the first left part to form a new first left part; and inserts the second right part into the first right part to form a new first right part.
[0109] In this embodiment, the adjustment platform 30 can quickly obtain the insertion position in the first part by using the binary search method, and insert the second part into the first part from the insertion position to form a new first part.
[0110] In other feasible embodiments, the adjustment platform 30 may also use a second vertical line or a second horizontal line in the second part that is farther from the anchor point than the first part as the first vertical line or the first horizontal line of the new first part. That is, the first vertical line is replaced by a second vertical line farther from the anchor point, or the first horizontal line is replaced by a second horizontal line farther from the anchor point.
[0111] Step S704: Connect all the new first parts to form a new first edge box.
[0112] The adjustment platform 30 connects the new first upper part, the new first lower part, the new first left part, and the new first right part to form a new first edge frame. Specifically, the adjustment platform 30 can connect the new first left part, the new first lower part, the new first right part, and the new first upper part in sequence to form a closed first edge frame. In some feasible embodiments, the order in which the adjustment platform 30 connects the new first left part, the new first right part, the new first upper part, and the new first lower part is not limited to this and is not restricted here.
[0113] In the above embodiments, when adding the second edge box to the first edge box, one side in the corresponding direction can be added to the part in the corresponding direction. That is, the second left part is added to the first left part, the second right part is added to the first right part, the second upper part is added to the first upper part, and the second lower part is added to the first lower part. Using a binary search method can quickly determine the insertion position, improving efficiency.
[0114] Please refer to the following: Figure 8 This is the seventh sub-flowchart of the method for adjusting the position of mind map nodes provided in this application embodiment. Before executing step S106, the method for adjusting the position of mind map nodes further includes the following steps.
[0115] Step S802: Detect whether the first edge box and the second edge box intersect.
[0116] The adjustment platform 30 detects whether the first edge box and the second edge box intersect. In this embodiment, the adjustment platform 30 can perform bounding box detection on the first edge box and the second edge box to obtain the result of whether the first edge box and the second edge box intersect.
[0117] Step S804: When the first edge box and the second edge box do not intersect, add an adjustment label to the second node so that the second node becomes the first node.
[0118] When the first and second bounding boxes do not intersect, it means that the first and second nodes do not overlap or overlap, and therefore no adjustment is needed for the second node. Therefore, the adjustment platform 30 adds an adjustment label to the second node to transform it into the first node.
[0119] Step S806: Reconstruct the first edge box for the first node.
[0120] Platform 30 reconstructs the first bounding box for all first nodes in the mind map. It's understandable that if the number of all first nodes when reconstructing the first bounding box is considered the first value, and the number of all first nodes when the first bounding box was previously constructed is considered the second value, then the first value is one greater than the second value.
[0121] When the first and second bounding boxes intersect, it indicates that the first and second nodes overlap or overlap, and the second node needs to be adjusted. The adjustment platform 30 calculates the first distance between the first and second bounding boxes and moves the second node accordingly.
[0122] In the above embodiments, before calculating the first distance, bounding box detection can be performed to quickly determine whether the first and second edge boxes may intersect. If they intersect, the first distance is then calculated, which can speed up the adjustment process and save adjustment time.
[0123] Please refer to the following: Figure 11 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. The computer device 10 includes a memory 11 and a processor 12. The memory 11 is used to store program instructions, and the processor 12 is used to execute the program instructions to implement the above-described method for adjusting the position of mind map nodes.
[0124] In some embodiments, the processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor or other data processing chip, used to run program instructions stored in the memory 11.
[0125] The memory 11 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of a computer device, such as a hard disk. In other embodiments, the memory 11 may be an external storage device of a computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the memory 11 may include both internal and external storage units of the computer device. The memory 11 can be used not only to store application software and various types of data installed on the computer device, such as code implementing methods for adjusting the position of mind map nodes, but also to temporarily store data that has been output or will be output.
[0126] Please refer to the following: Figure 12 This is a schematic diagram of the internal structure of the mind map node position adjustment system provided in this application embodiment. The mind map node position adjustment system 20 includes a node module 21, a construction module 22, a calculation module 23, and an execution module 24.
[0127] Node module 21 is used to respond to user operations, displaying hidden child nodes of existing nodes in the mind map or creating new nodes based on existing nodes.
[0128] Users can view and interact with nodes in the mind map by adjusting system 20. The mind map includes several existing nodes, which may include the main body and hidden child nodes, or the main body and displayed child nodes, or only the main body. In this embodiment, hidden child nodes are child nodes of the existing node that are not yet visible, and displayed child nodes are child nodes of the existing node that are already visible. During node adjustment, both hidden and displayed child nodes move relative to the corresponding main body. That is, when a node needs to be moved or adjusted, the main body and either hidden or displayed child nodes of the existing node will move together as a whole.
[0129] Node module 21 responds to user actions by expanding the hidden child nodes of existing nodes in the mind map, turning them into visible child nodes. However, the visible hidden child nodes may obscure existing visible nodes. Node module 21 also responds to user actions by creating new nodes in the mind map, but these new nodes may also obscure existing visible nodes. Therefore, after responding to user actions, adjustments need to be made to the obscured nodes in the mind map.
[0130] In this embodiment, existing nodes include a first node and a second node, or existing nodes and new nodes include both a first node and a second node. That is, all nodes in the mind map include both a first node and a second node. When a user creates a new node, all nodes in the mind map include both existing nodes and the new node.
[0131] The mind map also includes preset anchor points. In this embodiment, the preset anchor point is a pre-defined fixed point, such as the root node in the mind map. It is understood that the root node is a fixed node in the mind map. Preferably, the root node in the mind map is used as the preset anchor point. Furthermore, a point of the root node, such as the center point, can be used as the preset anchor point. In some feasible embodiments, the preset anchor point can be the centroid or geometric center of all existing nodes in the mind map, a preset point in the mind map, or the midpoint of the visible window; no limitation is made here.
[0132] Module 22 is used to construct a first edgebox and a second edgebox for the first node and the second node, respectively.
[0133] The construction module 22 constructs a first edgebox along the edge of the first node and a second edgebox along the edge of the second node. In this embodiment, the first node includes an adjustment label, indicating that the existing node is not covered by other existing nodes and does not require adjustment. The second node is the node among the remaining nodes that is closest to the preset anchor point. The remaining nodes are either the existing nodes excluding the first node, or the remaining nodes are either the existing nodes or new nodes excluding the first node. It can be understood that the remaining nodes are all the existing nodes remaining after removing the first node from all the nodes in the mind map. The first node includes at least one existing node, and the second node includes only one existing node. That is, the number of first nodes is at least one, and the number of second nodes is one. At least one first node corresponds to one first edgebox, and one second node corresponds to one second edgebox. That is, regardless of the number of first nodes, all first nodes construct only one first edgebox.
[0134] In this embodiment, the first edge box and the second edge box can be referred to as HVLineSegmentBox, or simply HVB.
[0135] The calculation module 23 is used to calculate the first distance between the first edge box and the second edge box.
[0136] The calculation module 23 calculates the distance between the first edge box and the second edge box as the first distance.
[0137] Execution module 24 is used to move the second node according to the first distance when the first distance is negative.
[0138] When the first distance is negative, it indicates that the first and second bounding boxes intersect. That is, the first node and the second node overlap or overlap. The execution module 24 moves the second node according to the first distance. After the second node has been moved, the execution module 24 adds an adjustment label to the second node, converting the second node into the first node.
[0139] When the first distance is positive, it indicates that the first and second edge boxes are separate; when the first distance is exactly zero, it indicates that the first and second edge boxes are adjacent. Whether the first and second edge boxes are separate or adjacent, there is no need to move the second node. The execution module 24 directly adds an adjustment label to the second node, converting it into the first node.
[0140] After converting the second node into the first node, the construction module 22 selects the existing node closest to the preset anchor point from the remaining nodes as the new second node and constructs a new second bounding box for the new second node. The execution module 24 sequentially adjusts and moves all the second nodes to ensure that none of the nodes in the mind map are obscured. Understandably, the construction module 22 calculates the distance between all remaining nodes and the preset anchor point, sorts the remaining nodes according to the distance, and sequentially selects the existing node closest to the preset anchor point as the second node. Correspondingly, the execution module 24 first processes the existing nodes closer to the preset anchor point, and then processes the more distant existing nodes one by one.
[0141] In this embodiment, the spatial complexity of the spatial movement process is O(N), and the time complexity is O(NLogN). Here, N represents the total number of existing nodes or existing nodes and new nodes in the mind map.
[0142] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if these modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.
[0143] The above-listed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A method for adjusting a position of a mind map node, characterized in that, The method for adjusting the position of the mind map node comprises: In response to an operation of a user, a hidden sub-node of an existing node or a new node is created based on the existing node in a mind map, wherein the existing node or the existing node and the new node comprises a first node and a second node, and the mind map further comprises a preset anchor point; A first edge frame and a second edge frame are respectively constructed for the first node and the second node, wherein the first node comprises an adjustment label, the second node is a node closest to the preset anchor point among remaining nodes, and the remaining nodes are nodes other than the first node among the existing nodes or the remaining nodes are nodes other than the first node among the existing nodes and the new nodes; the first edge frame and the second edge frame are respectively constructed for the first node and the second node, and specifically comprises: a plurality of first vertical lines and a plurality of second vertical lines are respectively drawn for the first node and the second node in a direction parallel to a first straight line; a plurality of first horizontal lines and a plurality of second horizontal lines are respectively drawn for the first node and the second node in a direction parallel to a second straight line, wherein the second straight line is perpendicular to the first straight line; the first vertical lines and the first horizontal lines are connected to form the first edge frame, wherein if the first node comprises a displayed sub-node or a hidden sub-node, the first edge frame surrounds the displayed sub-node or the hidden sub-node; and the second vertical lines and the second horizontal lines are connected to form the second edge frame, wherein if the second node comprises a displayed sub-node or a hidden sub-node, the second edge frame surrounds the displayed sub-node or the hidden sub-node; A first distance between the first edge frame and the second edge frame is calculated, comprising: the first edge frame is split into a plurality of first parts, each of the first parts comprising a plurality of the first vertical lines and a plurality of the first horizontal lines; the second edge frame is split into a plurality of second parts, each of the second parts comprising a plurality of the second vertical lines and a plurality of the second horizontal lines, each of the second parts corresponding to each of the first parts one by one; a movement distance of each of the second parts moving in a direction parallel to the first straight line or a direction parallel to the second straight line is calculated, each movement causing an end point of the second part and an end point of the corresponding first part to coincide in projection on the first straight line or the second straight line; when the end point of the second part and the end point of the corresponding first part coincide in projection on the first straight line or the second straight line, a projection distance between the end point of the second part and the end point of the corresponding first part in projection on the second straight line or the first straight line is calculated; and when the sum of the movement distance and the projection distance is the smallest, the movement distance and the projection distance are taken as the first distance; and When the first distance is negative, the second node is moved according to the first distance.
2. The method of claim 1, wherein, The movement distance of each of the second parts moving in the direction parallel to the first straight line or the direction parallel to the second straight line specifically comprises: calculate an end point distance between a projection of an end point of the second part on the first straight line or the second straight line and a projection of an end point of the first part on the first straight line or the second straight line; and select a minimum end point distance from the end point distances in turn according to a minimum heap, and calculate a sum of all the minimum end point distances as the moving distance.
3. The method of claim 1, wherein, After moving the second node according to the first distance, the method further comprises: adding the adjustment label to the second node to make the second node become a first node; and fusing the first edge frame and the second edge frame to form a new first edge frame.
4. The method of claim 3, wherein, The fusing the first edge frame and the second edge frame to form a new first edge frame specifically comprises: inserting the second part into the first part respectively to form new first parts; and connecting all the new first parts to form the new first edge frame.
5. The method of claim 1, wherein, Before constructing the first edge frame and the second edge frame for the first node and the second node respectively, the method further comprises: calculating a second distance between each of the existing nodes and the preset anchor point; and adding the adjustment label to an existing node corresponding to a minimum second distance in the second distances to make the existing node become a first node.
6. The method of claim 1, wherein, Before calculating the first distance between the first edge frame and the second edge frame, the method further comprises: detecting whether the first edge frame and the second edge frame intersect; when the first edge frame and the second edge frame do not intersect, adding the adjustment label to the second node to make the second node become a first node; and reconstructing a first edge frame for the first node.
7. A computer device, characterized by The computer device comprises: a memory for storing program instructions; and a processor for executing the program instructions to implement the method for adjusting the position of a mind map node according to any one of claims 1 to 6.
8. A mind map node position adjustment system, characterized by, The system for adjusting the position of a mind map node comprises: a node module for, in response to a user's operation, displaying hidden sub-nodes of existing nodes or creating new nodes on the basis of the existing nodes in a mind map, the existing nodes or the existing nodes and the new nodes including first nodes and second nodes, the mind map further including a preset anchor point; a constructing module, configured to construct a first edge frame and a second edge frame for the first node and the second node respectively, wherein the first node comprises an adjustment label, the second node is a node closest to the preset anchor point among remaining nodes, the remaining nodes are nodes other than the first node among the existing nodes, or the remaining nodes are nodes other than the first node among the existing nodes and the new nodes, and the constructing a first edge frame and a second edge frame for the first node and the second node respectively specifically comprises: drawing a plurality of first vertical lines and a plurality of second vertical lines for the first node and the second node respectively along a direction of a first parallel straight line; drawing a plurality of first horizontal lines and a plurality of second horizontal lines for the first node and the second node respectively along a direction of a second parallel straight line, wherein the second straight line is perpendicular to the first straight line; connecting the first vertical lines and the first horizontal lines to form the first edge frame, wherein if the first node comprises a display sub-node or a hidden sub-node, the first edge frame surrounds the display sub-node or the hidden sub-node therein; and connecting the second vertical lines and the second horizontal lines to form the second edge frame, wherein if the second node comprises a display sub-node or a hidden sub-node, the second edge frame surrounds the display sub-node or the hidden sub-node therein; a calculating module, configured to calculate a first distance between the first edge frame and the second edge frame, wherein the calculating a first distance between the first edge frame and the second edge frame comprises: splitting the first edge frame into a plurality of first parts, each of the first parts comprising a plurality of the first vertical lines and a plurality of the first horizontal lines; splitting the second edge frame into a plurality of second parts, each of the second parts comprising a plurality of the second vertical lines and a plurality of the second horizontal lines, each of the second parts corresponding to each of the first parts one by one; calculating a moving distance of the second part moving along a direction parallel to the first straight line or a direction parallel to the second straight line, each movement causing endpoints of the second part and corresponding endpoints of the first part to coincide in projection on the first straight line or the second straight line; calculating a projection distance between the projection of the endpoints of the second part and the corresponding endpoints of the first part on the second straight line or the first straight line when the endpoints of the second part and the corresponding endpoints of the first part coincide in projection on the first straight line or the second straight line; and taking the moving distance and the projection distance as the first distance when the sum of the moving distance and the projection distance is the smallest; and an executing module, configured to move the second node according to the first distance when the first distance is negative.
Citation Information
Patent Citations
Large-scale point cloud visualization method capable of preloading nodes and adaptively filling
CN112509118A
Mass point cloud data visualization method
CN114926590A