Method, device and equipment for arranging large sample pictures and readable storage medium

文档序号:8033 发布日期:2021-09-17 浏览:33次 中文

1. A method of arranging a thumbnail, the method comprising:

receiving an arrangement instruction, and acquiring a layout area for arranging the big sample pictures, a picture set containing the big sample pictures to be arranged and a preset arrangement rule according to the arrangement instruction;

analyzing an arrangement sequence, a minimum column distance and a minimum row distance from the arrangement rule;

and determining target large sample graphs from the graph set, arranging the target large sample graphs in the layout area according to the arrangement sequence, and enabling the arranged target large sample graphs to meet the minimum column spacing and the minimum row spacing so as to obtain an arrangement result graph.

2. The method of arranging a thumbnail according to claim 1, wherein obtaining a layout area for arranging a thumbnail according to the arrangement instruction comprises:

obtaining a layout frame drawn by a user on a display interface, and intercepting the layout area from the layout frame according to a preset elevation symbol reserved width;

the height of the layout area is the height of the layout frame, and the width of the layout area is the difference value between the width of the layout frame and the reserved width of the elevation symbol.

3. The method of arranging thumbnail images according to claim 1, wherein obtaining an atlas containing thumbnail images to be arranged according to the arrangement instruction comprises:

and acquiring the large sample images to be arranged, and sequencing all the acquired large sample images according to a preset sequencing rule to obtain the image set.

4. The method according to claim 1, wherein the determining a target large sample from the set of images, arranging the target large sample in the layout area according to the arrangement order, and making each arranged target large sample satisfy the minimum column distance and the minimum row distance to obtain an arrangement result image comprises:

sequentially acquiring the large sample images from the image set aiming at the ith row, and determining the target large sample images distributed on the ith row according to the width of each acquired large sample image, the width of the layout area and the minimum column distance;

determining the height of the ith row according to the height of each target big sample graph of the ith row and the minimum row spacing;

determining the accumulated height of the previous i rows according to the height of the ith row, and judging whether the accumulated height is smaller than the height of the layout area;

if yes, determining the target large sample graph arranged in the (i +1) th row; and if not, adding all the target large sample maps in the ith row to the map set, and forming a layout result map according to the target large sample maps in the previous (i-1) row.

5. The method according to claim 4, wherein the step of sequentially acquiring the large sample images from the image set for the ith row, and determining the target large sample image arranged on the ith row according to the width of each acquired large sample image, the width of the layout area and the minimum column pitch comprises:

acquiring a candidate large sample image from the image set, and arranging the candidate large sample image on the ith row according to the arrangement sequence;

adding the width of the candidate large sample graph, the minimum column spacing and the accumulated width of the ith row to obtain the updated accumulated width of the ith row;

judging whether the updated accumulated width of the ith row is smaller than the width of the layout area;

if yes, obtaining a next candidate big sample graph from the graph set; and if not, adding the candidate large sample map into the map set, and setting the large sample map arranged on the ith row before the candidate large sample map is acquired as the target large sample map of the ith row.

6. The method according to claim 4, wherein after the obtaining of the large sample images from the image set in turn for the ith row and the determining of the target large sample image arranged on the ith row according to the width of each obtained large sample image, the width of the layout area and the minimum column pitch, the method further comprises:

the margin column spacing d of the ith row is calculated according to the following formula:

wherein W is a width of the layout region;

rw (i) is the accumulated width calculated according to all target large sample images in the ith row;

n is the total number of the target large sample graphs in the ith row;

and adjusting the column distance between two adjacent target large sample graphs in the ith row to be the sum of the spare column distance and the minimum column distance.

7. The method of claim 4, wherein determining the height of the ith row according to the height of each target great sample map of the ith row and the minimum row spacing comprises:

acquiring the height of each target big sample image in the ith row, and determining the maximum height from all the acquired heights;

and adding the maximum height and the minimum row spacing to obtain the height of the ith row.

8. An apparatus for arranging a thumbnail, said apparatus comprising:

the acquisition module is used for receiving the arrangement instruction and acquiring a layout area for arranging the big sample pictures, a picture set containing the big sample pictures to be arranged and a preset arrangement rule according to the arrangement instruction;

the analysis module is used for analyzing the arrangement sequence, the minimum column spacing and the minimum row spacing from the arrangement rule;

and the arrangement module is used for determining the target big sample graphs from the graph set, arranging the target big sample graphs in the arrangement area according to the arrangement sequence, and enabling the arranged target big sample graphs to meet the minimum column spacing and the minimum row spacing so as to obtain an arrangement result graph and obtain the arrangement result graph.

9. A computer device, the computer device comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.

Background

In the building design business, the detailed construction information of local parts of a building needs to be expressed through a large drawing and a detailed drawing; because the large sample drawings and the detailed drawings only show local information of the building, the large sample drawings and the detailed drawings occupy small drawing space, and a plurality of large sample drawings and detailed drawings are often arranged on one drawing when the drawing is carried out. For example, a plurality of door and window thumbnail pictures are displayed through one layout result drawing.

In the prior art, a designer needs to manually place a large sample drawing and detailed drawings to be arranged in a drawing one by one, and in the placing process, the designer needs to consider the arrangement sequence problem of the large sample drawing and the detailed drawings as well as the column spacing and the row spacing problem; therefore, the existing mode of manually arranging the large sample figures occupies a great deal of time for designers and is low in efficiency. Therefore, how to automatically arrange a plurality of large drawings and detailed drawings into a drawing according to the requirements of designers becomes a technical problem which needs to be solved by the technical personnel in the field.

Disclosure of Invention

The invention aims to provide a method, a device, equipment and a readable storage medium for arranging a large sample chart, which can automatically arrange a plurality of large sample charts and detailed charts into a drawing according to the requirements of designers, thereby saving the labor cost and improving the drawing efficiency.

According to an aspect of the present invention, there is provided a method of arranging a thumbnail, the method comprising:

receiving an arrangement instruction, and acquiring a layout area for arranging the big sample pictures, a picture set containing the big sample pictures to be arranged and a preset arrangement rule according to the arrangement instruction;

analyzing an arrangement sequence, a minimum column distance and a minimum row distance from the arrangement rule;

and determining target large sample graphs from the graph set, arranging the target large sample graphs in the layout area according to the arrangement sequence, and enabling the arranged target large sample graphs to meet the minimum column spacing and the minimum row spacing so as to obtain an arrangement result graph.

Optionally, obtaining a layout area for arranging the thumbnail according to the arrangement instruction includes:

obtaining a layout frame drawn by a user on a display interface, and intercepting the layout area from the layout frame according to a preset elevation symbol reserved width;

the height of the layout area is the height of the layout frame, and the width of the layout area is the difference value between the width of the layout frame and the reserved width of the elevation symbol.

Optionally, obtaining an atlas containing a thumbnail to be arranged according to the arrangement instruction includes:

and acquiring the large sample images to be arranged, and sequencing all the acquired large sample images according to a preset sequencing rule to obtain the image set.

Optionally, the determining a target large sample from the graph set, arranging the target large sample in the layout area according to the arrangement order, and enabling each arranged target large sample to satisfy the minimum column spacing and the minimum row spacing to obtain an arrangement result graph includes:

sequentially acquiring the large sample images from the image set aiming at the ith row, and determining the target large sample images distributed on the ith row according to the width of each acquired large sample image, the width of the layout area and the minimum column distance;

determining the height of the ith row according to the height of each target big sample graph of the ith row and the minimum row spacing;

determining the accumulated height of the previous i rows according to the height of the ith row, and judging whether the accumulated height is smaller than the height of the layout area;

if yes, determining the target large sample graph arranged in the (i +1) th row; and if not, adding all the target large sample maps in the ith row to the map set, and forming a layout result map according to the target large sample maps in the previous (i-1) row.

Optionally, the obtaining, for the ith row, the large sample maps from the map set in sequence, and determining the target large sample maps arranged in the ith row according to the width of each obtained large sample map, the width of the layout area, and the minimum column pitch includes:

