Layered drawing method based on functional characteristics, computer equipment and storage medium
By adopting a layered drawing method based on functional characteristics, and using buffer isolation and display hierarchy constraints for the first-level and second-level drawing layers, the problem of layered loading of graphics units is solved, achieving efficient local refresh and visual consistency, and improving drawing efficiency and user experience in complex graphics scenes.
Patent Information
- Application Number
- CN202511284733.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-12-12
AI Technical Summary
Existing methods for layered loading of graphic elements are insufficient to meet the needs of complex engineering drawings. They incur high computational costs and have limited practical optimization effects, leading to visual logic confusion such as occlusion and disordered display of graphic elements.
A layered drawing method based on functional characteristics is adopted. By establishing several first-level and second-level drawing layers, buffers are used to physically isolate and logically divide graphics units. Combined with display hierarchy constraints, the drawing order of graphics units and local refresh strategies are determined to achieve precise positioning and local redrawing.
It improves rendering efficiency and visual consistency in complex graphics scenes, reduces computational overhead, avoids occlusion and misalignment of graphic elements and display sequence disorder, and enhances user experience.
Smart Images

Figure CN121120843A_ABST
Abstract
Description
[0001] Divisional application This application is a divisional application of Chinese invention patent application filed on June 16, 2025 [Application No.: 202510796523X] [Title: A Layered Drawing Method, Computer Equipment and Storage Medium]. Technical Field
[0002] This application relates to the field of computer graphics, and more particularly to layered rendering methods based on functional characteristics, computer devices, and storage media. Background Technology
[0003] As engineering projects continue to expand in scale, the complexity of drawings in computer-aided design (CAD) systems also increases accordingly, leading to higher drawing loading overhead. Currently, a common strategy is to separate graphic units according to static and dynamic attributes to reduce computational overhead.
[0004] For example, patent application CN106780659A discloses a method and electronic device for generating a two-dimensional situation map. The method includes: establishing an icon drawing layer, wherein the icon drawing layer includes a dynamic graphic element drawing layer and a static graphic element drawing layer; drawing static graphic elements in the static graphic element drawing layer in conjunction with geographic information images and storing them in a static graphics buffer; drawing dynamic graphic elements in the dynamic graphic element drawing layer at preset time intervals and storing them in a dynamic graphics buffer; and obtaining a two-dimensional situation map based on first data in the static graphics buffer and second data in the dynamic graphics buffer.
[0005] For example, patent application CN109582409A discloses a display overlay method based on double buffering. This method creates two frame buffers in memory, and the display driver alternately reads information from both buffers. While information is read from one frame buffer, the image to be displayed is drawn in real-time in the other frame buffer. Drawing the image to be displayed in the frame buffer includes: splitting the image to be displayed into a UI interaction control layer for human-computer interaction and a dynamic image layer for displaying real-time data changes; determining the display size and position of the UI interaction control layer and the dynamic image layer respectively; drawing the UI interaction control layer and the dynamic image layer separately using independent threads; and using a hardware accelerator to blend and overlay the drawn UI interaction control layer and dynamic image layer to obtain the image to be displayed.
[0006] However, the current layered loading of graphics units is difficult to cope with the increasingly complex engineering drawing requirements, and the actual optimization effect is limited, resulting in low practicality. Summary of the Invention
[0007] The main objective of this application is to provide a layered rendering method, computer device, and storage medium based on functional characteristics. To solve the aforementioned technical problems, this application specifically adopts the following technical solution: A first aspect of this application is to provide a layered drawing method, the method comprising: S1, establish several first-level drawing layers and a buffer for each of the first-level drawing layers, wherein each first-level drawing layer includes several second-level drawing layers, and several second-level drawing layers within the same first-level drawing layer share the same buffer; the buffer is used to store the drawing results of several graphics units in the corresponding first-level drawing layer; S2, When a graphics unit changes, determine the target first-level drawing layer to which the changed graphics unit belongs; S3, based on the second display layer between the secondary drawing layers and the third display layer within the secondary drawing layer, determine the drawing order of the graphics units; based on the drawing order, redraw several graphics units in the target primary drawing layer to update the drawing result of the target primary drawing layer; S4, based on the first display level between the first-level drawing layers, the drawing results of several first-level drawing layers and the updated drawing results of the target first-level drawing layer are superimposed to update the drawing.
[0008] In some embodiments, S2 further includes: when the changed graphics unit is a newly created graphics unit, the changed graphics unit is assigned to the corresponding target first-level drawing layer based on a preset layering rule; or, when the changed graphics unit is an existing graphics unit, the first-level drawing layer where the changed graphics unit is currently located is taken as the target first-level drawing layer.
[0009] In some embodiments, the method further includes: dividing a number of graphics units in the first-level drawing layer into corresponding second-level drawing layers based on a preset layering rule.
[0010] In some embodiments, the drawing order includes a global drawing order, and S3 includes: determining a global drawing order among a plurality of graphics units within the target primary drawing layer based on a second display layer between the secondary drawing layers and a third display layer within the secondary drawing layer; and redrawing the plurality of graphics units within the target primary drawing layer sequentially based on the global drawing order to update the drawing result of the target primary drawing layer.
[0011] In some embodiments, the drawing order includes a local drawing order, and S3 includes: calling the historical drawing results of the target first-level drawing layer; determining the target area that needs to be redrawn in the historical drawing results according to the position of the changed graphics unit, wherein there is at least one redrawn graphics unit in the target area; obtaining the target second-level drawing layer to which at least one of the redrawn graphics units belongs; determining the local drawing order between the redrawn graphics units based on the second display layer between the target second-level drawing layers and the third display layer inside the target second-level drawing layer; and redrawing the redrawn graphics units sequentially based on the local drawing order to update the drawing results of the target area.
[0012] In some embodiments, S3 includes: generating a minimum rectangular frame surrounding the modified graphic unit based on the modified graphic unit, and using the area divided by the minimum rectangular frame as the target area; determining a plurality of associated graphic units that are within the target area and / or intersect with the target area; and using the modified graphic unit and the plurality of associated graphic units as the redrawing graphic unit.
[0013] In some embodiments, the secondary rendering layer includes a preset auxiliary secondary rendering layer and several ordinary secondary rendering layers, wherein the display level of the auxiliary secondary rendering layer is higher than the display level of the several ordinary secondary rendering layers; step S3 further includes: moving the changed graphics unit from its topping ordinary secondary rendering layer to the auxiliary secondary rendering layer, and executing step S3; when the changed graphics unit stops changing, reassigning the changed graphics unit from the auxiliary secondary rendering layer to its original topping ordinary secondary rendering layer, and executing step S3.
[0014] In some embodiments, each buffer of the first-level drawing layer is provided with display attributes; the method further includes: drawing a plurality of graphics units in the corresponding first-level drawing layer according to the display attributes of the buffer.
[0015] A second aspect of this application is to provide a computer device, the device comprising: Memory, used to store computer programs; A processor is configured to execute the computer program and, in executing the computer program, implement the steps of the layered rendering method provided in any embodiment of this application.
[0016] A third aspect of this application is that a computer-readable storage medium is also provided, the computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the layered drawing method provided in any embodiment of this application.
[0017] Beneficial effects: This application provides a layered drawing method, a computer device, and a storage medium. Specifically, it provides an efficient local refresh strategy based on hierarchical constraints. By using a nested hierarchical structure, it provides a feasible basis for local refresh and establishes strict constraints, enabling precise local redrawing in complex graphics scenes while improving visual consistency and display accuracy during the process.
[0018] Specifically, based on the display hierarchy, several first-level drawing layers are initially divided, and the first display hierarchy between the first-level drawing layers forms an overall stacking order constraint. In each first-level drawing layer, the display hierarchy relationship is further refined, and second-level drawing layers with shared buffers are divided. Based on the second display hierarchy of several second-level drawing layers within the same first-level drawing layer and the third display hierarchy between graphics units within the same second-level drawing layer, multiple graphics unit drawing order constraints are formed.
[0019] When a graphic unit changes, the target first-level drawing layer is quickly located and the initial redrawing range is defined based on hierarchical relationships. Each first-level drawing layer is equipped with an independent buffer, ensuring that redrawing a specific layer locally does not interfere with other layers. Furthermore, change analysis precisely identifies specific graphic units, determining the areas within the redrawing range that actually require local refresh. The remaining areas can reuse historical drawing results, refining the redrawing computation to a minimum while maintaining a shared buffer. The redrawing order strictly follows a preset three-level display rule to ensure that the drawing results always satisfy stacking order constraints and drawing order constraints, ensuring that higher-level elements always cover lower-level elements. This effectively avoids visual logic confusion such as graphic element occlusion and disordered display sequence that may result from local refreshes.
[0020] Furthermore, a dynamic layer transition mechanism is introduced for continuous interactive scenarios, allowing specific primitives to break through the strict layer constraints of the second and third display layers. Elements in drag-and-drop operations are temporarily elevated to a dedicated high-level layer for independent refresh, which improves the visibility of operations and avoids repeated redrawing of the underlying layers. After the operation is completed, the layers are intelligently reset and a global update is triggered. During this process, only the first display layer is used to maintain key occlusion relationships, thereby improving rendering efficiency in complex scenes while taking into account the user's visual experience. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. The elements or parts in the drawings are not necessarily drawn to scale. Obviously, the drawings described below are some embodiments of this application; for those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0022] Figure 1 This is a schematic diagram of a drawing scene provided in an embodiment of this application; Figure 2 This is a schematic flowchart of a layered drawing method provided in an embodiment of this application; Figure 3 This is a schematic diagram of a primary drawing layer provided in an embodiment of this application; Figure 4 This is a schematic diagram of another drawing scene provided in an embodiment of this application; Figure 5 This is a schematic diagram of a two-level drawing layer provided in an embodiment of this application; Figure 6 This is a schematic diagram of another drawing scene provided in an embodiment of this application; Figure 7 This is a schematic diagram illustrating different display attributes of a buffer provided in an embodiment of this application; Figure 8 This is a schematic diagram illustrating another type of buffer with different display attributes provided in an embodiment of this application; Figure 9 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0024] In this document, suffixes such as “module,” “part,” or “unit” used to denote elements are used only for illustrative purposes and have no specific meaning in themselves. Therefore, “module,” “part,” or “unit” may be used interchangeably.
[0025] In this document, the terms "upper," "lower," "inner," "outer," "front," "rear," "one end," and "the other end," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0026] In this document, unless otherwise explicitly specified and limited, the terms "installed," "equipped with," and "connected," etc., should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, a direct connection, or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0027] In this document, "and / or" includes any and all combinations of one or more of the listed related items.
[0028] In this article, "multiple" means two or more, that is, it includes two, three, four, five, etc.
[0029] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0030] Modern engineering projects are becoming increasingly complex, requiring drawings to incorporate more specialized details, such as multidisciplinary integrated design in architecture and precision assembly relationships in machinery. Meanwhile, CAD systems are constantly being upgraded, supporting advanced analyses such as 3D modeling and simulation, significantly improving design quality. However, this also brings larger data volumes and higher computational demands, further exacerbating drawing complexity. This directly leads to increased drawing loading time and higher consumption of computing resources. Currently, the optimization strategy is to separate the drawing units according to static and dynamic attributes. That is, during the rendering process, static elements that do not change frequently are pre-generated into a graphics cache, while only frequently changing dynamic parts are updated in real time, in order to reduce unnecessary repetitive calculations.
[0031] However, this categorized drawing approach is too simplistic and crude in practical applications. As the complexity of drawings continues to increase and interaction modes diversify, the proportion of primitives with dynamic attributes has significantly surpassed that of primitives with purely static attributes. Even if only dynamic primitives are redrawn, the computational overhead remains substantial. Furthermore, the relationships between primitives have become increasingly complex, leading to increased difficulty and computational overhead in implementing local drawing. Consequently, the current layered loading of graphics units is insufficient to meet the demands of increasingly complex engineering drawings, severely limiting the actual performance improvement.
[0032] Based on this, embodiments of this application provide a layered drawing method, a computer device, and a storage medium. Specifically, it provides an efficient local refresh strategy based on hierarchical constraints. By using a nested hierarchical structure, it provides a feasible basis for local refresh and establishes strict constraints, enabling precise local redrawing in complex graphics scenes while improving visual consistency and display accuracy during the process.
[0033] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0034] In this article, the drawings can be CAD drawings, and the format of the drawings can be dwg, dxf, dwt, etc., or they can be Pro / E drawings, SolidWorks drawings, etc., without any restrictions.
[0035] In this article, graphic units refer to the various basic elements present in a drawing, also known simply as graphic primitives. Specifically, they can be divided into two categories: basic graphic units, which are the geometric entities or objects actually drawn by the user in the drawing. These graphic units constitute the core content of the design outcome and are part of the final output drawing, including but not limited to geometric figures such as points, lines, circles, arcs, and polygons, as well as dimensions and text descriptions; and auxiliary graphic units, which are temporary, non-persistent interface elements or auxiliary tools generated by the user during the operation of CAD software. These graphic units are mainly used to improve the visibility and accuracy of the drawing process but are not retained in the final drawing, including but not limited to cursors, selection boxes, coordinate systems, grids, and alignment guides.
[0036] Please see Figure 1 , Figure 1 This is a schematic diagram of a drawing scene provided in an embodiment of this application. For example... Figure 1 As shown, in the drawing scene of the CAD software, there are three combined entities: a first combined entity 10, a second combined entity 20, and a third combined entity 30. These combined entities are composed of at least one graphic element. Specifically, the first combined entity 10 is a circular graphic element under adjustment, including a cursor, a basic circular graphic unit, and multiple auxiliary graphic units generated when the user modifies the basic circular graphic unit; the second combined entity 20 is a user-drawn custom graphic, including basic graphic units such as circles, polygons, and dimension annotations; and the third combined entity 30 is a coordinate system icon, an auxiliary graphic unit indicating the coordinate direction.
[0037] Please see Figure 2 , Figure 2 This is a schematic flowchart illustrating a layered drawing method provided in an embodiment of this application, such as... Figure 2 As shown in the figure, this application provides a layered drawing method, which includes S1 to S4.
[0038] S1, establish several first-level drawing layers and a buffer for each of the first-level drawing layers, wherein each first-level drawing layer includes several second-level drawing layers, and several second-level drawing layers within the same first-level drawing layer share the same buffer; the buffer is used to store the drawing results of several graphics units in the corresponding first-level drawing layer.
[0039] The first-level drawing layer is a macroscopic hierarchical structure that is physically divided based on the functional attributes of primitives. Each first-level drawing layer is physically isolated through an independent buffer to store the drawing results of all graphics units within that layer. Meanwhile, the stacking order of the first-level drawing layers (i.e., the first display layer) is determined by the occlusion relationship, forming a hierarchical priority from high to low.
[0040] Furthermore, the second-level rendering layer is a further subdivision of the first-level rendering layer. It is logically divided based on the functional attributes of the primitives. Second-level rendering layers within the same first-level rendering layer share the buffer of that first-level layer, undergoing only logical division. Simultaneously, the stacking order of the second-level rendering layers (i.e., the second display layer) is determined by occlusion relationships, forming a hierarchical priority from high to low. It should be understood that after the functional division of the first-level rendering layer clearly defines the macroscopic visual hierarchy, the second-level rendering layers can further refine the local order. Moreover, the rendering order within a second-level rendering layer is determined by the order in which the graphic units are generated (i.e., the third display layer).
[0041] In some embodiments, the layering rules (i.e., preset layering rules) of the first-level drawing layer and the second-level drawing layer can be pre-defined according to the functional characteristics of different CAD software and the usage requirements of the graphic units. Then, the affiliation relationship between different graphic units and each first-level drawing layer and second-level drawing layer can be determined according to the preset layering rules. This allows for the rapid allocation of various graphic units generated during the use of CAD software (such as graphic units drawn by the user, graphic units that are built into the software function or automatically generated in response to user operations, etc.) to the corresponding layers, thereby optimizing the functionality and user experience of the CAD software user interface. The specific layering rules and the number of layers are not limited here.
[0042] For example, please refer to Figure 3 , Figure 3 This is a schematic diagram of a primary drawing layer provided in an embodiment of this application. Figure 1 Multiple combined entities can be assigned to the corresponding first-level drawing layer 100 according to their functional attributes, such as Figure 3As shown, the specific layered structure, ranked from highest to lowest priority, includes the following layers: Interaction Control Layer 101, Interface Information Layer 102, Operation Assistance Layer 103, Main Drawing Layer 104, and Background Reference Layer 105. The Interaction Control Layer 101 carries graphical elements for direct user interaction (such as cursors, selection boxes, drag-and-drop tooltips), and must always be on top to improve operational visibility. The Interface Information Layer 102 displays information directly related to the software interface (such as coordinate systems, status bars, scale bars, and view navigation tools), and must maintain long-term visibility. The Operation Assistance Layer 103 stores temporary, non-persistent auxiliary graphical units, and must cover the basic graphical units to demonstrate the operational effects. The Main Drawing Layer 104 carries the core basic graphical units drawn by the user, supporting subsequent operations (such as modification, combination, and alignment). The Background Reference Layer 105 serves as a background graphical element (such as grid lines), providing a drawing reference, and is allowed to be occluded by all other graphical elements.
[0043] like Figure 3 As shown, the background reference layer 105 is at the lowest display level to provide a drawing reference while avoiding obscuring the drawing content. The main drawing layer 104, as the core drawing area, carries the basic graphic units drawn by the user (such as the circular graphic unit 10c and the second combined entity 20), and is located at a lower position in the visual hierarchy so that the subsequently generated auxiliary graphic units can cover it. Furthermore, when the user modifies the circular basic graphic unit, the generated auxiliary graphic units 10b (such as grips, highlighting tools, adjustment preview circles, etc.) are assigned to the operation assistance layer 103, which is located above the main drawing layer 104, so that these primitives cover the basic graphic units, clearly defining the object and effect of the user's operation.
[0044] Furthermore, the graphic elements in the interface information layer 102 need to remain visible at all times to help users understand the current operating environment. For example, if the coordinate system icon is obscured by other graphic elements, users will have difficulty judging the drawing direction or scale. Therefore, the interface information layer 102 is placed below the interaction control layer 101 and above the operation assistance layer 103, which maintains the display priority of interface information and avoids interference with directly interactive elements. The interaction control layer 101 is responsible for presenting components that directly interact with the user, such as the cursor 10a. In order to meet the real-time and dynamic requirements of user interaction, the interaction control layer 101 must always be on the top layer so that the cursor 10a or other interactive elements (such as selection boxes and drag-and-drop tooltips) are not obscured by other graphic elements.
[0045] As can be seen, the cursor 10a, the basic circular graphic unit 10c, and the multiple auxiliary graphic units 10b generated when the user modifies the basic circular graphic unit are assigned to the corresponding first-level drawing layer according to their functional attributes and occlusion relationships.
[0046] For example, the layering method and / or number of layers in the first-level drawing layer can be modified based on the original layering logic. This includes dynamically adding new first-level drawing layers and deleting old ones, flexibly adapting to functional requirements. For example, please refer to... Figure 4 , Figure 4 This is a schematic diagram of another drawing scene provided in the embodiments of this application, such as... Figure 4 As shown, some CAD software has a special magnifying glass function, used to temporarily zoom in on a local area of a drawing to observe or edit details. In this case, based on the aforementioned layered structure, a bottom layer can be added below the background reference layer, and the view before zooming can be cached and displayed on this bottom layer, such as... Figure 4 The area outside the enlarged circular white-background area. Simultaneously, an overlay layer is placed above the operation assistance layer, using semi-transparent gray primitives to cover non-critical content outside the enlarged circular white-background area. It should be noted that the layered structure within the enlarged area is completely identical to the original layered structure, but its display range is limited to the circular area.
[0047] It should be understood that this approach retains the integrity of the original layered logic while expanding functionality through dynamic updates to the layer division. Furthermore, once the user completes their operation, the bottom layer and overlay layer can be removed or hidden, restoring the original layered structure and thus avoiding redundant resource consumption.
[0048] For example, please refer to Figure 5 , Figure 5 This is a schematic diagram of a two-level drawing layer provided in an embodiment of this application. Figure 3 Multiple auxiliary graphics units 10b in the operation assistance layer 103 can be assigned to the corresponding secondary drawing layer 200 according to their functional attributes, such as... Figure 5 As shown, adjusting a circular element involves dragging and selecting its grip point to modify its radius attribute. The specific layered structure, prioritized from highest to lowest, includes a high layer (201), a middle-upper layer (202), a middle layer (203), and a low layer (204). Multiple auxiliary graphic units 10b can include grip points, a blue ring, a radius length, and an adjustment preview circle. Grip points, needing priority display to provide real-time feedback to user actions, are assigned to the high layer (201); the blue ring, indicating the circular element's selection, is located in the middle-upper layer (202); the radius length is indicated by its placement in the middle layer (203); and the adjustment preview circle is assigned to the low layer (204).
[0049] In some embodiments, secondary drawing layers can be distinguished by index values, and entities between secondary drawing layers are drawn strictly from bottom to top according to the layer index values. Primitives within a secondary drawing layer are drawn from bottom to top according to the actual drawing order. For example... Figure 5The four secondary drawing layers are indexed from 90 to 93 from bottom to top. The lower layer 204 (index 90) first draws a straight line from the center of the circular primitive to the cursor position, then draws a preview of the circular primitive after the radius attribute has been modified (i.e., an adjustment preview circle). The middle layer 203 (index 91) draws a set of dashed lines representing the radius value of the circular primitive (i.e., the radius length). The upper-middle layer 202 (index 92) draws a blue ring indicating the selected state of the circular primitive. The upper layer 201 (index 93) draws a set of blue or red squares (i.e., grips) indicating that the vertices of the circular primitive can be dragged and edited. When drawing the operation auxiliary layer 103, the drawing is performed in the order of index values from 90 to 93.
[0050] It should be noted that the hierarchical rules and number of levels for the first-level and second-level drawing layers can be flexibly determined based on the functional characteristics of different CAD software and the usage requirements of the graphic units, and are not limited to the examples above. For instance, in some CAD software, the selected state of a graphic element is the main display element during the modification process of a graphic unit, so the blue ring will be assigned to a higher level; another example is that in some CAD software, there are no visual cue elements for the selected state of a graphic element, so the upper-middle layer 202 can be omitted. Furthermore, the higher the display level, the later the drawing order, to avoid obscuring graphic elements at higher display levels.
[0051] It should be understood that the division of rendering layers integrates the dual constraints of functional attributes and occlusion relationships, ensuring both the logical independence between primitives and maintaining orderly control of the visual hierarchy. First, primitives with the same macroscopic function are grouped into the same first-level rendering layer and share a buffer. Physical isolation prevents data interference between layers. For example, primitives in the interface information layer are only used to display interface information, and primitives in the interaction control layer are only used to respond to user operations, avoiding rendering conflicts or logical errors caused by mixed functions and ensuring the stability of the software during partial refreshes. Second, each first-level rendering layer can be further divided into multiple second-level rendering layers to refine the visual hierarchy and control the stacking order of primitives within the same functional category. Furthermore, the second-level rendering layers are logically divided, supporting flexible expansion in number without increasing the resource overhead of the buffer.
[0052] This layered structure provides the foundation for local refresh. When the primitives within a certain level of the drawing layer change, only the buffer content of that level of drawing layer needs to be updated, without redrawing other levels of drawing layers. This enables the reuse of drawing results and reduces computational overhead. For example, when the user moves the cursor, only the interactive control layer needs to be refreshed, while the other levels of drawing layers remain stable, effectively improving drawing efficiency and system response speed.
[0053] Building upon this foundation, the stacking order of graphic elements is further refined through hierarchical control of the first display level between first-level drawing layers, the second display level between second-level drawing layers, and the third display level within a second-level drawing layer. This enhances visual consistency and prevents graphic occlusion chaos or display sequence errors. For example, in the operation assistance layer, auxiliary graphic units such as grips and highlighted circles achieve precise occlusion control through the drawing order of the second-level drawing layers. Simultaneously, because their respective first-level drawing layers have higher display priority, these auxiliary graphic units always cover the main drawing layer, preventing them from being occluded by the underlying basic graphic units.
[0054] In other words, the two-level structure of the first-level drawing layer and the second-level drawing layer avoids the waste of resources caused by allocating a buffer for each primitive separately, and the strict hierarchical constraints ensure the accuracy and visual consistency of local refresh, thereby enabling CAD software to achieve efficient and orderly graphic management in complex scenarios.
[0055] In some embodiments, the method further includes: dividing a number of graphics units into corresponding first-level drawing layers based on preset layering rules.
[0056] In some embodiments, several graphics units in a first-level drawing layer are assigned to corresponding second-level drawing layers. Specifically, based on preset layering rules, several graphics units in a first-level drawing layer or modified graphics units in a target first-level drawing layer are further assigned to corresponding second-level drawing layers. It should be understood that the second-level drawing layers share the buffer of the first-level drawing layer, and visual differentiation is achieved only through the drawing order. This reduces the number of independent buffers and refines the hierarchical priority of primitives under the same functional category, thereby improving performance while optimizing visual consistency.
[0057] In some embodiments, when the number of graphics units in a first-level drawing layer exceeds a preset number, the hierarchical structure of the second-level drawing layer is triggered, and several graphics units in the corresponding first-level drawing layer are assigned to the corresponding second-level drawing layer. Thus, some first-level drawing layers include several second-level drawing layers, while some graphics units in a first-level drawing layer are not temporarily assigned to second-level drawing layers. It should be understood that for first-level drawing layers with fewer graphics units, even if the entire layer is redrawn, the workload is low, and second-level drawing layer assignment can be omitted to avoid excessive consumption of system resources. Furthermore, in this case, the drawing order within a first-level drawing layer is determined by the order in which the graphics units are generated (i.e., the fourth display layer).
[0058] S2, when a graphics unit changes, determine the target first-level drawing layer to which the changed graphics unit belongs.
[0059] Specifically, a changed graphic unit refers to a graphic unit whose state is added, modified, or deleted during the graphic drawing or interaction process. This change directly or indirectly affects the drawing result. When a change in a graphic unit is detected, its target first-level drawing layer is determined based on the functional attributes of the changed graphic unit. For example, if the change involves user interaction (such as cursor movement), the target first-level drawing layer is the interaction control layer; if it is an auxiliary graphic unit (such as grips or highlighting tools), the target first-level drawing layer is the operation assistance layer; if it is basic drawing content (such as circles or rectangles), the target first-level drawing layer is the main drawing layer.
[0060] It should be understood that, based on preset layering rules, the relationship between graphics units with different functional attributes and each first-level and second-level drawing layer is determined, thereby determining the target first-level drawing layer to which the changed graphics unit belongs, accurately locating the physical buffer that needs to be updated, realizing local refresh, and improving drawing efficiency.
[0061] In some embodiments, S2 further includes: when the changed graphics unit is a newly created graphics unit, the changed graphics unit is assigned to the corresponding target first-level drawing layer based on a preset layering rule; or, when the changed graphics unit is an existing graphics unit, the first-level drawing layer where the changed graphics unit is currently located is taken as the target first-level drawing layer.
[0062] Specifically, when a graphic unit is changed to a newly created graphic unit, it is assigned to the corresponding target first-level drawing layer based on preset layering rules. For example, a circle drawn by the user is assigned to the main drawing layer, and a grip is assigned to the operation assistance layer. When a graphic unit is changed to an existing graphic unit, its current first-level drawing layer is taken as the target first-level drawing layer.
[0063] In some embodiments, when a new graphics unit is created, after assigning the changed graphics unit to the corresponding target first-level drawing layer, the method further includes: assigning the changed graphics unit to the corresponding target second-level drawing layer based on a preset layering rule.
[0064] In some embodiments, when changing a graphics unit to an existing graphics unit, after setting the current first-level drawing layer of the changed graphics unit as the target first-level drawing layer, the method further includes setting the current second-level drawing layer of the changed graphics unit as the target second-level drawing layer.
[0065] It should be understood that each graphic element in the drawing is strictly assigned to a specific secondary drawing layer under a certain primary drawing layer, forming a dual constraint system of functional characteristics and occlusion relationships.
[0066] S3, based on the second display level between the secondary drawing layers and the third display level within the secondary drawing layer, determine the drawing order of the graphics units; based on the drawing order, redraw several graphics units in the target primary drawing layer to update the drawing result of the target primary drawing layer.
[0067] The second display layer refers to the stacking order of secondary rendering layers within the same primary rendering layer, determined by occlusion relationships. It controls the display priority of different graphic elements within the same functional category; the higher the second display layer, the later the rendering order. Correspondingly, the third display layer determines the rendering order of graphic elements within the same secondary rendering layer based on their generation time; the earlier the rendering time, the earlier the rendering order, forming a local visual stacking relationship.
[0068] The drawing order refers to the order in which primitives are drawn one by one in the buffer, which will affect the layer effect in the final display. By controlling the drawing order, the graphic units that need to be updated in the target first-level drawing layer can be redrawn in the correct order, avoiding a full refresh of the entire first-level drawing layer, thereby improving drawing efficiency while ensuring visual consistency.
[0069] Specifically, the drawing order among graphics units within a primary drawing layer is determined by comprehensively considering the second display level between secondary drawing layers and the third display level within a secondary drawing layer. First, the initial drawing order among graphics units at different secondary drawing levels within the target primary drawing layer is determined, meaning that graphics units with lower second display levels are drawn first. Second, graphics units within a secondary drawing layer are arranged in parallel within the first drawing order. The second drawing order among multiple graphics units within the same secondary drawing layer is further differentiated based on the third display level within the secondary drawing layer, meaning that graphics units generated earlier are drawn first. Finally, the drawing order can be determined by combining the first drawing order between layers and the second drawing order within a layer.
[0070] like Figure 3 and Figure 5 As shown, if the operation auxiliary layer 103 is the target first-level drawing layer, the graphics units in the operation auxiliary layer 103 need to be redrawn to update the drawing results in the buffer of the operation auxiliary layer 103. At this time, since the second display level of the high layer 201 is higher than the second display level of the middle and upper layer 202, the blue ring needs to be drawn before the grip. In the high layer 201, assuming that the blue grip is generated before the red grip, the third display level of the red grip is higher than the third display level of the blue grip, and the blue grip needs to be drawn before the red grip.
[0071] In some embodiments, the drawing order includes a global drawing order, and S3 includes: determining a global drawing order among a plurality of graphics units within the target primary drawing layer based on a second display layer between the secondary drawing layers and a third display layer within the secondary drawing layer; and redrawing the plurality of graphics units within the target primary drawing layer sequentially based on the global drawing order to update the drawing result of the target primary drawing layer.
[0072] The global drawing order refers to the drawing sequence of each graphic element within the target first-level drawing layer, determined by the second display level between second-level drawing layers and the third display level within the second-level drawing layer.
[0073] For example, based on the second display level between each second-level drawing layer, the third drawing order of all graphics units in the first-level drawing layer is initially determined. Secondly, when multiple graphics units are in the same second-level drawing layer, these graphics units are in parallel order in the third drawing order. Based on the third display level within the second-level drawing layer, the fourth drawing order among multiple graphics units in the same second-level drawing layer is further distinguished, that is, the graphics unit generated earlier is drawn first. Finally, the global drawing order can be determined by combining the third drawing order between layers and the fourth drawing order within layers.
[0074] Based on the global rendering order, the graphic units within the target first-level rendering layer are redrawn sequentially, rather than redrawing the entire first-level rendering layer. This ensures visual consistency while reducing redundant calculations and improving rendering efficiency. As a result, primitives are covered layer by layer in the buffer according to logical priority and time order, ultimately forming the correct stacking effect.
[0075] In some embodiments, the drawing order includes a local drawing order, and S3 includes: calling the historical drawing results of the target first-level drawing layer; determining the target area that needs to be redrawn in the historical drawing results according to the position of the changed graphics unit, wherein there is at least one redrawn graphics unit in the target area; obtaining the target second-level drawing layer to which at least one of the redrawn graphics units belongs; determining the local drawing order between the redrawn graphics units based on the second display layer between the target second-level drawing layers and the third display layer inside the target second-level drawing layer; and redrawing the redrawn graphics units sequentially based on the local drawing order to update the drawing results of the target area.
[0076] The historical rendering result refers to the complete graphic data of the previous rendering of the target first-level rendering layer, including the final display state of all graphic units within that first-level rendering layer, such as position, color, and shape. Using the historical rendering result as the basis for the current rendering, only the rendering result of the target area is updated.
[0077] Specifically, the historical rendering results of the target first-level rendering layer are retrieved. Then, based on the location of the changed graphic unit (e.g., position coordinates, geometric range), the target area requiring updated rendering results is determined, and the graphic units within the target area are identified as the redrawn graphic units. The target area refers to the local range that needs updating due to the presence of the changed graphic unit, such as a preset area that might be affected by a change in the graphic unit. The specific range value can be flexibly set according to different scenarios and is not limited here. Correspondingly, the redrawn graphic unit refers to the graphic unit within the target area, including changed graphic units whose status has changed due to addition, modification, or deletion, as well as other graphic units within the target area, such as graphic units in areas that partially or completely overlap with the changed graphic unit. These graphic units also need to be refreshed in tandem to improve display accuracy.
[0078] Obtain the target secondary rendering layer to which the redrawn graphic unit belongs, and determine the local rendering order based on the second and / or third display layers. For example, if there are multiple redrawn graphic units belonging to different secondary rendering layers, the fifth rendering order of the multiple redrawn graphic units is initially determined based on the second display layer between the target secondary rendering layers, that is, the redrawn graphic unit with the lower display layer is rendered first. Furthermore, if there are multiple redrawn graphic units in the same target secondary rendering layer, and these redrawn graphic units are in parallel order in the fifth rendering order, then the sixth rendering order among the multiple redrawn graphic units in the same target secondary rendering layer is further distinguished based on the third display layer within the target secondary rendering layer, that is, the redrawn graphic unit with the earlier generation time is rendered first. Finally, the local rendering order can be determined by combining the fifth rendering order between layers and the sixth rendering order within layers.
[0079] In other words, the local drawing order refers to the order in which several redrawn graphic units are drawn, determined by the second display layer between the two levels of drawing layers and the third display layer within the second level of drawing layers. Following this order, only the redrawn graphic units are redrawn one by one, updating only the drawing results of the target area, rather than fully refreshing the entire target first-level drawing layer. This allows for the partial reuse of historical drawing results in the target first-level drawing layer, thereby reducing redundant calculations and improving redrawing efficiency while ensuring visual consistency.
[0080] It should be understood that the first, third, and fifth drawing orders in the embodiments of this application are all constraints imposed on the drawing order by the second display level between the two drawing layers, and the second, fourth, and sixth drawing orders are all constraints imposed on the drawing order by the third display level within the two drawing layers. The difference lies in the fact that the graphic units constrained by the drawing order may be different. When the constrained graphic units are completely identical, the first, third, and fifth drawing orders are the same, and the second, fourth, and sixth drawing orders are the same.
[0081] Please see Figure 6 , Figure 6 This is a schematic diagram of another drawing scenario provided in an embodiment of this application. For example... Figure 6 As shown, there are three combined entities within the target first-level drawing layer, and these three combined entities belong to different second-level drawing layers: the text editing window, the coordinate system icon, and the view navigation tool. When the user edits the text "abc" in the text editing window, the text editing window is the unit for changing graphics. Based on the position of the text editing window, the target area 40 that needs to be redrawn in the historical drawing results is determined. The drawing area of the coordinate system icon intersects with the target area 40, while the drawing area of the view navigation tool in the upper right corner does not intersect with the target area 40. Therefore, only the text editing window and the coordinate system icon are determined as the units for redrawing graphics.
[0082] Furthermore, the secondary drawing layers of the text editing window and the coordinate system icon are used as the target secondary drawing layer. The second display layer of the coordinate system icon is higher than the second display layer of the text editing window. The text editing window includes two graphic units: a positioning box and a text box. The third display layer of the text box is higher than the third display layer of the positioning box. In this case, the local drawing order from first to last is: positioning box, text box, coordinate system icon.
[0083] In some embodiments, S3 includes: generating a minimum rectangular frame surrounding the modified graphic unit based on the modified graphic unit, and using the area divided by the minimum rectangular frame as the target area; determining a plurality of associated graphic units that are within the target area and / or intersect with the target area; and using the modified graphic unit and the plurality of associated graphic units as the redrawing graphic unit.
[0084] The minimum rectangular box refers to the smallest covering rectangular area generated based on the geometric boundaries of the changed graphic units, which is used to define the scope of the target area.
[0085] Among them, associated graphic units refer to graphic units located within or intersecting with the target area, whose display status may need to be updated synchronously due to changes in the graphic units.
[0086] Specifically, based on the position of the changed graphic unit, a minimum bounding rectangle is generated to surround the graphic unit as the target area to be updated. Then, several related graphic units that are within or intersect with the bounding rectangle are identified, such as primitives that have geometric overlap or occlusion with the changed graphic unit. The changed graphic unit and related graphic units are used together as redrawing graphic units. Through a local refresh mechanism, only the primitives within the target area are updated, rather than redrawing the entire hierarchy, thereby reducing redundant calculations.
[0087] In some embodiments, when a graphics unit becomes invalid (e.g., added, deleted, or modified), it is identified as a changed graphics unit. The target first-level drawing layer corresponding to the changed graphics unit is set to an invalid state, and the invalid target first-level drawing layer is redrawn. All graphics units in the target first-level drawing layer can be redrawn in global drawing order, or a local refresh method can be used. The target area where the changed graphics unit is located can be retrieved. For example, the intersecting redrawn graphics units can be approximated by the smallest rectangle surrounding the changed graphics unit, and these redrawn graphics units can be redrawn in the target area of the changed graphics unit in local drawing order.
[0088] This application's embodiments introduce a dynamic layer transition mechanism for continuous interactive scenarios, enabling specific primitives to break through the strict layer constraints of the second and third display layers. Elements in drag-and-drop operations are temporarily elevated to a dedicated high-level layer for independent refresh, which improves the visibility of operations and avoids repeated redrawing of the underlying layers. After the operation is completed, the layers are intelligently reset and a global update is triggered. During this process, only the first display layer is used to maintain key occlusion relationships, thereby improving rendering efficiency in complex scenes while also taking into account the user's visual experience.
[0089] In some embodiments, the secondary rendering layer includes a preset auxiliary secondary rendering layer and several ordinary secondary rendering layers, wherein the display level of the auxiliary secondary rendering layer is higher than the display level of the several ordinary secondary rendering layers; step S3 further includes: moving the changed graphics unit from its topping ordinary secondary rendering layer to the auxiliary secondary rendering layer, and executing step S3; when the changed graphics unit stops changing, reassigning the changed graphics unit from the auxiliary secondary rendering layer to its original topping ordinary secondary rendering layer, and executing step S3.
[0090] In this context, the auxiliary secondary drawing layer refers to a special secondary drawing layer with a pre-set display level higher than the ordinary secondary drawing layer. It is used to temporarily support graphics units in a dynamically changing state, and it has the highest display level within this primary drawing layer. Conversely, the ordinary secondary drawing layer refers to a normally existing secondary drawing layer set according to preset layering rules, and its display level is lower than that of the auxiliary secondary drawing layer.
[0091] Specifically, when one or more graphic units are detected to have changed, they can be moved from their original ordinary secondary drawing layer to an auxiliary secondary drawing layer, so that the changed graphic unit has the highest secondary display level in its original primary drawing layer, ensuring the visualization of the operation. When the changed graphic unit stops changing, it is then reassigned to its original ordinary secondary drawing layer to restore normal display.
[0092] In some embodiments, the system monitors attribute changes (such as position, size, shape, etc.) and change frequency of graphic units within a first preset time period. If the number of changes per unit time exceeds a preset threshold and / or the change interval is shorter than a preset interval threshold, it is determined to be a continuous change. When one or more graphic units are detected to be continuously changing, a dynamic hierarchy transition mechanism is triggered, moving them from their original ordinary secondary rendering layer to an auxiliary secondary rendering layer to separate unstable graphic elements with high-frequency changes from stable graphic elements with low-frequency changes. When a graphic unit is detected to no longer be changing within a second preset time period, it is determined to have stopped changing, and it is then reassigned to its original ordinary secondary rendering layer to restore normal display, thereby optimizing local refresh efficiency and hierarchy management flexibility. The specific values of the first and second preset time periods can be set according to the application scenario requirements or response sensitivity of the dynamic hierarchy transition mechanism, and are not limited here.
[0093] For example, when a user drags a grip to adjust a graphic, the number of times the position coordinates change is detected in real time. If the frequency of changes in the position coordinates of the grip exceeds a set threshold, the graphic element is marked as continuously changing and is moved to the auxiliary secondary drawing layer for dynamic management.
[0094] The dynamic hierarchical transition mechanism is particularly suitable for graphic units in the first-level drawing layer that have occlusion relationships with multiple graphic units. It not only improves the visual priority of continuously changing graphic units, but also reduces the associated refresh of redrawing graphic units during local refresh, thereby improving the visibility of operations and avoiding repeated redrawing of the underlying layer.
[0095] The dynamic hierarchical transition mechanism also applies to packaged drawing graphics units. For example, in a secondary drawing layer, there are three lines A, B, and C. These three lines have different coordinates, but all other attributes (such as line type, line width, color, and transparency) are exactly the same. In this case, these three lines can be packaged for drawing, reducing resource consumption. However, if the position coordinates of line B change continuously due to dragging adjustments, each change requires repackaging the data and triggering a partial refresh, which leads to performance degradation. In this case, line B is promoted to a dynamic auxiliary secondary drawing layer. Subsequent adjustments to line B are managed independently by the dynamic auxiliary secondary drawing layer, no longer triggering or affecting the packaged drawing of lines A and C. Repackaging will only occur when line B is first moved to the auxiliary secondary drawing layer and when it is finally demoted back to the normal secondary drawing layer, reducing the amount of data for partial refreshes and improving the rationality of resource utilization.
[0096] S4, based on the first display level between the first-level drawing layers, the drawing results of several first-level drawing layers and the updated drawing results of the target first-level drawing layer are superimposed to update the drawing.
[0097] The first display layer refers to the stacking order between different first-level drawing layers, which is determined by the occlusion relationship and reflects the global visual priority of the first-level drawing layer to which the primitive belongs in the entire drawing system.
[0098] Specifically, the current drawing results of all first-level drawing layers are obtained, including the updated drawing results of the target first-level drawing layer and the historical drawing results of other first-level drawing layers. These current drawing results are then sequentially overlaid based on the first display level between the first-level drawing layers to ultimately generate a complete drawing. For example, the interactive control layer prioritizes overlaying the interface information layer, which in turn overlays the operation assistance layer, and so on. All graphic elements will be displayed correctly according to their occlusion relationships. After overlaying, the drawing status is updated synchronously to reflect the latest changes in graphic units and hierarchical relationships. Here, "drawing" refers to the CAD software user interface or the output graphic result, which is the complete image generated by overlaying the drawing results of all first-level drawing layers according to the first display level.
[0099] In some embodiments, multiple first-level drawing layers are preset according to preset layering rules. When there are no graphics units in a first-level drawing layer, the corresponding first-level drawing layer does not participate in drawing.
[0100] It should be understood that, according to the embodiments of this application, several first-level drawing layers are initially divided according to the display hierarchy, and the first display hierarchy between the first-level drawing layers forms an overall stacking order constraint; the display hierarchy relationship is further refined in each first-level drawing layer, and second-level drawing layers with shared buffers are divided. According to the second display hierarchy of several second-level drawing layers in the same first-level drawing layer and the third display hierarchy between graphics units in the same second-level drawing layer, multiple graphics unit drawing order constraints are formed.
[0101] When a graphics unit changes, the target first-level drawing layer is quickly located and the initial redrawing range is defined based on hierarchical relationships. Each first-level drawing layer is equipped with an independent buffer, ensuring that redrawing a specific layer locally does not interfere with other layers. Furthermore, change analysis precisely locates specific graphics units, determining the areas within the redrawing range that actually require local refresh. The remaining areas can reuse historical drawing results, refining the redrawing computation to a minimum while sharing a buffer. The redrawing order strictly follows a preset three-level display rule to ensure that the drawing results always satisfy stacking order constraints and drawing order constraints, ensuring that higher-level elements always cover lower-level elements. This effectively avoids visual logic confusion such as graphic element occlusion and display sequence reversal that may result from local refreshes. In other words, this embodiment provides a feasible basis for local refreshes through multi-level display layer constraints, enabling precise local redrawing in complex graphics scenes while improving visual consistency and display accuracy.
[0102] In some embodiments, each buffer of the first-level drawing layer is provided with display attributes; the method further includes: drawing a plurality of graphics units in the corresponding first-level drawing layer according to the display attributes of the buffer.
[0103] Specifically, display attributes refer to a set of parameters used to control the drawing effect of graphics units, including transparency, blending mode, visibility, color overlay rules, etc. Each first-level drawing layer has a buffer with uniform display attributes, which improves the consistency of visual presentation and functional adaptability between layers.
[0104] Please see Figures 7 to 8 , Figure 7 This is a schematic diagram illustrating different display attributes of a buffer provided in an embodiment of this application; Figure 8 This is a schematic diagram illustrating different display attributes of a buffer provided in an embodiment of this application. For example... Figure 7 As shown, display properties include anti-aliasing. Anti-aliasing is used to smooth the graphics units in the display buffer, improving visual effects while increasing system overhead. The two images on the left illustrate the effect of anti-aliasing being enabled, and the two images on the right illustrate the effect of anti-aliasing being disabled. Figure 8 As shown, the display properties include the transparency property, which is used to draw semi-transparent entities. Enabling it can also improve the visual effect, but it increases system overhead. The image on the left shows the effect of enabling semi-transparency, and the image on the right shows the effect of disabling semi-transparency.
[0105] In some embodiments, the display properties of the buffer can be controlled by corresponding switches in the graphics engine. Primitives on the buffer are automatically drawn using the corresponding properties during drawing.
[0106] In some embodiments, the size of all buffers is the same as the display window size of the current drawing. The CAD software can predefine the relationship between graphic units and each drawing layer according to preset layering rules. The first-level drawing layer and the buffer are in one-to-one correspondence. When drawing each graphic element, it will be automatically drawn onto the corresponding buffer.
[0107] In some embodiments, several primary drawing layers and a buffer for each primary drawing layer are established. The buffer is used to store the drawing results of several graphics units in the corresponding primary drawing layer. When a graphics unit changes, the target primary drawing layer to which the changed graphics unit belongs is determined. Several graphics units in the target primary drawing layer are redrawn to update the drawing results of the target primary drawing layer. Based on the first display layer between the primary drawing layers, the drawing results of several primary drawing layers and the updated drawing results of the target primary drawing layer are superimposed to update the drawing. Detailed implementation methods can be found in the foregoing embodiments and will not be repeated here.
[0108] In some embodiments, the rendering overhead of each secondary rendering layer is calculated; when the rendering overhead exceeds a preset rendering overhead, the corresponding secondary rendering layer is designated as a saturated rendering layer; a new backup rendering layer is added, and some graphics units in the saturated rendering layer are moved to the backup rendering layer; wherein, the backup rendering layer has the same second display level as the saturated rendering layer. It should be understood that real-time monitoring of the rendering pressure of each layer, automatic splitting of overloaded layers, and the backup layer having the same display level as the original layer effectively prevent overall performance degradation due to overload of a single layer, without altering the graphics logic.
[0109] Please see Figure 9 , Figure 9 This is a schematic block diagram illustrating the structure of a computer device according to an embodiment of this application. The computer device may be a terminal device or a server.
[0110] For example, the above method can be implemented as a computer program, which can be used in, for example... Figure 9 It runs on the computer device shown.
[0111] like Figure 9 As shown, the computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.
[0112] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any layered rendering method.
[0113] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0114] Internal memory provides an environment for the execution of computer programs in non-volatile storage media. When the computer program is executed by the processor, it enables the processor to perform any layered rendering method.
[0115] This network interface is used for network communication, such as sending assigned tasks.
[0116] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0117] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps: S1, establish several first-level drawing layers and a buffer for each of the first-level drawing layers, wherein each first-level drawing layer includes several second-level drawing layers, and several second-level drawing layers within the same first-level drawing layer share the same buffer; the buffer is used to store the drawing results of several graphics units in the corresponding first-level drawing layer; S2, When a graphics unit changes, determine the target first-level drawing layer to which the changed graphics unit belongs; S3, based on the second display layer between the secondary drawing layers and the third display layer within the secondary drawing layer, determine the drawing order of the graphics units; based on the drawing order, redraw several graphics units in the target primary drawing layer to update the drawing result of the target primary drawing layer; S4, based on the first display level between the first-level drawing layers, the drawing results of several first-level drawing layers and the updated drawing results of the target first-level drawing layer are superimposed to update the drawing.
[0118] In some embodiments, when implementing step S2, the processor is further configured to: when the graphics unit is changed to a newly created graphics unit, classify the changed graphics unit to the corresponding target first-level drawing layer based on a preset layering rule; or, when the graphics unit is changed to an existing graphics unit, use the first-level drawing layer where the changed graphics unit is currently located as the target first-level drawing layer.
[0119] In some embodiments, the processor is further configured to: divide a number of graphics units in the first-level drawing layer into corresponding second-level drawing layers based on a preset layering rule.
[0120] In some embodiments, the drawing order includes a global drawing order. When implementing step S3, the processor is further configured to: determine a global drawing order among several graphics units in the target primary drawing layer based on a second display layer between the secondary drawing layers and a third display layer within the secondary drawing layer; and redraw several graphics units in the target primary drawing layer sequentially based on the global drawing order to update the drawing result of the target primary drawing layer.
[0121] In some embodiments, the drawing order includes a local drawing order. When implementing step S3, the processor is further configured to: call the historical drawing results of the target first-level drawing layer; determine the target area that needs to be redrawn in the historical drawing results based on the position of the changed graphics unit, wherein there is at least one redrawing graphics unit in the target area; obtain the target second-level drawing layer to which at least one of the redrawing graphics units belongs; determine the local drawing order between the redrawing graphics units based on the second display layer between the target second-level drawing layers and the third display layer inside the target second-level drawing layer; and redraw the redrawing graphics units sequentially based on the local drawing order to update the drawing results of the target area.
[0122] In some embodiments, when implementing step S3, the processor is further configured to: generate a minimum rectangular frame surrounding the modified graphic unit based on the modified graphic unit, and take the area divided by the minimum rectangular frame as the target area; determine a plurality of associated graphic units that are located within the target area and / or intersect with the target area; and take the modified graphic unit and the plurality of associated graphic units as the redrawing graphic unit.
[0123] In some embodiments, the secondary rendering layer includes a preset auxiliary secondary rendering layer and several ordinary secondary rendering layers, wherein the display level of the auxiliary secondary rendering layer is higher than the display level of the several ordinary secondary rendering layers; when implementing step S3, the processor is further configured to: move the changing graphics unit from its respective ordinary secondary rendering layer to the auxiliary secondary rendering layer, and execute step S3; when the changing graphics unit stops changing, reassign the changing graphics unit from the auxiliary secondary rendering layer to its original ordinary secondary rendering layer, and execute step S3.
[0124] In some embodiments, each buffer of the first-level drawing layer is provided with display attributes; the processor is further configured to: draw a plurality of graphics units in the corresponding first-level drawing layer according to the display attributes of the buffer.
[0125] For example, the processor is used to run a computer program stored in the memory, and is also used to implement the steps of the layered drawing method provided in any embodiment of this application, which will not be repeated here.
[0126] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement the steps of any of the layered drawing methods provided in the embodiments of this application.
[0127] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0128] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A layered drawing method, characterized in that, The method includes: Establish several first-level drawing layers and a buffer for each of the first-level drawing layers, wherein the buffer is used to store the drawing results of several graphics units in the corresponding first-level drawing layer; When a graphics unit changes, determine the target first-level drawing layer to which the changed graphics unit belongs; Redraw several graphics units in the target first-level rendering layer to update the rendering result of the target first-level rendering layer; Based on the first display layer between the first-level drawing layers, the drawing results of several first-level drawing layers and the updated drawing results of the target first-level drawing layer are superimposed to update the drawing; The method further includes: Based on the functional characteristics of different software and the usage requirements of graphics units, preset layering rules for the first-level drawing layer are set in advance; the affiliation relationship between different graphics units and each first-level drawing layer is determined according to the preset layering rules, and various graphics units generated during the software usage process are assigned to the corresponding layers.
2. The method as described in claim 1, characterized in that, The method further includes: Based on the functional characteristics of different software and the usage requirements of graphics units, preset layering rules for the second-level drawing layer are set in advance. When the number of graphics units in the first-level rendering layer exceeds a preset number, the hierarchical structure of the second-level rendering layer is triggered, including: Based on preset layering rules, several graphics units in the first-level drawing layer are divided into corresponding second-level drawing layers; wherein, several second-level drawing layers within the same first-level drawing layer share the same buffer.
3. The method as described in claim 2, characterized in that, The method includes: The drawing order of the graphics units is determined based on the second display layer between the two secondary drawing layers and the third display layer within the two secondary drawing layers; Based on the drawing order, several graphic units in the target first-level drawing layer are redrawn to update the drawing results of the target first-level drawing layer.
4. The method as described in claim 3, characterized in that, The two-level drawing layers are distinguished by index values. Entities between the two-level drawing layers are drawn from bottom to top according to the layer index values, and primitives within the two-level drawing layers are drawn from bottom to top according to the actual drawing order.
5. The method as described in claim 1, characterized in that, The order of drawing within the first-level drawing layer is determined by the order in which the graphics units are generated.
6. The method as described in claim 1, characterized in that, The method further includes: When a new graphic unit is created, based on preset layering rules, the changed graphic unit is assigned to the corresponding target first-level drawing layer; or, When a graphics unit is changed to an existing graphics unit, the current first-level drawing layer of the changed graphics unit is taken as the target first-level drawing layer.
7. The method as described in claim 1, characterized in that, The method further includes: Get the current rendering results of all first-level rendering layers, including the updated rendering results of the target first-level rendering layer and the historical rendering results of other first-level rendering layers; The current drawing results are superimposed sequentially based on the first display layer between the first-level drawing layers.
8. The method as described in claim 1, characterized in that, Each of the first-level drawing layers has a buffer with display attributes; the method further includes: drawing a number of graphic units in the corresponding first-level drawing layer according to the display attributes of the buffer.
9. A computer device, characterized in that, The device includes: Memory, used to store computer programs; A processor for executing the computer program and, in executing the computer program, implementing the layered rendering method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the layered rendering method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Two dimension situation map forming method and electronic equipment
CN106780659A
Display superposition method based on double buffering
CN109582409A