WO2023044913A1 - Graph drawing method and apparatus, and computer-readable storage medium - Google Patents

Graph drawing method and apparatus, and computer-readable storage medium Download PDF

Info

Publication number
WO2023044913A1
WO2023044913A1 PCT/CN2021/121039 CN2021121039W WO2023044913A1 WO 2023044913 A1 WO2023044913 A1 WO 2023044913A1 CN 2021121039 W CN2021121039 W CN 2021121039W WO 2023044913 A1 WO2023044913 A1 WO 2023044913A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
input
closed
graph
user
Prior art date
Application number
PCT/CN2021/121039
Other languages
French (fr)
Chinese (zh)
Inventor
卞甲慧
张阳阳
Original Assignee
京东方科技集团股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 京东方科技集团股份有限公司 filed Critical 京东方科技集团股份有限公司
Priority to CN202180002703.6A priority Critical patent/CN116194876A/en
Priority to PCT/CN2021/121039 priority patent/WO2023044913A1/en
Publication of WO2023044913A1 publication Critical patent/WO2023044913A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance

Definitions

  • Embodiments of the present disclosure relate to but are not limited to the field of computer application technologies, and in particular, refer to a graphics rendering method and device, and a computer-readable storage medium.
  • Mind map also known as mind map, is an effective graphic thinking tool to express divergent thinking. It uses the technique of paying equal attention to pictures and texts to show the relationship between themes at all levels with mutual subordination and correlation. Create memory links with images, colors, etc.
  • Mind mapping is a way to visualize thinking, which satisfies the characteristics of radial thinking. Radiant thinking is the natural way of thinking of the human brain. Every information that enters the brain can become a thinking center, and thousands of associated nodes are emitted from this center, and each associated node can become another center. theme, thus presenting a radioactive three-dimensional structure. In this way, our brains can more easily accept related content and the relationship between content.
  • An embodiment of the present disclosure provides a graphic drawing method, including: receiving a first input from a user; detecting whether the content of the first input includes a closable graphic, and the closable graphic is a closed graphic or is identified by a graphic recognition method as A graph of a closed graph; when the content of the first input includes a closable graph, identifying the shape of the closable graph as the first closed graph, and generating an outer frame as the first node of the first closed graph.
  • the method before receiving the first input from the user, the method further includes: receiving a second input from the user, where the content of the second input is one or more characters;
  • the method further includes: detecting that the first closed figure and the character in the second input are in a figure drawing interface positional relationship on the first closed graph; when there is an overlapping area between the first closed graph and the characters in the second input, perform the operation of generating the outer frame as the first node of the first closed graph, and according to the first closed graph
  • the content of the second input generates the node name of the first node.
  • the method before receiving the first input from the user, the method further includes: receiving a second input from the user, where the content of the second input is one or more characters;
  • the method further includes: detecting that the first closed figure and the character in the second input are in a figure drawing interface positional relationship on the graph; when the first closed graph contains all the characters in the second input, execute the operation of generating the outer frame as the first node of the first closed graph, and according to the second input The content generates the node name of the first node.
  • the method before receiving the first input from the user, the method further includes: receiving a second input from the user, where the content of the second input is one or more characters;
  • the method further includes: detecting that the first closed figure and the character in the second input are in a figure drawing interface The positional relationship on the above; when there is no overlapping area between the first closed figure and any character in the second input, in response to the fifth operation of the user, move the position of the first closed figure or the character , the fifth operation is dragging the first closed figure or the character; when there is an overlapping area between the first closed figure and at least one character in the second input, execute generating an outer frame for the The operation of the first node of the first closed graph is performed, and the node name of the first node is generated according to the content of the second input.
  • the method after receiving the user's first input and before generating the first node, the method further includes:
  • the method after receiving the user's first input and before generating the first node, the method further includes:
  • the first closed graph in the first input contains all the characters in the third input, perform the operation of generating the outer frame as the first node of the first closed graph, and according to the third input
  • the content generates the node name of the first node.
  • the method after receiving the user's first input and before generating the first node, the method further includes:
  • the method further includes: displaying the closable graphic as a first closed graphic.
  • the method further includes: detecting whether there is a first operation of editing the name of the first node; when the first operation is detected, receiving a fourth input from the user through a pop-up window, And generate the name of the first node according to the fourth input.
  • the method further includes: identifying whether the closable graph is connected to any node in the current graph drawing interface; when the closable graph is connected to any node in the current graph drawing interface When the nodes are not connected, the generated first node is a free node; when the closable graph is connected to the second node in the current graphics drawing interface, the generated first node is the second node.
  • a child node of the node, the second node is a root node or a child node in the current graphic drawing interface.
  • the method further includes: detecting whether there is a second operation of selecting the free node; when the second operation is detected, displaying a delete button in the area where the free node is located, so The delete button is used to delete the node where the delete button is located.
  • the method further includes: detecting whether there is a third operation of moving the free node to the area where any node in the current graphics drawing interface is located; when the third operation is detected , the free node is added as a third node in the current graphics drawing interface, and the parent node of the third node is a node in the area where the free node in the third operation is moved.
  • the method further includes: receiving a fifth input from a user, the fifth input including at least one connecting line configured to connect the free node and the current graph drawing A second node in the interface; adding the free node as a fourth node in the current graphics drawing interface, the parent node of the fourth node being the second node connected by the connecting line in the fifth input.
  • the connecting line is a straight connecting line, a broken line connecting line or a curved connecting line.
  • the method further includes: a fourth operation of detecting whether the second node is selected; when the fourth operation is detected and the second node is the root node, in the The area where the root node is located displays an add button, and the add button is used to add a child node of the node where the add button is located; when the fourth operation is detected and the second node is a non-root node, in the An add button and a delete button are displayed in the area where the second node is located, and the delete button is used to delete the node where the delete button is located.
  • the method further includes: detecting the number and/or length of characters contained in the node name; when the number and/or length of characters contained in the node name exceeds a preset first threshold, Adjust the width and height of the frame of the node so that the node names are displayed in rows.
  • the data structure of any node in the graphical drawing interface includes at least one of the following: the left position of the node, the position of the top edge of the node, whether it is a root node, whether it is a free node, a child node collection, the text content of the node, the rectangle size of the node.
  • the shape of the closable figure includes a straight line polygon, a curved line polygon, or a closed figure composed of a straight line and a curve.
  • An embodiment of the present disclosure also provides a graphics drawing device, including a processor and a memory, the processor is configured to execute a program stored in the memory, so as to implement the steps of the graphics drawing method described in any one of the preceding items.
  • An embodiment of the present disclosure also provides a computer-readable storage medium, where one or more programs are stored on the computer-readable storage medium, and the one or more programs can be executed by one or more processors to realize The steps of the graphic drawing method as described in any one of the preceding items.
  • FIG. 1 is a schematic flow diagram of a graph drawing method according to an embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of an interface of a drawing board page according to an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of a graphic drawing interface according to an embodiment of the present disclosure.
  • FIGS. 4 to 6 are schematic diagrams of three kinds of root nodes in the embodiments of the present disclosure.
  • Fig. 7 is a schematic diagram of the interface when the root node in Fig. 4 is selected.
  • FIG. 8 is a schematic diagram of an interface with a child node added to the root node in FIG. 7;
  • Fig. 9 is a schematic diagram of the interface when the child node in Fig. 8 is selected.
  • Fig. 10 to Fig. 14 are several interface schematic diagrams when the root node in Fig. 4 is in the editing state;
  • Fig. 15 is a schematic diagram of an interface with multiple child nodes added to the root node in Fig. 7;
  • Fig. 16 is a schematic diagram of adding a hand-drawn rectangle in the graphic drawing interface of Fig. 15;
  • Fig. 17 is a schematic diagram of an interface identifying the hand-drawn rectangle in Fig. 16 as a free node;
  • Fig. 18 is a schematic diagram of the interface when the free node in Fig. 17 is selected;
  • Figures 19 to 21 are schematic diagrams of the interface when the free node in Figure 17 is moved to a node in the graphical drawing interface;
  • Fig. 22 is a schematic diagram of the interface of adding a hand-drawn triangle in the graphic drawing interface of Fig. 15;
  • Fig. 23 is a schematic diagram of an interface for recognizing the hand-drawn triangle in Fig. 22 as a standard triangle;
  • Fig. 24 is a schematic diagram of adding a hand-drawn ellipse in the graphic drawing interface of Fig. 15;
  • Fig. 25 is a schematic diagram of an interface for identifying the hand-drawn ellipse in Fig. 24 as a standard ellipse;
  • Fig. 26 is a schematic diagram of an interface for adding hand-drawn text in the graphic drawing interface of Fig. 25;
  • Fig. 27 is a schematic diagram of an interface for recognizing the hand-drawn text in Fig. 26 as standard text;
  • Fig. 28 is a schematic diagram of an interface identifying the standard body text and standard ellipse in Fig. 27 as a free node;
  • 29 to 30 are schematic diagrams of the process of identifying mutually independent standard body characters and standard ellipses as a free node
  • FIG. 31 is a schematic flowchart of another graph drawing method according to an embodiment of the present disclosure.
  • Fig. 32 is a schematic structural diagram of a graphics rendering device provided by an exemplary embodiment of the present disclosure.
  • Mind map also known as mind map, is an effective graphic thinking tool to express divergent thinking. It uses the technique of paying equal attention to pictures and texts to show the relationship between themes at all levels with mutual subordination and correlation. Establishing memory links with images, colors, etc. is a way to visualize thinking. Mind mapping is a way to visualize thinking, which satisfies the characteristics of radial thinking. Radiant thinking is the natural way of thinking of the human brain. Every information that enters the brain can become a thinking center, and thousands of associated nodes are emitted from this center, and each associated node can become another center. theme, thus presenting a radioactive three-dimensional structure. In this way, our brains can more easily accept related content and the relationship between content.
  • FIG. 1 is a schematic flowchart of a graphics drawing method provided by an embodiment of the present disclosure, and the method can be applied to electronic devices with graphics drawing functions such as desktop computers, notebook computers, smart phones, and tablet computers.
  • the method can be applied to the graphic editing software installed in the above-mentioned electronic device, or can be applied to a browser in the form of a web page, when the user opens the corresponding web page in the browser for graphic editing or display,
  • the graph drawing method of the embodiment of the present disclosure is automatically invoked.
  • the graphics drawn by the graphics drawing method may be mind maps, flow charts, logical relationship diagrams, and the like.
  • the graph drawing method includes the following steps:
  • Step 101 receiving the first input from the user
  • the user may first open the drawing board page as shown in FIG. 2 , click the mind map option on the drawing board page, and open the graphic drawing interface.
  • the user may also open the graphical drawing interface in other ways, which is not limited in the present disclosure.
  • the graphical drawing interface may include a root node by default.
  • the root node can be created automatically when the user opens the graphic drawing interface.
  • the default name of the root node may be "My Theme”.
  • the method before step 101, the method further includes:
  • the data structure of the root node includes the left position of the root node, the top edge position of the root node, the text content of the root node and the rectangular size of the root node, etc.;
  • the rectangular size of a node refers to the width and height of the outer frame of the node in the current graphic drawing interface, where the width of the outer frame refers to the outer frame of the node in the current graphic drawing interface along the first direction (Exemplary, the first direction is the row direction), the height of the outer frame refers to the size of the outer frame of the node in the current graphic drawing interface along the second direction (Exemplary, the second direction is the column direction) .
  • the data structure of each node may be the following array structure:
  • Child node collection (childList), the element type of the collection is the model itself;
  • the rectangular (rect) size of the node which records the size of the current node
  • such a data model When initializing, such a data model will be created first as the data structure of the root node, and the left position and top edge position of the model will be assigned values.
  • the left position (left) of the model is 50 pixels
  • the text content is the default "I Theme”, after the initial data is established, you can enter the root node drawing stage.
  • determining the rectangular size of the root node according to the text content of the root node includes:
  • the width occupied by the node name in the drawn root node is the length of n1 characters (n1 can be between 1 and 3 Between, for example, n1 can be 2), and the number of lines is 1 line; when the length of the text content of the root node is greater than n1 characters and less than or equal to the preset reference length, determine the node name in the drawn root node
  • the occupied width is the length of n2 characters, n2 is the number of characters contained in the root node, and the number of lines occupied by the node name is 1 line.
  • n3 is the number of characters contained in the preset reference length, is the round up symbol.
  • determining the character size of the root node according to the text content of the root node and the zoom ratio of the canvas includes: defining a text brush (paint) of the root node, and setting the character size (textSize) of the text paint pen It is the preset first pixel number (for example, the preset first pixel number may be 20 pixels) multiplied by the scaling scale of the current canvas.
  • the zoom ratio scale of the current canvas is 1.
  • the preset reference length may be 6 to 10 characters, for example, the preset reference length may be 8 characters.
  • the application program (API) interface of the Android system exemplary, paint method getTextBounds
  • the application program (API) interface of the Android system exemplary, paint method getTextBounds
  • paint method getTextBounds to obtain the actual width and height pixel size of the text content of the current root node, form a rectangle (rect), and assign it to the rectangle size parameter of the current node.
  • the string segmentation can be performed first, and the text content of the current root node is divided into single-line reference lengths Carry out segmentation, calculate the height of each line, and accumulate according to the number of lines to obtain the overall width and height pixel size of the multi-line text, form a rectangle (rect), and assign it to the rectangle size parameter of the current node.
  • a rectangle when the content of the current root node is cleared, a rectangle (rect) may be formed according to the calculation of width and height of two Chinese characters by default, and assigned to the rectangle size parameter of the current node.
  • the background block brush of the root node is used to draw the background according to the previously calculated rectangle size parameters; the text brush of the root node is used , to draw text, forming the aforementioned root node.
  • the method also includes:
  • the preset first threshold adjust the width and height of the outline of the node (i.e. the rectangular size of the node), so that the node name is displayed in rows.
  • the width of the node name is set to 8 characters, and the number of lines occupied by the node name is 2 lines; as shown in Figure 6, assuming the current root node The text content of is empty, and the width occupied by the node name is still set to 2 characters.
  • the method also includes:
  • an add button is displayed in the area where the root node is located, and the add button is used to add a child node of the node where the add button is located;
  • an add button and a delete button are displayed in the area where the selected node is located, and the delete button is used to delete the node where the delete button is located.
  • the operation button of the root node includes an add button (that is, the + sign in FIG. 7 ). Click the + sign to add a child node to the current node. For example, the added child node is shown in FIG. 8 . As shown in Figure 9, long press the newly added child node, and the operation button will also pop up. Unlike the root node, the operation buttons of the child node include the add button and the delete button. After clicking the delete button, the child node will be deleted .
  • the method also includes:
  • a fourth input from the user is received through a pop-up window, and a name of the node is generated according to the fourth input.
  • clicking a drawn node can pop up an editing window under the node, and the editing window can include an input box and a The handwriting board, the user can draw text on the handwriting board. After the text is recognized, it will be added to the input box. After clicking the "Finish" button, the editing of the text content of the node will be completed, and the name of the node will also change to Edit after the content.
  • the editing window may also include an input box and a keyboard located below the input box, that is, editing of node content also supports keyboard input.
  • Step 102 Detect whether the content of the first input includes a closable figure, and the closable figure is a closed figure or a figure recognized as a closed figure by a figure recognition method.
  • the shapes of the closable figures include straight polygons (such as triangles, rectangles, squares, parallelograms, regular pentagons, regular hexagons, etc.), curved polygons (such as circles, ellipses, etc.) or straight lines.
  • a closed figure composed of curves such as a rounded rectangle, etc.).
  • the first input is a hand-drawn graphic.
  • the user-drawn graphic may not be a closed graphic in the strict sense.
  • the user-drawn graphic in FIG. 16 does not completely closed, however, the hand-drawn graphics can be recognized as a rectangle by the graphics recognition method (at this time, the distance between the adjacent vertices of the two unclosed sides is less than the preset distance threshold), so we can set
  • the hand-drawn figure is regarded as a closeable figure. That is, the closable figure may be a closed figure, or a figure that is not a closed figure but can be recognized as a closed figure by a figure recognition method.
  • Step 103 When the content of the first input includes a closable figure, identify the shape of the closable figure as the first closed figure, and generate a frame as the first node of the first closed figure.
  • the first node may be a free node, or may be a child node in the current graphic drawing interface.
  • the method also includes:
  • the first generated node is a free node.
  • the hand-drawn figure in FIG. 16 is recognized as a rectangle by a graphic recognition method, and a free node with a rectangle as an outer frame is generated at a corresponding position.
  • the content of the free node may be "free topic 1" by default.
  • the method also includes:
  • a delete button is displayed in the area where the free node is located, and the delete button is used to delete the node where the delete button is located.
  • the operation button of the free node only includes the delete button, and does not include the add child node button. After the delete button is clicked, the free node will be deleted.
  • the method also includes:
  • the free node is added as a third node in the graphic drawing interface, and the parent node of the third node is a node in the area where the free node in the third operation is moved.
  • the method before receiving the first input from the user, the method further includes: receiving a second input from the user, where the content of the second input can be one or more characters;
  • the method further includes: detecting the positional relationship between the first closed figure and the characters in the second input on the graphic drawing interface; when the first closed figure When there is an overlapping area between the graph and the characters in the second input, perform the operation of generating the first node whose outer frame is the first closed graph, and generate the node name of the first node according to the content of the second input.
  • the overlapping area between the first closed figure in the first input and at least one character in the second input includes at least the following two situations: the first closed figure in the first input contains the character in the second input Part of the characters, or the first closed figure in the first input contains all the characters in the second input.
  • the content of the second input is input before the content of the first input (graphic), that is, the text is written first, and then a frame is drawn outside the text, the frame contains the text or the frame is related to the text Intersection (that is, there is an overlapping area), when the text and the closed figure are recognized successfully, check whether there is an intersection or containment relationship between the recognized closed figure and the standard text, and if there is, it will be recognized as a free node.
  • the node name of the first node may be generated according to all characters of the second input, or the node name of the first node may be generated by extracting key characters in the second input, which is not limited in the present disclosure.
  • the method before receiving the first input from the user, the method further includes: receiving a second input from the user, where the content of the second input can be one or more characters;
  • the method further includes: detecting the positional relationship between the first closed figure and the characters in the second input on the graphic drawing interface; when the first closed figure When the graph contains all the characters in the second input, execute the operation of generating the first node whose outer frame is the first closed graph, and generate the node name of the first node according to the content of the second input.
  • the method before receiving the user's first input, the method further includes:
  • the method further includes:
  • the position of the first closed figure or the character is moved in response to the fifth operation of the user, and the fifth operation is dragging the first closed figure or character;
  • the method after receiving the user's first input and before generating the first node, the method further includes:
  • the third input content (one or more characters) is input after the first input content (graphic).
  • the drawn closed figure When the drawn closed figure is recognized successfully, it will not directly generate a default "free node", but directly recognize it as a closed figure, such as a rectangle, ellipse, triangle, etc.
  • write text on this graphic as shown in Figure 26, it is not necessary to ensure that each text is inside the graphic, but it is necessary to ensure the continuity of writing, and each stroke should not stay for too long.
  • the written content will be handed over to the character recognition algorithm (the prior art), as shown in FIG. 27, and the handwritten characters will be recognized as standard characters. Check whether there is an intersection or containment relationship between the identified closed figure and the standard font (that is, whether there is an overlapping area), and if so, identify it as a first node, as shown in FIG. 28 .
  • the node name of the first node may be generated according to all characters of the third input, or the node name of the first node may be generated by extracting key characters in the third input, which is not limited in the present disclosure.
  • the method after receiving the user's first input and before generating the first node, the method further includes:
  • the method after receiving the user's first input and before generating the first node, the method further includes:
  • a first node can also be generated by dragging and merging the recognized standard font and a closed figure that does not contain text.
  • the content of the third input may also be input before the content of the first input.
  • the drawn graphics and text are originally two separate elements on the graphics drawing interface, and have their own position information: left, top, and width and height information: width, height.
  • rectangle information corresponding to these two elements, that is, Rect(left, top, left+width, top+height).
  • the method further includes:
  • the graphics drawn by the user can be converted into a standard closed graphics display, or not converted first, in When generating the first node, convert the graphics and text into standard graphics and text, which is not limited in the present disclosure.
  • the method also includes:
  • the fifth input includes at least one connection line, the connection line is configured to connect the free node with the second node in the current graphical drawing interface, the second node can be the root node or child node in the graphical drawing interface node;
  • the connecting line may be a straight connecting line, a broken line connecting line, a curved connecting line, etc., which is not limited in the present disclosure.
  • the position of the free node and/or the shape of the connecting line can be adjusted as required, which is not limited in the present disclosure.
  • the method also includes:
  • the generated outer frame is the first node of the first closed graph
  • the parent node of the first node is the second node
  • the second node is in the current graph drawing interface root node or child node.
  • the difference between this step and the previous steps is that the closable graph in the previous step is not connected to any node in the current graph drawing interface, but the closable graph in this step is connected to the second node in the current graph drawing interface , wherein the second node may be a root node or a child node in the current graphic drawing interface.
  • the connection line connecting the closable figure and the second node can be drawn simultaneously when the user draws the closable figure, before the user draws the closable figure, or after the user draws the closable figure.
  • the recognition method is similar to the recognition method in the preceding steps, except that in this step, the first closed figure is no longer recognized as a free node, but is directly recognized as a sub-node in the graphic drawing interface, and the sub-node The parent node is the second node. Its realization principle and realization effect are similar to the realization principle and realization effect of the preceding steps, and will not be repeated here.
  • FIG. 31 is a schematic flowchart of another graph drawing method according to an embodiment of the present disclosure.
  • click on the drawn node an edit pop-up window will pop up below the node, and edit the node content through the edit pop-up window.
  • the operation buttons include the add button and the delete button.
  • the add button is used to add child nodes
  • the delete button is used to delete the current node.
  • free nodes can be generated by drawing graphics, and free nodes can be added to other nodes by moving or drawing connecting lines.
  • the graph drawing method provided by the present disclosure adds nodes by identifying whether the first input content includes a closeable graph, which conveniently adds nodes of different styles and improves user experience.
  • An embodiment of the present disclosure also provides a graphics rendering device, the graphics rendering device may include a processor and a memory storing a computer program that can run on the processor, and when the processor executes the computer program, the following aspects in the present disclosure are implemented: The steps of the graphics drawing method described in the preceding item.
  • the graphics rendering device may include: a processor 3210, a memory 3220, a bus system 3230, and a transceiver 3240, wherein the processor 3210, the memory 3220, and the transceiver 3240 pass through the bus
  • the system 3230 is connected, the memory 3220 is used to store instructions, and the processor 3210 is used to execute the instructions stored in the memory 3220 to control the transceiver 3240 to send signals.
  • the transceiver 3240 can acquire the user's first input from the graphic drawing interface under the control of the processor 3210, and detect whether the content of the first input includes a closable graphic, and the closable graphic is a closed graphic or is identified by a graphic recognition method.
  • the processor 3210 can be a central processing unit (Central Processing Unit, CPU), and the processor 3210 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, and the like.
  • the memory 3220 may include read-only memory and random-access memory, and provides instructions and data to the processor 3210 .
  • a portion of memory 3220 may also include non-volatile random access memory.
  • memory 3220 may also store device type information.
  • bus system 3230 may also include a power bus, a control bus, and a status signal bus.
  • bus system 3230 may also include a power bus, a control bus, and a status signal bus.
  • various buses are labeled as bus system 3230 in FIG. 32 for clarity of illustration.
  • the processing performed by the processing device may be completed by an integrated logic circuit of hardware in the processor 3210 or instructions in the form of software. That is, the method steps in the embodiments of the present disclosure may be implemented by a hardware processor, or by a combination of hardware and software modules in the processor.
  • the software module may be located in storage media such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in the memory 3220, and the processor 3210 reads the information in the memory 3220, and completes the steps of the above method in combination with its hardware. To avoid repetition, no detailed description is given here.
  • An embodiment of the present disclosure also provides a computer-readable storage medium, the computer-readable storage medium stores executable instructions, and when the executable instructions are executed by a processor, the graphics rendering method provided by any of the above-mentioned embodiments of the present disclosure can be implemented , the graph drawing method can add nodes by identifying whether the first input content includes a closeable graph, conveniently adding nodes of different styles, and improving user experience.
  • the method for driving the graphics rendering device to generate nodes by executing executable instructions is basically the same as the graphics rendering method provided in the above-mentioned embodiments of the present disclosure, and details are not repeated here.
  • the graphics drawing method, device, and computer storage medium provided by the embodiments of the present disclosure conveniently add nodes of different styles by identifying whether the content of the first input includes a closable graphic and adding nodes, thereby improving user experience.
  • the functional modules/units in the system, and the device can be implemented as software, firmware, hardware, and an appropriate combination thereof.
  • the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical components. Components cooperate to execute.
  • Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit.
  • Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
  • computer storage media includes both volatile and nonvolatile media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. permanent, removable and non-removable media.
  • Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer.
  • communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Image Generation (AREA)
  • Document Processing Apparatus (AREA)
  • Processing Or Creating Images (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

A graph drawing method and apparatus, and a computer-readable storage medium. The graph drawing method comprises: receiving a first input of a user; detecting whether the content of the first input comprises a closable graph, wherein the closable graph is a closed graph or a graph which is recognized as a closed graph by means of a graph recognition method; and when the content of the first input comprises a closeable graph, recognizing the shape of the closeable graph as a first closed graph, and generating a first node, an outer frame of which is the first closed graph.

Description

图形绘制方法及装置、计算机可读存储介质Graphic drawing method and device, and computer-readable storage medium 技术领域technical field
本公开实施例涉及但不限于计算机应用技术领域,尤指一种图形绘制方法及装置、计算机可读存储介质。Embodiments of the present disclosure relate to but are not limited to the field of computer application technologies, and in particular, refer to a graphics rendering method and device, and a computer-readable storage medium.
背景技术Background technique
思维导图又叫心智导图,是表达发散性思维的有效图形思维工具,其运用图文并重的技巧,把各级主题的关系用相互隶属与相关的层级图表现出来,把主题关键词与图像、颜色等建立记忆链接。思维导图是一种将思维形象化的方法,满足放射性思考的特征。放射性思考是人类大脑的自然思考方式,每一种进入大脑的信息都可以成为一个思考中心,并由此中心向外散发出成千上万的关联节点,每个关联节点又可以成为另一个中心主题,从而呈现出放射性立体结构。采用这种方式,可以使我们的大脑更容易地接受相关内容以及内容之间的关联关系。Mind map, also known as mind map, is an effective graphic thinking tool to express divergent thinking. It uses the technique of paying equal attention to pictures and texts to show the relationship between themes at all levels with mutual subordination and correlation. Create memory links with images, colors, etc. Mind mapping is a way to visualize thinking, which satisfies the characteristics of radial thinking. Radiant thinking is the natural way of thinking of the human brain. Every information that enters the brain can become a thinking center, and thousands of associated nodes are emitted from this center, and each associated node can become another center. theme, thus presenting a radioactive three-dimensional structure. In this way, our brains can more easily accept related content and the relationship between content.
发明内容Contents of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics described in detail in this article. This summary is not intended to limit the scope of the claims.
本公开实施例提供了一种图形绘制方法,包括:接收用户的第一输入;检测所述第一输入的内容是否包括可封闭图形,所述可封闭图形为封闭图形或通过图形识别方法识别为封闭图形的图形;当所述第一输入的内容包括可封闭图形时,识别所述可封闭图形的形状为第一封闭图形,生成外框为所述第一封闭图形的第一节点。An embodiment of the present disclosure provides a graphic drawing method, including: receiving a first input from a user; detecting whether the content of the first input includes a closable graphic, and the closable graphic is a closed graphic or is identified by a graphic recognition method as A graph of a closed graph; when the content of the first input includes a closable graph, identifying the shape of the closable graph as the first closed graph, and generating an outer frame as the first node of the first closed graph.
在一些示例性实施例中,在所述接收用户的第一输入之前,所述方法还包括:接收用户的第二输入,所述第二输入的内容为一个或多个字符;In some exemplary embodiments, before receiving the first input from the user, the method further includes: receiving a second input from the user, where the content of the second input is one or more characters;
在识别所述可封闭图形的形状为第一封闭图形之后且生成所述第一节点之前,所述方法还包括:检测所述第一封闭图形与所述第二输入中的字符在 图形绘制界面上的位置关系;当所述第一封闭图形与所述第二输入中的字符存在交叠区域时,执行生成外框为所述第一封闭图形的第一节点的操作,并根据所述第二输入的内容生成所述第一节点的节点名称。After identifying the shape of the closable figure as the first closed figure and before generating the first node, the method further includes: detecting that the first closed figure and the character in the second input are in a figure drawing interface positional relationship on the first closed graph; when there is an overlapping area between the first closed graph and the characters in the second input, perform the operation of generating the outer frame as the first node of the first closed graph, and according to the first closed graph The content of the second input generates the node name of the first node.
在一些示例性实施例中,在所述接收用户的第一输入之前,所述方法还包括:接收用户的第二输入,所述第二输入的内容为一个或多个字符;In some exemplary embodiments, before receiving the first input from the user, the method further includes: receiving a second input from the user, where the content of the second input is one or more characters;
在识别所述可封闭图形的形状为第一封闭图形之后且生成所述第一节点之前,所述方法还包括:检测所述第一封闭图形与所述第二输入中的字符在图形绘制界面上的位置关系;当所述第一封闭图形包含所述第二输入中的全部字符时,执行生成外框为所述第一封闭图形的第一节点的操作,并根据所述第二输入的内容生成所述第一节点的节点名称。After identifying the shape of the closable figure as the first closed figure and before generating the first node, the method further includes: detecting that the first closed figure and the character in the second input are in a figure drawing interface positional relationship on the graph; when the first closed graph contains all the characters in the second input, execute the operation of generating the outer frame as the first node of the first closed graph, and according to the second input The content generates the node name of the first node.
在一些示例性实施例中,在所述接收用户的第一输入之前,所述方法还包括:接收用户的第二输入,所述第二输入的内容为一个或多个字符;In some exemplary embodiments, before receiving the first input from the user, the method further includes: receiving a second input from the user, where the content of the second input is one or more characters;
在识别所述可封闭图形的形状为第一封闭图形之后且生成所述第一节点之前,所述方法还包括:检测所述第一封闭图形与所述第二输入中的字符在图形绘制界面上的位置关系;当所述第一封闭图形与所述第二输入中的任一个字符不存在交叠区域时,响应用户的第五操作,移动所述第一封闭图形或所述字符的位置,所述第五操作为拖拽所述第一封闭图形或所述字符;当所述第一封闭图形与所述第二输入中的至少一个字符存在交叠区域时,执行生成外框为所述第一封闭图形的第一节点的操作,并根据所述第二输入的内容生成所述第一节点的节点名称。After identifying the shape of the closable figure as the first closed figure and before generating the first node, the method further includes: detecting that the first closed figure and the character in the second input are in a figure drawing interface The positional relationship on the above; when there is no overlapping area between the first closed figure and any character in the second input, in response to the fifth operation of the user, move the position of the first closed figure or the character , the fifth operation is dragging the first closed figure or the character; when there is an overlapping area between the first closed figure and at least one character in the second input, execute generating an outer frame for the The operation of the first node of the first closed graph is performed, and the node name of the first node is generated according to the content of the second input.
在一些示例性实施例中,在所述接收用户的第一输入之后且生成所述第一节点之前,所述方法还包括:In some exemplary embodiments, after receiving the user's first input and before generating the first node, the method further includes:
接收用户的第三输入,所述第三输入的内容为一个或多个字符;receiving a third input from the user, where the content of the third input is one or more characters;
检测所述第一封闭图形与所述第三输入中的字符在图形绘制界面上的位置关系;Detecting the positional relationship between the first closed figure and the characters in the third input on the graphic drawing interface;
当所述第一输入中的第一封闭图形与所述第三输入中的至少一个字符存在交叠区域时,执行生成外框为所述第一封闭图形的第一节点的操作,并根据所述第三输入的内容生成所述第一节点的节点名称。When there is an overlapping area between the first closed graph in the first input and at least one character in the third input, perform the operation of generating the outer frame as the first node of the first closed graph, and according to the Generate the node name of the first node based on the content of the third input.
在一些示例性实施例中,在所述接收用户的第一输入之后且生成所述第一节点之前,所述方法还包括:In some exemplary embodiments, after receiving the user's first input and before generating the first node, the method further includes:
接收用户的第三输入,所述第三输入的内容为一个或多个字符;receiving a third input from the user, where the content of the third input is one or more characters;
检测所述第一封闭图形与所述第三输入中的字符在图形绘制界面上的位置关系;Detecting the positional relationship between the first closed figure and the characters in the third input on the graphic drawing interface;
当所述第一输入中的第一封闭图形包含所述第三输入中的全部字符时,执行生成外框为所述第一封闭图形的第一节点的操作,并根据所述第三输入的内容生成所述第一节点的节点名称。When the first closed graph in the first input contains all the characters in the third input, perform the operation of generating the outer frame as the first node of the first closed graph, and according to the third input The content generates the node name of the first node.
在一些示例性实施例中,在所述接收用户的第一输入之后且生成所述第一节点之前,所述方法还包括:In some exemplary embodiments, after receiving the user's first input and before generating the first node, the method further includes:
接收用户的第三输入,所述第三输入的内容为一个或多个字符;receiving a third input from the user, where the content of the third input is one or more characters;
检测所述第一封闭图形与所述第三输入中的字符在图形绘制界面上的位置关系;Detecting the positional relationship between the first closed figure and the characters in the third input on the graphic drawing interface;
当所述第一输入中的第一封闭图形与所述第三输入中的任一个字符不存在交叠区域时,响应用户的第五操作,移动所述第一封闭图形或所述字符的位置,所述第五操作为拖拽所述第一封闭图形或所述字符;When there is no overlapping area between the first closed figure in the first input and any character in the third input, in response to the user's fifth operation, move the position of the first closed figure or the character , the fifth operation is dragging the first closed figure or the character;
当所述第一封闭图形与所述第三输入中的至少一个字符存在交叠区域时,执行生成外框为所述第一封闭图形的第一节点的操作,并根据所述第三输入的内容生成所述第一节点的节点名称。When there is an overlapping area between the first closed graph and at least one character in the third input, perform the operation of generating the outer frame as the first node of the first closed graph, and according to the third input The content generates the node name of the first node.
在一些示例性实施例中,在所述接收用户的第一输入之后且在所述接收用户的第三输入之前,所述方法还包括:显示所述可封闭图形为第一封闭图形。In some exemplary embodiments, after receiving the first input from the user and before receiving the third input from the user, the method further includes: displaying the closable graphic as a first closed graphic.
在一些示例性实施例中,所述方法还包括:检测是否有编辑所述第一节点的名称的第一操作;当检测到所述第一操作时,通过弹窗接收用户的第四输入,并根据所述第四输入生成所述第一节点的名称。In some exemplary embodiments, the method further includes: detecting whether there is a first operation of editing the name of the first node; when the first operation is detected, receiving a fourth input from the user through a pop-up window, And generate the name of the first node according to the fourth input.
在一些示例性实施例中,所述方法还包括:识别所述可封闭图形是否与当前图形绘制界面中的任一节点连接;当所述可封闭图形与所述当前图形绘制界面中的任一节点均未连接时,生成的所述第一节点为自由节点;当所述 可封闭图形与所述当前图形绘制界面中的第二节点连接时,生成的所述第一节点为所述第二节点的子节点,所述第二节点为所述当前图形绘制界面中的根节点或子节点。In some exemplary embodiments, the method further includes: identifying whether the closable graph is connected to any node in the current graph drawing interface; when the closable graph is connected to any node in the current graph drawing interface When the nodes are not connected, the generated first node is a free node; when the closable graph is connected to the second node in the current graphics drawing interface, the generated first node is the second node. A child node of the node, the second node is a root node or a child node in the current graphic drawing interface.
在一些示例性实施例中,所述方法还包括:检测是否有所述自由节点被选中的第二操作;当检测到所述第二操作时,在所述自由节点所在区域显示删除按钮,所述删除按钮用于删除所述删除按钮所在位置的节点。In some exemplary embodiments, the method further includes: detecting whether there is a second operation of selecting the free node; when the second operation is detected, displaying a delete button in the area where the free node is located, so The delete button is used to delete the node where the delete button is located.
在一些示例性实施例中,所述方法还包括:检测是否有将所述自由节点移动至所述当前图形绘制界面中的任一节点所在区域的第三操作;当检测到所述第三操作时,将所述自由节点添加为所述当前图形绘制界面中的第三节点,所述第三节点的父节点为所述第三操作中的自由节点被移动后所在区域的节点。In some exemplary embodiments, the method further includes: detecting whether there is a third operation of moving the free node to the area where any node in the current graphics drawing interface is located; when the third operation is detected , the free node is added as a third node in the current graphics drawing interface, and the parent node of the third node is a node in the area where the free node in the third operation is moved.
在一些示例性实施例中,所述方法还包括:接收用户的第五输入,所述第五输入包括至少一条连接线,所述连接线被配置为连接所述自由节点与所述当前图形绘制界面中的第二节点;将所述自由节点添加为所述当前图形绘制界面中的第四节点,所述第四节点的父节点为所述第五输入中的连接线连接的第二节点。In some exemplary embodiments, the method further includes: receiving a fifth input from a user, the fifth input including at least one connecting line configured to connect the free node and the current graph drawing A second node in the interface; adding the free node as a fourth node in the current graphics drawing interface, the parent node of the fourth node being the second node connected by the connecting line in the fifth input.
在一些示例性实施例中,所述连接线为直线连接线、折线连接线或曲线连接线。In some exemplary embodiments, the connecting line is a straight connecting line, a broken line connecting line or a curved connecting line.
在一些示例性实施例中,所述方法还包括:检测是否有所述第二节点被选中的第四操作;当检测到所述第四操作且所述第二节点为根节点时,在所述根节点所在区域显示添加按钮,所述添加按钮用于添加所述添加按钮所在位置节点的子节点;当检测到所述第四操作且所述第二节点为非根节点时,在所述第二节点所在区域显示添加按钮和删除按钮,所述删除按钮用于删除所述删除按钮所在位置的节点。In some exemplary embodiments, the method further includes: a fourth operation of detecting whether the second node is selected; when the fourth operation is detected and the second node is the root node, in the The area where the root node is located displays an add button, and the add button is used to add a child node of the node where the add button is located; when the fourth operation is detected and the second node is a non-root node, in the An add button and a delete button are displayed in the area where the second node is located, and the delete button is used to delete the node where the delete button is located.
在一些示例性实施例中,所述方法还包括:检测节点名称包含的字符个数和/或长度;当所述节点名称包含的字符个数和/或长度超过预设的第一阈值时,调整节点的外框的宽度和高度,以使得所述节点名称分行显示。In some exemplary embodiments, the method further includes: detecting the number and/or length of characters contained in the node name; when the number and/or length of characters contained in the node name exceeds a preset first threshold, Adjust the width and height of the frame of the node so that the node names are displayed in rows.
在一些示例性实施例中,所述图形绘制界面中的任一节点的数据结构包 括以下至少之一:节点的左边位置、节点的顶边位置、是否为根节点、是否为自由节点、子节点集合、节点的文本内容、节点的矩形尺寸。In some exemplary embodiments, the data structure of any node in the graphical drawing interface includes at least one of the following: the left position of the node, the position of the top edge of the node, whether it is a root node, whether it is a free node, a child node collection, the text content of the node, the rectangle size of the node.
在一些示例性实施例中,所述可封闭图形的形状包括直线多边形、曲线多边形或者直线形与曲线组成的封闭图形。In some exemplary embodiments, the shape of the closable figure includes a straight line polygon, a curved line polygon, or a closed figure composed of a straight line and a curve.
本公开实施例还提供了一种图形绘制装置,包括处理器及存储器,所述处理器用于执行所述存储器中存储的程序,以实现如前任一项所述的图形绘制方法的步骤。An embodiment of the present disclosure also provides a graphics drawing device, including a processor and a memory, the processor is configured to execute a program stored in the memory, so as to implement the steps of the graphics drawing method described in any one of the preceding items.
本公开实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如前任一项所述的图形绘制方法的步骤。An embodiment of the present disclosure also provides a computer-readable storage medium, where one or more programs are stored on the computer-readable storage medium, and the one or more programs can be executed by one or more processors to realize The steps of the graphic drawing method as described in any one of the preceding items.
在阅读理解了附图和详细描述后,可以明白其他方面。Other aspects will become apparent upon reading and understanding the drawings and detailed description.
附图说明Description of drawings
附图用来提供对本公开技术方案的进一步理解,并且构成说明书的一部分,与本公开的实施例一起用于解释本公开的技术方案,并不构成对本公开的技术方案的限制。附图中各部件的形状和大小不反映真实比例,目的只是示意说明本公开内容。The accompanying drawings are used to provide a further understanding of the technical solutions of the present disclosure, and constitute a part of the specification, and are used together with the embodiments of the present disclosure to explain the technical solutions of the present disclosure, and do not constitute limitations to the technical solutions of the present disclosure. The shapes and sizes of the various components in the drawings do not reflect true scale, but are only intended to illustrate the present disclosure.
图1为本公开实施例一种图形绘制方法的流程示意图;FIG. 1 is a schematic flow diagram of a graph drawing method according to an embodiment of the present disclosure;
图2为本公开实施例一种画板页面的界面示意图;FIG. 2 is a schematic diagram of an interface of a drawing board page according to an embodiment of the present disclosure;
图3为本公开实施例一种图形绘制界面示意图;FIG. 3 is a schematic diagram of a graphic drawing interface according to an embodiment of the present disclosure;
图4至图6为本公开实施例的三种根节点的示意图;4 to 6 are schematic diagrams of three kinds of root nodes in the embodiments of the present disclosure;
图7为图4中的根节点被选中时的界面示意图;Fig. 7 is a schematic diagram of the interface when the root node in Fig. 4 is selected;
图8为图7中的根节点添加了一个子节点的界面示意图;FIG. 8 is a schematic diagram of an interface with a child node added to the root node in FIG. 7;
图9为图8中的子节点被选中时的界面示意图;Fig. 9 is a schematic diagram of the interface when the child node in Fig. 8 is selected;
图10至图14为图4中的根节点在编辑状态时的几种界面示意图;Fig. 10 to Fig. 14 are several interface schematic diagrams when the root node in Fig. 4 is in the editing state;
图15为图7中的根节点添加了多个子节点的界面示意图;Fig. 15 is a schematic diagram of an interface with multiple child nodes added to the root node in Fig. 7;
图16为在图15的图形绘制界面中,添加一个手绘矩形的界面示意图;Fig. 16 is a schematic diagram of adding a hand-drawn rectangle in the graphic drawing interface of Fig. 15;
图17为将图16中的手绘矩形识别为一个自由节点的界面示意图;Fig. 17 is a schematic diagram of an interface identifying the hand-drawn rectangle in Fig. 16 as a free node;
图18为图17中的自由节点被选中时的界面示意图;Fig. 18 is a schematic diagram of the interface when the free node in Fig. 17 is selected;
图19至图21为将图17中的自由节点移动至图形绘制界面中的一个节点下时的界面示意图;Figures 19 to 21 are schematic diagrams of the interface when the free node in Figure 17 is moved to a node in the graphical drawing interface;
图22为在图15的图形绘制界面中,添加一个手绘三角形的界面示意图;Fig. 22 is a schematic diagram of the interface of adding a hand-drawn triangle in the graphic drawing interface of Fig. 15;
图23为将图22中的手绘三角形识别为一个标准三角形的界面示意图;Fig. 23 is a schematic diagram of an interface for recognizing the hand-drawn triangle in Fig. 22 as a standard triangle;
图24为在图15的图形绘制界面中,添加一个手绘椭圆的界面示意图;Fig. 24 is a schematic diagram of adding a hand-drawn ellipse in the graphic drawing interface of Fig. 15;
图25为将图24中的手绘椭圆识别为一个标准椭圆的界面示意图;Fig. 25 is a schematic diagram of an interface for identifying the hand-drawn ellipse in Fig. 24 as a standard ellipse;
图26为在图25的图形绘制界面中,添加手绘文字的界面示意图;Fig. 26 is a schematic diagram of an interface for adding hand-drawn text in the graphic drawing interface of Fig. 25;
图27为将图26中的手绘文字识别为标准体文字的界面示意图;Fig. 27 is a schematic diagram of an interface for recognizing the hand-drawn text in Fig. 26 as standard text;
图28为将图27中的标准体文字和标准椭圆识别为一个自由节点的界面示意图;Fig. 28 is a schematic diagram of an interface identifying the standard body text and standard ellipse in Fig. 27 as a free node;
图29至图30为将相互独立的标准体文字和标准椭圆识别为一个自由节点的过程示意图;29 to 30 are schematic diagrams of the process of identifying mutually independent standard body characters and standard ellipses as a free node;
图31为本公开实施例另一种图形绘制方法的流程示意图;FIG. 31 is a schematic flowchart of another graph drawing method according to an embodiment of the present disclosure;
图32为本公开示例性实施例提供的一种图形绘制装置的结构示意图。Fig. 32 is a schematic structural diagram of a graphics rendering device provided by an exemplary embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开的目的、技术方案和优点更加清楚明白,下文中将结合附图对本公开的实施例进行详细说明。注意,实施方式可以以多个不同形式来实施。所属技术领域的普通技术人员可以很容易地理解一个事实,就是方式和内容可以在不脱离本公开的宗旨及其范围的条件下被变换为各种各样的形式。因此,本公开不应该被解释为仅限定在下面的实施方式所记载的内容中。在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互任意组合。In order to make the purpose, technical solution and advantages of the present disclosure clearer, the embodiments of the present disclosure will be described in detail below in conjunction with the accompanying drawings. Note that an embodiment may be embodied in many different forms. Those skilled in the art can easily understand the fact that the means and contents can be changed into various forms without departing from the gist and scope of the present disclosure. Therefore, the present disclosure should not be interpreted as being limited only to the contents described in the following embodiments. In the case of no conflict, the embodiments in the present disclosure and the features in the embodiments can be combined arbitrarily with each other.
除非另外定义,本公开实施例公开使用的技术术语或者科学术语应当为 本公开所属领域内具有一般技能的人士所理解的通常意义。本公开实施例中使用的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的组成部分。“包括”或者“包含”等类似的词语意指出该词前面的元件或物件涵盖出现在该词后面列举的元件或者物件及其等同,而不排除其他元件或者物件。Unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure shall have the usual meanings understood by those skilled in the art to which the present disclosure belongs. "First", "second" and similar words used in the embodiments of the present disclosure do not indicate any sequence, quantity or importance, but are only used to distinguish different components. "Comprising" or "comprising" and similar words mean that the elements or items preceding the word include the elements or items listed after the word and their equivalents, but do not exclude other elements or items.
思维导图又叫心智导图,是表达发散性思维的有效图形思维工具,其运用图文并重的技巧,把各级主题的关系用相互隶属与相关的层级图表现出来,把主题关键词与图像、颜色等建立记忆链接,是一种将思维形象化的方法。思维导图是一种将思维形象化的方法,满足放射性思考的特征。放射性思考是人类大脑的自然思考方式,每一种进入大脑的信息都可以成为一个思考中心,并由此中心向外散发出成千上万的关联节点,每个关联节点又可以成为另一个中心主题,从而呈现出放射性立体结构。采用这种方式,可以使我们的大脑更容易地接受相关内容以及内容之间的关联关系。Mind map, also known as mind map, is an effective graphic thinking tool to express divergent thinking. It uses the technique of paying equal attention to pictures and texts to show the relationship between themes at all levels with mutual subordination and correlation. Establishing memory links with images, colors, etc. is a way to visualize thinking. Mind mapping is a way to visualize thinking, which satisfies the characteristics of radial thinking. Radiant thinking is the natural way of thinking of the human brain. Every information that enters the brain can become a thinking center, and thousands of associated nodes are emitted from this center, and each associated node can become another center. theme, thus presenting a radioactive three-dimensional structure. In this way, our brains can more easily accept related content and the relationship between content.
目前市面上有较多思维导图软件,这些软件构建思维导图主要有两种方式:一是打开相应软件后,通过快捷键或右键的方式添加一个个节点生成思维导图;二是通过打开软件支持的格式的文档来生成思维导图。这两种方式添加的节点的样式都比较单一,用户体验较差。At present, there are many mind map softwares on the market. There are two main ways to build a mind map with these software: one is to open the corresponding software and add nodes one by one to generate a mind map through shortcut keys or right keys; Documents in formats supported by the software to generate mind maps. The styles of the nodes added in these two ways are relatively simple, and the user experience is poor.
图1为本公开实施例所提供的一种图形绘制方法的流程示意图,该方法可以应用于台式电脑、笔记本电脑、智能手机、平板电脑等具有图形绘制功能的电子设备中。可选地,该方法可以应用于上述电子设备中安装的图形编辑软件中,或者,可以以网页的形式,应用于浏览器中,用户在浏览器中打开相应的网页进行图形编辑或展示时,自动调用本公开实施例的图形绘制方法。示例性的,该图形绘制方法绘制的图形可以是思维导图、流程图、逻辑关系图等。FIG. 1 is a schematic flowchart of a graphics drawing method provided by an embodiment of the present disclosure, and the method can be applied to electronic devices with graphics drawing functions such as desktop computers, notebook computers, smart phones, and tablet computers. Optionally, the method can be applied to the graphic editing software installed in the above-mentioned electronic device, or can be applied to a browser in the form of a web page, when the user opens the corresponding web page in the browser for graphic editing or display, The graph drawing method of the embodiment of the present disclosure is automatically invoked. Exemplarily, the graphics drawn by the graphics drawing method may be mind maps, flow charts, logical relationship diagrams, and the like.
为便于描述,下述实施例将以本公开实施例的图形绘制方法应用于思维导图编辑软件中为例,来解释说明本公开。For ease of description, the following embodiments will take the graphic drawing method of the embodiment of the present disclosure applied to mind map editing software as an example to explain the present disclosure.
如图1所示,该图形绘制方法包括以下步骤:As shown in Figure 1, the graph drawing method includes the following steps:
步骤101:接收用户的第一输入;Step 101: receiving the first input from the user;
在一些示例性实施例中,在使用本公开的图形绘制方法之前,用户可以先打开如图2所示的画板页面,点击画板页面上的思维导图选项,打开图形绘制界面。在另一些示例性实施例中,用户也可以通过其他方式打开图形绘制界面,本公开对此不作限制。In some exemplary embodiments, before using the graphic drawing method of the present disclosure, the user may first open the drawing board page as shown in FIG. 2 , click the mind map option on the drawing board page, and open the graphic drawing interface. In some other exemplary embodiments, the user may also open the graphical drawing interface in other ways, which is not limited in the present disclosure.
在一些示例性实施例中,如图3所示,图形绘制界面默认可以包括一个根节点。该根节点可以在用户打开图形绘制界面时,自动创建。默认的该根节点的名称可以为“我的主题”。In some exemplary embodiments, as shown in FIG. 3 , the graphical drawing interface may include a root node by default. The root node can be created automatically when the user opens the graphic drawing interface. The default name of the root node may be "My Theme".
在一些示例性实施例中,在步骤101之前,所述方法还包括:In some exemplary embodiments, before step 101, the method further includes:
创建根节点的数据结构,所述根节点的数据结构包括根节点的左边位置、根节点的顶边位置、根节点的文本内容以及根节点的矩形尺寸等;Create the data structure of the root node, the data structure of the root node includes the left position of the root node, the top edge position of the root node, the text content of the root node and the rectangular size of the root node, etc.;
根据当前屏幕的尺寸,确定根节点的左边位置和顶边位置;Determine the left and top positions of the root node according to the size of the current screen;
根据根节点的文本内容确定根节点的矩形尺寸;Determine the rectangular size of the root node according to the text content of the root node;
根据根节点的左边位置、顶边位置、文本内容以及根节点的矩形尺寸,绘制根节点。Draw the root node according to the left position of the root node, the position of the top edge, the text content and the rectangle size of the root node.
本公开中,节点的矩形尺寸指的是节点在当前图形绘制界面中的外框的宽度和高度大小,其中,外框的宽度指的是节点在当前图形绘制界面中的外框沿第一方向(示例性的,第一方向为行方向)的尺寸,外框的高度指的是节点在当前图形绘制界面中的外框沿第二方向(示例性的,第二方向为列方向)的尺寸。In this disclosure, the rectangular size of a node refers to the width and height of the outer frame of the node in the current graphic drawing interface, where the width of the outer frame refers to the outer frame of the node in the current graphic drawing interface along the first direction (Exemplary, the first direction is the row direction), the height of the outer frame refers to the size of the outer frame of the node in the current graphic drawing interface along the second direction (Exemplary, the second direction is the column direction) .
在一些示例性实施例中,在本公开实施例的图形绘制界面中,每个节点的数据结构可以为如下的数组结构:In some exemplary embodiments, in the graphic drawing interface of the embodiment of the present disclosure, the data structure of each node may be the following array structure:
{{
节点的左边位置(left);The left position of the node (left);
节点的顶边位置(top);The position of the top edge of the node (top);
是否为根节点(isRoot);Is it the root node (isRoot);
是否为自由节点(isWild);Whether it is a free node (isWild);
子节点集合(childList),集合的元素类型为该模型本身;Child node collection (childList), the element type of the collection is the model itself;
节点的文本内容(content);The text content of the node (content);
节点的矩形(rect)尺寸,记录当前节点的大小;The rectangular (rect) size of the node, which records the size of the current node;
……..……..
}}
初始化时,首先会创建这样一个数据模型作为根节点的数据结构,并会对该模型的左边位置和顶边位置赋值。在示例性实施例中,该模型的左边位置(left)为50像素,顶边位置(top)为当前设备屏幕高度的一半,设置为根节点(isRoot=true),文本内容为默认的”我的主题”,初始数据建立之后,就可以进入根节点绘制阶段。When initializing, such a data model will be created first as the data structure of the root node, and the left position and top edge position of the model will be assigned values. In an exemplary embodiment, the left position (left) of the model is 50 pixels, the top position (top) is half the height of the current device screen, set as the root node (isRoot=true), and the text content is the default "I Theme", after the initial data is established, you can enter the root node drawing stage.
在一些示例性实施例中,根据根节点的文本内容确定根节点的矩形尺寸,包括:In some exemplary embodiments, determining the rectangular size of the root node according to the text content of the root node includes:
根据根节点的文本内容以及画布缩放比例,确定根节点的字符大小;Determine the character size of the root node according to the text content of the root node and the zoom ratio of the canvas;
确定根节点的文本内容的长度是否大于预设的基准长度;Determine whether the length of the text content of the root node is greater than a preset reference length;
当根节点的文本内容的长度大于预设的基准长度时,确定绘制的根节点中节点名称所占的宽度及节点名称所占的行数;When the length of the text content of the root node is greater than the preset reference length, determine the width occupied by the node name and the number of lines occupied by the node name in the drawn root node;
当根节点的文本内容的长度大于或等于0且小于或等于预设的基准长度时,确定绘制的根节点中节点名称所占的宽度(此时,节点名称所占的行数为1)。When the length of the text content of the root node is greater than or equal to 0 and less than or equal to the preset reference length, determine the width occupied by the node name in the drawn root node (at this time, the number of lines occupied by the node name is 1).
示例性的,当根节点的文本内容的长度大于或等于0且小于或等于n1个字符时,确定绘制的根节点中节点名称所占的宽度为n1个字符的长度(n1可以在1至3之间,示例性的,n1可以为2),行数为1行;当根节点的文本内容的长度大于n1个字符且小于或等于预设的基准长度时,确定绘制的根节点中节点名称所占的宽度为n2个字符的长度,n2为根节点中包含的字符数量,节点名称所占的行数为1行。当根节点的文本内容的长度大于预设的基准长度时,确定绘制的根节点中节点名称所占的宽度为n3个字符的长度,节点名称所占的行数为
Figure PCTCN2021121039-appb-000001
其中,n3为预设的基准长度中包含的字符 数量,
Figure PCTCN2021121039-appb-000002
为向上取整符号。
Exemplarily, when the length of the text content of the root node is greater than or equal to 0 and less than or equal to n1 characters, it is determined that the width occupied by the node name in the drawn root node is the length of n1 characters (n1 can be between 1 and 3 Between, for example, n1 can be 2), and the number of lines is 1 line; when the length of the text content of the root node is greater than n1 characters and less than or equal to the preset reference length, determine the node name in the drawn root node The occupied width is the length of n2 characters, n2 is the number of characters contained in the root node, and the number of lines occupied by the node name is 1 line. When the length of the text content of the root node is greater than the preset reference length, determine that the width of the node name in the drawn root node is n3 characters long, and the number of lines occupied by the node name is
Figure PCTCN2021121039-appb-000001
Among them, n3 is the number of characters contained in the preset reference length,
Figure PCTCN2021121039-appb-000002
is the round up symbol.
在一些示例性实施例中,根据根节点的文本内容以及画布缩放比例,确定根节点的字符大小,包括:定义根节点的文字画笔(paint),并将文字画笔的字符大小(textSize)设定为预设的第一像素数(示例性的,预设的第一像素数可以为20像素)乘以当前画布的缩放比例scale。In some exemplary embodiments, determining the character size of the root node according to the text content of the root node and the zoom ratio of the canvas includes: defining a text brush (paint) of the root node, and setting the character size (textSize) of the text paint pen It is the preset first pixel number (for example, the preset first pixel number may be 20 pixels) multiplied by the scaling scale of the current canvas.
示例性的,在未缩放时候,当前画布的缩放比例scale为1。Exemplarily, when not zoomed, the zoom ratio scale of the current canvas is 1.
在一些示例性实施例中,预设的基准长度可以为6到10个字符,示例性的,预设的基准长度可以为8个字符。In some exemplary embodiments, the preset reference length may be 6 to 10 characters, for example, the preset reference length may be 8 characters.
在一些示例性实施例中,当当前的根节点的文本内容的长度小于或等于预设的基准长度即不需要换行的情况下,可以通过安卓系统的应用程序(API)接口(示例性的,paint的方法getTextBounds),获取当前的根节点的文本内容的实际宽高像素大小,构成一个矩形(rect),并赋值给当前节点的矩形尺寸参数。In some exemplary embodiments, when the length of the text content of the current root node is less than or equal to the preset reference length, that is, no line break is required, the application program (API) interface of the Android system (exemplary, paint method getTextBounds), to obtain the actual width and height pixel size of the text content of the current root node, form a rectangle (rect), and assign it to the rectangle size parameter of the current node.
在一些示例性实施例中,当当前的根节点的文本内容的长度大于预设的基准长度即需要换行的情况下,可以先进行字符串分割,将当前的根节点的文本内容按照单行基准长度进行分割,并计算出每行的高度,并根据行数进行累加,则获得了多行文字的整体宽高像素大小,构成一个矩形(rect),并赋值给当前节点的矩形尺寸参数。In some exemplary embodiments, when the length of the text content of the current root node is greater than the preset reference length, that is, a line break is required, the string segmentation can be performed first, and the text content of the current root node is divided into single-line reference lengths Carry out segmentation, calculate the height of each line, and accumulate according to the number of lines to obtain the overall width and height pixel size of the multi-line text, form a rectangle (rect), and assign it to the rectangle size parameter of the current node.
在一些示例性实施例中,当当前的根节点内容被清空的情况下,可以按照默认保留两个汉字的宽高计算,构成一个矩形(rect),并赋值给当前节点的矩形尺寸参数。In some exemplary embodiments, when the content of the current root node is cleared, a rectangle (rect) may be formed according to the calculation of width and height of two Chinese characters by default, and assigned to the rectangle size parameter of the current node.
在一些示例性实施例中,根据根节点的左边位置(left)和顶边位置(top),使用根节点的背景块画笔,按照之前计算的矩形尺寸参数,绘制背景;使用根节点的文字画笔,绘制文字,形成前述的根节点。In some exemplary embodiments, according to the left position (left) and the top edge position (top) of the root node, the background block brush of the root node is used to draw the background according to the previously calculated rectangle size parameters; the text brush of the root node is used , to draw text, forming the aforementioned root node.
在一些示例性实施例中,该方法还包括:In some exemplary embodiments, the method also includes:
检测节点名称(即节点的文本内容)包含的字符个数和/或长度;Detect the number and/or length of characters contained in the node name (ie, the text content of the node);
当节点名称包含的字符个数和/或长度超过预设的第一阈值时,调整节点 的外框的宽度和高度(即节点的矩形尺寸),以使得节点名称分行显示。When the number of characters and/or length contained in the node name exceed the preset first threshold, adjust the width and height of the outline of the node (i.e. the rectangular size of the node), so that the node name is displayed in rows.
示例性的,如图4所示,假设当前的根节点的文本内容是”我的主题”,则节点的文本内容的长度为4,小于基准长度8,则无需换行,节点名称所占的宽度设为4个字符,节点名称所占的行数为1行;如图5所示,假设当前的根节点的文本内容是”我的主题我的主题我的主题我的主题”,节点的文本内容的长度即为16,则需要分割成两段并换行,节点名称所占的宽度设为8个字符,节点名称所占的行数为2行;如图6所示,假设当前的根节点的文本内容为空,节点名称所占的宽度仍设为2个字符。Exemplarily, as shown in Figure 4, assuming that the text content of the current root node is "My Topic", the length of the text content of the node is 4, which is less than the reference length 8, and there is no need to wrap the line, and the width occupied by the node name Set it to 4 characters, and the number of lines occupied by the node name is 1 line; as shown in Figure 5, assuming that the text content of the current root node is "My theme My theme My theme My theme", the text of the node The length of the content is 16, so it needs to be divided into two paragraphs and line-wrapped. The width of the node name is set to 8 characters, and the number of lines occupied by the node name is 2 lines; as shown in Figure 6, assuming the current root node The text content of is empty, and the width occupied by the node name is still set to 2 characters.
在一些示例性实施例中,该方法还包括:In some exemplary embodiments, the method also includes:
检测是否有节点被选中的操作;Detect whether a node is selected;
当检测到有节点被选中且选中的节点为根节点时,在根节点所在区域显示添加按钮,添加按钮用于添加该添加按钮所在位置节点的子节点;When it is detected that a node is selected and the selected node is the root node, an add button is displayed in the area where the root node is located, and the add button is used to add a child node of the node where the add button is located;
当检测到有节点被选中且选中的节点为非根节点时,在选中的节点所在区域显示添加按钮和删除按钮,删除按钮用于删除该删除按钮所在位置的节点。When it is detected that a node is selected and the selected node is a non-root node, an add button and a delete button are displayed in the area where the selected node is located, and the delete button is used to delete the node where the delete button is located.
本实施例中,长按绘制好的节点,则该节点被选中,确定长按时触摸的位置坐标(x,y),检测触摸的位置坐标(x,y)是否在节点的范围内,若在节点的范围内,则根据节点的位置和范围,弹出操作按钮。其中,根节点的操作按钮包括添加按钮(即图7中的+号)。点击+号,为当前节点添加子节点,示例性的,添加的子节点如图8所示。如图9所示,长按刚刚添加的子节点,同样会弹出操作按钮,与根节点不同的是,子节点的操作按钮包括添加按钮和删除按钮,点击删除按钮后,该子节点会被删除。In this embodiment, long press the drawn node, then the node will be selected, determine the position coordinates (x, y) of the touch during the long press, and detect whether the touched position coordinates (x, y) are within the range of the node. Within the range of the node, the operation button will pop up according to the position and range of the node. Wherein, the operation button of the root node includes an add button (that is, the + sign in FIG. 7 ). Click the + sign to add a child node to the current node. For example, the added child node is shown in FIG. 8 . As shown in Figure 9, long press the newly added child node, and the operation button will also pop up. Unlike the root node, the operation buttons of the child node include the add button and the delete button. After clicking the delete button, the child node will be deleted .
在一些示例性实施例中,该方法还包括:In some exemplary embodiments, the method also includes:
检测是否有编辑节点的名称的操作;Detect whether there is an operation to edit the name of the node;
当检测到有编辑节点的名称的操作时,通过弹窗接收用户的第四输入,并根据第四输入生成节点的名称。When an operation of editing the name of the node is detected, a fourth input from the user is received through a pop-up window, and a name of the node is generated according to the fourth input.
在一些示例性实施例中,如图10、图11、图12和图13所示,单击绘制 好的节点,可以在该节点下方弹出编辑窗口,编辑窗口可以包括输入框和位于输入框下方的手写板,用户可以在手写板上绘制文字,文字被识别后,则添加到输入框上,点击“完成”按钮后,完成对节点的文本内容的编辑,同时节点的名称也会变为编辑后的内容。如图14所示,编辑窗口也可以包括输入框和位于输入框下方的键盘,即节点内容的编辑也支持键盘输入。通过上述操作,用户可以添加多个节点,如图15所示。In some exemplary embodiments, as shown in Fig. 10, Fig. 11, Fig. 12 and Fig. 13, clicking a drawn node can pop up an editing window under the node, and the editing window can include an input box and a The handwriting board, the user can draw text on the handwriting board. After the text is recognized, it will be added to the input box. After clicking the "Finish" button, the editing of the text content of the node will be completed, and the name of the node will also change to Edit after the content. As shown in FIG. 14 , the editing window may also include an input box and a keyboard located below the input box, that is, editing of node content also supports keyboard input. Through the above operations, the user can add multiple nodes, as shown in Figure 15.
步骤102:检测第一输入的内容是否包括可封闭图形,可封闭图形为封闭图形或通过图形识别方法识别为封闭图形的图形。Step 102: Detect whether the content of the first input includes a closable figure, and the closable figure is a closed figure or a figure recognized as a closed figure by a figure recognition method.
在一些示例性实施例中,可封闭图形的形状包括直线多边形(如三角形、矩形、正方形、平行四边形、正五边形、正六边形等)、曲线多边形(如圆、椭圆等)或者直线形与曲线组成的封闭图形(如圆角矩形等)。In some exemplary embodiments, the shapes of the closable figures include straight polygons (such as triangles, rectangles, squares, parallelograms, regular pentagons, regular hexagons, etc.), curved polygons (such as circles, ellipses, etc.) or straight lines. A closed figure composed of curves (such as a rounded rectangle, etc.).
示例性的,如图16所示,第一输入为手绘的图形,本公开实施例中,用户手绘的图形可以不是严格意义上的封闭图形,示例性的,图16中用户手绘的图形并没有完全闭合,但是,该手绘的图形可以通过图形识别方法识别为一个矩形(此时,未闭合的两条边的相临近的顶点之间的距离小于预设的距离阈值),因此,我们可以将该手绘的图形看成一个可封闭图形。即,可封闭图形可以为封闭图形,也可以不是封闭图形但是通过图形识别方法可以识别为一个封闭图形的图形。Exemplarily, as shown in FIG. 16 , the first input is a hand-drawn graphic. In the embodiment of the present disclosure, the user-drawn graphic may not be a closed graphic in the strict sense. Exemplarily, the user-drawn graphic in FIG. 16 does not completely closed, however, the hand-drawn graphics can be recognized as a rectangle by the graphics recognition method (at this time, the distance between the adjacent vertices of the two unclosed sides is less than the preset distance threshold), so we can set The hand-drawn figure is regarded as a closeable figure. That is, the closable figure may be a closed figure, or a figure that is not a closed figure but can be recognized as a closed figure by a figure recognition method.
步骤103:当第一输入的内容包括可封闭图形时,识别可封闭图形的形状为第一封闭图形,生成外框为第一封闭图形的第一节点。本公开实施例中,第一节点可以为一个自由节点,也可以为当前图形绘制界面中的一个子节点。Step 103: When the content of the first input includes a closable figure, identify the shape of the closable figure as the first closed figure, and generate a frame as the first node of the first closed figure. In the embodiment of the present disclosure, the first node may be a free node, or may be a child node in the current graphic drawing interface.
在一些示例性实施例中,该方法还包括:In some exemplary embodiments, the method also includes:
识别可封闭图形是否与当前图形绘制界面中的任一节点连接;Identify whether the closed graph is connected to any node in the current graph drawing interface;
当可封闭图形与当前图形绘制界面中的任一节点均未连接时,生成的第一节点为自由节点。When the closable graph is not connected to any node in the current graph drawing interface, the first generated node is a free node.
示例性的,如图17所示,将图16中手绘的图形通过图形识别方法识别为一个矩形,在相应的位置上生成一个外框为矩形的自由节点。该自由节点的内容可以默认为“自由主题1”。Exemplarily, as shown in FIG. 17 , the hand-drawn figure in FIG. 16 is recognized as a rectangle by a graphic recognition method, and a free node with a rectangle as an outer frame is generated at a corresponding position. The content of the free node may be "free topic 1" by default.
在一些示例性实施例中,该方法还包括:In some exemplary embodiments, the method also includes:
检测是否有自由节点被选中的第二操作;The second operation of detecting whether a free node is selected;
当检测到第二操作时,在自由节点所在区域显示删除按钮,删除按钮用于删除该删除按钮所在位置的节点。When the second operation is detected, a delete button is displayed in the area where the free node is located, and the delete button is used to delete the node where the delete button is located.
如图18所示,长按绘制好的自由节点,也会弹出操作按钮。示例性的,自由节点的操作按钮只包括删除按钮,不包括添加子节点按钮,点击删除按钮后,该自由节点会被删除。As shown in Figure 18, long press the drawn free node, and the operation button will also pop up. Exemplarily, the operation button of the free node only includes the delete button, and does not include the add child node button. After the delete button is clicked, the free node will be deleted.
在一些示例性实施例中,该方法还包括:In some exemplary embodiments, the method also includes:
检测是否有将自由节点移动至图形绘制界面中的任一节点所在区域的第三操作;Detect whether there is a third operation for moving the free node to the area where any node in the graphical drawing interface is located;
当检测到第三操作时,将自由节点添加为图形绘制界面中的第三节点,第三节点的父节点为第三操作中的自由节点被移动后所在区域的节点。When the third operation is detected, the free node is added as a third node in the graphic drawing interface, and the parent node of the third node is a node in the area where the free node in the third operation is moved.
如图18、图19、图20和图21所示,长按绘制好的自由节点同时表示这个自由节点当前是被选中的状态,可以拖动这个自由节点到任意位置。如果将这个自由节点拖动到主干的某个节点下,并抬起手指,则会将这个节点添加到所处节点位置的节点上,成为它的子节点。As shown in Figure 18, Figure 19, Figure 20 and Figure 21, long press the drawn free node to indicate that the free node is currently selected, and you can drag the free node to any position. If you drag this free node under a node of the trunk and lift your finger, this node will be added to the node at the node position and become its child node.
同理,其他图形的绘制和识别(包括但不限于三角形,椭圆等),也会绘制出相应的图形,同样会生成对应图形的自由节点,如图22、图23、图24和图25所示。Similarly, the drawing and identification of other graphics (including but not limited to triangles, ellipses, etc.) will also draw the corresponding graphics, and also generate free nodes of the corresponding graphics, as shown in Figure 22, Figure 23, Figure 24 and Figure 25 Show.
在一些示例性实施例中,在接收用户的第一输入之前,该方法还包括:接收用户的第二输入,第二输入的内容可以为一个或多个字符;In some exemplary embodiments, before receiving the first input from the user, the method further includes: receiving a second input from the user, where the content of the second input can be one or more characters;
在识别可封闭图形的形状为第一封闭图形之后且生成第一节点之前,该方法还包括:检测第一封闭图形与第二输入中的字符在图形绘制界面上的位置关系;当第一封闭图形与第二输入中的字符存在交叠区域时,执行生成外框为第一封闭图形的第一节点的操作,并根据第二输入的内容生成第一节点的节点名称。After identifying the shape of the closed figure as the first closed figure and before generating the first node, the method further includes: detecting the positional relationship between the first closed figure and the characters in the second input on the graphic drawing interface; when the first closed figure When there is an overlapping area between the graph and the characters in the second input, perform the operation of generating the first node whose outer frame is the first closed graph, and generate the node name of the first node according to the content of the second input.
本公开实施例中,第一输入中的第一封闭图形与第二输入中的至少一个 字符存在交叠区域至少包含以下两种情况:第一输入中的第一封闭图形包含第二输入中的部分字符,或者第一输入中的第一封闭图形包含第二输入中的全部字符。In the embodiment of the present disclosure, the overlapping area between the first closed figure in the first input and at least one character in the second input includes at least the following two situations: the first closed figure in the first input contains the character in the second input Part of the characters, or the first closed figure in the first input contains all the characters in the second input.
本公开实施例中,第二输入的内容(一个或多个字符)在第一输入的内容(图形)之前输入,即先写文字,再在文字外绘制边框,边框包含文字或者边框与文字有交叉(即存在交叠区域),当文字和封闭图形识别成功后,检查识别的封闭图形与标准体文字是否存在交叉或包含关系,如果存在,则识别为一个自由节点。In the embodiment of the present disclosure, the content of the second input (one or more characters) is input before the content of the first input (graphic), that is, the text is written first, and then a frame is drawn outside the text, the frame contains the text or the frame is related to the text Intersection (that is, there is an overlapping area), when the text and the closed figure are recognized successfully, check whether there is an intersection or containment relationship between the recognized closed figure and the standard text, and if there is, it will be recognized as a free node.
本公开实施例中,可以根据第二输入的全部字符生成第一节点的节点名称,也可以提取第二输入中的关键字符生成第一节点的节点名称,本公开对此不作限制。In the embodiment of the present disclosure, the node name of the first node may be generated according to all characters of the second input, or the node name of the first node may be generated by extracting key characters in the second input, which is not limited in the present disclosure.
在一些示例性实施例中,在接收用户的第一输入之前,该方法还包括:接收用户的第二输入,第二输入的内容可以为一个或多个字符;In some exemplary embodiments, before receiving the first input from the user, the method further includes: receiving a second input from the user, where the content of the second input can be one or more characters;
在识别可封闭图形的形状为第一封闭图形之后且生成第一节点之前,该方法还包括:检测第一封闭图形与第二输入中的字符在图形绘制界面上的位置关系;当第一封闭图形包含第二输入中的全部字符时,执行生成外框为第一封闭图形的第一节点的操作,并根据第二输入的内容生成第一节点的节点名称。After identifying the shape of the closed figure as the first closed figure and before generating the first node, the method further includes: detecting the positional relationship between the first closed figure and the characters in the second input on the graphic drawing interface; when the first closed figure When the graph contains all the characters in the second input, execute the operation of generating the first node whose outer frame is the first closed graph, and generate the node name of the first node according to the content of the second input.
在另一些示例性实施例中,在接收用户的第一输入之前,该方法还包括:In other exemplary embodiments, before receiving the user's first input, the method further includes:
接收用户的第二输入,第二输入的内容为一个或多个字符;receiving a second input from the user, where the content of the second input is one or more characters;
在识别可封闭图形的形状为第一封闭图形之后且生成第一节点之前,该方法还包括:After identifying the shape of the closeable graph as the first closed graph and before generating the first node, the method further includes:
检测第一封闭图形与第二输入中的字符在图形绘制界面上的位置关系;Detecting the positional relationship between the first closed figure and the characters in the second input on the figure drawing interface;
当第一封闭图形与第二输入中的任一个字符不存在交叠区域时,响应用户的第五操作,移动第一封闭图形或所述字符的位置,第五操作为拖拽第一封闭图形或字符;When there is no overlapping area between the first closed figure and any character in the second input, the position of the first closed figure or the character is moved in response to the fifth operation of the user, and the fifth operation is dragging the first closed figure or character;
当第一封闭图形与第二输入中的至少一个字符存在交叠区域时,执行生 成外框为第一封闭图形的第一节点的操作,并根据第二输入的内容生成第一节点的节点名称。When there is an overlapping area between the first closed figure and at least one character in the second input, execute the operation of generating the first node whose outer frame is the first closed figure, and generate the node name of the first node according to the content of the second input .
在另一些示例性实施例中,在接收用户的第一输入之后且生成第一节点之前,该方法还包括:In some other exemplary embodiments, after receiving the user's first input and before generating the first node, the method further includes:
接收用户的第三输入,第三输入的内容为一个或多个字符;Receive a third input from the user, where the content of the third input is one or more characters;
检测第一封闭图形与第三输入中的字符在图形绘制界面上的位置关系;Detecting the positional relationship between the first closed figure and the characters in the third input on the figure drawing interface;
当第一输入中的第一封闭图形与第三输入中的至少一个字符存在交叠区域时,执行生成外框为第一封闭图形的第一节点的操作,并根据第三输入的内容生成第一节点的节点名称。When there is an overlapping area between the first closed figure in the first input and at least one character in the third input, perform the operation of generating the outer frame as the first node of the first closed figure, and generate the first node according to the content of the third input The node name of a node.
本公开实施例中,第三输入的内容(一个或多个字符)在第一输入的内容(图形)之后输入。当绘制的可封闭图形识别成功后,并不会直接生成一个默认的”自由节点”,而是直接识别成一个封闭图形,如矩形、椭圆、三角形等。接下来,在这个图形上书写文字,如图26所示,不必保证每个文字都在图形内部,但要保证书写的连贯性,每一笔不能停留时间过长,在完全写完后,我们会将书写的内容交给文字识别算法(现有技术),如图27所示,将手写的文字识别为标准体文字。检查识别的封闭图形与标准体文字是否存在交叉或包含关系(即是否存在交叠区域),如果存在,则识别为一个第一节点,如图28所示。In the embodiment of the present disclosure, the third input content (one or more characters) is input after the first input content (graphic). When the drawn closed figure is recognized successfully, it will not directly generate a default "free node", but directly recognize it as a closed figure, such as a rectangle, ellipse, triangle, etc. Next, write text on this graphic, as shown in Figure 26, it is not necessary to ensure that each text is inside the graphic, but it is necessary to ensure the continuity of writing, and each stroke should not stay for too long. After it is completely written, we The written content will be handed over to the character recognition algorithm (the prior art), as shown in FIG. 27, and the handwritten characters will be recognized as standard characters. Check whether there is an intersection or containment relationship between the identified closed figure and the standard font (that is, whether there is an overlapping area), and if so, identify it as a first node, as shown in FIG. 28 .
本公开实施例中,可以根据第三输入的全部字符生成第一节点的节点名称,也可以提取第三输入中的关键字符生成第一节点的节点名称,本公开对此不作限制。In the embodiment of the present disclosure, the node name of the first node may be generated according to all characters of the third input, or the node name of the first node may be generated by extracting key characters in the third input, which is not limited in the present disclosure.
在另一些示例性实施例中,在接收用户的第一输入之后且生成第一节点之前,该方法还包括:In some other exemplary embodiments, after receiving the user's first input and before generating the first node, the method further includes:
接收用户的第三输入,第三输入的内容为一个或多个字符;Receive a third input from the user, where the content of the third input is one or more characters;
检测第一封闭图形与第三输入中的字符在图形绘制界面上的位置关系;Detecting the positional relationship between the first closed figure and the characters in the third input on the figure drawing interface;
当第一输入中的第一封闭图形包含第三输入中的全部字符时,执行生成外框为第一封闭图形的第一节点的操作,并根据第三输入的内容生成第一节 点的节点名称。When the first closed graph in the first input contains all the characters in the third input, execute the operation of generating the first node whose outer frame is the first closed graph, and generate the node name of the first node according to the content of the third input .
在一些示例性实施例中,在接收用户的第一输入之后且生成第一节点之前,该方法还包括:In some exemplary embodiments, after receiving the user's first input and before generating the first node, the method further includes:
接收用户的第三输入,第三输入的内容为一个或多个字符;Receive a third input from the user, where the content of the third input is one or more characters;
检测第一封闭图形与第三输入中的字符在图形绘制界面上的位置关系;Detecting the positional relationship between the first closed figure and the characters in the third input on the figure drawing interface;
当第一输入中的第一封闭图形与第三输入中的任一个字符不存在交叠区域时,响应用户的第五操作,移动第一封闭图形或字符的位置,第五操作为拖拽第一封闭图形或所述字符;When there is no overlapping area between the first closed figure in the first input and any character in the third input, the position of the first closed figure or character is moved in response to the fifth operation of the user, and the fifth operation is dragging the second a closed figure or said character;
当第一封闭图形与第三输入中的至少一个字符存在交叠区域时,执行生成外框为第一封闭图形的第一节点的操作,并根据第三输入的内容生成第一节点的节点名称。When there is an overlapping area between the first closed figure and at least one character in the third input, execute the operation of generating the first node whose outer frame is the first closed figure, and generate the node name of the first node according to the content of the third input .
本实施例中,如图29和图30所示,将识别后的标准体文字和一个未包含文字的封闭图形进行拖拽合并,也可以产生一个第一节点。在另一些示例性实施例中,第三输入的内容也可以在第一输入的内容之前输入。In this embodiment, as shown in FIG. 29 and FIG. 30 , a first node can also be generated by dragging and merging the recognized standard font and a closed figure that does not contain text. In some other exemplary embodiments, the content of the third input may also be input before the content of the first input.
本实施例中,绘制的图形和文字本来在图形绘制界面上是两个单独的元素,并有各自的位置信息:left、top,以及宽高信息:width、height。我们通过这些信息,可以得到这两个元素各自对应的矩形信息,既Rect(left,top,left+width,top+height)。此外,每个元素还有类型信息type,其中,文字的类型信息是”text”,内容属性content用于保存文字内容,如”自由主题”;图形的类型信息是”shape”,并有属性”shapeType”来区分具体类型,如矩形的shapeType=1,椭圆的shapeType=2等。In this embodiment, the drawn graphics and text are originally two separate elements on the graphics drawing interface, and have their own position information: left, top, and width and height information: width, height. Through this information, we can get the rectangle information corresponding to these two elements, that is, Rect(left, top, left+width, top+height). In addition, each element also has type information type, among which, the type information of the text is "text", and the content attribute content is used to save the text content, such as "free theme"; the type information of the graphic is "shape", and has the attribute " shapeType" to distinguish specific types, such as shapeType=1 for rectangles, shapeType=2 for ellipses, etc.
当我们书写或者绘制完毕后,会根据当前元素位置信息确定矩形,并与其他元素的矩形进行相交判断,示例性的,可以通过java Rect对象提供的intersect方法来判断矩形是否相交,如果相交,则将两个元素的信息(位置,大小,位子内容,图形类型)合并形成一个新的元素,也就是图形绘制界面中的一个自由节点,并将之前两个单独的元素从图形绘制界面上删除。When we finish writing or drawing, we will determine the rectangle according to the position information of the current element, and judge the intersection with the rectangles of other elements. For example, we can use the intersect method provided by the java Rect object to judge whether the rectangles intersect. If they intersect, then Merge the information (position, size, seat content, graphic type) of the two elements to form a new element, that is, a free node in the graphic drawing interface, and delete the previous two separate elements from the graphic drawing interface.
在一些示例性实施例中,在接收用户的第一输入之后且在接收用户的第三输入之前,该方法还包括:In some exemplary embodiments, after receiving the user's first input and before receiving the user's third input, the method further includes:
显示可封闭图形为第一封闭图形。Display the closable figure as the first closed figure.
本公开实施例中,当采用先画图形、再写文字的方法生成一个节点时,在写文字之前,可以将用户手绘的图形先转化成一个标准的封闭图形显示,也可以先不转化,在生成第一节点时,将图形和文字一起转化为标准的图形和文字,本公开对此不作限制。In the embodiment of the present disclosure, when a node is generated by drawing graphics first and then writing text, before writing text, the graphics drawn by the user can be converted into a standard closed graphics display, or not converted first, in When generating the first node, convert the graphics and text into standard graphics and text, which is not limited in the present disclosure.
在另一些示例性实施例中,该方法还包括:In other exemplary embodiments, the method also includes:
接收用户的第五输入,第五输入包括至少一条连接线,该连接线被配置为连接自由节点与当前图形绘制界面中的第二节点,第二节点可以为图形绘制界面中的根节点或子节点;Receive a fifth input from the user, the fifth input includes at least one connection line, the connection line is configured to connect the free node with the second node in the current graphical drawing interface, the second node can be the root node or child node in the graphical drawing interface node;
将自由节点添加为当前图形绘制界面中的第四节点,第四节点的父节点为第五输入中的连接线连接的第二节点。Add the free node as the fourth node in the current graphic drawing interface, and the parent node of the fourth node is the second node connected by the connecting line in the fifth input.
示例性的,连接线可以为直线连接线、折线连接线、曲线连接线等,本公开对此不作限制。在实际使用时,可以根据需要调整自由节点的位置和/或连接线的形状,本公开对此不作限制。Exemplarily, the connecting line may be a straight connecting line, a broken line connecting line, a curved connecting line, etc., which is not limited in the present disclosure. In actual use, the position of the free node and/or the shape of the connecting line can be adjusted as required, which is not limited in the present disclosure.
在另一些示例性实施例中,该方法还包括:In other exemplary embodiments, the method also includes:
识别可封闭图形是否与当前图形绘制界面中的任一节点连接;Identify whether the closed graph is connected to any node in the current graph drawing interface;
当可封闭图形与当前图形绘制界面中的第二节点连接时,生成外框为第一封闭图形的第一节点,第一节点的父节点为第二节点,第二节点为当前图形绘制界面中的根节点或子节点。When the closable graph is connected to the second node in the current graph drawing interface, the generated outer frame is the first node of the first closed graph, the parent node of the first node is the second node, and the second node is in the current graph drawing interface root node or child node.
本步骤与前述步骤的不同之处在于,前述步骤中的可封闭图形不与当前图形绘制界面中的任意一个节点连接,而本步骤中的可封闭图形与当前图形绘制界面中的第二节点连接,其中,第二节点可以为当前图形绘制界面中的根节点或子节点。连接可封闭图形与第二节点的连接线可以在用户绘制可封闭图形时同时绘制、在用户绘制可封闭图形之前绘制或者在用户绘制可封闭图形之后绘制。此时,识别方法与前述步骤中的识别方法类似,只是本步骤中,不再将第一封闭图形识别为一个自由节点,而是直接识别为图形绘制界面中的一个子节点,该子节点的父节点为第二节点。其实现原理和实现效果 与前述步骤的实现原理和实现效果类似,在此不再赘述。The difference between this step and the previous steps is that the closable graph in the previous step is not connected to any node in the current graph drawing interface, but the closable graph in this step is connected to the second node in the current graph drawing interface , wherein the second node may be a root node or a child node in the current graphic drawing interface. The connection line connecting the closable figure and the second node can be drawn simultaneously when the user draws the closable figure, before the user draws the closable figure, or after the user draws the closable figure. At this time, the recognition method is similar to the recognition method in the preceding steps, except that in this step, the first closed figure is no longer recognized as a free node, but is directly recognized as a sub-node in the graphic drawing interface, and the sub-node The parent node is the second node. Its realization principle and realization effect are similar to the realization principle and realization effect of the preceding steps, and will not be repeated here.
图31为本公开实施例另一种图形绘制方法的流程示意图。如图31所示,点击绘制好的节点,可以在该节点下方弹出编辑弹窗,通过编辑弹窗完成对节点内容的编辑。长按绘制好的节点,会在该节点上展示操作按钮,操作按钮包括添加按钮和删除按钮,添加按钮用于添加子节点,删除按钮用于删除当前节点。此外,可以通过手绘图形生成自由节点,并可以通过移动或手绘连接线将自由节点添加到其它节点上。FIG. 31 is a schematic flowchart of another graph drawing method according to an embodiment of the present disclosure. As shown in Figure 31, click on the drawn node, an edit pop-up window will pop up below the node, and edit the node content through the edit pop-up window. Long press the drawn node, and the operation buttons will be displayed on the node. The operation buttons include the add button and the delete button. The add button is used to add child nodes, and the delete button is used to delete the current node. In addition, free nodes can be generated by drawing graphics, and free nodes can be added to other nodes by moving or drawing connecting lines.
综上所述,本公开提供的图形绘制方法,通过识别第一输入的内容是否包括可封闭图形来添加节点,很方便的增加了不同样式的节点,提高了用户的使用体验。To sum up, the graph drawing method provided by the present disclosure adds nodes by identifying whether the first input content includes a closeable graph, which conveniently adds nodes of different styles and improves user experience.
本公开实施例还提供了一种图形绘制装置,该图形绘制装置可包括处理器以及存储有可在处理器上运行的计算机程序的存储器,该处理器执行所述计算机程序时实现本公开中如前任一项所述的图形绘制方法的步骤。An embodiment of the present disclosure also provides a graphics rendering device, the graphics rendering device may include a processor and a memory storing a computer program that can run on the processor, and when the processor executes the computer program, the following aspects in the present disclosure are implemented: The steps of the graphics drawing method described in the preceding item.
如图32所示,在一个示例中,图形绘制装置可包括:处理器3210、存储器3220、总线系统3230和收发器3240,其中,该处理器3210、该存储器3220和该收发器3240通过该总线系统3230相连,该存储器3220用于存储指令,该处理器3210用于执行该存储器3220存储的指令,以控制该收发器3240发送信号。具体地,收发器3240可在处理器3210的控制下从图形绘制界面中获取用户的第一输入,检测第一输入的内容是否包括可封闭图形,可封闭图形为封闭图形或通过图形识别方法识别为封闭图形的图形;当第一输入的内容包括可封闭图形时,识别可封闭图形的形状为第一封闭图形,生成外框为第一封闭图形的第一节点,通过收发器将生成的第一节点输出至图形绘制界面。As shown in FIG. 32 , in an example, the graphics rendering device may include: a processor 3210, a memory 3220, a bus system 3230, and a transceiver 3240, wherein the processor 3210, the memory 3220, and the transceiver 3240 pass through the bus The system 3230 is connected, the memory 3220 is used to store instructions, and the processor 3210 is used to execute the instructions stored in the memory 3220 to control the transceiver 3240 to send signals. Specifically, the transceiver 3240 can acquire the user's first input from the graphic drawing interface under the control of the processor 3210, and detect whether the content of the first input includes a closable graphic, and the closable graphic is a closed graphic or is identified by a graphic recognition method. is a closed figure; when the content of the first input includes a closeable figure, identify the shape of the closeable figure as the first closed figure, generate the outer frame as the first node of the first closed figure, and pass the generated first node through the transceiver A node is output to the graphics drawing interface.
应理解,处理器3210可以是中央处理单元(Central Processing Unit,CPU),处理器3210还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或 者该处理器也可以是任何常规的处理器等。It should be understood that the processor 3210 can be a central processing unit (Central Processing Unit, CPU), and the processor 3210 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, and the like.
存储器3220可以包括只读存储器和随机存取存储器,并向处理器3210提供指令和数据。存储器3220的一部分还可以包括非易失性随机存取存储器。例如,存储器3220还可以存储设备类型的信息。The memory 3220 may include read-only memory and random-access memory, and provides instructions and data to the processor 3210 . A portion of memory 3220 may also include non-volatile random access memory. For example, memory 3220 may also store device type information.
总线系统3230除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图32中将各种总线都标为总线系统3230。In addition to the data bus, the bus system 3230 may also include a power bus, a control bus, and a status signal bus. However, the various buses are labeled as bus system 3230 in FIG. 32 for clarity of illustration.
在实现过程中,处理设备所执行的处理可以通过处理器3210中的硬件的集成逻辑电路或者软件形式的指令完成。即本公开实施例的方法步骤可以体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等存储介质中。该存储介质位于存储器3220,处理器3210读取存储器3220中的信息,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。In the course of implementation, the processing performed by the processing device may be completed by an integrated logic circuit of hardware in the processor 3210 or instructions in the form of software. That is, the method steps in the embodiments of the present disclosure may be implemented by a hardware processor, or by a combination of hardware and software modules in the processor. The software module may be located in storage media such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers, and the like. The storage medium is located in the memory 3220, and the processor 3210 reads the information in the memory 3220, and completes the steps of the above method in combination with its hardware. To avoid repetition, no detailed description is given here.
本公开实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有可执行指令,该可执行指令被处理器执行时可以实现本公开上述任一实施例提供的图形绘制方法,该图形绘制方法可以通过识别第一输入的内容是否包括可封闭图形来添加节点,很方便的增加了不同样式的节点,提高了用户的使用体验。通过执行可执行指令驱动图形绘制装置生成节点的方法与本公开上述实施例提供的图形绘制方法基本相同,在此不做赘述。An embodiment of the present disclosure also provides a computer-readable storage medium, the computer-readable storage medium stores executable instructions, and when the executable instructions are executed by a processor, the graphics rendering method provided by any of the above-mentioned embodiments of the present disclosure can be implemented , the graph drawing method can add nodes by identifying whether the first input content includes a closeable graph, conveniently adding nodes of different styles, and improving user experience. The method for driving the graphics rendering device to generate nodes by executing executable instructions is basically the same as the graphics rendering method provided in the above-mentioned embodiments of the present disclosure, and details are not repeated here.
本公开实施例提供的图形绘制方法、装置及计算机存储介质,通过识别第一输入的内容是否包括可封闭图形并添加节点,很方便的增加了不同样式的节点,提高了用户的使用体验。The graphics drawing method, device, and computer storage medium provided by the embodiments of the present disclosure conveniently add nodes of different styles by identifying whether the content of the first input includes a closable graphic and adding nodes, thereby improving user experience.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一 个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, the functional modules/units in the system, and the device can be implemented as software, firmware, hardware, and an appropriate combination thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical components. Components cooperate to execute. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those of ordinary skill in the art, the term computer storage media includes both volatile and nonvolatile media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. permanent, removable and non-removable media. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .
虽然本公开所揭露的实施方式如上,但所述的内容仅为便于理解本公开而采用的实施方式,并非用以限定本公开。任何本公开所属领域内的技术人员,在不脱离本公开所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本公开的保护范围,仍须以所附的权利要求书所界定的范围为准。Although the embodiments disclosed in the present disclosure are as above, the content described is only the embodiments adopted to facilitate understanding of the present disclosure, and is not intended to limit the present disclosure. Any person skilled in the art to which this disclosure belongs can make any modifications and changes in the form and details of implementation without departing from the spirit and scope disclosed by this disclosure, but the protection scope of this disclosure must still be limited to The scope defined in the appended claims shall prevail.

Claims (20)

  1. 一种图形绘制方法,包括:A graph drawing method, comprising:
    接收用户的第一输入;receiving a first input from the user;
    检测所述第一输入的内容是否包括可封闭图形,所述可封闭图形为封闭图形或通过图形识别方法识别为封闭图形的图形;Detecting whether the content of the first input includes a closable figure, and the closable figure is a closed figure or a figure recognized as a closed figure by a figure recognition method;
    当所述第一输入的内容包括可封闭图形时,识别所述可封闭图形的形状为第一封闭图形,生成外框为所述第一封闭图形的第一节点。When the content of the first input includes a closeable figure, identifying the shape of the closeable figure as a first closed figure, and generating an outer frame as a first node of the first closed figure.
  2. 根据权利要求1所述的图形绘制方法,在所述接收用户的第一输入之前,所述方法还包括:接收用户的第二输入,所述第二输入的内容为一个或多个字符;According to the graphics drawing method according to claim 1, before receiving the first input from the user, the method further comprises: receiving a second input from the user, the content of the second input being one or more characters;
    在识别所述可封闭图形的形状为第一封闭图形之后且生成所述第一节点之前,所述方法还包括:检测所述第一封闭图形与所述第二输入中的字符在图形绘制界面上的位置关系;当所述第一封闭图形与所述第二输入中的字符存在交叠区域时,执行生成外框为所述第一封闭图形的第一节点的操作,并根据所述第二输入的内容生成所述第一节点的节点名称。After identifying the shape of the closable figure as the first closed figure and before generating the first node, the method further includes: detecting that the first closed figure and the character in the second input are in a figure drawing interface positional relationship on the first closed graph; when there is an overlapping area between the first closed graph and the characters in the second input, perform the operation of generating the outer frame as the first node of the first closed graph, and according to the first closed graph The content of the second input generates the node name of the first node.
  3. 根据权利要求1所述的图形绘制方法,在所述接收用户的第一输入之前,所述方法还包括:接收用户的第二输入,所述第二输入的内容为一个或多个字符;According to the graphics drawing method according to claim 1, before receiving the first input from the user, the method further comprises: receiving a second input from the user, the content of the second input being one or more characters;
    在识别所述可封闭图形的形状为第一封闭图形之后且生成所述第一节点之前,所述方法还包括:检测所述第一封闭图形与所述第二输入中的字符在图形绘制界面上的位置关系;当所述第一封闭图形包含所述第二输入中的全部字符时,执行生成外框为所述第一封闭图形的第一节点的操作,并根据所述第二输入的内容生成所述第一节点的节点名称。After identifying the shape of the closable figure as the first closed figure and before generating the first node, the method further includes: detecting that the first closed figure and the character in the second input are in a figure drawing interface positional relationship on the graph; when the first closed graph contains all the characters in the second input, execute the operation of generating the outer frame as the first node of the first closed graph, and according to the second input The content generates the node name of the first node.
  4. 根据权利要求1所述的图形绘制方法,在所述接收用户的第一输入之前,所述方法还包括:接收用户的第二输入,所述第二输入的内容为一个或多个字符;According to the graphics drawing method according to claim 1, before receiving the first input from the user, the method further comprises: receiving a second input from the user, the content of the second input being one or more characters;
    在识别所述可封闭图形的形状为第一封闭图形之后且生成所述第一节点之前,所述方法还包括:检测所述第一封闭图形与所述第二输入中的字符在图形绘制界面上的位置关系;当所述第一封闭图形与所述第二输入中的任一个字符不存在交叠区域时,响应用户的第五操作,移动所述第一封闭图形或所述字符的位置,所述第五操作为拖拽所述第一封闭图形或所述字符;当所述第一封闭图形与所述第二输入中的至少一个字符存在交叠区域时,执行生成外框为所述第一封闭图形的第一节点的操作,并根据所述第二输入的内容生成所述第一节点的节点名称。After identifying the shape of the closable figure as the first closed figure and before generating the first node, the method further includes: detecting that the first closed figure and the character in the second input are in a figure drawing interface The positional relationship on the above; when there is no overlapping area between the first closed figure and any character in the second input, in response to the fifth operation of the user, move the position of the first closed figure or the character , the fifth operation is dragging the first closed figure or the character; when there is an overlapping area between the first closed figure and at least one character in the second input, execute generating an outer frame for the The operation of the first node of the first closed graph is performed, and the node name of the first node is generated according to the content of the second input.
  5. 根据权利要求1所述的图形绘制方法,在所述接收用户的第一输入之后且生成所述第一节点之前,所述方法还包括:According to the graph drawing method according to claim 1, after receiving the user's first input and before generating the first node, the method further comprises:
    接收用户的第三输入,所述第三输入的内容为一个或多个字符;receiving a third input from the user, where the content of the third input is one or more characters;
    检测所述第一封闭图形与所述第三输入中的字符在图形绘制界面上的位置关系;Detecting the positional relationship between the first closed figure and the characters in the third input on the graphic drawing interface;
    当所述第一输入中的第一封闭图形与所述第三输入中的至少一个字符存在交叠区域时,执行生成外框为所述第一封闭图形的第一节点的操作,并根据所述第三输入的内容生成所述第一节点的节点名称。When there is an overlapping area between the first closed graph in the first input and at least one character in the third input, perform the operation of generating the outer frame as the first node of the first closed graph, and according to the Generate the node name of the first node based on the content of the third input.
  6. 根据权利要求1所述的图形绘制方法,在所述接收用户的第一输入之后且生成所述第一节点之前,所述方法还包括:According to the graph drawing method according to claim 1, after receiving the user's first input and before generating the first node, the method further comprises:
    接收用户的第三输入,所述第三输入的内容为一个或多个字符;receiving a third input from the user, where the content of the third input is one or more characters;
    检测所述第一封闭图形与所述第三输入中的字符在图形绘制界面上的位置关系;Detecting the positional relationship between the first closed figure and the characters in the third input on the graphic drawing interface;
    当所述第一输入中的第一封闭图形包含所述第三输入中的全部字符时,执行生成外框为所述第一封闭图形的第一节点的操作,并根据所述第三输入的内容生成所述第一节点的节点名称。When the first closed graph in the first input contains all the characters in the third input, perform the operation of generating the outer frame as the first node of the first closed graph, and according to the third input The content generates the node name of the first node.
  7. 根据权利要求1所述的图形绘制方法,在所述接收用户的第一输入之后且生成所述第一节点之前,所述方法还包括:According to the graph drawing method according to claim 1, after receiving the user's first input and before generating the first node, the method further comprises:
    接收用户的第三输入,所述第三输入的内容为一个或多个字符;receiving a third input from the user, where the content of the third input is one or more characters;
    检测所述第一封闭图形与所述第三输入中的字符在图形绘制界面上的位置关系;Detecting the positional relationship between the first closed figure and the characters in the third input on the graphic drawing interface;
    当所述第一输入中的第一封闭图形与所述第三输入中的任一个字符不存在交叠区域时,响应用户的第五操作,移动所述第一封闭图形或所述字符的位置,所述第五操作为拖拽所述第一封闭图形或所述字符;When there is no overlapping area between the first closed figure in the first input and any character in the third input, in response to the user's fifth operation, move the position of the first closed figure or the character , the fifth operation is dragging the first closed figure or the character;
    当所述第一封闭图形与所述第三输入中的至少一个字符存在交叠区域时,执行生成外框为所述第一封闭图形的第一节点的操作,并根据所述第三输入的内容生成所述第一节点的节点名称。When there is an overlapping area between the first closed graph and at least one character in the third input, perform the operation of generating the outer frame as the first node of the first closed graph, and according to the third input The content generates the node name of the first node.
  8. 根据权利要求5至7任一所述的图形绘制方法,在所述接收用户的第一输入之后且在所述接收用户的第三输入之前,所述方法还包括:According to the graphics drawing method according to any one of claims 5 to 7, after receiving the first input from the user and before receiving the third input from the user, the method further includes:
    显示所述可封闭图形为第一封闭图形。The closable figure is displayed as a first closed figure.
  9. 根据权利要求1所述的图形绘制方法,所述方法还包括:The graph drawing method according to claim 1, said method further comprising:
    检测是否有编辑所述第一节点的名称的第一操作;Detecting whether there is a first operation to edit the name of the first node;
    当检测到所述第一操作时,通过弹窗接收用户的第四输入,并根据所述第四输入生成所述第一节点的名称。When the first operation is detected, a fourth input from the user is received through a pop-up window, and the name of the first node is generated according to the fourth input.
  10. 根据权利要求1所述的图形绘制方法,所述方法还包括:The graph drawing method according to claim 1, said method further comprising:
    识别所述可封闭图形是否与当前图形绘制界面中的任一节点连接;identifying whether the closable graph is connected to any node in the current graph drawing interface;
    当所述可封闭图形与所述当前图形绘制界面中的任一节点均未连接时,生成的所述第一节点为自由节点;When the closable graph is not connected to any node in the current graph drawing interface, the generated first node is a free node;
    当所述可封闭图形与所述当前图形绘制界面中的第二节点连接时,生成的所述第一节点为所述第二节点的子节点,所述第二节点为所述当前图形绘制界面中的根节点或子节点。When the closable graph is connected to the second node in the current graph drawing interface, the generated first node is a child node of the second node, and the second node is the current graph drawing interface A root node or child node in .
  11. 根据权利要求10所述的图形绘制方法,所述方法还包括:The graph drawing method according to claim 10, said method further comprising:
    检测是否有所述自由节点被选中的第二操作;A second operation of detecting whether the free node is selected;
    当检测到所述第二操作时,在所述自由节点所在区域显示删除按钮,所述删除按钮用于删除所述删除按钮所在位置的节点。When the second operation is detected, a delete button is displayed in the area where the free node is located, and the delete button is used to delete the node where the delete button is located.
  12. 根据权利要求10所述的图形绘制方法,所述方法还包括:The graph drawing method according to claim 10, said method further comprising:
    检测是否有将所述自由节点移动至所述当前图形绘制界面中的任一节点所在区域的第三操作;Detecting whether there is a third operation of moving the free node to the area where any node in the current graphics drawing interface is located;
    当检测到所述第三操作时,将所述自由节点添加为所述当前图形绘制界面中的第三节点,所述第三节点的父节点为所述第三操作中的自由节点被移动后所在区域的节点。When the third operation is detected, the free node is added as a third node in the current graphical drawing interface, and the parent node of the third node is after the free node in the third operation is moved node in the region.
  13. 根据权利要求10所述的图形绘制方法,所述方法还包括:The graph drawing method according to claim 10, said method further comprising:
    接收用户的第五输入,所述第五输入包括至少一条连接线,所述连接线被配置为连接所述自由节点与所述当前图形绘制界面中的第二节点;receiving a fifth input from the user, the fifth input including at least one connecting line configured to connect the free node with a second node in the current graphical drawing interface;
    将所述自由节点添加为所述当前图形绘制界面中的第四节点,所述第四节点的父节点为所述第五输入中的连接线连接的第二节点。The free node is added as a fourth node in the current graphic drawing interface, and the parent node of the fourth node is the second node connected by the connection line in the fifth input.
  14. 根据权利要求13所述的图形绘制方法,其中,所述连接线为直线连接线、折线连接线或曲线连接线。The graph drawing method according to claim 13, wherein the connection line is a straight connection line, a polyline connection line or a curved connection line.
  15. 根据权利要求10所述的图形绘制方法,所述方法还包括:The graph drawing method according to claim 10, said method further comprising:
    检测是否有所述第二节点被选中的第四操作;A fourth operation of detecting whether the second node is selected;
    当检测到所述第四操作且所述第二节点为根节点时,在所述根节点所在区域显示添加按钮,所述添加按钮用于添加所述添加按钮所在位置节点的子节点;When the fourth operation is detected and the second node is a root node, an add button is displayed in the area where the root node is located, and the add button is used to add a child node of the node where the add button is located;
    当检测到所述第四操作且所述第二节点为非根节点时,在所述第二节点所在区域显示添加按钮和删除按钮,所述删除按钮用于删除所述删除按钮所在位置的节点。When the fourth operation is detected and the second node is a non-root node, an add button and a delete button are displayed in the area where the second node is located, and the delete button is used to delete the node at the position where the delete button is located .
  16. 根据权利要求1所述的图形绘制方法,所述方法还包括:The graph drawing method according to claim 1, said method further comprising:
    检测节点名称包含的字符个数和/或长度;Detect the number and/or length of characters contained in the node name;
    当所述节点名称包含的字符个数和/或长度超过预设的第一阈值时,调整节点的外框的宽度和高度,以使得所述节点名称分行显示。When the number and/or length of characters contained in the node name exceeds a preset first threshold, the width and height of the frame of the node are adjusted so that the node name is displayed in rows.
  17. 根据权利要求1所述的图形绘制方法,其中,所述图形绘制界面中的任一节点的数据结构包括以下至少之一:节点的左边位置、节点的顶边位置、是否为根节点、是否为自由节点、子节点集合、节点的文本内容、节点的矩形尺寸。The graph drawing method according to claim 1, wherein the data structure of any node in the graph drawing interface includes at least one of the following: the left position of the node, the top edge position of the node, whether it is a root node, whether it is A free node, a collection of child nodes, the text content of the node, and the rectangular size of the node.
  18. 根据权利要求1所述的图形绘制方法,其中,所述可封闭图形的形状包括直线多边形、曲线多边形或者直线形与曲线组成的封闭图形。The graph drawing method according to claim 1, wherein the shape of the closeable graph includes a straight polygon, a curved polygon, or a closed graph composed of a straight line and a curve.
  19. 一种图形绘制装置,包括处理器及存储器,所述处理器用于执行所述存储器中存储的程序,以实现如权利要求1至权利要求18任一项所述的图形绘制方法的步骤。A graphics drawing device, comprising a processor and a memory, the processor is used to execute the program stored in the memory, so as to realize the steps of the graphics drawing method according to any one of claims 1 to 18.
  20. 一种计算机可读存储介质,所述计算机可读存储介质上存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如权利要求1至权利要求18任一项所述的图形绘制方法的步骤。A computer-readable storage medium, one or more programs are stored on the computer-readable storage medium, and the one or more programs can be executed by one or more processors, so as to implement claims 1 to 1 18. The steps of the graphic drawing method described in any one of 18.
PCT/CN2021/121039 2021-09-27 2021-09-27 Graph drawing method and apparatus, and computer-readable storage medium WO2023044913A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202180002703.6A CN116194876A (en) 2021-09-27 2021-09-27 Graph drawing method and device and computer readable storage medium
PCT/CN2021/121039 WO2023044913A1 (en) 2021-09-27 2021-09-27 Graph drawing method and apparatus, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/121039 WO2023044913A1 (en) 2021-09-27 2021-09-27 Graph drawing method and apparatus, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
WO2023044913A1 true WO2023044913A1 (en) 2023-03-30

Family

ID=85719915

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/121039 WO2023044913A1 (en) 2021-09-27 2021-09-27 Graph drawing method and apparatus, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN116194876A (en)
WO (1) WO2023044913A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050193327A1 (en) * 2004-02-27 2005-09-01 Hui Chao Method for determining logical components of a document
CN101419714A (en) * 2008-10-27 2009-04-29 浙江大学 Interactive document typesetting method based on quick sketch
CN112711362A (en) * 2020-12-24 2021-04-27 北京华宇信息技术有限公司 Method and device for generating hand-drawn flow chart icon in standardized manner

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050193327A1 (en) * 2004-02-27 2005-09-01 Hui Chao Method for determining logical components of a document
CN101419714A (en) * 2008-10-27 2009-04-29 浙江大学 Interactive document typesetting method based on quick sketch
CN112711362A (en) * 2020-12-24 2021-04-27 北京华宇信息技术有限公司 Method and device for generating hand-drawn flow chart icon in standardized manner

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SCAVIN: "DrawExpress Diagram Lite hand-drawn mind map [iOS/Android])", 25 December 2014 (2014-12-25), pages 1 - 5, XP093052388, Retrieved from the Internet <URL:https://www.appinn.com/drawexpress-diagram/> [retrieved on 20230607] *

Also Published As

Publication number Publication date
CN116194876A (en) 2023-05-30

Similar Documents

Publication Publication Date Title
US10984295B2 (en) Font recognition using text localization
US10699166B2 (en) Font attributes for font recognition and similarity
US11074397B1 (en) Adaptive annotations
JP7065023B2 (en) System and method to guide handwritten figure input
WO2020192463A1 (en) Display method and apparatus
US6952803B1 (en) Method and system for transcribing and editing using a structured freeform editor
US9824304B2 (en) Determination of font similarity
JP4486325B2 (en) How to display a writing guide for a freeform document editor
US20020064308A1 (en) System and methods for spacing, storing and recognizing electronic representations of handwriting printing and drawings
JP6820919B2 (en) Systems and methods for recognizing handwritten figure connectors
CN108351745A (en) The system and method for digital notes record
TWI550519B (en) Chart drawing method
KR102075433B1 (en) Handwriting input apparatus and control method thereof
JP2020504848A (en) System and method for managing hand-drawn graphical connectors
US11561637B2 (en) Method and device of drawing handwriting track, electronic apparatus, medium, and program product
US8564620B2 (en) Method for automatically adjusting the rendered fidelity of elements of a composition
JP2022548494A (en) Method and corresponding device for selecting graphic objects
CN110692060A (en) Electronic text pen system and method
CN107870911B (en) Data visualization display method and equipment
US11914951B2 (en) Semantically-guided template generation from image content
US9465785B2 (en) Methods and apparatus for comic creation
WO2023044913A1 (en) Graph drawing method and apparatus, and computer-readable storage medium
Plimmer et al. Beautifying sketching-based design tool content: issues and experiences
US10514841B2 (en) Multi-layered ink object
US20190220096A1 (en) System and method for natural content editing with gestures

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21958031

Country of ref document: EP

Kind code of ref document: A1