acquiring a candidate large sample image from the image set, and arranging the candidate large sample image on the ith row according to the arrangement sequence;

adding the width of the candidate large sample graph, the minimum column spacing and the accumulated width of the ith row to obtain the updated accumulated width of the ith row;

judging whether the updated accumulated width of the ith row is smaller than the width of the layout area;

if yes, obtaining a next candidate big sample graph from the graph set; and if not, adding the candidate large sample map into the map set, and setting the large sample map arranged on the ith row before the candidate large sample map is acquired as the target large sample map of the ith row.

Optionally, after the obtaining of the large sample images from the image set in sequence for the ith row, and determining the target large sample images arranged in the ith row according to the width of each obtained large sample image, the width of the layout area, and the minimum column pitch, the method further includes:

the margin column spacing d of the ith row is calculated according to the following formula:

wherein W is a width of the layout region;

rw (i) is the accumulated width calculated according to all target large sample images in the ith row;

n is the total number of the target large sample graphs in the ith row;

and adjusting the column distance between two adjacent target large sample graphs in the ith row to be the sum of the spare column distance and the minimum column distance.

Optionally, the determining the height of the ith row according to the height of each target great sample graph of the ith row and the minimum row spacing includes:

acquiring the height of each target big sample image in the ith row, and determining the maximum height from all the acquired heights;

and adding the maximum height and the minimum row spacing to obtain the height of the ith row.

In order to achieve the above object, the present invention further provides an apparatus for arranging thumbnail images, which specifically comprises the following components:

the acquisition module is used for receiving the arrangement instruction and acquiring a layout area for arranging the big sample pictures, a picture set containing the big sample pictures to be arranged and a preset arrangement rule according to the arrangement instruction;

the analysis module is used for analyzing the arrangement sequence, the minimum column spacing and the minimum row spacing from the arrangement rule;

and the arrangement module is used for determining the target big sample graphs from the graph set, arranging the target big sample graphs in the arrangement area according to the arrangement sequence, and enabling the arranged target big sample graphs to meet the minimum column spacing and the minimum row spacing so as to obtain an arrangement result graph.

In order to achieve the above object, the present invention further provides a computer device, which specifically includes: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of arranging a thumbnail as described above when executing the computer program.

To achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the above-mentioned steps of the method of arranging thumbnails.

According to the method, the device, the equipment and the readable storage medium for arranging the big sample graphs, provided by the invention, a designer only needs to select one layout area in the display interface frame and set the arrangement rule in advance, so that the big sample graphs to be arranged in the graph set can be automatically arranged in the layout area according to the arrangement rule, and the arrangement result graph is obtained. According to the invention, a plurality of large pattern drawings and detailed drawings can be automatically arranged in the drawing according to the requirements of designers, so that the labor cost is saved and the drawing efficiency is improved.

Drawings

Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:

FIG. 1 is a schematic flow chart illustrating an alternative method for arranging a thumbnail according to an embodiment;

FIG. 2 is a diagram showing an example of an arrangement result in the first embodiment;

FIG. 3 is a schematic size diagram of a window thumbnail bounding box according to the first embodiment;

FIG. 4 is a schematic diagram of an alternative structure of the apparatus for arranging thumbnail images according to the second embodiment;

fig. 5 is a schematic diagram of an alternative hardware architecture of the computer device according to the third embodiment.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Example one

The embodiment of the invention provides a method for arranging a large sample graph, which specifically comprises the following steps as shown in figure 1:

step S101: and receiving an arrangement instruction, and acquiring a layout area for arranging the big sample pictures, a picture set containing the big sample pictures to be arranged and a preset arrangement rule according to the arrangement instruction.

In this embodiment, when the layout area, the atlas and the layout rule are required to be arranged, the designer only needs to determine the layout area, the atlas and the layout rule in advance, and then the layout of the layout area, the atlas and the layout rule can be automatically arranged according to the layout area, the atlas and the layout rule.

Specifically, obtaining a layout area for arranging the thumbnail according to the arrangement instruction includes:

