CN111611782A - Connection point generation method and device - Google Patents

Connection point generation method and device Download PDF

Info

Publication number
CN111611782A
CN111611782A CN201910139089.2A CN201910139089A CN111611782A CN 111611782 A CN111611782 A CN 111611782A CN 201910139089 A CN201910139089 A CN 201910139089A CN 111611782 A CN111611782 A CN 111611782A
Authority
CN
China
Prior art keywords
target
edge
coordinate value
connection point
graph
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201910139089.2A
Other languages
Chinese (zh)
Other versions
CN111611782B (en
Inventor
叶师思
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Guangzhou Kingsoft Mobile Technology Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Guangzhou Kingsoft Mobile Technology Co Ltd
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 Beijing Kingsoft Office Software Inc, Zhuhai Kingsoft Office Software Co Ltd, Guangzhou Kingsoft Mobile Technology Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN201910139089.2A priority Critical patent/CN111611782B/en
Publication of CN111611782A publication Critical patent/CN111611782A/en
Application granted granted Critical
Publication of CN111611782B publication Critical patent/CN111611782B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention provides a connection point generation method and a connection point generation device, which can determine a graph to be processed in a target document, acquire coordinate values of connection points at two ends of a target edge in the target document when receiving a connection point generation instruction aiming at the target edge in the graph to be processed, determine target coordinate values of target positions of the connection points required to be generated by a user in the target edge according to the coordinate values and position marks carried in the connection point generation instruction, and generate connection points in the target document according to the target coordinate values. Based on the processing, the coordinate value of the position of the connecting point required to be generated by the user can be determined according to the coordinate value of the existing connecting point in the graph to be processed, and then the connecting point is generated.

Description

Connection point generation method and device
Technical Field
The invention relates to the technical field of computers, in particular to a connection point generation method and device.
Background
With the rapid development of computer technology, information-based office work gradually goes deep into various industries, and the office efficiency of users is also continuously improved. For example, with an office application, a user may create a polygon in a document, which may be used to create a flow chart, or other schematic, for presentation.
The polygon typically includes a plurality of connection points at the intersection of each two edges. The user may manipulate the connection points to change the size and shape of the polygon. The user may also add connection points at equal divisions of the edges of the polygon (e.g., the midpoints of the edges) to meet the user's personalized needs. For example, when a user needs to add a connection point at the midpoint of a certain edge, the user needs to visually observe the edge and determine the position of the midpoint of the edge, and then the user can select to add a connection point at the determined position.
However, the inventor finds that the prior art has at least the following problems in the process of implementing the invention:
the position determined manually by the user has a large error, and a new connection point cannot be built at the real position of the middle point of the edge, so that the user experience is reduced.
Disclosure of Invention
The embodiment of the invention aims to provide a connection point generation method and device to improve user experience. The specific technical scheme is as follows:
in a first aspect, to achieve the above object, an embodiment of the present invention discloses a method for generating a connection point, where the method includes:
determining a graph to be processed in a target document, wherein the graph to be processed is a polygon;
when a connecting point generation instruction for a target edge in the graph to be processed is received, coordinate values of connecting points at two ends of the target edge in the target document are obtained;
determining a target coordinate value of a target position of a connection point required to be generated by a user in the target edge according to the coordinate value and a position identifier carried in the connection point generation instruction, wherein the position identifier is used for representing the position of the target position in the target edge;
and generating a connecting point in the target document according to the target coordinate value.
Optionally, the position identifier indicates that the target position is a position corresponding to a midpoint of the target edge;
the determining, according to the coordinate value and the position identifier carried in the connection point generation instruction, a target coordinate value of a target position where a user needs to generate a connection point in the target edge includes:
calculating an abscissa value of the midpoint of the target edge according to the abscissa values of the connection points at the two ends of the target edge, and calculating an ordinate value of the midpoint of the target edge according to the ordinate values of the connection points at the two ends of the target edge;
and taking the abscissa value of the middle point of the target edge and the ordinate value of the middle point of the target edge as the target coordinate value.
Optionally, the target edge is all edges that constitute the graph to be processed, and the position identifier indicates that the target position is a position corresponding to a midpoint of the target edge;
the determining, according to the coordinate value and the position identifier carried in the connection point generation instruction, a target coordinate value of a target position where a user needs to generate a connection point in the target edge includes:
aiming at each side in the graph to be processed, calculating a coordinate value of a middle point of the side according to coordinate values of connecting points at two ends of the side;
and taking the coordinate value of the midpoint of each side obtained by calculation as the target coordinate value.
Optionally, after generating the connection point in the target document according to the target coordinate value, the method further includes:
and displaying the connection points generated in the target edges in a preset form.
In a second aspect, to achieve the above object, an embodiment of the present invention discloses a connection point generating apparatus, including:
the system comprises a first determining module, a second determining module and a processing module, wherein the first determining module is used for determining a graph to be processed in a target document, and the graph to be processed is a polygon;
the acquisition module is used for acquiring coordinate values of the connection points at two ends of the target edge in the target document when receiving a connection point generation instruction aiming at the target edge in the graph to be processed;
a second determining module, configured to determine, according to the coordinate value and a position identifier carried in the connection point generation instruction, a target coordinate value of a target position where a user needs to generate a connection point in the target edge, where the position identifier is used to indicate a position of the target position in the target edge;
and the generating module is used for generating a connecting point in the target document according to the target coordinate value.
Optionally, the position identifier indicates that the target position is a position corresponding to a midpoint of the target edge;
the second determining module is specifically configured to calculate an abscissa value of a midpoint of the target edge according to the abscissa values of the connection points at the two ends of the target edge, and calculate an ordinate value of the midpoint of the target edge according to the ordinate values of the connection points at the two ends of the target edge;
and taking the abscissa value of the middle point of the target edge and the ordinate value of the middle point of the target edge as the target coordinate value.
Optionally, the target edge is all edges that constitute the graph to be processed, and the position identifier indicates that the target position is a position corresponding to a midpoint of the target edge;
the second determining module is specifically configured to calculate, for each edge of the graph to be processed, a coordinate value of a midpoint of the edge according to coordinate values of connection points at two ends of the edge;
and taking the coordinate value of the midpoint of each side obtained by calculation as the target coordinate value.
Optionally, the apparatus further comprises:
and the processing module is used for displaying the connection points generated in the target edges in a preset form.
In a third aspect, in order to achieve the above object, an embodiment of the present invention discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement any one of the connection point generation methods described above when executing the program stored in the memory.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to execute any one of the above-described connection point generation methods.
In yet another aspect of the present invention, the present invention further provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any of the above-mentioned connection point generation methods.
The connection point generation method and device provided by the embodiment of the invention can determine a graph to be processed in a target document, when a connection point generation instruction aiming at a target side in the graph to be processed is received, coordinate values of connection points at two ends of the target side in the target document are obtained, a target coordinate value of a target position where a user needs to generate the connection point in the target side is determined according to the coordinate value and a position identification carried in the connection point generation instruction, and the connection point is generated in the target document according to the target coordinate value. Based on the processing, the coordinate value of the position of the connecting point required to be generated by the user can be determined according to the coordinate value of the existing connecting point in the graph to be processed, and then the connecting point is generated.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a connection point generation method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a triangular connection point according to an embodiment of the present invention;
fig. 3 is a flowchart of an example of a connection point generation method according to an embodiment of the present invention;
fig. 4 is a structural diagram of a connection point generating apparatus according to an embodiment of the present invention;
fig. 5 is a structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the prior art, a position determined manually by a user has a large error, and a new connection point cannot be established at the real position of the middle point of the edge, so that the user experience is reduced.
In order to solve the above problem, embodiments of the present invention provide a connection point generation method and apparatus, which may be applied to a target application, and the target application may be embedded in an office application such as office to be called by the office application.
The target application program can determine a graph to be processed in a target document, when receiving a connecting point generation instruction aiming at a target side in the graph to be processed, coordinate values of the connecting points at two ends of the target side in the target document are obtained, a target coordinate value of a target position of the connecting point required to be generated by a user in the target side is determined according to the coordinate value and a position identification carried in the connecting point generation instruction, and the connecting point is generated in the target document according to the target coordinate value. Based on the processing, the coordinate value of the position of the connecting point required to be generated by the user can be determined according to the coordinate value of the existing connecting point in the graph to be processed, and then the connecting point is generated.
Referring to fig. 1, fig. 1 is a flowchart of a connection point generation method according to an embodiment of the present invention, where the method may include the following steps:
s101: and determining the graph to be processed in the target document.
The graph to be processed is a polygon, for example, the graph to be processed may be a triangle, a quadrangle, a pentagon, or the like. The target document may be a document used by a user to edit the graphics to be processed, for example, the target document may be a WORD document.
In implementation, during the process of processing the graphics in the target document by the user, if the user needs to add a connection point on the side of a certain graphic (to be processed), the user may click the graphic to be processed through the input device to select the graphic to be processed. Accordingly, the target application may determine that the graphics selected by the user are to-be-processed graphics in the target document.
S102: and when receiving a connecting point generation instruction aiming at a target edge in the graph to be processed, acquiring coordinate values of the connecting points at two ends of the target edge in the target document.
The coordinate values comprise abscissa values and ordinate values of connecting points at two ends of the target edge in the target document. The target edge may be one or more. If there is one target edge, the target edge may be any edge in the graph to be processed.
In implementation, a user may select an edge (i.e., a target edge) of a to-be-processed graph to which a connection point needs to be added, and select to add a connection point for the target edge, and accordingly, the target application program may receive a connection point generation instruction for the target edge in the to-be-processed graph, which is input by the user, and then the target application program may obtain coordinate values of the connection points at both ends of the target edge in the target document.
In one implementation, a user may click and select a to-be-processed graph with a mouse, then, the user may click a right button of the mouse, and select "add a connection point to the current edge", and accordingly, the target application may determine the current position of the mouse pointer, determine the target edge as an edge corresponding to the current position of the mouse pointer, and then, the target application may obtain an abscissa value and an ordinate value of the connection point at both ends of the target edge in the target document.
In another implementation, a user may click and select a to-be-processed graph with a mouse, then, the user may click a right button of the mouse, and select "add a connection point to an edge of a current graph", and accordingly, the target application program may determine that the target edge is all edges in the to-be-processed graph, and then, the target application program may obtain abscissa values and ordinate values of all currently existing connection points in the to-be-processed graph in the target document.
S103: and determining the target coordinate value of the target position of the connection point which needs to be generated by the user in the target edge according to the coordinate value and the position identifier carried in the connection point generation instruction.
The position mark is used for representing the position of the target position in the target edge. The target position is usually a position corresponding to a bisected position of the target edge, for example, the target position may be a position corresponding to a midpoint of the target edge, or may be a position corresponding to a trisection of the target edge, but the present invention is not limited thereto.
In implementation, the connection point generation instruction may further carry a position identifier, and accordingly, after the target application program obtains the coordinate values of the connection points at the two ends of the target side in the target document, the target application program may determine, according to the obtained coordinate values and the position identifier, the coordinate values of the target position (i.e., the target coordinate values) at which the user needs to generate the connection points in the target side.
Optionally, the target application may generate the connection point at the midpoint of the target edge according to the instruction of the user, that is, the location identifier may indicate that the target location is the location corresponding to the midpoint of the target edge, and accordingly, S103 may include the following steps:
step one, calculating an abscissa value of the midpoint of the target edge according to the abscissa values of the connection points at the two ends of the target edge, and calculating an ordinate value of the midpoint of the target edge according to the ordinate values of the connection points at the two ends of the target edge.
In implementation, when the user needs to generate a connection point at the midpoint of the target edge, the location identifier carried in the connection point generation instruction input by the user may indicate that the target location is a location corresponding to the midpoint of the target edge. Correspondingly, after the target application program obtains the coordinate values (including the abscissa value and the ordinate value) of the connection points at the two ends of the target edge in the target document, the target application program may calculate the abscissa value of the midpoint of the target edge according to the abscissa values of the connection points at the two ends of the target edge, and calculate the ordinate value of the midpoint of the target edge according to the ordinate values of the connection points at the two ends of the target edge.
In one implementation, a user may click and select a graph to be processed with a mouse, then, the user may click a right button of the mouse, and select "add a connection point at a midpoint of a current edge", accordingly, the target application program may determine a current position of a mouse pointer, and determine a target edge as an edge corresponding to the current position of the mouse pointer, and then, the target application program may obtain an abscissa value and an ordinate value of the connection points at both ends of the target edge in the target document, and further calculate to obtain an abscissa value and an ordinate value of the midpoint of the target edge.
For example, the coordinate values of the connection points at the two ends of the target edge in the target document are (X1, Y1), (X2, Y2), respectively, and the target application program can obtain the abscissa value of the midpoint of the target edge as
Figure BDA0001977967070000071
The longitudinal coordinate value of the midpoint of the target edge is
Figure BDA0001977967070000072
And step two, taking the abscissa value of the middle point of the target edge and the ordinate value of the middle point of the target edge as target coordinate values.
In an implementation, after obtaining the abscissa and ordinate values of the midpoint of the target edge, the target application may use the abscissa and ordinate values of the midpoint of the target edge as the target coordinate values to generate the connection point.
For the example in step one, the target application may determine the target coordinate value as
Figure BDA0001977967070000073
Figure BDA0001977967070000074
Optionally, the target application may also generate a join point at the midpoint of each edge in the graph to be processed. That is, the target edge is all edges constituting the graph to be processed, and the position identifier indicates that the target position is a position corresponding to a midpoint of the target edge, and accordingly, S103 may include the following steps:
step one, aiming at each side in the graph to be processed, calculating the coordinate value of the middle point of the side according to the coordinate values of the connecting points at the two ends of the side.
In implementation, when a user selects to generate a connection point at the midpoint of each target edge in the graph to be processed, for each edge in the graph to be processed, the target application program may calculate the coordinate value of the midpoint of the edge according to the coordinate values of the connection points at the two ends of the edge, and may further obtain the coordinate value of the midpoint of each edge in the graph to be processed.
In one implementation, a user may click and select a to-be-processed graph with a mouse, then, the user may click a right button of the mouse, and select "add a connection point at a midpoint of all edges of a current graph", accordingly, the target application program may determine that the target edge is all edges in the to-be-processed graph, then, the target application program may obtain abscissa values and ordinate values of all currently existing connection points in the to-be-processed graph in the target document, and may further calculate and obtain coordinate values of the midpoint of each edge in the to-be-processed graph.
For example, the to-be-processed graph is a triangle, the target edge is three edges of the triangle, and the target application may obtain coordinate values of three current connection points of the triangle, which are respectively (X1, Y1), (X2, Y2), (X3, and Y3). The target application program can obtain coordinate values of midpoints of the three sides, wherein the coordinate values are respectively
Figure BDA0001977967070000081
In addition, for an N (N ≧ 3) polygon, in office applications, the N polygon usually includes N +1 connection points, where the coordinate values of the first connection point and the last connection point are the same.
In this step, the target application program may obtain coordinate values of all the connection points of the N-polygon, and sequentially store the coordinate values in the array a. For example, referring to fig. 2, the triangle contains four connection points: the coordinate values of the connection point P1, the connection point P2, the connection point P3 and the connection point P4 are the same, and the coordinate values of the connection point P1 and the connection point P4 are the same. The coordinate values of the connection point P1 and the connection point P4 are (X1, Y1), the coordinate value of the connection point P2 is (X2, Y2), and the coordinate value of the connection point P3 is (X3, Y3).
The target application program may sequentially obtain coordinate values of each connection point in a counterclockwise direction from the connection point P1, and store the coordinate values in the array a, so as to obtain an array a { (X1, Y1) (X2, Y2) (X3, Y3) (X1, Y1) }. The target application may start from the second element (X2, Y2) in the array A and calculate the coordinate values of the middle point of the edge between the connection point corresponding to the element (X2, Y2) and the connection point corresponding to the previous element (X1, Y1)
Figure BDA0001977967070000091
Until the coordinate value of the midpoint of the edge between the connection point corresponding to the last element (X1, Y1) and the connection point corresponding to the last element (X3, Y3) in the array A is calculated
Figure BDA0001977967070000092
And step two, using the coordinate value of the midpoint of each side obtained by calculation as a target coordinate value.
In implementation, after the target application program obtains the coordinate values of the midpoints of all the edges included in the graph to be processed, the target application program may use the obtained coordinate values of the midpoints as the target coordinate values.
For example, for the example in step one, where the graph to be processed is a triangle, the target application may be to
Figure BDA0001977967070000093
And
Figure BDA0001977967070000094
Figure BDA0001977967070000095
as target coordinate values for generating the connection points.
S104: and generating a connecting point in the target document according to the target coordinate value.
In implementation, the target application may generate the connection point in the target document according to the target coordinate value, that is, the target application generates the connection point at a position corresponding to the target coordinate value.
For example, the graph to be processed is a triangle, and the target coordinate values include
Figure BDA0001977967070000096
Figure BDA0001977967070000097
And
Figure BDA0001977967070000098
the target application mayCall the function of generating a connection point of the office application in
Figure BDA0001977967070000099
Figure BDA00019779670700000910
And
Figure BDA00019779670700000911
the connection point is generated at a corresponding location, i.e., the target application may generate the connection point at a location corresponding to a midpoint of the three sides of the triangle.
Optionally, after generating the connection point, the method may further include the following steps:
and displaying the connection points generated in the target edge in a preset form.
The preset form may be set by a technician empirically, for example, by displaying the connection points generated in the target edges in a color different from that of the graphic to be processed.
In an embodiment, after the target application generates the connection point, the target application may display the generated connection point in a preset form, so that a user can conveniently browse the generated connection point, and user experience is further improved.
As can be seen from the above, the connection point generation method provided in the embodiment of the present invention can determine a to-be-processed graph in a target document, and when receiving a connection point generation instruction for a target edge in the to-be-processed graph, obtain coordinate values of connection points at two ends of the target edge in the target document, determine a target coordinate value of a target position where a user needs to generate a connection point in the target edge according to the coordinate value and a position identifier carried in the connection point generation instruction, and generate a connection point in the target document according to the target coordinate value. Based on the processing, the coordinate value of the position of the connecting point required to be generated by the user can be determined according to the coordinate value of the existing connecting point in the graph to be processed, and then the connecting point is generated.
Referring to fig. 3, fig. 3 is a flowchart of an example of a connection point generation method provided in an embodiment of the present invention, where the method may include the following steps:
s301: and determining the graph to be processed in the target document.
Wherein, the graph to be processed is a polygon.
S302: when receiving a connection point generation instruction aiming at the graph to be processed, aiming at each side in the graph to be processed, calculating the coordinate value of the middle point of the side according to the coordinate values of the connection points at the two ends of the side.
Wherein the connecting point generation instruction instructs to generate the connecting point at the position corresponding to the middle point of the edge.
S303: and taking the coordinate value of the midpoint of each side obtained by calculation as a target coordinate value.
S304: and generating a connecting point in the target document according to the target coordinate value.
S305: and displaying the generated connection points in a preset form.
As can be seen from the above, based on the connection point generation method provided by the embodiment of the present invention, the coordinate value of the position where the user needs to generate the connection point can be determined according to the coordinate value of the existing connection point in the graph to be processed, and then the connection point is generated.
Corresponding to the method embodiment of fig. 1, referring to fig. 4, fig. 4 is a block diagram of a connection point generating apparatus according to an embodiment of the present invention, where the apparatus may include:
a first determining module 401, configured to determine a to-be-processed graph in a target document, where the to-be-processed graph is a polygon;
an obtaining module 402, configured to obtain coordinate values of connection points at two ends of a target edge in the target document when receiving a connection point generation instruction for the target edge in the graph to be processed;
a second determining module 403, configured to determine, according to the coordinate value and a position identifier carried in the connection point generation instruction, a target coordinate value of a target position where a user needs to generate a connection point in the target edge, where the position identifier is used to indicate a position of the target position in the target edge;
a generating module 404, configured to generate a connection point in the target document according to the target coordinate value.
Optionally, the position identifier indicates that the target position is a position corresponding to a midpoint of the target edge;
the second determining module 403 is specifically configured to calculate an abscissa value of a midpoint of the target edge according to the abscissa values of the connection points at the two ends of the target edge, and calculate an ordinate value of the midpoint of the target edge according to the ordinate values of the connection points at the two ends of the target edge;
and taking the abscissa value of the middle point of the target edge and the ordinate value of the middle point of the target edge as the target coordinate value.
Optionally, the target edge is all edges that constitute the graph to be processed, and the position identifier indicates that the target position is a position corresponding to a midpoint of the target edge;
the second determining module 403 is specifically configured to calculate, for each edge of the graph to be processed, a coordinate value of a midpoint of the edge according to coordinate values of connection points at two ends of the edge;
and taking the coordinate value of the midpoint of each side obtained by calculation as the target coordinate value.
Optionally, the apparatus further comprises:
and the processing module is used for displaying the connection points generated in the target edges in a preset form.
As can be seen from the above, the connection point generating device provided in the embodiment of the present invention can determine a graph to be processed in a target document, when receiving a connection point generating instruction for a target edge in the graph to be processed, obtain coordinate values of connection points at two ends of the target edge in the target document, determine a target coordinate value of a target position where a user needs to generate a connection point in the target edge according to the coordinate value and a position identifier carried in the connection point generating instruction, and generate a connection point in the target document according to the target coordinate value. Based on the processing, the coordinate value of the position of the connecting point required to be generated by the user can be determined according to the coordinate value of the existing connecting point in the graph to be processed, and then the connecting point is generated.
An embodiment of the present invention further provides an electronic device, as shown in fig. 5, which includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502 and the memory 503 complete mutual communication through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501, when executing the program stored in the memory 503, implements the following steps:
determining a graph to be processed in a target document, wherein the graph to be processed is a polygon;
when a connecting point generation instruction for a target edge in the graph to be processed is received, coordinate values of connecting points at two ends of the target edge in the target document are obtained;
determining a target coordinate value of a target position of a connection point required to be generated by a user in the target edge according to the coordinate value and a position identifier carried in the connection point generation instruction, wherein the position identifier is used for representing the position of the target position in the target edge;
and generating a connecting point in the target document according to the target coordinate value.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
The electronic equipment provided by the embodiment of the invention can determine the coordinate value of the position of the connecting point required to be generated by the user according to the coordinate value of the existing connecting point in the graph to be processed when the connecting point is generated, so as to generate the connecting point.
The embodiment of the present invention further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on a computer, the computer is enabled to execute the connection point generation method provided in the embodiment of the present invention.
Specifically, the connection point generation method includes:
determining a graph to be processed in a target document, wherein the graph to be processed is a polygon;
when a connecting point generation instruction for a target edge in the graph to be processed is received, coordinate values of connecting points at two ends of the target edge in the target document are obtained;
determining a target coordinate value of a target position of a connection point required to be generated by a user in the target edge according to the coordinate value and a position identifier carried in the connection point generation instruction, wherein the position identifier is used for representing the position of the target position in the target edge;
and generating a connecting point in the target document according to the target coordinate value.
It should be noted that other implementation manners of the connection point generation method are partially the same as those of the foregoing method embodiments, and are not described herein again.
By operating the instruction stored in the computer-readable storage medium provided by the embodiment of the invention, when the connection point is generated, the coordinate value of the position of the connection point required to be generated by the user can be determined according to the coordinate value of the existing connection point in the graph to be processed, so that the connection point is generated.
Embodiments of the present invention further provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the connection point generation method provided by the embodiments of the present invention.
Specifically, the connection point generation method includes:
determining a graph to be processed in a target document, wherein the graph to be processed is a polygon;
when a connecting point generation instruction for a target edge in the graph to be processed is received, coordinate values of connecting points at two ends of the target edge in the target document are obtained;
determining a target coordinate value of a target position of a connection point required to be generated by a user in the target edge according to the coordinate value and a position identifier carried in the connection point generation instruction, wherein the position identifier is used for representing the position of the target position in the target edge;
and generating a connecting point in the target document according to the target coordinate value.
It should be noted that other implementation manners of the connection point generation method are partially the same as those of the foregoing method embodiments, and are not described herein again.
By operating the computer program product provided by the embodiment of the invention, when the connection point is generated, the coordinate value of the position of the connection point required to be generated by the user can be determined according to the coordinate value of the existing connection point in the graph to be processed, so that the connection point is generated.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A connection point generation method, the method comprising:
determining a graph to be processed in a target document, wherein the graph to be processed is a polygon;
when a connecting point generation instruction for a target edge in the graph to be processed is received, coordinate values of connecting points at two ends of the target edge in the target document are obtained;
determining a target coordinate value of a target position of a connection point required to be generated by a user in the target edge according to the coordinate value and a position identifier carried in the connection point generation instruction, wherein the position identifier is used for representing the position of the target position in the target edge;
and generating a connecting point in the target document according to the target coordinate value.
2. The method of claim 1, wherein the location identifier indicates that the target location is a location corresponding to a midpoint of the target edge;
the determining, according to the coordinate value and the position identifier carried in the connection point generation instruction, a target coordinate value of a target position where a user needs to generate a connection point in the target edge includes:
calculating an abscissa value of the midpoint of the target edge according to the abscissa values of the connection points at the two ends of the target edge, and calculating an ordinate value of the midpoint of the target edge according to the ordinate values of the connection points at the two ends of the target edge;
and taking the abscissa value of the middle point of the target edge and the ordinate value of the middle point of the target edge as the target coordinate value.
3. The method according to claim 1, wherein the target edge is all edges composing the graph to be processed, and the position identifier indicates that the target position is a position corresponding to a midpoint of the target edge;
the determining, according to the coordinate value and the position identifier carried in the connection point generation instruction, a target coordinate value of a target position where a user needs to generate a connection point in the target edge includes:
aiming at each side in the graph to be processed, calculating a coordinate value of a middle point of the side according to coordinate values of connecting points at two ends of the side;
and taking the coordinate value of the midpoint of each side obtained by calculation as the target coordinate value.
4. The method of claim 1, wherein after said generating a join point in said target document according to said target coordinate values, said method further comprises:
and displaying the connection points generated in the target edges in a preset form.
5. A connection point generation apparatus, characterized in that the apparatus comprises:
the system comprises a first determining module, a second determining module and a processing module, wherein the first determining module is used for determining a graph to be processed in a target document, and the graph to be processed is a polygon;
the acquisition module is used for acquiring coordinate values of the connection points at two ends of the target edge in the target document when receiving a connection point generation instruction aiming at the target edge in the graph to be processed;
a second determining module, configured to determine, according to the coordinate value and a position identifier carried in the connection point generation instruction, a target coordinate value of a target position where a user needs to generate a connection point in the target edge, where the position identifier is used to indicate a position of the target position in the target edge;
and the generating module is used for generating a connecting point in the target document according to the target coordinate value.
6. The apparatus of claim 5, wherein the location identifier indicates that the target location is a location corresponding to a midpoint of the target edge;
the second determining module is specifically configured to calculate an abscissa value of a midpoint of the target edge according to the abscissa values of the connection points at the two ends of the target edge, and calculate an ordinate value of the midpoint of the target edge according to the ordinate values of the connection points at the two ends of the target edge;
and taking the abscissa value of the middle point of the target edge and the ordinate value of the middle point of the target edge as the target coordinate value.
7. The apparatus according to claim 5, wherein the target edge is all edges composing the graph to be processed, and the position identifier indicates that the target position is a position corresponding to a midpoint of the target edge;
the second determining module is specifically configured to calculate, for each edge of the graph to be processed, a coordinate value of a midpoint of the edge according to coordinate values of connection points at two ends of the edge;
and taking the coordinate value of the midpoint of each side obtained by calculation as the target coordinate value.
8. The apparatus of claim 5, further comprising:
and the processing module is used for displaying the connection points generated in the target edges in a preset form.
9. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
the processor, when executing the program stored in the memory, implementing the method steps of any of claims 1-4.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN201910139089.2A 2019-02-25 2019-02-25 Connection point generation method and device Active CN111611782B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910139089.2A CN111611782B (en) 2019-02-25 2019-02-25 Connection point generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910139089.2A CN111611782B (en) 2019-02-25 2019-02-25 Connection point generation method and device

Publications (2)

Publication Number Publication Date
CN111611782A true CN111611782A (en) 2020-09-01
CN111611782B CN111611782B (en) 2024-03-26

Family

ID=72202884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910139089.2A Active CN111611782B (en) 2019-02-25 2019-02-25 Connection point generation method and device

Country Status (1)

Country Link
CN (1) CN111611782B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102331901A (en) * 2011-05-30 2012-01-25 广州视睿电子科技有限公司 Method and device for realizing middle mouse button effect on touch screen
CN105869188A (en) * 2016-04-22 2016-08-17 广州日滨科技发展有限公司 Detection method and system for point to polygon position relation
CN106033352A (en) * 2015-03-20 2016-10-19 广州金山移动科技有限公司 Vertex editing method and device
CN108196670A (en) * 2017-12-25 2018-06-22 深圳市金立通信设备有限公司 A kind of gesture display methods, terminal device and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102331901A (en) * 2011-05-30 2012-01-25 广州视睿电子科技有限公司 Method and device for realizing middle mouse button effect on touch screen
CN106033352A (en) * 2015-03-20 2016-10-19 广州金山移动科技有限公司 Vertex editing method and device
CN105869188A (en) * 2016-04-22 2016-08-17 广州日滨科技发展有限公司 Detection method and system for point to polygon position relation
CN108196670A (en) * 2017-12-25 2018-06-22 深圳市金立通信设备有限公司 A kind of gesture display methods, terminal device and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
赵星: "基于ACIS的虚拟现实平台开发实践" *

Also Published As

Publication number Publication date
CN111611782B (en) 2024-03-26

Similar Documents

Publication Publication Date Title
CN109753641B (en) Method and device for changing object position, electronic equipment and storage medium
CN110377209B (en) Method and device for realizing visual flow configuration through dragging
KR20110044204A (en) Presenting dynamic grids
CN110633959A (en) Method, device, equipment and medium for creating approval task based on graph structure
CN111178017A (en) Method and device for generating flow chart, storage medium and electronic equipment
CN110851225A (en) Method for visually displaying dynamic layout of incremental primitive, terminal device and storage medium
CN110633220A (en) Debugging information display method and device, storage medium and electronic equipment
US11423587B2 (en) Freeform gradient style blending
CN109739859B (en) Relation map drawing method, system and related device
CN111553962A (en) Chart display method, system and display equipment
CN108507563B (en) Cruise path generation method and device
CN111951348A (en) Method and device for determining frame selection area and electronic equipment
CN111611782A (en) Connection point generation method and device
CN112506976B (en) Data flow display method and device, electronic equipment and storage medium
CN115374499A (en) Dimension marking method and device, electronic equipment and storage medium
CN113872798A (en) Method and device for constructing space network topological graph, storage medium and electronic equipment
CN109600558B (en) Method and apparatus for generating information
US20200273222A1 (en) Freeform Gradient Style Transfer
CN109324797B (en) Desktop icon generation method, computer readable storage medium and terminal equipment
CN114070744B (en) Node coordinate generation method, device, equipment and medium of network topology
CN111737372A (en) Map data generation method and device
CN111831187B (en) Method and device for modifying presentation duration of presentation file and electronic equipment
CN112487769A (en) Cell background generation method and device
EP3062247B1 (en) Method and device for magnifying graphic within topology diagram, and computer storage medium
EP4216097A1 (en) Method, system, equipment and medium for modifying the layering layer information of finite element model unit

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant