CN112562036B - Method for drawing configuration system turnout icon by linear polygon - Google Patents

Method for drawing configuration system turnout icon by linear polygon Download PDF

Info

Publication number
CN112562036B
CN112562036B CN202011454247.2A CN202011454247A CN112562036B CN 112562036 B CN112562036 B CN 112562036B CN 202011454247 A CN202011454247 A CN 202011454247A CN 112562036 B CN112562036 B CN 112562036B
Authority
CN
China
Prior art keywords
arrow
point
polygon
end point
icon
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.)
Active
Application number
CN202011454247.2A
Other languages
Chinese (zh)
Other versions
CN112562036A (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.)
Casco Signal Cherngdu Ltd
Original Assignee
Casco Signal Cherngdu 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 Casco Signal Cherngdu Ltd filed Critical Casco Signal Cherngdu Ltd
Priority to CN202011454247.2A priority Critical patent/CN112562036B/en
Publication of CN112562036A publication Critical patent/CN112562036A/en
Application granted granted Critical
Publication of CN112562036B publication Critical patent/CN112562036B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention relates to a method for drawing a configuration system turnout icon by using a straight line polygon, in particular to an intelligent analysis system and method for a tramcar log, which relate to the technical field of tramcar signal systems and comprise an initialization step, a straight line polygon trunk calculation step, an arrow calculation step and an icon generation step, wherein a straight line polygon icon is designed, a parallelogram can be replaced to draw the turnout icon, the method is different from the method that the adjustment on the parallelogram acts on an external rectangle, the change of the side of the parallelogram is inconsistent with the actual operation change, the straight line polygon is composed of a trunk rectangle, a point set of a starting point shape and an end point shape, the value of the point set is directly influenced by the stretching and the shape adjustment of the straight line polygon, the side connected with the point set is the side of the straight line polygon icon, the direct reaction of the adjustment effect is realized, the side effect of the angle change of the adjustment shape of the planiform quadrilateral is eliminated, the problem of the angle change of the parallelogram in the length and size adjustment process of the turnout icon drawn by the parallelogram is solved, and the prospective adjustment on the length and size of the turnout icon is realized.

Description

Method for drawing configuration system turnout icon by linear polygon
Technical Field
The invention relates to the technical field of tramcar signal systems, in particular to a method for drawing a configuration system turnout icon by using a linear polygon.
Background
In the systems such as FAOTS, SSIP, tram, comprehensive operation and maintenance, the engineering station interface is a window of the whole system, is a man-machine operation interface and has a great significance for the whole system. In the process of manufacturing an interface of an engineering station, drawing personnel not only need to configure and check picture graphic data, but also need to draw a large amount of interface equipment graphics. Turnout, signal machine, track section are the key equipment in the signal system, and the equipment quantity is huge, therefore in interface equipment figure drawing, improve the efficiency that the icon was drawn, reduce the work load of adjusting the figure after drawing and seem to be especially important.
In the signal system, the turnout has the characteristics of multiple states, multiple actions and wide influence range. In the graphic drawing of the interface equipment, the drawing method is more complicated than that of a signal machine and a track section for simulating the states of real turnout positioning, inversion, turnout extrusion and the like. The turnout icon comprises 5 parts of a turnout front section, a positioning connection, a positioning section, an inversion connection and an inversion section, wherein a turnout center part is generally an oblique sharp corner figure, but the turnout icon is drawn by splicing a plurality of parallelograms in the prior art, and in the process of adjusting the size and the length of each part, because the adjustment of the parallelogram acts on the external rectangle, the adjustment of the size and the length can bring the side effect of the angle change of the parallelogram relative to the horizontal line, but the angle of the turnout is fixed for one turnout, namely the angle change is not the change required by drawing personnel.
Therefore, it is important to provide a method for adjusting the length and size of the turnout icon without changing the angle, and reducing the workload of the drawing personnel for adjusting the size of the figure.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a configuration system turnout icon drawing method which aims at drawing the shape of a straight line polygon icon, realizing the adjustment of the length and the size of the turnout icon, simultaneously not changing the angle of the turnout icon relative to a horizontal line and eliminating the side effect of angle change generated by adjusting the turnout icon when a parallelogram is used.
The purpose of the invention is realized by the following technical scheme:
a method for drawing a switch icon of a configuration system by using a linear polygon is characterized by comprising the following steps:
initializing, namely initializing a straight line polygon data model comprising key attributes and additional attributes, a starting point arrow instance and an end point arrow instance, and setting the data model of the starting point arrow and the end point arrow;
specifically, the key attributes include a start point coordinate, an end point coordinate, a width parameter, a start point type, an end point type, a start point angle, and an end point angle; the additional attributes comprise a background color parameter, a display center line parameter and a line width parameter. In order to meet the appearance display requirement of the turnout icon, the linear polygon icon has the characteristic of polygon, the boundary is formed by splicing a plurality of edges, the polygon is divided into a main polygon and polygons at end points of two ends, the main polygon is rectangular, the line width of the linear polygon icon can be set, and the shape of the main polygon is changed; the starting point and the end point of the straight line polygon are changeable points, an attribute setting interface is provided, the type of the end point is determined according to the line type, the angle type and the 3 attributes of the angle value, the shape of the end point polygon is changed, and the default shape of the end point polygon is a rectangle.
The data model for setting the starting point arrow and the end point arrow specifically comprises the starting point coordinates, the end point coordinates, the length parameters, the width parameters, the angle parameters and the types of the starting point arrow and the end point arrow.
A step of calculating a linear polygon backbone, which is to correspondingly take the linear polygon data model processed by the initialization step according to the starting point type, the end point type, the starting point angle and the end point angle of the linear polygon in the drawing parameters, construct the starting point and the end point of the linear polygon data model in a two-dimensional coordinate system according to the starting point coordinate, the end point coordinate and the width parameters in the drawing parameters, draw the linear polygon with four vertexes according to the width parameters by taking the connecting line of the starting point and the end point as a central line, and take 4 vertexes as a point set of a backbone polygon of the linear polygon; the icon formed by the linear polygon data model is formed by drawing a plurality of edges by points in a point set, the point set of the linear polygon comprises a trunk polygon point set and an arrow polygon point set, and the point set of the trunk polygon is formed by four vertexes of a rectangle which is drawn around a central line by a fixed width and takes a connecting line of a starting point and an end point of the linear polygon as a center.
Further, the step of calculating the linear polygon skeleton specifically includes:
step 1, setting a starting point and an end point of a straight line polygon data model according to drawing parameters, taking a connecting line of the starting point and the end point as a central line, and drawing two parallel lines parallel to the central line on two sides of the central line by taking the width in the drawing parameters as a distance;
and 2, respectively drawing two perpendicular lines which pass through the starting point and the end point and are perpendicular to the two parallel lines in the step 1, and selecting 4 intersection points of the two parallel lines and the perpendicular lines as a point set of a main polygon of the straight line polygon.
The linear polygon icon integrates the characteristics of a straight line and a polygon, is essentially a straight line with fixed width, takes a connecting line of a starting point and an ending point of the straight line as a center, and takes the fixed width to be around a central line to outline the polygon; in order to meet the requirement of only adjusting the extension length of the turnout icon without changing the angle relative to the horizontal line, the straight line polygon icon covers the straight line characteristics including the starting point, the ending point and the line length of the straight line, and the control points of the starting point and the ending point can enable the turnout icon to adjust the length along the straight line like the straight line without changing the angle.
Preferably, in the step of calculating the linear polygon skeleton, if the linear polygon data model processed in the initialization step does not include a linear polygon data model corresponding to the start point type, the end point type, the start point angle and the end point angle in the drawing parameter, the method further includes a step of constructing a model, and specifically, the method constructs a corresponding linear polygon data model in a two-dimensional coordinate system in an equal proportion by unit number according to the start point type, the end point type, the start point angle and the end point angle in the drawing parameter. In a configuration system, an icon resource of a straight line polygon data model is newly added, the icon is formed by connecting a plurality of points, the adjustment proportion of each side of the parallelogram and the adjustment proportion of the external rectangle, which are caused by the fact that the adjustment different from the parallelogram directly acts on the external rectangle, are different, the adjustment of the shape, the size and the length of the straight line polygon icon directly acts on a point set forming the straight line polygon icon, the change of the adjustment proportion can be directly reflected to each side of the straight line polygon icon, and the effect obtained by adjustment is realized.
An arrow calculation step, correspondingly calling the start arrow instance and the end arrow instance processed by the initialization step according to the start point coordinate, the end point coordinate, the angle parameter and the type of the start arrow and the end arrow in the drawing parameters, respectively selecting the center points ptCenter of the start arrow instance and the end arrow instance, outwards generating a rectangle Rc according to the length parameter and the width parameter in the drawing parameter requirement by taking the center points ptCenter as the center, and constructing a horizontal arrow point set of the start arrow and the end arrow according to the arrow type and the rectangle Rc; according to the different attribute values such as types and angles of the arrows, the point sets of different shapes are calculated in a classification mode through the arrow polygon point sets, and the arrows of different shapes can be drawn.
Preferably, the arrow calculating step specifically includes the following steps:
step 1, respectively selecting center points ptCenter of a starting point arrow instance and an end point arrow instance according to types of the starting point arrow and the end point arrow.
Step 2, respectively generating rectangles Rc of the starting point arrow and the end point arrow outwards according to the height and the width required by the drawing parameters by taking the central point ptCenter of the starting point arrow example and the end point arrow example selected in the step 1 as the center;
and 3, constructing a horizontal arrow point set of the starting point arrow and the end point arrow according to the types of the starting point arrow and the end point arrow and the rectangle Rc of the starting point arrow instance and the end point arrow instance obtained in the step 2.
Step 4, respectively calculating rotation matrixes M between central point vectors (0, ptcenter) and central line vectors (ptStart, ptEnd) of the start arrow and the end arrow;
and 5, calculating the horizontal arrow point sets of the starting point arrow and the end point arrow generated in the step 3 through the rotation matrix M in the step 4, and rotating the horizontal arrow point sets of the starting point arrow and the end point arrow to positions connected with the point sets parallel to the trunk polygon obtained in the linear polygon trunk calculation step.
Further, in the arrow calculation step, if the start point arrow instance and the end point arrow instance processed in the initialization step do not contain the start point arrow instance and the end point arrow instance corresponding to the start point coordinate, the end point coordinate, the angle parameter and the type in the drawing parameter, the method further includes an instance construction step, specifically, the start point arrow instance and the end point arrow instance are constructed in the two-dimensional coordinate system in an equal proportion by unit quantity according to the start point coordinate, the end point coordinate, the angle parameter and the type in the drawing parameter.
An icon generating step, namely merging the point set of the trunk polygon obtained in the linear polygon trunk calculating step and the point set of the horizontal arrow obtained in the arrow calculating step to form a linear polygon point set, and drawing a linear polygon icon; the polygon point set of the trunk and the polygon point set of the arrow are combined to form a straight line polygon point set, two points in the point set are connected in sequence, and then the drawing with the fixed width can be performed, the end points are provided with icons in different shapes, and the drawing requirements of the shape of the turnout icon are met.
Specifically, the icon generating step specifically includes the following steps:
step 1, inserting and replacing the horizontal arrow point sets of the starting point arrow and the end point arrow obtained in the arrow calculation step and the overlapped part of the point sets of the trunk polygon obtained in the linear polygon trunk calculation step, replacing the point sets of the trunk polygon with the horizontal arrow point sets in the overlapped part of the point sets, and deleting the redundant part of the point sets of the trunk polygon to form a linear polygon point set; and adjusting the length of the icon of the linear polygon, and implementing the shape adjustment to the recalculation of the main polygon and the arrow polygon point set, so that the effect of consistent adjustment and expectation of the icon can be realized.
And 2, drawing a linear polygon icon according to the linear polygon point set in the step 1.
Compared with the prior art, the technical scheme comprises the following innovation points and beneficial effects (advantages):
1. the linear polygon icon is designed by the scheme, the switch icon can be drawn by replacing a parallelogram, the adjustment on the parallelogram is different from the adjustment on the parallelogram on the external rectangle, the change of the side of the parallelogram is not consistent with the actual operation change, the linear polygon is composed of a trunk rectangle, a point set with the shapes of a starting point and an end point, the value of the point set is directly influenced aiming at the stretching and the shape adjustment of the linear polygon, the side connected with the point set is the side of the linear polygon icon, the direct reaction of the adjustment effect is realized, the side effect of the angle change generated by the adjustment on the shape of the parallelogram is eliminated, the problem of the angle change relative to a horizontal line in the adjustment process of the length and the size of the switch icon drawn by the parallelogram is solved, and the expected adjustment on the length and the size of the switch icon is realized.
2. The starting point and the end point of the straight line polygon icon are independent objects, starting points and end points in various forms can be realized, drawing of a plurality of icons of different forms of the turnout is unified into the straight line polygon icon, various icons are not used, and the drawing process of the turnout icon is more efficient.
3. In the drawing of the original turnout icon, at least 4 points need to be input by using the parallelogram icon, the drawing is kept horizontal, and only 2 points need to be input by using the linear polygon icon, so that the drawing and forming have the advantages of few input parameters and simplicity in drawing.
Drawings
The foregoing and following detailed description of the invention will be apparent when read in conjunction with the following drawings, in which:
FIG. 1 is a flow chart of the present invention for drawing a linear polygon;
FIG. 2 is a schematic diagram of the generation of a set of skeleton polygon points according to the present invention;
FIG. 3 is a schematic view of a rectilinear polygonal arrow type of the present invention;
FIG. 4 is a schematic diagram of a horizontal rectangle of the inventive construction;
FIG. 5 is a schematic diagram of a set of points of horizontal arrows according to the present invention;
FIG. 6 is a schematic view of an example of a single-line arrow according to the present invention.
Detailed Description
The technical solutions for achieving the objects of the present invention are further illustrated by the following specific examples, and it should be noted that the technical solutions claimed in the present invention include, but are not limited to, the following examples.
Examples
As a specific embodiment of the intelligent analysis system of the present invention, as shown in FIG. 1, the method comprises an initialization step, a straight polygon trunk calculation step, an arrow calculation step, and an icon generation step.
Initializing a straight line polygon data model comprising key attributes and additional attributes, a starting arrow instance and an end arrow instance, and setting data models of the starting arrow and the end arrow;
specifically, the key attributes include a starting point coordinate ptStart, an end point coordinate ptEnd, a width parameter width, a starting point type startType, an end point type endType, a starting point angle startAngle and an end point angle endAngle; the additional attributes comprise a background color parameter, a display center line parameter and a line width parameter. In order to meet the appearance display requirement of the turnout icon, the linear polygon icon has the characteristic of a polygon, the boundary is formed by splicing a plurality of edges, the polygon is divided into a main polygon and polygons with end points at two ends, the main polygon is rectangular, the line width of the linear polygon icon can be set, and the shape of the main polygon is changed; the starting point and the end point of the straight line polygon are changeable points, an attribute setting interface is provided, the type of the end point is determined according to the line type, the angle type and the 3 attributes of the angle value, the shape of the end point polygon is changed, and the default shape of the end point polygon is a rectangle.
The data model for setting the start arrow and the end arrow specifically comprises a start point ptStart, an end point ptEnd, a length parameter arrowLen, a width parameter arrowWidth, an angle parameter arrowAngle and a type arrowType.
Referring to the example of fig. 2, the relevant parameters of the straight-line polygon icon, ptStart (231, 343), ptEnd (317, 164), width (20 pixels), startType = single-line type, endType = double-line type, start angle =45 degrees, and end angle =45 degrees, are initialized.
The linear polygon backbone calculation step is to correspondingly take the linear polygon data model processed by the initialization step according to the starting point type, the end point type, the starting point angle and the end point angle of the linear polygon in the drawing parameters, construct the starting point and the end point of the linear polygon data model in a two-dimensional coordinate system according to the starting point coordinate, the end point coordinate and the width parameters in the drawing parameters, draw the linear polygon with four vertexes according to the width parameters by taking the connecting line of the starting point and the end point as the central line, and take 4 vertexes as the point set of the backbone polygon of the linear polygon; the icon formed by the linear polygon data model is formed by drawing a plurality of edges by points in a point set of the linear polygon, the point set of the linear polygon comprises a trunk polygon point set and an arrow polygon point set, and the point set of the trunk polygon is formed by four vertexes of a rectangle which is formed by taking a connecting line of a starting point and an end point of the linear polygon as a center and is drawn around a central line by a fixed width.
Further, the step of calculating the linear polygon skeleton specifically includes:
step 1, setting a starting point and an end point of a straight line polygon data model according to drawing parameters, drawing two parallel lines parallel to a central line on two sides of the central line by taking a connecting line of the starting point and the end point as the central line and taking the width in the drawing parameters as a distance;
and 2, respectively drawing two perpendicular lines which pass through the starting point and the end point and are perpendicular to the two parallel lines in the step 1, and selecting 4 intersection points of the two parallel lines and the perpendicular lines as a point set of a main polygon of the straight line polygon.
For example, referring to the example of fig. 2, two parallel lines a and a flat line B are drawn at a position where the distance from the vertical center line (ptStart, ptEnd) is half the width (i.e., width/2), a perpendicular line C and a perpendicular line D perpendicular to the center line are drawn at the past start point coordinate ptStart and the end point coordinate ptEnd, respectively, and 4 intersection points P1 (232, 319), P2 (250, 358), P3 (326, 169), and P4 (308, 160) of the parallel line a and the flat line B with the perpendicular line C and the perpendicular line D can be calculated using a geometric formula, which is a set of points rectscapepoints = { (232, 319), (250, 328), (326, 169), (308, 160) } of 4 points of the skeleton polygon.
The linear polygon icon integrates the characteristics of a straight line and a polygon, is essentially a straight line with fixed width, takes a connecting line of a starting point and an ending point of the straight line as a center, and takes the fixed width to be around a central line to outline the polygon; in order to meet the requirement of only adjusting the extension length of the turnout icon without changing the angle relative to the horizontal line, the straight line polygon icon covers the straight line characteristics including the starting point, the ending point and the line length of the straight line, and the control points of the starting point and the ending point can enable the turnout icon to adjust the length along the straight line like the straight line without changing the angle.
Preferably, in the step of calculating the linear polygon trunk, if the linear polygon data model processed by the initialization step does not include a linear polygon data model corresponding to the start point type, the end point type, the start point angle and the end point angle in the drawing parameter, the method further includes a step of constructing a model, and specifically, according to the start point type, the end point type, the start point angle and the end point angle in the drawing parameter, a corresponding linear polygon data model is constructed in a two-dimensional coordinate system in an equal proportion by unit number. In a configuration system, an icon resource of a straight line polygon data model is newly added, the icon is formed by lines connected by a plurality of points, adjustment different from parallelogram directly acts on adjustment proportion of each side of the parallelogram caused by the fact that the adjustment of the parallelogram is different from adjustment proportion of the circumscribed rectangle, the adjustment of the shape, size and length of the straight line polygon icon directly acts on a point set forming the straight line polygon icon, the change of the adjustment proportion can be directly reflected to each side of the straight line polygon icon, and the effect obtained by adjustment is achieved.
The arrow calculation step is used for correspondingly calling the start arrow instance and the end arrow instance processed in the initialization step according to the start point coordinates, the end point coordinates, the angle parameters and the types of the start arrow and the end arrow in the drawing parameters, respectively selecting the center points ptCenter of the start arrow instance and the end arrow instance, outwards generating a rectangular Rc according to the length parameters and the width parameters in the drawing parameter requirements by taking the center points ptCenter as the center, and constructing horizontal arrow point sets of the start arrow and the end arrow according to the arrow types and the rectangular Rc; according to the different attribute values such as types and angles of the arrows, the point sets of different shapes are calculated in a classification mode through the arrow polygon point sets, and the arrows of different shapes can be drawn.
Preferably, the arrow calculating step specifically includes the following steps:
step 1, respectively selecting center points ptCenter of a starting point arrow instance and an end point arrow instance according to types of the starting point arrow and the end point arrow.
Step 2, respectively generating rectangles Rc of the starting point arrow and the end point arrow outwards according to the height and the width required by the drawing parameters by taking the central point ptCenter of the starting point arrow example and the end point arrow example selected in the step 1 as the center;
and 3, constructing a horizontal arrow point set of the starting point arrow and the end point arrow according to the types of the starting point arrow and the end point arrow and the rectangle Rc of the starting point arrow instance and the end point arrow instance obtained in the step 2.
Step 4, respectively calculating rotation matrixes M between central point vectors (0, ptcenter) and central line vectors (ptStart, ptEnd) of the start arrow and the end arrow;
and 5, calculating the horizontal arrow point sets of the starting point arrow and the end point arrow generated in the step 3 through the rotation matrix M in the step 4, and rotating the horizontal arrow point sets of the starting point arrow and the end point arrow to positions connected with the point sets parallel to the trunk polygon obtained in the straight line polygon trunk calculation step.
Specifically, the classification of the arrow types can be divided into a default type a, a single line type B, a double line type C, and a single line (reverse) type D as shown in fig. 3, and the arrow of the default type a generally has no shape, i.e., is drawn by two points of the trunk polygon calculated in the straight line polygon trunk calculation step, so that the point set constituting the arrow is not calculated.
Further, in the arrow calculation step, if the start point arrow instance and the end point arrow instance processed in the initialization step do not contain the start point arrow instance and the end point arrow instance corresponding to the start point coordinate, the end point coordinate, the angle parameter and the type in the drawing parameter, the method further includes an instance construction step, specifically, the start point arrow instance and the end point arrow instance are constructed in the two-dimensional coordinate system in an equal proportion by unit quantity according to the start point coordinate, the end point coordinate, the angle parameter and the type in the drawing parameter.
Specifically, in the arrow calculation step, when the arrows having different shapes are actually used, the calculation of the width dLen of the rectangular extension in the X direction, the control point pControl, and the center point pCenter is specifically as follows:
1. if default type a, single line type B, or single line (inverted) type D, the parameters are calculated as follows:
first, the projection length of the arrow length arrowLen on the X coordinate axis
Figure BDA0002827880140000081
Then, a first-order Bezier curve control point pControl is calculated with ptStart, ptEnd and dLen as parameters, with ptStart as a starting point and ptEnd as an ending point,
Figure BDA0002827880140000082
where Len is the length between ptStart and ptEnd.
Finally, the starting point ptStart is taken as the center point pCenter.
2. If it is a two-line type C, the parameters are calculated as follows:
first, the projection length dLen of the arrow length arrowLen on the X coordinate axis = arrowLength × 3, i.e., the projection length is equal to 3 times the arrow length.
Then, a first-order bezier curve control point pControl is calculated starting from ptStart and ending at ptEnd, using ptStart, ptEnd and dLen as parameters, as in default type a, single-line type B or single-line (inverted) type D,
Figure BDA0002827880140000083
where Len is the length between ptStart and ptEnd.
Finally, the pControl control point is found and set by taking the starting point coordinate ptStart as the vertex.
Specifically, taking the starting arrow as a single line, and an angle of 45 degrees as an example, we calculated the dLen to be 20, pControl (238, 312), pCenter (231, 343).
As shown in fig. 4, a horizontal rectangle is constructed by extending (dLen) outward into a rectangular Rc centered on the center point pCenter, and the generated rectangular Rc = {333, 353, 221, 241} is extended.
Then, according to the arrow type, a set of points in the shape of a horizontal arrow is calculated based on the above-described rectangle Rc = {333, 353, 221, 241}. As shown in fig. 5, the shape of the horizontal single-line type and single-line type inverted arrows may be determined by 4 points, and the double-line type arrow may be determined by 5 points.
Wherein 4 points of the horizontal single-line arrow are determined as
Figure BDA0002827880140000091
The 5 points of the horizontal double-line arrow are determined as
Figure BDA0002827880140000092
And 4 points of the horizontal single-line reverse arrow are determined as
Figure BDA0002827880140000093
Then, a horizontal start point arrow shown by a solid line in fig. 6 is calculated, the set of arrow points is a [0] = (221, 333), a [1] = (261, 333), a [2] = (261, 353), a [3] = (241, 353), and then a rotation matrix between the vector (0, pcenter) and the vector (pControl, ptStart) is calculated
Figure BDA0002827880140000094
Wherein X is the X coordinate of ptCenter, Y is the Y coordinate of ptCenter, and alpha is the included angle between the central line and the horizontal line.
Then, the rotation matrix is
Figure BDA0002827880140000101
Rotating the horizontal arrow point set A with ptCenter as the center point and the horizontal start arrow with ptCenter (231, 343) as the center point according to the formula
Figure BDA0002827880140000102
The rotation yields a set of points arrowshapepoits { a '[0] = (218, 347), a' [1] = (261, 333), a '[2] = (253, 321), a' [3] = (244, 339) } of target arrows.
The icon generating step, namely merging the point set of the trunk polygon obtained in the straight line polygon trunk calculating step and the point set of the horizontal arrow obtained in the arrow calculating step to form a straight line polygon point set, and drawing a straight line polygon icon; the main polygonal point set and the arrow polygonal point set are combined to form a linear polygonal point set, two points in the point set are sequentially connected to form a line, and therefore the turnout icon can be drawn with a fixed width, the end points of the turnout icon are provided with icons in different shapes, and the shape drawing requirements of the turnout icon are met.
Specifically, the icon generating step specifically includes the following steps:
step 1, inserting and replacing the horizontal arrow point sets of the starting point arrow and the end point arrow obtained in the arrow calculation step and the overlapped part of the point sets of the trunk polygon obtained in the linear polygon trunk calculation step, replacing the point sets of the trunk polygon with the horizontal arrow point sets in the overlapped part of the point sets, and deleting the redundant part of the point sets of the trunk polygon to form a linear polygon point set; the length adjustment and the shape adjustment of the icons of the linear polygons are implemented to the recalculation of the trunk polygons and the arrow polygon point sets, and the effect of consistent adjustment and expectation of the icons can be realized.
And 2, drawing a linear polygon icon according to the linear polygon point set in the step 1.
Namely, according to the arrow type, selecting the point set which can describe the arrow, selecting the point A ' [1], A ' [0], A ' [4] in the double line type, selecting the point A ' [0], A ' [3] in the single line type, replacing and inserting the point set which represents the shapes of the starting point and the end point into the straight line polygon point set in the straight line polygon trunk calculating step. If the starting arrow is single-line type, replacing P1 point of the main polygon with A '0, replacing P2 point of the main polygon with A' 3, and finally generating point set of the straight line polygon as { A '0, A' 3, P4 }; if the starting point arrow type is double-line type, replacing P1 point of the main polygon with A '1, inserting A' 0 point, replacing P2 point of the main polygon with A '4, the point set of the linear polygon finally generated is { A' 1, A '0, A' 4, P3, P4 }, drawing a straight line between the two points of the obtained linear polygon point set, and drawing the linear polygon graph. For the stretching operation of the linear polygon icon, the starting point and the end point of the linear polygon icon are influenced, the steps are repeated, the point set of the stretched linear polygon icon can be recalculated, namely the point set of the linear polygon icon is directly influenced by the stretching operation, the stretching operation different from the parallelogram acts on the external rectangle, so that the linear polygon icon can realize the expected stretching change, and by referring to the steps, the linear polygon icon drawing command is used for respectively drawing the turnout front section, the positioning connection, the positioning section, the inversion connection and the inversion section of the turnout, and the turnout icon can be spliced into the turnout icon.

Claims (6)

1. A method for drawing a switch icon of a configuration system by using a linear polygon is characterized by comprising the following steps:
initializing, namely initializing a linear polygon data model comprising key attributes and additional attributes, a starting arrow instance and an end arrow instance, and setting the data models of the starting arrow and the end arrow; the key attributes comprise a starting point coordinate, an end point coordinate, a width parameter, a starting point type, an end point type, a starting point angle and an end point angle; the additional attributes comprise a background color parameter, a display center line parameter and a line width parameter;
a linear polygon backbone calculation step, wherein a linear polygon data model processed by the initialization step is correspondingly taken according to the starting point type, the end point type, the starting point angle and the end point angle of a linear polygon in the drawing parameters, the starting point and the end point of the linear polygon data model are constructed in a two-dimensional coordinate system according to the starting point coordinate, the end point coordinate and the width parameters in the drawing parameters, the connecting line of the starting point and the end point is taken as a central line, the linear polygon with four vertexes is drawn according to the width parameters, 4 vertexes are taken as a point set of a main polygon of the linear polygon, the main polygon is a rectangle, an icon formed by the linear polygon data model is formed by drawing a plurality of edges by points in the point set, the point set of the linear polygon comprises a main polygon point set and an arrow polygon point set, the point set of the polygon is formed by taking the connecting line of the starting point and the end point of the linear polygon as the center, and four vertexes of the rectangle drawn around the central line with a fixed width;
an arrow calculation step, correspondingly calling the start point arrow instance and the end point arrow instance processed by the initialization step according to the start point coordinate, the end point coordinate, the angle parameter and the type of the start point arrow and the end point arrow in the drawing parameters, respectively selecting the center points ptCenter of the start point arrow instance and the end point arrow instance, outwards generating a rectangular Rc according to the length parameter and the width parameter in the drawing parameter requirement by taking the center points ptCenter as the center, and constructing a horizontal arrow point set of the start point arrow and the end point arrow according to the arrow type and the rectangular Rc;
an icon generating step, namely merging the point set of the trunk polygon obtained in the straight line polygon trunk calculating step and the point set of the horizontal arrow obtained in the arrow calculating step to form a straight line polygon point set, and drawing a straight line polygon icon;
the arrow calculation step specifically comprises the following steps:
step 1, respectively selecting central points ptCenter of a starting point arrow instance and a finishing point arrow instance according to the types of the starting point arrow and the finishing point arrow;
step 2, respectively generating rectangles Rc of the starting point arrow and the end point arrow outwards according to the height and the width required by the drawing parameters by taking the central point ptCenter of the starting point arrow example and the end point arrow example selected in the step 1 as the center;
step 3, constructing a horizontal arrow point set of the starting point arrow and the end point arrow according to the types of the starting point arrow and the end point arrow and the rectangle Rc of the starting point arrow instance and the end point arrow instance obtained in the step 2;
step 4, respectively calculating rotation matrixes M between central point vectors (0, ptcenter) and central line vectors (ptStart, ptEnd) of the start arrow and the end arrow;
and 5, calculating the horizontal arrow point sets of the starting point arrow and the end point arrow generated in the step 3 through the rotation matrix M in the step 4, and rotating the horizontal arrow point sets of the starting point arrow and the end point arrow to positions connected with the point sets parallel to the trunk polygon obtained in the linear polygon trunk calculation step.
2. The method of claim 1, wherein the method comprises the steps of: the data model for setting the starting point arrow and the end point arrow specifically comprises a starting point coordinate, an end point coordinate, a length parameter, a width parameter, an angle parameter and a type for setting the starting point arrow and the end point arrow.
3. The method of claim 1, wherein the method comprises the steps of: the linear polygon trunk calculation step specifically includes:
step 1, setting a starting point and an end point of a straight line polygon data model according to drawing parameters, drawing two parallel lines parallel to a central line on two sides of the central line by taking a connecting line of the starting point and the end point as the central line and taking the width in the drawing parameters as a distance;
and 2, respectively drawing two perpendicular lines which pass through the starting point and the end point and are perpendicular to the two parallel lines in the step 1, and selecting 4 intersection points of the two parallel lines and the perpendicular lines as a point set of a main polygon of the straight line polygon.
4. A method for drawing configuration system switch icons according to claim 1 or 3, wherein: in the step of calculating the linear polygon backbone, if the linear polygon data model processed in the step of initializing does not contain a linear polygon data model corresponding to the starting point type, the end point type, the starting point angle and the end point angle in the drawing parameters, the method further comprises a step of constructing a model, and specifically, according to the starting point type, the end point type, the starting point angle and the end point angle in the drawing parameters, the corresponding linear polygon data model is constructed in a two-dimensional coordinate system in an equal proportion of unit quantity.
5. The method of claim 1, wherein the method comprises the steps of: in the arrow calculation step, if the start point arrow instance and the end point arrow instance processed in the initialization step do not contain the start point arrow instance and the end point arrow instance corresponding to the start point coordinate, the end point coordinate, the angle parameter and the type in the drawing parameter, the method further comprises an instance construction step, and specifically, the start point arrow instance and the end point arrow instance are constructed in the two-dimensional coordinate system in an equal proportion by unit quantity according to the start point coordinate, the end point coordinate, the angle parameter and the type in the drawing parameter.
6. The method of claim 1, wherein the method comprises the steps of: the icon generating step specifically includes the following steps:
step 1, inserting and replacing the overlapped part of the horizontal arrow point set of the starting point arrow and the end point arrow obtained in the arrow calculation step and the point set of the trunk polygon obtained in the straight line polygon trunk calculation step, replacing the point set of the trunk polygon with the horizontal arrow point set at the overlapped part of the point sets, and deleting the redundant part of the point set of the trunk polygon to form a straight line polygon point set;
and 2, drawing a linear polygon icon according to the linear polygon point set in the step 1.
CN202011454247.2A 2020-12-10 2020-12-10 Method for drawing configuration system turnout icon by linear polygon Active CN112562036B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011454247.2A CN112562036B (en) 2020-12-10 2020-12-10 Method for drawing configuration system turnout icon by linear polygon

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011454247.2A CN112562036B (en) 2020-12-10 2020-12-10 Method for drawing configuration system turnout icon by linear polygon

Publications (2)

Publication Number Publication Date
CN112562036A CN112562036A (en) 2021-03-26
CN112562036B true CN112562036B (en) 2023-04-07

Family

ID=75061568

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011454247.2A Active CN112562036B (en) 2020-12-10 2020-12-10 Method for drawing configuration system turnout icon by linear polygon

Country Status (1)

Country Link
CN (1) CN112562036B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114241090B (en) * 2021-12-31 2022-11-04 广州朗国电子科技股份有限公司 OCR-based electronic whiteboard straight line drawing method, system, equipment and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014219683A (en) * 2014-06-24 2014-11-20 株式会社ジオ技術研究所 Map data generation system
CN111145296A (en) * 2019-12-26 2020-05-12 南京师范大学 Vector map line symbol circular arrow drawing method considering line width consistency

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5588100A (en) * 1992-05-18 1996-12-24 Microsoft Corporation Method and system for creating a freeform drawing object
JP4742285B2 (en) * 2005-09-20 2011-08-10 株式会社ゼンリン MAP INFORMATION CREATION DEVICE AND METHOD, AND PROGRAM
CN101719057A (en) * 2009-11-27 2010-06-02 广东威创视讯科技股份有限公司 Method and device for drawing geometric figures
CN102568304A (en) * 2011-12-30 2012-07-11 北京合众思壮科技股份有限公司 Method and device for drawing arrow mark
CN104200501A (en) * 2014-08-25 2014-12-10 程学庆 Rail transit train flow diagram automatic preparation method
CN111145303B (en) * 2019-12-26 2023-04-25 南京师范大学 Vector map line symbol pointed arrow drawing method considering line width consistency
CN111754610B (en) * 2020-05-15 2022-05-17 中铁第一勘察设计院集团有限公司 Method for automatically drawing railway station signal plane layout

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014219683A (en) * 2014-06-24 2014-11-20 株式会社ジオ技術研究所 Map data generation system
CN111145296A (en) * 2019-12-26 2020-05-12 南京师范大学 Vector map line symbol circular arrow drawing method considering line width consistency

Also Published As

Publication number Publication date
CN112562036A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
US6157750A (en) Methods of transforming a basic shape element of a character
CN101271585A (en) Method for collecting three-dimensional geometric drawing member on pattern processor
CN112562036B (en) Method for drawing configuration system turnout icon by linear polygon
CN112419511A (en) Three-dimensional model file processing method and device, storage medium and server
CN111737844A (en) Web 3D-based three-dimensional building model editing system and workflow
CN114398071A (en) Control logic configuration implementation method and system of control system
CN111210520A (en) Reverse forming method and system for physical model
JP3029878B2 (en) Apparatus and method for processing a plurality of polygons representing an image
JPH05346957A (en) Device and method for presenting shape feature quantity
CN106920281B (en) A kind of calligraphy embossment modeling method
CN108510579B (en) A kind of rendering indication method of the complicated trimmed surface of industry
CN110502305A (en) Method and device for realizing dynamic interface and related equipment
CN105741335A (en) Fast drawing method of multi-level war-game map based on blocking structure
CN104143204A (en) Moving least square two-dimensional character deformation method considering topological structure
Romeiro et al. Hardware-assisted rendering of csg models
CN107728984A (en) A kind of virtual reality picture display control program
CN100476880C (en) Method and system for producing volume shade
CN116611991B (en) Processing method and system for drawing complex scene based on GPU
CN100568289C (en) Computer drawing element describing method and device
CN115150608B (en) Method for optimally displaying common video on giant-screen naked-eye 3D folding angle screen
JPH0799549B2 (en) Shading display method
CN112381705B (en) Method for rapidly drawing point cloud in Unity3d
CN115329697B (en) Method, device and system for generating simulated three-dimensional circuit diagram and storage medium
Youquan Graphic Design Optimization Method Based on Artistic Color Self-Adaptation
JPH0749965A (en) Shape production supporting method and device therefor

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