obtaining a layout frame drawn by a user on a display interface, and intercepting the layout area from the layout frame according to a preset elevation symbol reserved width;

the height of the layout area is the height of the layout frame, and the width of the layout area is the difference value between the width of the layout frame and the reserved width of the elevation symbol.

In this example, the layout area is a drawing area in which a plurality of large charts and/or detailed charts are placed, and is drawn by a designer in a frame selection manner; for example, in the example diagram of the arrangement result diagram shown in fig. 2, the outermost dotted line frame is a cloth frame drawn on the display interface by the designer, wherein the cloth frame has a width of 1000 and a height of 8000; when the elevation symbol reserve width is 1000, a layout area having a width 9000 and a height 8000 is cut out from the layout frame as shown in fig. 2.

Further, acquiring an atlas containing a thumbnail to be arranged according to the arrangement instruction specifically includes:

and acquiring the large sample images to be arranged, and sequencing all the acquired large sample images according to a preset sequencing rule to obtain the image set.

In this embodiment, all the large sample diagrams and/or the detailed diagrams to be sequenced are obtained first, and all the large sample diagrams and/or the detailed diagrams are sequenced according to a preset sequencing rule, and the large sample diagrams or the detailed diagrams sequenced before are arranged in the layout area first. The sorting rule can be set by the user in advance, for example: in the scene of the door and window large sample diagram, the sorting of the door and window table can be referred, or the characteristics can be set by a user, and ascending or descending sorting is carried out according to the characteristic values of the characteristics. In addition, the user may set filtering rules to filter out large thumbnails and/or detailed thumbnails that do not require sorting.

It should be noted that, in this embodiment, the scaling of all the thumbnail images in the atlas is the same.

In this embodiment, three inputs are required to automatically arrange the thumbnail: layout area, atlas, and layout rules.

Step S102: and analyzing the arrangement sequence, the minimum column spacing and the minimum row spacing from the arrangement rule.

Wherein, the arrangement sequence is a rule for determining the sequence of the positions of the large sample graphs and/or the detailed graphs on the layout area; for example, the sort order is from left to right and then from top to bottom, that is, the large charts are arranged in a row from left to right, and after the row is full, the large charts are arranged in the next row from top to bottom. In addition, the sorting order may also be one of: the large sample graphs are arranged in the next row from top to bottom and then from right to left (namely, the large sample graphs are arranged in the next row from the right to the left in sequence and then from the top to the bottom after the row is full), the large sample graphs are arranged in the next row from the top to the bottom, and the large sample graphs are arranged in the next row from the top to the bottom.

The minimum column distance is a minimum inter-column distance value between two adjacent target large sample graphs in each row of the arrangement result graph; i.e., the minimum spacing to the left and right of a single thumbnail and/or detail;

the minimum row spacing is a minimum row-to-row distance value between two adjacent rows in the arrangement result graph; i.e. the minimum spacing above and below a single thumbnail and/or detail.

Step S103: and determining target large sample graphs from the graph set, arranging the target large sample graphs in the layout area according to the arrangement sequence, and enabling the arranged target large sample graphs to meet the minimum column spacing and the minimum row spacing so as to obtain an arrangement result graph.

In this embodiment, the target large sample maps arranged in the layout area are determined from the map set, then all the target large sample maps are arranged in the layout area in sequence according to the arrangement order, and finally the positions of the target large sample maps arranged in the layout area are adjusted, so that the column distance between any two adjacent adjusted target large sample maps is larger than the minimum column distance, and the row distance between any two adjacent adjusted target large sample maps is larger than the minimum row distance.

Specifically, when the arrangement sequence is arranged line by line from top to bottom, step S103 includes:

step A1: sequentially acquiring the large sample images from the image set aiming at the ith row, and determining the target large sample images distributed on the ith row according to the width of each acquired large sample image, the width of the layout area and the minimum column distance; wherein i is an integer of 1 or more.

In this embodiment, the large sample maps are sequentially obtained from the atlas, and the obtained large sample maps are sequentially arranged in the ith row according to the arrangement order (from left to right or from right to left), until the large sample maps arranged in the ith row exceed the width of the layout area.

