CN106027322B - A kind of topological diagram end tree autoplacement method - Google Patents
A kind of topological diagram end tree autoplacement method Download PDFInfo
- Publication number
- CN106027322B CN106027322B CN201610633662.1A CN201610633662A CN106027322B CN 106027322 B CN106027322 B CN 106027322B CN 201610633662 A CN201610633662 A CN 201610633662A CN 106027322 B CN106027322 B CN 106027322B
- Authority
- CN
- China
- Prior art keywords
- value
- node
- leaf
- angle
- topological diagram
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/12—Discovery or management of network topologies
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/02—Topology update or discovery
Abstract
Present invention discloses a kind of topological diagram end tree autoplacement methods, which comprises the topological graph parameter for obtaining topological diagram analyzes all topological diagram ends tree included in topological diagram;One of topological diagram end tree is selected, according to leaf node quantity, the circumradius maximum value of leaf node shape graph, in the case where oval angle section is certain, calculates the corresponding oval arc length in oval angle section of topological diagram end tree;According to the corresponding oval arc length in the weighted value of each leaf node segmentation oval angle section;Calculate the angle of each arc length corresponding leaf node and root node angle;According to the corresponding angle of each arc length, leaf node coordinate is calculated;According to leaf node Coordinate generation visual interface.The advantages that present invention, which has, makes topological end tree carry out autoplacement along elliptic curve, and adjustment elliptic arc covering of the fan, leaf node is supported not to overlap each other, and layout symmetry is beautiful.
Description
Technical field
The present invention relates to computer application technology more particularly to a kind of topological diagram end tree autoplacement methods.
Background technique
Topological diagram is that one kind does not consider the physical attributes such as size, the shape of object, and states using only point or line drawing multiple
The abstract representation method of object physical location and relationship.Topological diagram is indifferent to the details of things, does not also mind that mutual ratio is closed
System, and the correlation in a certain range between multiple objects is only indicated in graph form.
In each field, topological diagram is usually used in showing the relationship between resource node, such as there is social networks in social networks
Topological diagram, there is Consumption relation topological diagram in consumer field, there is network structure topological diagram in network management.Clear beautiful opens up
It is extremely important to user's grasp resources relationship to flutter figure.
In computer application field, computer and network equipment will realize interconnection, must just use certain knot of tissue
Structure is attached, and this institutional framework is just called topological structure, is also topological diagram.As shown in Figure 1, generated using the prior art
Topological diagram.The number of the subtree of one node is known as the degree of node in the present invention, spends the node for 0 by topological diagram as mentioned
Referred to as leaf node is also leaf node, only will be known as root node with an adjacent nonleaf node of nonleaf node.
The figure being made of above-mentioned leaf node and root node, referred to as topological diagram end tree in the present invention, as shown in Figure 2
1a, 1b, 1c, 1d are topological diagram end tree.
When leaf node is more, structure is complicated for topological diagram, and topological end tree effect of visualization is poor.One good layout side
Method is more and more important for the visualized management of topology.
Topological diagram layout generallys use artificial dragging layout, but when leaf node quantity increases, and artificial dragging layout expends
Very big manpower, and it is poor to be laid out effect.
Likewise, paper is based on disclosing a kind of Force- in the network map layout algorithm of Repulsion-Tension model
Directed layout, although this method disperses each node automatically to a certain extent, is overlapped it not as far as possible, can not accomplish leaf
Node is symmetrical, it is even more impossible to accomplish weight distribution, so that it is different in size between each node, it is not beautiful enough to eventually lead to topological diagram.
More most of all, certain variation can all occur for the position of all nodes, be unfavorable for existing node after newly-increased node
Vision tracking.
Network in a kind of Network Management System is also disclosed in the Chinese patent literature of Patent No. 200510022224.3
Topological automatic generation method.Point out that leaf node is distributed along the path of basis circle in the method, although realizing simpler
It is single, but the radius of basis circle relies on the side length of picture panel, and is fixed as the 1/4 of side length, can only carry out equal part to basis circle,
The processing of non-equal part is not can be carried out.Meanwhile the generation of basic circular arc covering of the fan depends on leaf node quantity, can not further adjust
It is whole.
Summary of the invention
It is an object of the invention to overcome the deficiencies of existing technologies, a kind of topological diagram end autoplacement method is provided, is propped up
It holds and autoplacement is carried out to topological diagram end tree, can be laid out along elliptic curve, support adjustment elliptic arc covering of the fan,
And the method for weighting segmentation elliptic arc is provided, so that leaf segment is not overlapped mutually, layout symmetry, beauty.
To achieve the above object, the following technical solutions are proposed: a kind of topological diagram end tree autoplacement method, institute by the present invention
The method of stating includes:
S10 obtains each node of topological diagram and path relation, analyzes all topological diagram ends tree in topological diagram, and
It is stored in topological diagram end tree set;
S20 selects a topological diagram end tree from the topological diagram end tree set, calculates the topological diagram end of selection
Hold the leaf node quantity of tree and the circumradius maximum value of leaf node shape graph;
S30 calculates elliptic curve according to the circumradius maximum value of the leaf node quantity and leaf node shape graph
Total initial value of arc length and the initial value of elliptic curve major semiaxis;
S40 calculates the exact value of the major semiaxis of elliptic curve, according to the exact value of the major semiaxis, calculates semi-minor axis
Exact value, and calculate elliptic arc long value corresponding to oval upper angle section;
All leaf nodes of topological diagram end tree are put into the angle section and are laid out, weighted by elliptic arc by S50
Layout method and angle convert layout method, and all leaf node final coordinates are calculated in the angle interval range;
S60 generates the visual interface of the topological diagram end tree according to each leaf node final coordinate;
S70 repeats S20~S60, generates the visual interface of all topological diagram ends tree.
Preferably, topological diagram end tree set is obtained according to following steps:
S201 obtains the node that topological diagram moderate is 0, obtains leaf segment point set VLeaf, obtain the n omicronn-leaf adjacent with leaf node
Node obtains nonleaf node set, obtains root node from the nonleaf node set, obtains root node set VRoot;
S202, from root node set VRootOne root node a of middle selectionRoot, in path relation and leaf segment point set VLeafMiddle lookup
Out with root node aRootThere are all leaf nodes of path relation, obtain leaf segment point set V 'Leaf, export (aRoot, V 'Leaf) to get to should
The data of topological diagram end tree;
S203 is recycled from root node set VRootMiddle selection root node exports the data of new topological diagram end tree, until root
Node set VRootIt is sky to get the topological diagram end tree all into the topological diagram.
Preferably, the initial value of the initial value and elliptic curve major semiaxis of the total arc length of the elliptic curve is according to following first
Function is calculated to calculate,
Init_arc_len=nodes_num × r × h, wherein h={ h > 2, h ∈ R };
And
Wherein, init_arc_len indicates that the initial value of the total arc length of elliptic curve, r indicate the circumscribed circle of leaf node shape graph
Radius maximum value, h indicate that constant, nodes_num indicate leaf node quantity, and R indicates that set of real numbers, k indicate oval semi-minor axis and length
Semiaxis ratio, init_a indicate oval major semiaxis initial value.
Preferably, the exact value a of the major semiaxisEssence, the exact value b of semi-minor axisEssence, and above angle section institute is right for ellipse
The calculating of the elliptic arc long value arc_len answered includes the following steps:
S401 sets oval major semiaxis value interval as [a0, a1], accuracy is set as ξ, and oval short long axis ratio is k, ellipse
Angle is α on circle, wherein a1Indicate the initial value of oval major semiaxis, a0It is any to choose;
S402 calculates the midpoint a of oval major semiaxis value intervalc, calculating major semiaxis value is acWhen corresponding arc length
lenc;
S403, judgement | lenc- init_arc_len | whether it is less than accuracy ξ;If it is less than ξ, then the output interval upper limit
Value be aEssence;If being unsatisfactory for precise requirements and lencLess than init_arc_len, then a is usedcIt is taken as the diminution of interval limit value
Value section is [ac, a1];If being unsatisfactory for precise requirements and lencGreater than init_arc_len, then a is usedcAs the section upper limit
It is [a that value, which reduces value interval,0, ac];Step S402 and step S403 is repeated, the range of value interval is constantly reduced, until obtaining
Meet and be less than the value interval that accuracy ξ is required, then the value for exporting the value interval upper limit is aEssence;
S404, according to the exact value a of the oval major semiaxis of S403 outputEssenceAnd the short long axis ratio of ellipse is k, meter
Calculate the exact value b of oval semi-minor axisEssence=aEssence×k;
S405, according to the exact value a of the oval major semiaxisEssenceAnd the exact value b of semi-minor axisEssence, elliptic parameter side
Journey calculates the corresponding elliptic arc long value arc_len in angle section.
Preferably, the angle section is [- pi/2, pi/2].
Preferably, elliptic arc weighting layout method the following steps are included:
Elliptic arc weighting layout method the following steps are included:
S501 sets weighted value collection P={ p1, p2..., pnodes_num-1, wherein nodes_num is leaf node quantity;
The corresponding ellipse arc length arc_len in angle section is split by S502 according to leaf node quantity and weighted value collection;
S503, since starting leaf node, according to leaf node leafiAnd adjacent leaf node leafi+1Corresponding arc length,
Calculate the angle of each arc length corresponding leaf node and root node angle;
S504 calculates each leaf node to root node linear equation according to the corresponding angle of each arc length and root node coordinate;
S505 calculates each leaf node to root node straight line elliptic arc intersecting point coordinate corresponding with oval angle section;
S506 exports all leaf node initial coordinates in angle section.
Preferably, the corresponding leaf node of each arc length and the angle of root node angle calculate according to the following formula,
Wherein, a is oval major semiaxis,For start node eccentric angle, μ is terminal node eccentric angle, and y is oval centrifugation
Rate, ω are oval eccentric angle, and ω ∈ [0,2 π], L are the corresponding arc length of angle.
Preferably, angle conversion layout method the following steps are included:
S601, sets elliptic arc angle α, and major semiaxis value a, semi-minor axis value b calculate angle commutation factor m.
S602 calculates new major semiaxis value new_a=m × a according to angle commutation factor m, and new semi-minor axis value is new_b=m
×b;
S603, according to new major semiaxis value new_a, new semi-minor axis value new_b, new elliptic parametric equation calculates angle section
Corresponding new oval arc length new_arc_len;
S604 will be new according to leaf node weighted value collection according to new oval arc length new_arc_len and leaf node quantity
Oval arc length new_arc_len is split;
S605, since starting leaf node, according to leaf node leafiAnd adjacent leaf node leafi+1Corresponding arc length,
Recalculate leafi+1Coordinate;
S606, until exporting the final coordinate of all leaf nodes.
Preferably, the angle commutation factor calculates according to the following formula,
Wherein,A indicates that oval major semiaxis, b indicate that oval semi-minor axis, m indicate angle
Commutation factor is spent, the absolute value of n was origin, slope is tan ((π-α)/2) straight line and oval intersection point x coordinate.
A kind of topological diagram end tree autoplacement device of the invention, including storage unit, judging unit, topological analysis's list
Member and display unit, wherein
The storage unit, for each node, path relation, root node in memory topology figure, and layout relevant parameter;
The judging unit, for exporting from each node and path relation in the topological diagram is obtained in storage unit
All topological diagram ends tree;
The placement analysis unit weights layout method by elliptic arc and angle converts layout method and calculates the topological diagram end
The final coordinate position of each leaf node in the tree of end;
The display unit is drawn out respectively according to each leaf node final coordinate, root node final coordinate and path relation
Line between leaf node and each leaf node and root node.
The beneficial effects of the present invention are:
1) topological diagram layout method of the present invention, so that the upper leaf node of topological diagram end tree is pressed centered on root node
It is distributed automatically according to the path of elliptic arc, the leaf node of display is more;
2) topological diagram layout method of the present invention so that the distribution of leaf node more rationally, leaf node and root node
The length of line can be according to oval angle adjust automatically, and leaf node is not overlapped, and is laid out more beautiful.
3) topological end tree autoplacement device of the present invention, user is by presetting the angle area on ellipse
Between, the multiple parameters such as ELLIPTIC REVOLUTION angle so that the topological diagram generated is applied to, computer screen is shown, projector is shown, and
Applied in multi-touch device.
Detailed description of the invention
Fig. 1 is the topological diagram that the prior art generates;
Fig. 2 is the topological diagram end tree schematic diagram in Fig. 1 topological diagram;
Fig. 3 is the topological diagram end tree autoplacement method principle flow chart that the embodiment of the present invention 1 provides;
Fig. 4 is leaf node and root node angle schematic diagram on elliptic curve in the embodiment of the present invention 1;
Fig. 5 is the angle section chosen on ellipse in the embodiment of the present invention 1;
Fig. 6 is the schematic device for the topological diagram end tree autoplacement that the embodiment of the present invention 2 provides;
Fig. 7 is the effect picture in the embodiment of the present invention;
Fig. 8 is display effect Fig. 1 of the invention;
Fig. 9 is display effect Fig. 2 of the invention.
Specific embodiment
Below in conjunction with attached drawing of the invention, clear, complete description is carried out to the technical solution of the embodiment of the present invention.
The principle of the embodiment of the present invention is: firstly, the topological graph parameter of topological diagram is obtained, such as each node, path relation,
Analyze all topological diagram ends tree included in topological diagram;Secondly, selecting one of topological diagram end tree, leaf segment is calculated
Point quantity, the circumradius maximum value of leaf node shape graph;Leaf node in the present invention is around root node along elliptic curve
Autoplacement is carried out, therefore, introduces elliptic curve, at the beginning of calculating the total arc length initial value of elliptic curve and elliptic curve major semiaxis
Initial value, and major semiaxis exact value, semi-minor axis exact value are calculated, in the case where oval section angle is certain, calculate topological diagram end
Hold the corresponding oval arc length of the oval section angle of tree;It is corresponding according to the weighted value of each leaf node segmentation oval section angle
Oval arc length;Calculate the angle of each arc length corresponding leaf node and root node angle;According to the corresponding angle of each arc length, calculate
Leaf node coordinate;Finally, according to leaf node Coordinate generation visual interface.
As shown in figure 3, for the topological diagram end tree autoplacement method principle flow chart that the embodiment of the present invention 1 provides, tool
Body is as follows:
Step 10, each node of topological diagram and path relation are obtained, is analyzed in the topological diagram by logic judgment
All topological diagram ends tree is stored in topological diagram end tree set.Topological diagram end tree set is obtained according to such as under type:
Firstly, obtaining the node that topological diagram moderate is 0, leaf segment point set V is obtainedLeaf, obtain the n omicronn-leaf adjacent with leaf node
Node obtains nonleaf node set, then obtains root node from nonleaf node set, obtains root node set VRoot;
Secondly, from root node set VRootOne root node of middle selection, is denoted as aRoot, in path relation and VLeafIt is found out in set
With root node aRootThere are all leaf nodes of path relation, obtain leaf segment point set V 'Leaf, export (aRoot, V 'Leaf) opened up to get to this
Flutter the data of figure end tree;
Finally, recycling from root node set VRootMiddle selection root node exports the data of new topological diagram end tree, until root
Node combination VRootFor sky, topological diagram end tree all in the topological diagram can be obtained.
Wherein, the example of the topological diagram end tree data, including root node mark, root node position coordinate are (xRoot,
yRoot), each leaf segment point identification, leaf node quantity is nodes_num.
Step 20, a topological diagram end tree is selected from the topological diagram end tree set, calculates selected open up
Flutter the leaf node quantity of figure end tree and the circumradius maximum value of leaf node shape graph;
Step 30, according to the circumscribed circle of the leaf node quantity of the topological diagram end tree and leaf node shape graph half
Diameter maximum value calculates the initial value of the total arc length of elliptic curve and the initial value of elliptic curve major semiaxis by just calculating function;
Wherein, the total arc length initial value of elliptic curve is obtained according to first calculate function (1):
Init_arc_len=nodes_num × r × h wherein h={ h > 2, h ∈ R }; (1)
Init_arc_len indicates the total arc length of ellipse corresponding to the angle of oval section, and what r was indicated is leaf node shape graph
Circumradius maximum value, h indicate constant, nodes_num indicate leaf node quantity, R indicate set of real numbers.
Oval major semiaxis and semi-minor axis initial value are obtained according to first calculate function (2):
Wherein, what init_a was indicated is the initial value of oval major semiaxis, and what k was indicated is oval semi-minor axis and major semiaxis ratio.
Ellipse the ratio between semi-minor axis and major semiaxis k, leaf node shape atlas circumradius r can be in the present embodiment
It is presetting in system, it can also be manually specified with user.
Step 40, the ellipse for meeting precise requirements is calculated by dichotomy function according to the major semiaxis initial value
Curve major semiaxis exact value aEssence, according to the exact value a of oval major semiaxisEssence, calculate the exact value b of semi-minor axisEssence, and calculate oval
The corresponding elliptic arc long value arc_len in upper angle section;
Wherein, the exact value for meeting the elliptic curve major semiaxis of precise requirements is calculated according to following steps:
401, oval major semiaxis value interval is set as [a0, a1], wherein a1Indicate the initial value of major semiaxis, that is, a1=
Init_a, a0It can arbitrarily choose, set accuracy as ξ, oval short long axis ratio is k, and oval semi-minor axis is b, an oval upper folder
Angle is α, as shown in figure 5, the angle α, oval short major semiaxis ratio k, can summarize presetting or user in system and be manually specified.
402, acquire the midpoint a of oval major semiaxis value intervalc, calculate when major semiaxis value is acCorresponding arc length lenc;
403, judgement | lenc- init_arc_len | whether it is less than accuracy ξ;If it is less than ξ, then the output interval upper limit
Value is aEssence;If being unsatisfactory for precise requirements and lencLess than init_arc_len, then a is usedcValue is reduced as interval limit value
Section is [ac, a1];If being unsatisfactory for precise requirements and lencGreater than init_arc_len, then a is usedcAs section upper limit value
Diminution value interval is [a0, ac];Step S402 and step S403 is repeated, the range of value interval is constantly reduced, until being expired
Foot is less than the value interval that accuracy ξ is required, then the value for exporting the value interval upper limit is aEssence;
404, according to the exact value a of the oval major semiaxis of 403 outputsEssenceAnd the short long axis ratio k, it obtains oval short
Semiaxis bEssence=aEssence×k;
405, according to the exact value a of the oval major semiaxis for meeting accuracyEssence, the exact value b of semi-minor axisEssence, and
Elliptic parametric equation calculates the corresponding elliptic arc long value arc_len in angle section, wherein in the present embodiment, angle section is preferred
[- pi/2, pi/2].
Step 50, all leaf nodes of topological diagram end tree are put into the angle section to be laid out, pass through elliptic arc
It weights layout method and angle converts layout method, all leaf node final coordinates are calculated in the angle interval range;
Wherein, the elliptic arc weights layout method, comprising the following steps:
501, set weighted value collection P={ p1, p2..., pnodes_num-1, wherein nodes_num is leaf node quantity;
502, starting leaf node is set at pi/2, and coordinate is (xBegin, yBegin), then at-pi/2, coordinate is the last one node
(xEnd, yEnd);
503, it is according to the ratio of each leaf node weighted value that angle section [- pi/2, pi/2] is corresponding according to leaf node quantity
Oval arc length arc_len is split;
504, since starting leaf node, successively according to leaf node leafiAnd adjacent leaf node leafi+1Corresponding arc
It is long, the angle of each arc length corresponding leaf node and root node angle is calculated with definite integral side according to the ellipse arc length;
505, according to the corresponding angle of each arc length and root node coordinate (xRoot, yRoot), each leaf node is calculated to root node straight line
Equation;
506, each leaf node is calculated to root node straight line and the corresponding elliptic arc intersection point of oval angle section [- pi/2, pi/2]
Coordinate is the coordinate of each leaf node.
Oval angle section [- pi/2, pi/2], the initial coordinate of corresponding each leaf node has been calculated in above-mentioned steps.
Wherein, the definite integral formula of above-mentioned calculating ellipse arc length is as follows:
Enable a for oval major semiaxis,For start node eccentric angle, μ is terminal node eccentric angle, whereinY is
Oval eccentricity, ω are oval eccentric angle, ω ∈ [0,2 π], then arc length
Preferably, numerical integration can be carried out using Simpson rule in above-mentioned integral calculation process.
Preferably, numerical integration can be carried out using Euler rule in above-mentioned integral calculation process.
The initial coordinate of each leaf node is calculated according to such as under type:
As shown in figure 4, leaf node leafiThe angle of angle corresponding with root node is θ1,
It is y=x*tan θ by the linear equation of origin of root node1;
Elliptic equation are as follows:
It is by the coordinate that linear equation substitution elliptic equation can be calculated the node
Further, angle conversion layout method includes the following steps,
601, angle α is set, as shown in figure 5, major semiaxis value a, semi-minor axis value b, n were origin, slope is tan ((π-
The absolute value of straight line and oval intersection point x coordinate α)/2), calculating angle commutation factor is m.
If
Then
602, according to angle commutation factor m, new major semiaxis value new_a=m × a is calculated, new semi-minor axis value is new_b=m
×b;
603, according to new major semiaxis new_a, new semi-minor axis new_b, new elliptic parametric equation, calculating angle section [- α/
2 ,-α/2] corresponding oval arc length new_arc_len.
604, starting leaf node is set at α/2, and coordinate is (new_xBegin, new_yBegin), then most end node is sat at-α/2
It is designated as (new_xEnd, new_yEnd);
605, it, will be new according to weighted value collection in step 501 according to new oval arc length new_arc_len and leaf node quantity
Elliptic arc length be split;
606, since starting leaf node, successively according to leaf node leafiAnd adjacent leaf node leafi+1Corresponding arc
It is long, recalculate leafi+1Coordinate.
607, until exporting all leaf node final coordinates.
Wherein, the final coordinate calculation method of all leaf nodes is identical with the calculation method of the initial coordinate of leaf node.
Step 60, according to all leaf node final coordinates, the visual interface of the topological diagram end tree is generated;
Step 70, it repeats step 20 and arrives step 60, finished until the visual interface of all topological diagram ends tree all generates.
In above-mentioned elliptic arc weighting layout method and angle conversion layout method, angle α, oval short major semiaxis ratio k, leaf segment dot
Shape atlas circumradius r, can presetting in systems or user be manually specified.
As shown in fig. 6, a kind of schematic device of the topological diagram end tree autoplacement provided for the embodiment of the present invention 2,
The device includes storage unit 100, judging unit 101, placement analysis unit 102 and display unit 103, specific as follows:
Storage unit 100 is used for each node of memory topology figure, path relation, root node coordinate, and the related ginseng of layout
Number can complete the storage of topological diagram data using technological means such as database, file, cachings.The example of topological diagram data, packet
It includes: each node identification, each ID of trace route path, each nonleaf node coordinate position.
Judging unit 101, for obtaining each node of topological diagram and path relation from storage unit, by technological means from depositing
Each topological graph node and mutual path relation are obtained in storage unit.The technological means includes SNMP, database interface technology
Deng.Judging unit exports all topological diagram ends tree by logic analysis.
The example of topological diagram end tree data, comprising: root node mark, root node position coordinate are (xRoot, yRoot), each leaf segment
Point identification, leaf node quantity are nodes_num.
Placement analysis unit 102 weights layout method by elliptic arc and angle converts layout method and obtains each leaf node most
Whole coordinate position.
Display unit 103 uses technology according to each leaf node final coordinate, root node final coordinate and path relation
Means draw out each leaf node and their lines between root node automatically.The technological means include HTML5, CSS,
Javascript, flex, QT, wxWidgets, MFC, Java swing or Windows Forms etc..
Further, with topological diagram shown in FIG. 1 to topological diagram end tree layout method of the present invention and device
Further instruction.
According to step 10, logic analysis is carried out to topological diagram as shown in Figure 1, all topological diagram end trees is obtained, deposits
Enter topological diagram end tree set, as shown in Fig. 2, shown in topological diagram end tree set in share 4 topological diagram end trees, distinguish
It is 1a, 1b, 1c and 1d;
According to step 20, topological diagram end tree 1a therein is chosen, leaf node quantity is 9, and leaf node maximum is external
Radius of circle is 5px;
The initial value of the total arc length of elliptic curve and the initial value of elliptic curve major semiaxis are calculated according to step 30;It is default
Determining h is 4.5, k 0.8, a0=0, ξ=10-8, the initial value that the total arc length of elliptic curve is calculated by just calculating function is
202.5px, the initial value for calculating elliptic curve major semiaxis is about 247.2px;
It according to step 40, calculates that meet the elliptic curve major semiaxis exact value of precise requirements be about 71.4px, calculates
Semi-minor axis length exact value is about 57.1px out, calculates on ellipse the corresponding elliptic arc long value in [- pi/2, pi/2] section and is
202.5px;
The elliptic arc according to step 50 weight layout method, presetting weighted value integrate as P=1,1,1,1,1,1,1,
1 }, the initial coordinate for calculating each leaf node is respectively (71.4,0), (64.7,24.1), (47.6,42.5) etc.;
Layout method is converted according to the angle that step 50 provides, presetting angle section is [0,5 π/6], calculates angle conversion
Factor m is about 1.05, the final coordinate for each leaf node for recalculating out according to the commutation factor be respectively (71.4,
19.1), (59.3,37.1), (41.9,50.0) etc.;
It is drawn out according to step 60 according to the final coordinate for each leaf node that step 50 obtains with (0,0) for coordinate origin
Then the line of each leaf node and coordinate origin moves to figure at the root node coordinate (200,300) of tree T1, and clockwise
Rotate pi/2;
It repeats step 20 and arrives step 60, generate topological diagram end tree 1a, 1b, 1c, the visual interface of 1d, final display is as schemed
Shown in 7.
As shown in figure 8, leaf node is identified with open circles in the present embodiment, node or root node are identified with filled circles, real
The polar plot or bitmap mark of arbitrary shape can be used in the utilization of border.Physical couplings, that is, network topology of LA Management Room
Line between node of graph, line solid line in the present embodiment can be using solid line or any dotted line in practice
Polar plot or bitmap identify.
As shown in figure 9, further, after network topology end tree generates, user can set any rotation angle,
Rotational display is carried out to the network topology end tree.
Calculation formula involved in this embodiment, angle are converted into radian and are calculated, and length unit uses pixel
Unit px.Calculation formula, angle, length described in certain the present embodiment etc. can also be indicated with other corresponding units.
The topological diagram end autoplacement method and device through the invention so that leaf node around root node along
Elliptic curve is laid out, and adjustment elliptic arc covering of the fan is supported, so that leaf node does not overlap each other, and layout symmetry, beauty.
Technology contents and technical characteristic of the invention have revealed that as above, however those skilled in the art still may base
Make various replacements and modification without departing substantially from spirit of that invention, therefore, the scope of the present invention in teachings of the present invention and announcement
It should be not limited to the revealed content of embodiment, and should include various without departing substantially from replacement and modification of the invention, and be this patent Shen
Please claim covered.
Claims (7)
1. a kind of topological diagram end tree autoplacement method, which is characterized in that the described method includes:
S10 obtains each node of topological diagram and path relation, analyzes all topological diagram ends tree in topological diagram, and be stored in
In topological diagram end tree set;
S20 selects a topological diagram end tree from the topological diagram end tree set, calculates the topological diagram end tree of selection
Leaf node quantity and leaf node shape graph circumradius maximum value;
Elliptic curve is calculated according to the circumradius maximum value of the leaf node quantity and leaf node shape graph in S30
Total initial value of arc length and the initial value of elliptic curve major semiaxis;
S40 calculates the exact value a of the major semiaxis of elliptic curveEssence, the exact value b of semi-minor axisEssence, and oval upper angle section institute
Corresponding elliptic arc long value arc_len;
All leaf nodes of topological diagram end tree are put into the angle section and are laid out by S50, are weighted and are laid out by elliptic arc
Method and angle convert layout method, and all leaf node final coordinates are calculated in the angle interval range;
S60 generates the visual interface of the topological diagram end tree according to each leaf node final coordinate;
S70 repeats S20~S60, generates the visual interface of all topological diagram ends tree;Wherein:
Elliptic arc weighting layout method the following steps are included:
S501 sets weighted value collection P={ p1, p2..., pnodes_num-1, wherein nodes_num is leaf node quantity;
The corresponding ellipse arc length arc_len in angle section is split by S502 according to leaf node quantity and weighted value collection;
S503, since starting leaf node, according to leaf node leafiAnd adjacent leaf node leafi+1Corresponding arc length calculates each
The angle of arc length corresponding leaf node and root node angle;
S504 calculates each leaf node to root node linear equation according to the corresponding angle of each arc length and root node coordinate;
S505 calculates each leaf node to root node straight line elliptic arc intersecting point coordinate corresponding with oval angle section;
S506 exports all leaf node initial coordinates in angle section;
Angle conversion layout method the following steps are included:
S601, sets elliptic arc angle α, and major semiaxis value a, semi-minor axis value b calculate angle commutation factor m;
S602 calculates new major semiaxis value new_a=m × a according to angle commutation factor m, and new semi-minor axis value is new_b=m × b;
S603, according to new major semiaxis value new_a, it is corresponding to calculate angle section for new semi-minor axis value new_b, new elliptic parametric equation
New oval arc length new_arc_len;
S604, according to new oval arc length new_arc_len and leaf node quantity, according to leaf node weighted value collection by new ellipse
Arc length new_arc_len is split;
S605, since starting leaf node, according to leaf node leafiAnd adjacent leaf node leafi+1Corresponding arc length, is counted again
Calculate leafi+1Coordinate;
S606, until exporting the final coordinate of all leaf nodes.
2. the method according to claim 1, wherein topological diagram end tree set is obtained according to following steps
:
S201 obtains the node that topological diagram moderate is 0, obtains leaf segment point set VLeaf, the nonleaf node adjacent with leaf node is obtained,
Nonleaf node set is obtained, obtains root node from the nonleaf node set, obtains root node set VRoot;
S202, from root node set VRootOne root node a of middle selectionRoot, in path relation and leaf segment point set VLeafIn find out with
The root node aRootThere are all leaf nodes of path relation, obtain leaf segment point set V 'Leaf, export (aRoot, V 'Leaf) to get to should
The data of topological diagram end tree;
S203 is recycled from root node set VRootMiddle selection root node exports the data of new topological diagram end tree, until root node
Set VRootIt is sky to get the topological diagram end tree all into the topological diagram.
3. the method according to claim 1, wherein the initial value of the total arc length of the elliptic curve and oval song
The initial value of wire length semiaxis is calculated according to following function of just calculating:
Init_arc_len=nodes_num × r × h, wherein h={ h > 2, h ∈ R };And
Wherein, init_arc_len indicates that the initial value of the total arc length of elliptic curve, r indicate the circumradius of leaf node shape graph
Maximum value, h indicate that constant, nodes_num indicate leaf node quantity, and R indicates that set of real numbers, k indicate oval semi-minor axis and major semiaxis
Than init_a indicates oval major semiaxis initial value.
4. according to the method described in claim 3, it is characterized in that, the exact value a of the major semiaxisEssence, the exact value of semi-minor axis
bEssence, and the calculating of elliptic arc long value arc_len corresponding to oval upper angle section includes the following steps:
S401 sets oval major semiaxis value interval as [a0, a1], set accuracy as ξ, oval short long axis ratio is k, on ellipse
Angle is α, wherein a1Indicate the initial value of oval major semiaxis, a0It is any to choose;
S402 calculates the midpoint a of oval major semiaxis value intervalc, calculating major semiaxis value is acWhen corresponding arc length lenc;
S403, judgement | lenc- init_arc_len | whether it is less than accuracy ξ;If it is less than ξ, then the value of the output interval upper limit is
aEssence;If being unsatisfactory for precise requirements and lencLess than init_arc_len, then a is usedcValue interval is reduced as interval limit value
For [ac, a1];If being unsatisfactory for precise requirements and lencGreater than init_arc_len, then a is usedcIt is reduced as section upper limit value
Value interval is [a0, ac];Repeat step S402 and step S403, constantly reduce value interval range, until obtain meet it is small
In the value interval that accuracy ξ is required, then the value for exporting the value interval upper limit is aEssence;
S404, according to the exact value a of the oval major semiaxis of S403 outputEssenceAnd the short long axis ratio of ellipse is k, is calculated ellipse
The exact value b of circle semi-minor axisEssence=aEssence×k;
S405, according to the exact value a of the oval major semiaxisEssenceAnd the exact value b of semi-minor axisEssence, elliptic parametric equation, meter
Calculate the corresponding elliptic arc long value arc_len in angle section.
5. according to the method described in claim 4, it is characterized in that, the angle section is [- pi/2, pi/2].
6. the method according to claim 1, wherein the corresponding leaf node of each arc length and root node angle
Angle calculates according to the following formula,
Wherein, a is oval major semiaxis,For start node eccentric angle, μ is terminal node eccentric angle, and y is oval eccentricity, and ω is
Oval eccentric angle, ω ∈ [0,2 π], L are the corresponding arc length of angle.
7. the method according to claim 1, wherein the angle commutation factor calculates according to the following formula,
Wherein,A indicates that oval major semiaxis, b indicate that oval semi-minor axis, m indicate angle
Commutation factor, the absolute value of n was origin, slope is tan ((π-α)/2) straight line and oval intersection point x coordinate.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610633662.1A CN106027322B (en) | 2016-08-04 | 2016-08-04 | A kind of topological diagram end tree autoplacement method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610633662.1A CN106027322B (en) | 2016-08-04 | 2016-08-04 | A kind of topological diagram end tree autoplacement method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106027322A CN106027322A (en) | 2016-10-12 |
CN106027322B true CN106027322B (en) | 2019-11-12 |
Family
ID=57134762
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610633662.1A Active CN106027322B (en) | 2016-08-04 | 2016-08-04 | A kind of topological diagram end tree autoplacement method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106027322B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108234205B (en) * | 2017-12-29 | 2021-11-12 | 中国电子科技网络信息安全有限公司 | Network topology structure and information presentation method thereof |
CN113934341B (en) * | 2021-10-20 | 2024-04-09 | 迈普通信技术股份有限公司 | Network policy topology display method and device, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1399443A (en) * | 2001-07-26 | 2003-02-26 | 华为技术有限公司 | Graphical representation method of topological structure of network notes |
CN103258061A (en) * | 2013-06-09 | 2013-08-21 | 北京工商大学 | Area enclosure hypergraph visualization method based on interpolation algorithm |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090310028A1 (en) * | 2008-06-11 | 2009-12-17 | Reza Sadri | System for Controlling a Group of Picture Frames |
-
2016
- 2016-08-04 CN CN201610633662.1A patent/CN106027322B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1399443A (en) * | 2001-07-26 | 2003-02-26 | 华为技术有限公司 | Graphical representation method of topological structure of network notes |
CN103258061A (en) * | 2013-06-09 | 2013-08-21 | 北京工商大学 | Area enclosure hypergraph visualization method based on interpolation algorithm |
Non-Patent Citations (1)
Title |
---|
动态网络拓扑图自动布局研究与应用;张慧君;《中国优秀硕士学位论文全文数据库》;20160615;I139-5 * |
Also Published As
Publication number | Publication date |
---|---|
CN106027322A (en) | 2016-10-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106598988B (en) | Data processing method and equipment | |
CN105101093B (en) | A kind of network topology method for visualizing on geographical location information | |
CN110795148B (en) | Method and device for generating layout file and electronic equipment | |
CN104750737B (en) | A kind of photograph album management method and device | |
CN105608319B (en) | A kind of mask method and annotation equipment of digital pathological section | |
CN106059799B (en) | Mapping method of virtual network under elastic optical network towards SDN | |
CN109376313A (en) | Information recommendation method, device, terminal and storage medium | |
US9335889B2 (en) | Method and device for processing network element object information in 3D topology view | |
CN105468161B (en) | Instruction executing method and device | |
CN109977273A (en) | A kind of topology drawing generating method, device, equipment and readable storage medium storing program for executing | |
CN109408367A (en) | A kind of method and terminal of the control element identifying interactive interface | |
CN104580293B (en) | For the methods, devices and systems of remote control management and control strategy | |
CN106027322B (en) | A kind of topological diagram end tree autoplacement method | |
CN107102833A (en) | Line information interactive approach and electronic equipment | |
CN106998299B (en) | The recognition methods of the network equipment, apparatus and system in data center network | |
CN110955803A (en) | Drawing method, device, equipment and medium of relational graph based on graph database | |
CN106095579A (en) | Container resource allocation methods and device | |
CN112052884A (en) | Point cloud classification method and system based on local edge feature enhancement | |
CN110110950A (en) | Generate the method, apparatus and computer readable storage medium in dispatching road area | |
CN106446169A (en) | Method and device for managing user information in terminal device | |
CN109194545A (en) | A kind of network test platform traffic generating system, method, apparatus and electronic equipment | |
CN106776993A (en) | Recommend method and system in a kind of path based on temporal constraint activity purpose | |
Cheng et al. | An improved integrated generalization method for contours and Rivers using importance sequence of all points from these two elements | |
CN110288646A (en) | A kind of human dimension calculation method and device based on image | |
CN114139069A (en) | Indoor positioning method and system based on voice interaction and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |