Vector drawing display method, system, device and storage medium

文档序号:1428784 发布日期:2020-03-17 浏览:13次 中文

阅读说明:本技术 一种矢量图纸展示方法、系统、装置及存储介质 (Vector drawing display method, system, device and storage medium ) 是由 魏朝凌 于 2019-11-22 设计创作,主要内容包括:本发明属于工程设计技术领域,具体涉及一种矢量图纸展示方法、系统、装置及存储介质。包括获取矢量图纸上连续多个输入点的位置信息以计算出预加载区域;确定出所述预加载区域在矢量图纸上的所述预加载位置;将所述预加载位置对应的数据从ROM加载到RAM中以加速矢量图纸的展示,当所述方法用于PC端时,加强矢量图纸的展示流畅度且降低资源的损耗;当所述方法运用在移动设备上,能够降低CPU的工作强度,提升矢量图纸的展示流畅度的同时降低资源损耗,能让电池续航时间加长。(The invention belongs to the technical field of engineering design, and particularly relates to a vector drawing display method, a vector drawing display system, a vector drawing display device and a vector drawing display storage medium. Acquiring position information of a plurality of continuous input points on a vector drawing to calculate a preloading area; determining the preloading position of the preloading area on a vector drawing; loading the data corresponding to the preloading position into an RAM from an ROM to accelerate the display of a vector drawing, and when the method is used for a PC end, enhancing the display fluency of the vector drawing and reducing the loss of resources; when the method is applied to mobile equipment, the working strength of a CPU can be reduced, the display fluency of a vector drawing is improved, the resource loss is reduced, and the battery endurance time can be prolonged.)

1. A vector drawing display method is characterized by comprising the following steps:

acquiring position information of a plurality of continuous input points on a vector drawing to calculate a preloading area;

determining the preloading position of the preloading area on a vector drawing;

and loading data corresponding to the preloading position from the ROM into the RAM so as to accelerate the presentation of the vector drawing.

2. The vector drawing display method of claim 1, wherein: the obtaining of the position information of a plurality of continuous input points on the vector drawing to calculate the preloading area specifically includes:

acquiring the current acceleration and the current direction of the current input point in the plurality of input points by using the position information of the plurality of input points;

calculating a pre-movement distance according to the current acceleration and the card elimination constant;

calculating a vector movement distance according to the direction and the pre-movement distance;

and acquiring vertex data of the current display area, and calculating a preloading area by combining the vector movement distance.

3. The vector drawing display method of claim 2, wherein the current acceleration and the current direction are calculated by a weighted average method.

4. The method for displaying the vector drawing of claim 1, wherein the vector drawing is managed with a quadtree to determine the preloading position.

5. The vector drawing display method of claim 4, wherein the quadtree management comprises:

dividing a vector drawing into four quadrants;

and according to a threshold value for pre-selecting and setting the number of graphs in a single quadrant, performing recursive segmentation on each divided quadrant to refine the quadrant so as to determine the preloading position.

6. A vector drawing display system, comprising:

a preload region calculation module: acquiring position information of a plurality of continuous input points on a vector drawing to calculate a preloading area;

the preload position determination module: determining the preloading position of the preloading area on a vector drawing;

a data recording module: and loading data corresponding to the preloading position from the ROM into the RAM so as to accelerate the presentation of the vector drawing.

7. The vector drawing display system of claim 6, wherein the preloading region calculation module further comprises:

a first calculation module: acquiring the current acceleration and the current direction of the current input point in the plurality of input points by using the position information of the plurality of input points;

a second calculation module: calculating a pre-movement distance according to the acceleration and the card elimination constant;

a third calculation module: calculating a vector movement distance according to the direction and the pre-movement distance;

a fourth calculation module: and acquiring vertex data of the current display area, and calculating a preloading area by combining the vector movement distance.

8. A computer arrangement comprising a processor for executing a computer program stored in a memory to implement the method for vector drawing presentation of any one of claims 1-5.

9. A computer-readable storage medium on which a computer program is stored, wherein a processor is configured to execute the computer program stored in the storage medium to implement the method for vector drawing presentation according to any one of claims 1 to 5.

Technical Field

The invention belongs to the technical field of three-dimensional model roaming, and particularly relates to a vector drawing display method, a system, a device and a storage medium.

Background

In consideration of convenience in view of drawings, a plurality of floor drawings are usually placed on one drawing and then displayed on a high-end PC. However, the person who needs to look up the drawings is not always beside the PC, and when the drawings need to be browsed and examined, the person who needs to look up the drawings can preferably look up the drawings in real time through a device carried by the person, such as a mobile phone. However, the cell phone RAM is small and needs to be constantly exchanged with ROM. However, if all model data are exchanged, the CPU is bound to be too tired, which consumes resources and causes the program to run unsmoothly.