Further, step a1 specifically includes:

step A11: acquiring a candidate large sample image from the image set, and arranging the large sample image on the ith row according to the arrangement sequence;

step A12: adding the width of the candidate large sample graph, the minimum column spacing and the accumulated width of the ith row to obtain the updated accumulated width of the ith row; wherein the initial value of the accumulated width is 0;

in the present embodiment, the thumbnail images included in the atlas are images in the form of thumbnail bounding boxes; the full-scale bounding box is a diagram obtained by reserving a reserved width and a reserved height around a component schematic diagram; in this embodiment, the width of the thumbnail refers to the width of the thumbnail bounding box, and the height of the thumbnail refers to the height of the thumbnail bounding box; as shown in fig. 3, it is a schematic size diagram of the door and window full-page template enclosure, where w is the width of the door and window full-page template enclosure, and h is the height of the door and window full-page template enclosure;

step A13: judging whether the updated accumulated width of the ith row is smaller than the width of the layout area;

step A14: if yes, re-executing step A11 to obtain the next candidate large sample map from the atlas; and if not, adding the candidate large sample map into the map set, and setting the large sample map arranged on the ith row before the candidate large sample map is acquired as the target large sample map of the ith row.

Further, after the determining the target thumbnail arranged in the ith row, the method further includes:

the margin column spacing d of the ith row is calculated according to the following formula:

wherein W is a width of the layout region;

rw (i) is the accumulated width calculated according to all target large sample images in the ith row;

n is the total number of the target large sample graphs in the ith row;

and adjusting the column distance between two adjacent target large sample graphs in the ith row to be the sum of the spare column distance and the minimum column distance.

Wherein rw (i) is the result of adding n minimum column distances to the total width of the n target thumbnail images in the ith row; as shown in fig. 2, in the first row, the distance between the leftmost window and door thumbnail and the left boundary line of the layout area is the minimum column pitch a, but the distance between two adjacent window and door thumbnails in the first row is the sum of the adjusted margin column pitch d and the minimum column pitch a.

In this embodiment, the abscissa of the vertex at the lower left corner of the first target thumbnail in the ith row is the abscissa x of the vertex at the upper left corner of the layout area0The sum of the minimum column pitch a; starting from the second target macrosample in the ith row, the abscissa of the vertex at the lower left corner of the kth target macrosample is the (k-1) th targetAnd the abscissa of the vertex at the lower left corner of the standard big sample graph, the width of the (k-1) th target big sample graph, the minimum column spacing and the margin column spacing are obtained by accumulation.

Further, in step a11, the obtaining a candidate thumbnail from the atlas includes:

judging whether a large sample image exists in the image set or not;

if yes, acquiring a candidate large sample image from the image set, and deleting the candidate large sample image from the image set; wherein the candidate large sample graph is a first ordered large sample graph in the atlas;

if not, the thumbnail arranged in the ith row is set as the target thumbnail of the ith row, and step A2 is executed according to the target thumbnail of the ith row.

In this embodiment, since one thumbnail is deleted from the atlas each time it is acquired from the atlas, when the thumbnail is arranged in the ith row, a case may occur in which there is no thumbnail in the atlas, in which case the thumbnail already arranged in the ith row is set as the target thumbnail in the ith row, and step a2 is executed according to the target thumbnail in the ith row.

Step A2: and determining the height of the ith row according to the height of each target big sample graph of the ith row and the minimum row spacing.

Specifically, step a2 includes:

step A21: acquiring the height of each target big sample image in the ith row, and determining the maximum height from all the acquired heights;

step A22: and adding the maximum height and the minimum row spacing to obtain the height of the ith row.

As shown in fig. 2, in the ith row, the maximum height hmax is determined according to the height of each target thumbnail, and the maximum height hmax is added to the minimum row spacing b to obtain the height rh (i) of the ith row.

Step A3: determining the accumulated height of the previous i rows according to the height of the ith row, and judging whether the accumulated height is smaller than the height of the layout area; wherein the initial value of the cumulative height is 0.

