View display method and device, electronic equipment and storage medium
By dividing the scaled target view into multiple view areas and rendering it in reverse order, the visual lag problem when re-rendering the view after zooming, improving the display effect and development efficiency.
Patent Information
- Application Number
- CN202310981156.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-04
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, visual lag is prone to occur when re-rendering and displaying the view after zooming, which affects development efficiency.
By radiating outward with reference points in the view window as the center, the scaled target view is divided into a preset number of view areas, and each view area is rendered and displayed in reverse order from the distance from the center to the reference point.
This avoids visual lag and improves the display effect of the view and the development efficiency of users.
Smart Images

Figure CN119440362A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a view display method, device, electronic device and storage medium. Background Art
[0002] Electronic Design Automation (EDA) software plays an important role in product hardware system design, integrated circuit (IC) design, printed circuit board (PCB) design, etc.
[0003] When using EDA software, you can use zooming operations to view the view in the view window at different scales and ranges. At present, the method of view zooming display is to zoom the view as a whole according to the corresponding zoom ratio when a zooming operation is detected, that is, each time a zoom is performed, all view objects in the view respond to the zoom and render at the same time. When there are many view objects in the view, triggering a zoom will cause obvious freezes in the display, affecting development efficiency. Summary of the invention
[0004] The present invention provides a view display method, device, electronic device and storage medium, which are used to solve the visual freeze problem when the view is re-rendered and displayed after being scaled in the prior art.
[0005] The present invention provides a view display method, comprising:
[0006] Determine the target view after scaling the view to be scaled according to the scaling operation instruction;
[0007] Divide the target view into a first preset number of view areas radiating outwards from the position of the reference point in the view window as the center;
[0008] The preset number of view areas are rendered and displayed in sequence radiating outward from the position of the reference point.
[0009] According to a view display method provided by the present invention, the step of determining a target view after scaling the view to be scaled according to a scaling operation instruction includes:
[0010] The view to be scaled is scaled based on the scaling ratio corresponding to each scaling operation instruction within a preset time period to obtain the target view.
[0011] According to a view display method provided by the present invention, scaling the view to be scaled based on the scaling ratio corresponding to each scaling operation instruction within a preset time period to obtain the target view includes:
[0012] When the timer is not turned on, when a zoom operation instruction is detected, the timer is triggered to start timing, and the zoom multiple corresponding to the zoom operation instruction is recorded; the zoom multiple is a multiple of the unit zoom ratio;
[0013] During the timing time of the timer, each time the zoom operation instruction is detected, the zoom multiple corresponding to the zoom operation instruction is recorded until the timing of the timer ends; the timing time is the preset time period;
[0014] Determining a target zoom ratio based on the unit zoom ratio and the zoom multiples corresponding to each zoom operation instruction;
[0015] The view to be scaled is scaled based on the target scaling ratio to obtain the target view.
[0016] According to a view display method provided by the present invention, the method further includes:
[0017] Obtaining the pre-configured preset time period;
[0018] Alternatively, the complexity of the portion of the view to be scaled displayed in the view window and the occupancy rate of the processor are obtained, and the preset time period is determined based on the complexity and / or the occupancy rate.
[0019] According to a view display method provided by the present invention, the target view is divided into a first preset number of view areas radiating outward from a position where a reference point in a view window is located, including:
[0020] In the case where the size of the target view is larger than the size of the view window, radiating outwards from the position of the reference point, the portion of the target view within the view window is divided into a second preset number of view areas, and the portion of the target view outside the view window is determined as one view area;
[0021] The second preset number of viewing areas and the one viewing area are determined as the first preset number of viewing areas.
[0022] According to a view display method provided by the present invention, dividing the portion of the target view in the view window into a second preset number of view areas includes:
[0023] Determining the distance between the reference point and each border of the view window;
[0024] Based on the distances corresponding to the boundaries and the second preset number, the portion of the target view within the view window is divided to obtain the second preset number of view areas.
[0025] According to a view display method provided by the present invention, the method further includes:
[0026] Determine the position of the mouse pointer in the view window as the reference point;
[0027] Alternatively, when a click operation on the view window is detected, the contact point of the click operation is determined as the reference point.
[0028] The present invention also provides a view display device, comprising:
[0029] A view determination module, used to determine a target view after scaling the view to be scaled according to the scaling operation instruction;
[0030] A view division module, configured to divide the target view into a first preset number of view areas radiating outward from a position where a reference point in the view window is located;
[0031] The view display module is used to render and display the preset number of view areas in sequence, radiating outward from the position of the reference point.
[0032] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the view display methods described above when executing the computer program.
[0033] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the view display method described in any one of the above is implemented.
[0034] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the view display method described in any one of the above is implemented.
[0035] The view display method, device, electronic device and storage medium provided by the present invention first determine the target view after the view to be scaled is scaled according to the zoom operation instruction, then radiate outward with the position of the reference point in the view window as the center, divide the target view into a first preset number of view areas, and then radiate outward with the position of the reference point as the center, and render and display the preset number of view areas in sequence. In this way, when the view is scaled, the view area where the reference point is located can be used as the user's core observation area, starting from this view area, and rendering and displaying the surrounding areas in reverse order of the distance from the center of each view area to the reference point. Compared with the method of randomly and disorderly rendering and displaying the entire view in the prior art, the scaled target view can be partitioned and rendered and displayed in an order that conforms to the user's observation logic, avoiding visual freezes and improving the display effect of the view. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 This is one of the flowcharts of the view display method provided by an embodiment of the present invention;
[0038] Figure 2 is a schematic diagram of the principle of dividing the view area of the target view in an embodiment of the present invention;
[0039] Figure 3 This is a second flow chart of the view display method provided by an embodiment of the present invention;
[0040] Figure 4 is a structural schematic diagram of a view display device provided by an embodiment of the present invention;
[0041] Figure 5 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] It should be noted that the serial numbers assigned to the objects described in the present invention, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning.
[0044] In the embodiment of the present invention, basic display elements such as text, lines, components, etc. in a view may be collectively referred to as view objects.
[0045] When using EDA software to design hardware products, integrated circuits and other systems, the view (such as PCB layout) will be zoomed in and out. When the user zooms in and out the view by mouse or key operation, the zoom-in or zoom-out event of the entire view can be triggered. Each time the user zooms in and out, all view objects in the view respond to the zoom at the same time and are rendered and displayed. If the user performs multiple zoom operations in succession, the view will respond to multiple zoom and rendering display actions in series.
[0046] For systems with complex structures and a huge number of elements, it is easy to encounter problems such as lag when zooming and unsmooth operation. Its performance and visual effects directly determine the efficiency and quality of product development. When the number of view objects displayed in the view window increases dramatically and the pixel unit level is huge, the lag phenomenon when triggering a zoom will increase significantly. For layouts larger than a single board, this lag phenomenon will be more obvious, affecting development efficiency and user experience.
[0047] During the view display process, the zoom response is mainly completed by two actions: first, the change of the proportion of the view object in the view; second, the re-rendering and display of the changed view object. Among them, the zoom response speed mainly depends on the second action, and its influencing factor is the number of view objects rendered in the current view window of the display, that is, the number of pixel units displayed in the view window, and has no direct relationship with the complexity of the view (such as a PCB board) itself. For example, for a PCB board with extremely complex pin number and distribution, when the view window only displays one of the components, its zoom speed is only related to the complexity of the collection of view objects formed by the displayed component, and has nothing to do with the number of other view objects in the view that are not displayed in the view window. Therefore, in order to solve the problem of visual freeze when re-rendering and displaying after the view is zoomed, the embodiment of the present invention provides a view display method starting from the process of triggering the zoom action to completing the re-rendering and display.
[0048] The view display method provided by the embodiment of the present invention divides the zoomed target view into view areas by radiating outward from the position of the reference point in the view window as the center when the view is zoomed, and then renders the area where the reference point is as the observation center area first, and renders and displays the divided view areas in sequence in a manner of radiating outward from the reference point as the center. Compared with the method of randomly and disorderly rendering and displaying the entire view in the prior art, the zoomed target view can be rendered and displayed in a partitioned manner in an order that conforms to the user's observation logic, thereby avoiding visual freezes and improving the display effect of the view.
[0049] Combine the following Figure 1-Figure 3 The view display method of the present invention is described. The view display method can be applied to electronic devices such as terminal devices or servers. The terminal devices may include mobile phones, computers, tablet computers, etc.; the servers may include independent servers, cluster servers, or cloud servers, etc. The view display method can also be applied to a view display device provided in an electronic device such as a terminal device or a server, and the view display device can be implemented by software, hardware, or a combination of both.
[0050] Figure 1 One of the flow charts of the view display method provided by an embodiment of the present invention is exemplarily shown, referring to Figure 1 As shown, the view display method may include the following steps 110 to 130.
[0051] Step 110: Determine the target view after scaling the view to be scaled according to the scaling operation instruction.
[0052] When using EDA software, the user can use a mouse, keyboard or touch screen to perform a zoom operation on the view to be zoomed displayed in the view window, and the electronic device generates a zoom operation instruction according to the zoom operation. The zoom operation includes a zoom-in operation or a zoom-out operation, and accordingly, the zoom operation instruction includes a zoom-in operation instruction or a zoom-out operation instruction.
[0053] The electronic device determines a target zoom ratio according to the zoom operation instruction, and zooms the view to be zoomed based on the zoom ratio to obtain a zoomed target view.
[0054] Step 120: Divide the target view into a first preset number of view areas radiating outward from the position of the reference point in the view window as the center.
[0055] When operating EDA software, users can move the mouse pointer to the view area that needs to be focused on in the view window, and zoom the view in the view window by rolling the mouse or operating the key. It can be understood that the area where the mouse pointer is located in the view window is the core observation area of the user, and other areas outside the mouse pointer are secondary observation areas. Moreover, the user's concentration on the observation area decreases from the position of the mouse pointer as the center to the outside. Based on this, the position of the mouse pointer in the view window can be determined as a reference point.
[0056] Optionally, the user can also select the core observation area in the view window by clicking with the mouse, or select the core observation area by touching the view window on the touch screen. Based on this, the touch point corresponding to the mouse clicking operation or the touch operation on the touch screen can also be determined as the reference point.
[0057] Exemplarily, the electronic device may determine the core view area of the target view with the position of the reference point in the view window as the center, and then divide the rest of the target view into N view areas in a manner radiating outward from the core view area, so that N+1 view areas may be obtained. The areas of the N view areas may be equal or unequal.
[0058] For example, Figure 2 The schematic diagram exemplarily shows the principle of dividing the view area of the target view, referring to Figure 2 As shown, in the view window 20, the boundary coordinate points of the target view 21 include B1, B2, B3 and B4, and point C is the position of the current mouse pointer. Taking the division of the target view 21 into four areas as an example, the electronic device can first determine the core view area 24 according to the position C where the mouse pointer is located. For example, the area of the target view 21 with a preset proportion can be determined as the core view area 24 with position C as the center, and then the remaining area of the target view 21 except the core view area 24 is divided into three areas in a manner of radiating outward around the core view area 24, namely, the area surrounded by the boundary of area 23 and the boundary of area 24, the area surrounded by the boundary of area 22 and the boundary of area 23, and the area surrounded by the boundary of area 21 and the boundary of area 22. In this way, the target view 21 can be divided into four view areas.
[0059] Exemplarily, the electronic device can determine the distance between the reference point and each boundary of the target view with the position of the reference point in the view window as the center, and then divide the target view based on the distance corresponding to each boundary and the number of areas to be divided to obtain the number of view areas.
[0060] For example, refer to Figure 2Taking the target view 21 as being divided into four regions, the electronic device may determine, according to the position C where the mouse pointer is located, a distance L1 between the position C and the boundary B1B4 of the target view 21, a distance L2 between the position C and the boundary B2B3 of the target view 21, a distance L3 between the position C and the boundary B1B2 of the target view 21, and a distance L4 between the position C and the boundary B3B4 of the target view 21, and then divide L1, L2, L3, and L4 into four equal or unequal parts, respectively, and form divided view regions based on each segmentation point, that is, forming Figure 2 The target view 21 is divided into four view areas: the area 24 in the target view 21, the area enclosed by the boundary of the area 23 and the boundary of the area 24, the area enclosed by the boundary of the area 22 and the boundary of the area 23, and the area enclosed by the boundary of the area 21 and the boundary of the area 22. In this way, the target view 21 can be divided into four view areas.
[0061] For example, in a zooming operation, the size of the zoomed target view may exceed the view window. In this case, the portion exceeding the view window can be divided into a view area, and the portion within the view window can be divided in a manner radiating outward from the position of the reference point as the center, to obtain M+1 view areas, where M is the number of view areas divided from the portion within the view window.
[0062] Step 130: radiating outward from the location of the reference point, rendering and displaying a preset number of view areas in sequence.
[0063] After the target view is divided into a first preset number of view areas, each view area may be rendered and displayed in sequence in the reverse order of the distance from the center of each view area to the reference point, radiating outward from the location of the reference point.
[0064] For example, Figure 2 For example, after dividing the target view 21 into four view areas, the area 24 may be rendered and displayed first, and then the area enclosed by the boundary of the area 23 and the boundary of the area 24 may be rendered and displayed, the area enclosed by the boundary of the area 22 and the boundary of the area 23 may be rendered and displayed, and the area enclosed by the boundary of the area 21 and the boundary of the area 22 may be rendered and displayed. In this way, the target view may be rendered and displayed in partitions in a manner radiating outward from the position of the reference point as the center.
[0065] The view display method provided by the embodiment of the present invention first determines the target view after the view to be scaled is scaled according to the zoom operation instruction, then radiates outward with the position of the reference point in the view window as the center, divides the target view into a first preset number of view areas, and then radiates outward with the position of the reference point as the center, and renders and displays the preset number of view areas in sequence. In this way, when the view is scaled, the view area where the reference point is located can be used as the user's core observation area, starting from this view area, and rendering and displaying the surrounding areas in reverse order of the distance from the center of each view area to the reference point. Compared with the method of randomly and disorderly rendering and displaying the entire view in the prior art, the scaled target view can be partitioned and rendered and displayed in an order that conforms to the user's observation logic, avoiding visual freezes and improving the display effect of the view.
[0066] based on Figure 1 In a view display method of a corresponding embodiment, in an exemplary embodiment, in a zooming operation, the zoomed target view may exceed the view window. In this case, the portion exceeding the view window can be divided into a view area, and the portion in the view window can be divided in a manner of radiating outwards with the position of the reference point as the center. Specifically, radiating outwards with the position of the reference point in the view window as the center, dividing the target view into a first preset number of view areas may include: when the size of the target view is larger than the size of the view window, radiating outwards with the position of the reference point as the center, dividing the portion of the target view in the view window into a second preset number of view areas, and determining the portion of the target view outside the view window as a view area; determining the second preset number of view areas and a view area determined by the portion of the target view outside the view window as the first preset number of view areas.
[0067] Among them, dividing the portion of the target view within the view window into a second preset number of view areas may include: determining the distance between the reference point and each boundary of the view window; dividing the portion of the target view within the view window based on the distance corresponding to each boundary and the second preset number to obtain the second preset number of view areas.
[0068] Alternatively, dividing the portion of the target view within the view window into a second preset number of view areas may include: determining a core view area of the target view with the position of the reference point in the view window as the center; dividing the portion of the target view other than the core view area into a third preset number of view areas in a manner radiating outward from the core view area; and determining the core view area and the third preset number of view areas as a second preset number of view areas.
[0069] Wherein, determining the core view area of the target view with the position of the reference point in the view window as the center may include: determining an area of the target view with a preset proportion size with the position of the reference point in the view window as the center as the core view area. Figure 2 For example, with point C as the center, an area 24 occupying 20 percent of the target view 21 can be determined as the core view area.
[0070] Specifically, Figure 3 The second flow chart of the view display method provided by the embodiment of the present invention is exemplarily shown. It takes the EDA software as PCB design software, the view to be zoomed is the PCB layout, and the PCB layout is divided into 4 view areas as an example. The PCB design software can load data by importing electronic design files to realize the visualization of the PCB board diagram, and support functions such as view switching, zooming, and information query. Figure 3 As shown, the view display method may include the following steps 301 to 308.
[0071] Step 301: Initialize the PCB layout display.
[0072] The electronic device imports the PCB layout according to the import operation of the user in the PCB design software, and initializes the display of the PCB layout.
[0073] Step 302: Determine the initial area of the PCB layout.
[0074] After the PCB layout is initialized and displayed, the coordinates of the boundary points of the PCB layout can be obtained, for example Figure 2 The coordinates of the boundary points B1, B2, B3 and B4 in the figure can be used to determine the area of the PCB layout in the initial display state and obtain the initial area.
[0075] Step 303: When a zoom operation instruction is detected, a target zoom ratio is determined according to the zoom operation instruction, and a position of the mouse pointer is determined.
[0076] When the user zooms in or out the PCB layout using the mouse or keyboard, the zoom factor can be determined based on the zoom operation. The zoom factor can reflect the degree of zooming, and then the product of the zoom factor and the unit zoom ratio is calculated to obtain the target zoom ratio. At the same time, the position coordinates of the mouse pointer can be obtained, such as Figure 2 In the example above, you can get the coordinates of the position C where the mouse pointer is located.
[0077] Step 304: scaling the PCB layout according to the initial area and the target scaling ratio, and determining the area of the scaled PCB layout.
[0078] Assuming that the initial area of the PCB layout is S0 and the target scaling ratio is Q, the area of the scaled PCB layout is S=S0×Q.
[0079] Step 305: Determine whether the area of the scaled PCB layout is larger than the area of the view window. If so, execute step 306; otherwise, execute step 307.
[0080] Step 306: radiating outward from the position of the mouse pointer, the portion of the PCB layout within the view window is divided into three view areas, and the portion of the PCB layout outside the view window is used as one view area.
[0081] When the area of the scaled PCB layout is larger than the area of the view window, it means that the scaled PCB layout exceeds the size of the view window. Then the part of the PCB layout that exceeds the view window can be divided into one view area, and the part of the PCB layout that is within the view window can be divided into three view areas. The area S of the PCB layout at the current scale can be expressed as: N represents the number of divided view areas, which is N=4 in this example, and P′ represents the area of the PCB layout that exceeds the view window.
[0082] Step 307: Divide the PCB layout into four view areas radiating outward from the position of the mouse pointer.
[0083] For example, refer to Figure 2 , assuming that the zoomed PCB layout view is area 24, the position of the mouse pointer is point C, and its coordinates are (Xc, Yc). The area of area 24 is smaller than the area of view window 20. Then area 24 can be divided into 4 view areas with point C as the center and the X and Y directions of the coordinate system where the center point C is located. The areas of the 4 view areas can be the same or different. Assume that the area of the i-th view area is P i , then the area S of the circumscribed rectangle 24 where the PCB layout is located at the current scale can be expressed as: N represents the number of divided view areas, which is N=4 in this example.
[0084] Step 308: Render and display each viewing area in sequence along a direction radiating outward from the position of the mouse pointer.
[0085] After the four view areas are divided, the four divided view areas can be marked, and the view areas can be sorted from the center to the surrounding areas with the mouse pointer as the center, and stored in the data set E. After that, the rendering and display operation can be performed in the data set E in sequence according to the sorting, that is, the view objects of each view area with the changed scale can be rendered and displayed again.
[0086] For example, Figure 2 For example, assuming that the view area 24 is marked as E1, the area enclosed by the boundaries of area 23 and area 24 is marked as E2, the area enclosed by the boundaries of area 22 and area 23 is marked as E3, and the area enclosed by the boundaries of area 21 and area 22 is marked as E4. Then, the corresponding view areas can be rendered and displayed in the order of E1→E2→E3→E4.
[0087] When a user performs a zoom observation of a view, if the view objects in the view window are relatively complex, if the view is zoomed and displayed in a manner that all view objects in the entire view respond to zooming and rendering at the same time, the time for re-rendering and displaying after zooming will increase linearly, and the order of rendering and displaying in the view is random in the computer, which is very likely to cause visual jamming. According to the view display method provided in an embodiment of the present invention, the zoomed target view is divided into view areas in a manner that radiates outward with the position of the mouse pointer as the center, and the peripheral view areas are rendered and displayed in sequence in a manner that radiates outward starting from the view area where the mouse pointer is located, that is, the order of rendering and display is the reverse order of the distance from each view area to the mouse pointer. In this way, the order of view rendering changes from random and disordered to a predetermined and orderly rendering and display. By spreading the rendering from the center to the surroundings, it can meet the user's observation logic, avoid visual jamming, and improve the display effect of the view.
[0088] Based on this, the view display method provided by an embodiment of the present invention can take into account both the zooming speed and the user visual experience and optimize the display effect by adopting a view response method in which the position of the mouse pointer is used as the observation center area for priority rendering during a single view zoom, and other areas are divided and rendered outward in sequence.
[0089] When a user zooms in and out to view a view, such as when viewing a PCB layout, the user can zoom in or out the view to a large extent in a short period of time, that is, perform multiple consecutive zoom operations, such as continuous and rapid scrolling of the mouse or continuous and rapid zoom key operations on the keyboard, etc., to achieve the purpose of adjusting the viewed view object to an appropriate scale. In an embodiment of the present invention, the process of multiple consecutive zooming in this scenario is regarded as multiple "accumulations" of the zoom ratio, and the view after the last zoom is rendered and displayed as the target view. In this way, in the intermediate zooming process, it is not necessary to render the zoomed view once after each zoom action, which can save processor resources and time consumption, further avoid visual freezes, and improve display performance.
[0090] Based on this, combined Figure 1In a view display method corresponding to the embodiment, in an exemplary embodiment, determining the target view after scaling the view to be scaled according to the scaling operation instruction may include: scaling the view to be scaled based on the scaling ratio corresponding to each scaling operation instruction within a preset time period to obtain the target view.
[0091] Exemplarily, within a preset time period, each time a zoom operation instruction is detected, the zoom ratio corresponding to the zoom operation instruction is determined, and then the view zoomed by the last zoom operation instruction is zoomed according to the zoom ratio until the preset time period ends, and the final zoomed view is determined as the target view of the view to be zoomed.
[0092] For example, within a preset time period, the zoom ratio corresponding to each zoom operation instruction may be recorded first, and when the preset time period ends, the product of each zoom ratio is determined as the target zoom ratio, and the target zoom ratio is used to zoom the view to be zoomed to obtain the target view. Alternatively, within a preset time period, the zoom times corresponding to each zoom operation instruction may be recorded first, and the zoom times may represent multiples of the unit zoom ratio, and the unit zoom ratio may represent the minimum scale unit that can trigger the view zoom; when the preset time period ends, the target zoom times are accumulated for each zoom times, and the product of the target zoom times and the unit zoom ratio is determined as the target zoom ratio, and the target zoom ratio is used to zoom the view to be zoomed to obtain the target view.
[0093] Specifically, scaling the view to be scaled based on the scaling ratio corresponding to each scaling operation instruction within a preset time period to obtain a target view may include: when the timer is not turned on, when a scaling operation instruction is detected, triggering the timer to start timing, and recording the scaling ratio corresponding to the scaling operation instruction; within the timing time of the timer, that is, within the preset time period, each time a scaling operation instruction is detected, recording the scaling times corresponding to the scaling operation instruction until the timer ends; then determining the target scaling ratio based on the unit scaling ratio and the scaling times corresponding to each scaling operation instruction; scaling the view to be scaled based on the target scaling ratio to obtain the target view.
[0094] For example, taking the PCB layout as an example, when the PCB design software is initialized, a second variable T2 can be defined to record the initial number of zooms within the timing time during the continuous zoom operation. In the initial state, the timer is in the off state, and the first variable T1 can be used to record the zoom times within the timer timing time. When the zoom operation instruction is an enlargement instruction, T1 increases by 1, otherwise it decreases by 1; the third variable T3 can be used to record the number of zooms executed within the timing time. When a zoom operation instruction is detected, T1 changes according to the zoom operation instruction, T3 increases by 1, and the timer is turned on. Within the timing time T0 of the timer, each time a zoom operation instruction is detected, T1 increases or decreases according to the degree of zoom, and T3 increases by 1 until the timing time T0 ends. Among them, the initial values of T2 and T3 before starting the timing task are both 0. Only when the zoom operation instruction is continuously detected within T0, T3 will increase by 1, but T2 will not change. Therefore, after the timer's current timing task ends, the number of continuous zooms within the timing time can be determined according to the difference ΔT between T2 and T3. Specifically, when the difference ΔT>=2, it means that the user has performed multiple consecutive zoom operations. The PCB layout to be zoomed can be zoomed only once. The total target zoom ratio F is determined by T1 and the unit zoom ratio, that is, the target zoom ratio F is T1 times the unit zoom ratio. Then the PCB layout to be zoomed is zoomed F times to obtain the target view. In this way, the consumption of intermediate zoom resources can be omitted, processor resources can be saved, the view can respond quickly, and the jamming phenomenon can be further avoided. When the difference ΔT=1, it means that the user has only performed one zoom operation. After the completion of this timing task, the total target zoom ratio F is determined by T1 and the unit zoom ratio. The PCB layout to be zoomed is zoomed F times to obtain the target view. Afterwards, if a zoom operation instruction is detected, the variable T1=0 is reset, and T2=T3 is set to automatically enter the next timing cycle.
[0095] In this way, when the user performs continuous zooming, the processor resource consumption and time consumption of the intermediate process can be reduced in multiple zooming, so that the view zooming and rendering display can respond quickly, further avoiding visual freezes and improving the display performance of the view.
[0096] In this exemplary embodiment, the preset time period T0 may be a fixed time length determined based on an empirical value or through experiments, or may be determined based on the complexity of the view during view scaling and / or the occupancy rate of the processor.
[0097] Based on this, the view display method provided by the embodiment of the present invention may also include: obtaining a preconfigured preset time period; or, obtaining the complexity of the portion of the view to be scaled displayed in the view window and the occupancy rate of the processor, and determining the preset time period based on the complexity and / or occupancy rate.
[0098] For example, a first data table may be pre-established based on empirical values or through experimental verification, and the first data table is used to store the corresponding relationship between complexity and time period. After obtaining the complexity of the portion of the view to be zoomed displayed in the view window, the time period corresponding to the complexity may be searched from the first data table to obtain the preset time period. Alternatively, the first proportionality coefficient may be determined based on empirical values or through experiments, and the product of the first proportionality coefficient and the complexity may be determined as the preset time period.
[0099] For example, a second data table may be pre-established based on empirical values or through experimental verification, and the second data table is used to store the corresponding relationship between the occupancy rate and the time period. After the occupancy rate of the processor is obtained, the time period corresponding to the occupancy rate may be searched from the second data table to obtain the preset time period. Alternatively, the second proportional coefficient may be determined based on empirical values or through experiments, and the product of the second proportional coefficient and the occupancy rate may be determined as the preset time period.
[0100] For example, a third data table can be pre-established based on empirical values or through experimental verification, and the third data table is used to store the corresponding relationship between complexity, occupancy rate and time period. After obtaining the complexity of the portion of the view to be zoomed in the view window and the occupancy rate of the processor, the time period corresponding to the complexity and occupancy rate can be searched from the third data table to obtain the preset time period.
[0101] Exemplarily, the preset time period T0 may be determined using the following formula (1):
[0102] T0=0.1*(S / β+R) (1)
[0103] Among them, S represents the complexity of the view to be scaled, such as the number of view objects or the number of pins of a single board; R is the processor occupancy rate when the view is scaled, and the value range is between 0 and 1; β is the unit coefficient, such as 1000.
[0104] According to the above formula (1), when the view to be scaled is more complex and the processor occupancy rate is greater, T0 is also greater, that is, the total time consumed for scaling is greater, but the impact of T0 on the overall speed is smaller, and vice versa.
[0105] In this way, during continuous zooming, the timing time, that is, the preset time period, is determined by the complexity of the displayed part of the view to be zoomed in the view window and the processor occupancy rate. The proportion of the timing time in the total time consumed in the current zooming can be considered to balance the speed response and visual effect.
[0106] Based on the view display methods of the above-mentioned embodiments, in an exemplary embodiment, the method may further include: determining the position of the mouse pointer in the view window as a reference point; or, when a click operation on the view window is detected, determining the contact point of the click operation as a reference point.
[0107] The view display method provided by the embodiment of the present invention, on the one hand, when the view is zoomed, the zoomed target view is divided into view areas in a manner of radiating outward from the position of the mouse pointer as the center, and each divided view area is rendered and displayed in sequence in a manner of radiating outward from the reference point as the center, so that the zoomed target view can be partitioned and rendered and displayed in an order that conforms to the user's observation logic, taking into account the zooming speed and the user's visual experience, avoiding visual stuttering, and improving the display effect of the view. On the other hand, in the scenario of multiple consecutive zooming, by accumulating the zoom ratios of multiple consecutive zooming processes within a timed period, the view after the last zoom is rendered and displayed as the target view, and there is no need to render the zoomed view once after each zooming action in the intermediate zooming process, which can save processor resources and time consumption, further avoid visual stuttering, and improve display performance.
[0108] The view display device provided by the present invention is described below. The view display device described below and the view display method described above can be referred to each other.
[0109] Figure 4 The schematic diagram of the structure of the view display device provided by the embodiment of the present invention is exemplarily shown. Figure 4 As shown, the view display device 400 may include: a view determination module 410, used to determine the target view after scaling the view to be scaled according to the scaling operation instruction; a view division module 420, used to radiate outward with the position of the reference point in the view window as the center, and divide the target view into a first preset number of view areas; a view display module 430, used to radiate outward with the position of the reference point as the center, and render and display the preset number of view areas in sequence.
[0110] In an exemplary embodiment, the view determination module 410 may be specifically configured to scale the to-be-scaled view based on a scaling ratio corresponding to each scaling operation instruction within a preset time period to obtain a target view.
[0111] In an exemplary embodiment, the view determination module 410 may include: a processing unit, which is used to trigger the timer to start timing when a zoom operation instruction is detected, and record the zoom multiple corresponding to the zoom operation instruction, which is a multiple of the unit zoom ratio; a recording unit, which is used to record the zoom multiple corresponding to the zoom operation instruction each time a zoom operation instruction is detected within the timing time of the timer until the timing of the timer ends; the timing time is a preset time period; a first determination unit, which is used to determine the target zoom ratio based on the unit zoom ratio and the zoom multiples corresponding to each zoom operation instruction; a scaling unit, which is used to scale the view to be scaled based on the target zoom ratio to obtain a target view.
[0112] In an exemplary embodiment, the view determination module 410 further includes: a first acquisition unit for acquiring the complexity of the portion of the view to be scaled displayed in the view window and the occupancy rate of the processor; and a second determination unit for determining a preset time period based on the complexity and the occupancy rate.
[0113] In an exemplary embodiment, the view determination module 410 further includes: a second acquisition unit, configured to acquire a preconfigured preset time period.
[0114] In an exemplary embodiment, the view division module 420 may include: a division unit, which is used to divide the portion of the target view within the view window into a second preset number of view areas, radiating outward from the position of the reference point as the center, when the size of the target view is larger than the size of the view window, and determine the portion of the target view outside the view window as one view area; and a third determination unit, which is used to determine the second preset number of view areas and one view area as the first preset number of view areas.
[0115] In an exemplary embodiment, the division unit may be specifically used to: determine the distance between the reference point and each boundary of the view window; and divide the portion of the target view within the view window based on the distance corresponding to each boundary and a second preset number to obtain a second preset number of view areas.
[0116] In an exemplary embodiment, the view display device 400 may further include a determination module, which may be used to: determine the position of the mouse pointer in the view window as a reference point; or, when a click operation on the view window is detected, determine the contact point of the click operation as a reference point.
[0117] Figure 5 An example of a structural diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the view display method provided by any of the above method embodiments.
[0118] Exemplarily, the processor 510 may include a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), or a field programmable gate array (FPGA).
[0119] Exemplarily, the communication bus 540 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc.
[0120] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0121] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the view display method provided by any of the above method embodiments.
[0122] In yet another aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the view display method provided by any of the above method embodiments is implemented.
[0123] By way of example, computer readable storage media include non-transitory computer readable storage media.
[0124] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0125] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A view display method, characterized in that: include: Determine the target view after scaling the view to be scaled according to the scaling operation instruction; Divide the target view into a first preset number of view areas radiating outwards from the position of the reference point in the view window as the center; The preset number of view areas are rendered and displayed in sequence radiating outward from the position of the reference point.
2. The view display method according to claim 1, characterized in that: The step of determining the target view after scaling the view to be scaled according to the scaling operation instruction includes: The view to be scaled is scaled based on the scaling ratio corresponding to each scaling operation instruction within a preset time period to obtain the target view.
3. The view display method according to claim 2, characterized in that: The method further comprises: Obtaining the pre-configured preset time period; Alternatively, the complexity of the portion of the view to be scaled displayed in the view window and the occupancy rate of the processor are obtained, and the preset time period is determined based on the complexity and / or the occupancy rate.
4. The view display method according to claim 2, characterized in that: The scaling the view to be scaled based on the scaling ratio corresponding to each scaling operation instruction within a preset time period to obtain the target view includes: When the timer is not turned on, when a zoom operation instruction is detected, the timer is triggered to start timing, and the zoom multiple corresponding to the zoom operation instruction is recorded; the zoom multiple is a multiple of the unit zoom ratio; During the timing time of the timer, each time the zoom operation instruction is detected, the zoom multiple corresponding to the zoom operation instruction is recorded until the timing of the timer ends; the timing time is the preset time period; Determining a target zoom ratio based on the unit zoom ratio and the zoom multiples corresponding to each zoom operation instruction; The view to be scaled is scaled based on the target scaling ratio to obtain the target view.
5. The view display method according to claim 1, characterized in that: The step of radiating outward from the position of the reference point in the view window as the center to divide the target view into a first preset number of view areas includes: In the case where the size of the target view is larger than the size of the view window, radiating outwards from the position of the reference point, the portion of the target view within the view window is divided into a second preset number of view areas, and the portion of the target view outside the view window is determined as one view area; The second preset number of viewing areas and the one viewing area are determined as the first preset number of viewing areas.
6. The view display method according to claim 5, characterized in that: The step of dividing the portion of the target view within the view window into a second preset number of view areas includes: Determining the distance between the reference point and each border of the view window; Based on the distances corresponding to the boundaries and the second preset number, the portion of the target view within the view window is divided to obtain the second preset number of view areas.
7. The view display method according to any one of claims 1 to 6, characterized in that: The method further comprises: Determine the position of the mouse pointer in the view window as the reference point; Alternatively, when a click operation on the view window is detected, the contact point of the click operation is determined as the reference point.
8. A view display device, characterized in that: include: A view determination module, used to determine a target view after scaling the view to be scaled according to the scaling operation instruction; A view division module, configured to divide the target view into a first preset number of view areas radiating outward from a position where a reference point in the view window is located; The view display module is used to render and display the preset number of view areas in sequence, radiating outward from the position of the reference point.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the view display method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the view display method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Electronic design automation system based on network front-end technology
CN120234861A
Map identifier display method and device, electronic equipment and storage medium
CN121187472A