Because the CPU performance of a PC is more powerful, fluency impact is not as great, but resource consumption remains great. The CPU performance of the mobile equipment is weak, the large model operation is very obvious in blocking, and the battery power is rapidly reduced due to the consumption of resources.

Disclosure of Invention

The technical problem to be solved by the invention is that in the process of displaying the vector drawing in the prior art, for the PC end with strong CPU performance, although fluency is not affected, resource consumption is huge; for mobile equipment with weak CPU performance, the checking process is obvious in blockage, and the battery power is rapidly reduced due to the severe consumption of resources.

Therefore, according to a first aspect, the embodiment of the invention discloses a vector drawing display method, which comprises the following steps:

acquiring position information of a plurality of continuous input points on a vector drawing to calculate a preloading area; determining the preloading position of the preloading area on a vector drawing; and loading data corresponding to the preloading position from the ROM into the RAM so as to accelerate the presentation of the vector drawing.

Further, the obtaining of the position information of a plurality of continuous input points on the vector drawing to calculate the preloading area specifically includes: acquiring the current acceleration and the current direction of the current input point in the plurality of input points by using the position information of the plurality of input points; calculating a pre-movement distance according to the current acceleration and the card elimination constant; calculating a vector movement distance according to the direction and the pre-movement distance; and acquiring vertex data of the current display area, and calculating a preloading area by combining the vector movement distance.

Further, in response to an inquiry request initiated by identifying the graphic code, generating a data file inquiry list corresponding to the graphic code; downloading in batch or partially by checking the data files in the query list; or inquiring or printing a specific data file, marking the specific file after executing the printing instruction and displaying the mark when receiving the printing instruction.

Further, the current acceleration and the current direction are calculated by a weighted average method.

Further, the vector drawing is managed with a quadtree to facilitate determination of the preload location.

Further, the quadtree management includes: dividing a vector drawing into four quadrants; and according to a threshold value for pre-selecting and setting the number of graphs in a single quadrant, performing recursive segmentation on each divided quadrant to refine the quadrant so as to determine the preloading position.

In a second aspect, an embodiment of the present invention provides a vector drawing display system, including: a preload region calculation module: acquiring position information of a plurality of continuous input points on a vector drawing to calculate a preloading area; the preload position determination module: determining the preloading position of the preloading area on a vector drawing; a data recording module: and loading data corresponding to the preloading position from the ROM into the RAM so as to accelerate the presentation of the vector drawing.

Further, the first calculation module: acquiring the current acceleration and the current direction of the current input point in the plurality of input points by using the position information of the plurality of input points; a second calculation module: calculating a pre-movement distance according to the acceleration and the card elimination constant; a third calculation module: calculating a vector movement distance according to the direction and the pre-movement distance; a fourth calculation module: and acquiring vertex data of the current display area, and calculating a preloading area by combining the vector movement distance.

According to a third aspect, the present invention provides a computer apparatus, comprising a processor, wherein the processor is configured to execute a computer program stored in a memory to implement the vector drawing presentation method of any one of the first aspect.

According to a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, wherein a processor is configured to execute the computer program stored in the storage medium to implement the vector drawing presentation method of any one of the above first aspects.

The invention has the beneficial effects that:

the embodiment of the invention discloses a vector drawing display method, which comprises the steps of obtaining position information of a plurality of continuous input points on a vector drawing to calculate a preloading area; determining the preloading position of the preloading area on a vector drawing; loading the data corresponding to the preloading position into an RAM from an ROM to accelerate the display of a vector drawing, and when the method is used for a PC end, enhancing the display fluency of the vector drawing and reducing the loss of resources; when the method is applied to mobile equipment, the working strength of a CPU can be reduced, the display fluency of a vector drawing is improved, the resource loss is reduced, and the battery endurance time can be prolonged.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.

FIG. 1 is a first flowchart of a method for displaying a vector drawing according to an embodiment of the present invention;

FIG. 2 is a schematic diagram illustrating the operation trend of the present invention formed by four input points in series;

FIG. 3 is a diagram illustrating motion vectors in an input direction according to an embodiment of the present invention;

FIG. 4 is a schematic diagram of a quad-tree management structure of the vector drawing of the present invention;

FIG. 5 is a schematic structural diagram of a vector drawing display system according to an embodiment of the present invention;

fig. 6 is a second flowchart of a method for displaying a vector drawing according to an embodiment of the present invention.

The reference numbers in the figures illustrate:

1. vector drawings; 2. a current display area of the vector drawing; 3. a pre-display area of the vector drawing; 4. a preloading area of the vector drawing; fa. The moving direction of the current input point; p1, first entry point; a1, first input point acceleration; p2, second entry point; a2, second input point acceleration; p3, third input point; a3, third input point acceleration; p4, current input point; a2, current input point acceleration.

Detailed Description

The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present 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.

Referring to fig. 1, a first flowchart of a method for displaying a vector drawing disclosed in this embodiment is shown, where the method for displaying a vector drawing includes:

and step S100, acquiring position information of a plurality of continuous input points on the vector drawing to calculate a preloading area.

In the present embodiment, a plurality of input points can be selected according to the size of the display device, and in principle, the more input points, the more accurate the prediction of the next input point. For convenience of description, the plurality of consecutive input points take 4 points as an example, and before acquiring the consecutive 4 input points, the user input is waited, wherein the input may be performed by a gesture of a mouse or a mobile device, and after detecting the initial input point, the next input point is recorded and waited until acquiring the consecutive 4 input points.

Referring to fig. 6, step S100 specifically includes:

step S110, acquiring the current acceleration and the current direction of the current input point in the plurality of input points by using the position information of the plurality of input points; and the position information comprises an input position and input time, and the current acceleration and the current direction of the current input point are obtained by a weighted average method through the input position and the input time of the current input point and the recorded previous point. For ease of understanding, the plurality of dots are still exemplified by 4 dots, and the 4 dots are hereinafter defined as p1, p2, p3, p4, respectively. Referring to fig. 2, the current direction and the current acceleration are calculated, respectively:

1. the current direction calculation formula is fd ═ a × d (p2-p1) + B × d (p3-p2) + C × d (p4-p3), and each point is a Vector (Vector) type expressed in homogeneous coordinates (x, y, 1). The direction between two adjacent points is the difference of the two vectors, which are then unitized.

2. The current acceleration fa ═ a1+ B a2+ C a 3.

The a/B/C appearing in the formula is the weight of different segments, generally, the closer to the segment of the current input point, the higher the weight ratio, in this embodiment, according to the result of repeated use, the value range of a is 0.1 to 0.3, the value range of B is 0.2 to 0.4, the value of C is 0.4 to 0.6, preferably, the value of a is 0.2, the value of B is 0.3, and the value of C is 0.5. When the value of a/B/C is selected from different value ranges, it is necessary to ensure that a + B + C is 1.

And step S120, calculating a pre-movement distance according to the current acceleration and the card elimination constant.

Since the image change recognized by the human eye per second is about 24 frames, that is, 1/24 seconds are required for 1 frame, the motion distance is 1/2 fa t, and therefore, the image can be loaded without being recognized by the human eye, in which the motion distance constant (constant factor for eliminating the click) t is a multiple of 1/24. The card elimination constant depends on the pause index, the value range of the pause index is 1-10, the pause index can be calculated by rendering one frame, an inherent value can also be set, the higher the pause index is, the smaller the t value is, otherwise, frame skipping is easy to generate.

Step S130, calculating a vector movement distance according to the direction and the pre-movement distance, wherein the movement vector in the input direction is dv ═ fd × distance, and the position of the image after moving the calculated distance in the calculated direction can be obtained by multiplying the direction and the distance.

And step S130, acquiring vertex data of the current display area, and calculating a preloading area by combining the vector movement distance. That is, the display area rect 'is rect + dv, where rect is the current display area, and referring to fig. 3, the display area rect' is composed of four points, i.e., a lower left point, a lower right point, an upper right point, and an upper left point. And adding dv to each point to generate a new point, and forming a new display area by the four new points, namely the preloading area.

Step S200, determining the preloading position of the preloading area on the vector drawing.

In this embodiment, the vector drawing is managed by using a quadtree to determine the preloading position, where the quadtree management specifically includes first dividing the vector drawing into four quadrants; then, according to a threshold value of the number of graphs in a preselected set single quadrant, and finally, each divided quadrant is divided into fine quadrants by adopting recursive division so as to determine the preloading position. Specifically, the graphics under the whole scene are managed by using the quadtree, and the graphics are placed in different quadrants of a plane space according to the situation of the quadtree by dividing the plane into four quadrants according to the spatial position and the density of the graphics on the drawing. In the area with high density, the quadrant is refined in a recursive mode, and the node levels of the quadtree are more. Referring to fig. 4, the drawing sheet is provided with various patterns, wherein the fourth quadrant has a higher density. We segment the fourth quadrant again. By analogy, by setting the maximum number of graphics in each quadrant, the quadrants with the large number of graphics are recursively divided.