Specifically, the cumulative height ro (i) of the i rows is calculated according to the following formula:

ro(i)=ro(i-1)+rh(i);

wherein ro (i-1) is the accumulated height of the previous (i-1) row;

rh (i) is the height of the ith row.

It should be noted that, in the ith row, the ordinate of the vertex at the lower left corner of each target thumbnail is the ordinate y of the vertex at the upper left corner of the layout area0And the sum of the cumulative height ro (i) of row i.

Step A4: if yes, repeating the step A1 to determine the target thumbnail arranged in the (i +1) th row; and if not, adding all the target large sample maps in the ith row to the map set, and forming a layout result map according to the target large sample maps in the previous (i-1) row.

In this embodiment, when the designer needs to arrange the thumbnail images and/or the detailed images, the designer only needs to drag and draw a rectangular layout area in the interface, and a plurality of thumbnail images and/or detailed images are automatically arranged in the layout area according to the above steps. It should be noted that, in the process of forming the layout area by the user's dragging, the user can preview the layout result in real time, that is, as the user adjusts the size of the layout area, the layout result in the adjusted layout area can be dynamically displayed.

Further, when the arrangement order is arranged column by column from left to right, step S103 includes:

step B1: sequentially acquiring the large sample images from the image set aiming at the jth column, and determining target large sample images arranged in the jth column according to the height of each acquired large sample image, the height of the image distribution area and the minimum line spacing; wherein j is an integer of 1 or more.

In this embodiment, the thumbnail images are sequentially obtained from the atlas, and the obtained thumbnail images are arranged in the order: and sequentially arranging the big samples in the jth column from top to bottom until the big samples arranged in the jth column exceed the height of the layout area.

Further, step B1 specifically includes:

step B11: acquiring a candidate large sample graph from the graph set, and arranging the large sample graph in a j column according to the arrangement sequence;

step B12: adding the height of the candidate large sample graph, the minimum row spacing and the accumulated height of the jth column to obtain an updated accumulated height of the jth column; wherein the initial value of the cumulative height is 0;

in the present embodiment, the thumbnail images included in the atlas are images in the form of thumbnail bounding boxes; the full-scale bounding box is a diagram obtained by reserving a reserved width and a reserved height around a component schematic diagram; in this embodiment, the width of the thumbnail refers to the width of the thumbnail bounding box, and the height of the thumbnail refers to the height of the thumbnail bounding box; as shown in fig. 3, it is a schematic size diagram of the door and window full-page template enclosure, where w is the width of the door and window full-page template enclosure, and h is the height of the door and window full-page template enclosure;

step B13: judging whether the updated cumulative height of the jth column is smaller than the height of the layout area;

step B14: if yes, re-executing step B11 to obtain the next candidate large sample map from the atlas; and if not, adding the candidate large sample map into the map set, and setting the large sample map which is arranged in the jth column before the candidate large sample map is obtained as the target large sample map of the jth column.

Further, after the determining the target thumbnail arranged in the jth column, the method further includes:

the spare row spacing t of the jth column is calculated according to the following formula:

wherein H is the height of the layout area;

lo (j) is the accumulated height calculated according to all the target big sample images in the j column;

m is the total number of the target large sample graphs in the jth column;

and adjusting the line spacing between two adjacent target large sample graphs in the jth column to be the sum of the spare line spacing and the minimum line spacing.

It should be noted that lo (j) is the result obtained by adding m minimum line distances to the total height of the m target thumbnail images in the j-th column; in this embodiment, the ordinate of the vertex at the top right corner of the first target thumbnail is the ordinate y of the vertex at the top left corner of the layout area0The sum of the minimum row spacing b; and starting from the second target big sample diagram in the j column, and accumulating the ordinate of the top right vertex of the kth target big sample diagram, the height of the (k-1) th target big sample diagram, the minimum line spacing and the surplus line spacing to obtain the ordinate of the top right vertex of the kth target big sample diagram.

Further, in step B11, the obtaining a candidate thumbnail from the atlas includes:

judging whether a large sample image exists in the image set or not;

if yes, acquiring a candidate large sample image from the image set, and deleting the candidate large sample image from the image set; wherein the candidate large sample graph is a first ordered large sample graph in the atlas;

if not, the thumbnail already arranged in the jth column is set as the target thumbnail in the jth column, and step B2 is executed according to the target thumbnail in the jth column.

In this embodiment, since one thumbnail is deleted from the atlas each time it is acquired from the atlas, when the thumbnail is arranged in the jth column, a situation may occur in which there is no thumbnail in the atlas, in which case the thumbnail already arranged in the jth column is set as the target thumbnail in the jth column, and step B2 is executed according to the target thumbnail in the jth column.

Step B2: and determining the width of the jth row according to the width of each target big sample graph of the jth column and the minimum column distance.

Specifically, step B2 includes:

step B21: acquiring the width of each target big sample image in the jth column, and determining the maximum width from all the acquired widths;

step B22: and adding the maximum width and the minimum column distance to obtain the width of the jth column.

Step B3: determining the cumulative width of the front j column according to the width of the j column, and judging whether the cumulative width is smaller than the width of the layout area; wherein the initial value of the integration width is 0.

Specifically, the cumulative width lq (j) of the j column is calculated according to the following formula:

lq(j)=lq(j-1)+lw(j);

wherein lq (i-1) is the accumulated width of the front (j-1) column;

lw (j) is the width of column j.

It should be noted that, in the j-th column, the abscissa of the vertex at the top right corner of each target thumbnail is the abscissa x of the vertex at the top left corner of the layout area0And the sum of the cumulative widths lq (j) of the columns j.

Step B4: if yes, step B1 is repeated to determine the target thumbnail arranged in the (j +1) th column; and if not, adding all the target large sample maps in the j column into the map set, and forming a layout result map according to the target large sample maps in the previous (j-1) column.

Through the embodiment, a designer only needs to select one layout area in the display interface frame and set the arrangement rule in advance, so that the large sample pictures to be arranged in the picture set can be automatically arranged in the layout area according to the arrangement rule, and the arrangement result picture can be obtained. According to the embodiment, a plurality of large sample drawings and detailed drawings can be automatically arranged in the drawing according to the requirements of designers, so that the labor cost is saved, and the drawing efficiency is improved.

Example two

The embodiment of the invention provides a device for arranging a large sample figure, which specifically comprises the following components as shown in fig. 4:

an obtaining module 401, configured to receive an arrangement instruction, and obtain, according to the arrangement instruction, a layout area for arranging the thumbnail, an atlas including the thumbnail to be arranged, and a preset arrangement rule;

an analyzing module 402, configured to analyze an arrangement order, a minimum column spacing, and a minimum row spacing from the arrangement rule;

the arrangement module 403 is configured to determine target large sample maps from the atlas, arrange the target large sample maps in the arrangement area according to the arrangement order, and enable each arranged target large sample map to satisfy the minimum column spacing and the minimum row spacing, so as to obtain an arrangement result map, and obtain an arrangement result map.

Specifically, the obtaining module 401 is configured to:

obtaining a layout frame drawn by a user on a display interface, and intercepting the layout area from the layout frame according to a preset elevation symbol reserved width;

the height of the layout area is the height of the layout frame, and the width of the layout area is the difference value between the width of the layout frame and the reserved width of the elevation symbol.

Further, the obtaining module 401 is further configured to:

and acquiring the large sample images to be arranged, and sequencing all the acquired large sample images according to a preset sequencing rule to obtain the image set.

Further, the arrangement module 403 specifically includes:

the obtaining unit is used for sequentially obtaining the large sample images from the image set aiming at the ith row and determining the target large sample images distributed on the ith row according to the width of each obtained large sample image, the width of the layout area and the minimum column spacing;

the determining unit is used for determining the height of the ith row according to the height of each target big sample graph of the ith row and the minimum row spacing;

the judging unit is used for determining the accumulated height of the previous i rows according to the height of the ith row and judging whether the accumulated height is smaller than the height of the layout area;