The reason for the refinement is that the drawing is visual, and during the process of loading the drawing in advance, an invisible expression mode needs to be found in a computer to manage the data of the drawing. However, since the drawing is composed of a large number of points and a sequence of points, how to quickly find one of the points becomes an urgent problem to be solved, it is necessary to provide a data structure for managing the points and provide a relevant query method for facilitating the query, where a quadtree is the data structure. Compared with the traditional unmanaged mode, the method only forms a linked list in an unordered mode by the unmanaged mode of points, does not need to search each time, and needs to search one by one from the first point, thereby improving the speed of data loading and reducing the blockage.

And step S300, loading the data corresponding to the preloading position into the RAM from the ROM so as to accelerate the display of the vector drawing. Based on the condition that the processing capacity of a CPU is limited and the electric quantity of a battery is limited, the operation trend of a user is judged in a fuzzy mode, the position of a drawing to be browsed by the user is located in advance, data in a ROM is loaded to an RAM in advance, the rendering process is accelerated, and then the target drawing is displayed for the user quickly.

The embodiment of the invention discloses a method for displaying a vector drawing, which is used for obtaining position information of a plurality of continuous input points on the vector drawing to calculate a preloading area and specifically comprises the following steps: acquiring the current acceleration and the current direction of the current input point in the plurality of input points by using the position information of the plurality of input points; calculating a pre-movement distance according to the current acceleration and the card elimination constant; calculating a vector movement distance according to the direction and the pre-movement distance; the method comprises the steps of obtaining vertex data of a current display area, calculating a preloading area by combining a vector moving distance, and enhancing the display fluency of a vector drawing and reducing the loss of resources when the method is used for a PC (personal computer) terminal; when the method is applied to mobile equipment, the working strength of a CPU can be reduced, the display fluency of a vector drawing is improved, the resource loss is reduced, and the battery endurance time can be prolonged.

The traditional method is changed to always display where the data is loaded, so that the drawing is operated in place, but the data is not displayed, a user does not know whether the operation is really in place, the operation is continued, and the drawing is displayed more slowly or even is disordered. According to the method, because the behavior of the user is predicted in advance, the data is loaded in advance to help to accelerate the display of the drawing, the drawing is operated smoothly by the user, misoperation is not easy to occur, and the efficiency of the user in browsing the drawing is improved.

The embodiment also discloses a vector drawing display system, please refer to fig. 5, which is a schematic structural diagram of the vector drawing display system, and the system for displaying vector drawings includes:

a preload region calculation module: acquiring position information of a plurality of continuous input points on a vector drawing to calculate a preloading area;

the preload position determination module: determining the preloading position of the preloading area on a vector drawing;

a data recording module: and loading data corresponding to the preloading position from the ROM into the RAM so as to accelerate the presentation of the vector drawing.

Further, the preload area calculation module further includes: a first calculation module: acquiring the current acceleration and the current direction of the current input point in the plurality of input points by using the position information of the plurality of input points; a second calculation module: calculating a pre-movement distance according to the acceleration and the card elimination constant; a third calculation module: calculating a vector movement distance according to the direction and the pre-movement distance; a fourth calculation module: and acquiring vertex data of the current display area, and calculating a preloading area by combining the vector movement distance.

In addition, an embodiment of the present invention further provides a computer apparatus, where a processor executes the computer instructions, so as to implement the following method:

acquiring position information of a plurality of continuous input points on a vector drawing to calculate a preloading area; determining the preloading position of the preloading area on a vector drawing; and loading data corresponding to the preloading position from the ROM into the RAM so as to accelerate the presentation of the vector drawing.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or the like. The computer processor is used to execute a computer program stored in a storage medium to implement the following method:

acquiring position information of a plurality of continuous input points on a vector drawing to calculate a preloading area; determining the preloading position of the preloading area on a vector drawing; and loading data corresponding to the preloading position from the ROM into the RAM so as to accelerate the presentation of the vector drawing.

The foregoing is merely an example of the present invention and common general knowledge of known specific structures and features of the embodiments is not described herein in any greater detail. It should be noted that variations and modifications can be made by those skilled in the art without departing from the structure of the present invention. These should also be construed as the scope of the present invention, and they should not be construed as affecting the effectiveness of the practice of the present invention or the applicability of the patent. The scope of the claims of the present application shall be determined by the contents of the claims, and the description of the embodiments and the like in the specification shall be used to explain the contents of the claims.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:搜索医学参考图像

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!