the processing unit is used for determining the target thumbnail arranged in the (i +1) th row if the target thumbnail is in the (i +1) th row; and if not, adding all the target large sample maps in the ith row to the map set, and forming a layout result map according to the target large sample maps in the previous (i-1) row.

Further, the obtaining unit is specifically configured to:

acquiring a candidate large sample image from the image set, and arranging the candidate large sample image on the ith row according to the arrangement sequence;

adding the width of the candidate large sample graph, the minimum column spacing and the accumulated width of the ith row to obtain the updated accumulated width of the ith row;

judging whether the updated accumulated width of the ith row is smaller than the width of the layout area;

if yes, obtaining a next candidate big sample graph from the graph set; and if not, adding the candidate large sample map into the map set, and setting the large sample map arranged on the ith row before the candidate large sample map is acquired as the target large sample map of the ith row.

A determination unit, specifically configured to:

acquiring the height of each target big sample image in the ith row, and determining the maximum height from all the acquired heights;

and adding the maximum height and the minimum row spacing to obtain the height of the ith row.

Further, the arranging module 403 is further configured to:

the margin column spacing d of the ith row is calculated according to the following formula:

wherein W is a width of the layout region;

rw (i) is the accumulated width calculated according to all target large sample images in the ith row;

n is the total number of the target large sample graphs in the ith row;

and adjusting the column distance between two adjacent target large sample graphs in the ith row to be the sum of the spare column distance and the minimum column distance.

EXAMPLE III

The embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers) capable of executing programs, and the like. As shown in fig. 5, the computer device 50 of the present embodiment includes at least but is not limited to: a memory 501, a processor 502 communicatively coupled to each other via a system bus. It is noted that FIG. 5 only shows the computer device 50 having the components 501 and 502, but it is understood that not all of the shown components are required and that more or fewer components may be implemented instead.

In this embodiment, the memory 501 (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 501 may be an internal storage unit of the computer device 50, such as a hard disk or a memory of the computer device 50. In other embodiments, the memory 501 may also be an external storage device of the computer device 50, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device 50. Of course, the memory 501 may also include both internal and external storage devices for the computer device 50. In the present embodiment, the memory 501 is generally used for storing an operating system and various types of application software installed in the computer device 50. Further, the memory 501 may also be used to temporarily store various types of data that have been output or are to be output.

Processor 502 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 502 generally serves to control the overall operation of the computer device 50.

Specifically, in this embodiment, the processor 502 is configured to execute the program of the method for arranging a thumbnail stored in the memory 501, and the program of the method for arranging a thumbnail implements the following steps when executed:

receiving an arrangement instruction, and acquiring a layout area for arranging the big sample pictures, a picture set containing the big sample pictures to be arranged and a preset arrangement rule according to the arrangement instruction;

analyzing an arrangement sequence, a minimum column distance and a minimum row distance from the arrangement rule;

and determining target large sample graphs from the graph set, arranging the target large sample graphs in the layout area according to the arrangement sequence, and enabling the arranged target large sample graphs to meet the minimum column spacing and the minimum row spacing so as to obtain an arrangement result graph.

The specific embodiment process of the above method steps can be referred to in the first embodiment, and the detailed description of this embodiment is not repeated here.

Example four

The present embodiments also provide a computer readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., having stored thereon a computer program that when executed by a processor implements the method steps of:

receiving an arrangement instruction, and acquiring a layout area for arranging the big sample pictures, a picture set containing the big sample pictures to be arranged and a preset arrangement rule according to the arrangement instruction;

analyzing an arrangement sequence, a minimum column distance and a minimum row distance from the arrangement rule;

and determining target large sample graphs from the graph set, arranging the target large sample graphs in the layout area according to the arrangement sequence, and enabling the arranged target large sample graphs to meet the minimum column spacing and the minimum row spacing so as to obtain an arrangement result graph.

The specific embodiment process of the above method steps can be referred to in the first embodiment, and the detailed description of this embodiment is not repeated here.

It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.

Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.

The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种生成门窗大样图的方法、设备及可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类