A layered drawing method, computer device and storage medium

By establishing a hierarchical structure of primary and secondary drawing layers in engineering drawings, and using display levels and occlusion relationships to determine the drawing order, the problem of low efficiency in hierarchical loading of graphic units in complex engineering drawings is solved, and efficient local refresh and visual consistency are achieved.

CN120318368BActive Publication Date: 2025-09-30SUZHOU CAD SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510796523.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-16
Publication Date
2025-09-30
Estimated Expiration
2045-06-16

AI Technical Summary

Technical Problem

Existing technologies have difficulty in efficiently handling the hierarchical loading of graphic units in complex engineering drawings, resulting in high computational overhead and limited actual optimization effects, which cannot meet the increasingly complex requirements of engineering drawings.

Method used

A layered drawing method is adopted. By establishing several first-level drawing layers and second-level drawing layers, the buffer is used to store the drawing results of the graphics units, and the drawing order is determined according to the display level and occlusion relationship to achieve local refresh and precise positioning, avoiding full redrawing.

Benefits of technology

It improves graphics drawing efficiency and visual consistency, reduces computational overhead, and ensures efficient local refresh and display accuracy in complex graphics scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318368B_ABST
    Figure CN120318368B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer graphics, and in particular to a layered drawing method, computer device, and storage medium. The method includes: establishing several first-level drawing layers and corresponding buffers, wherein the first-level drawing layer includes several second-level drawing layers that share the same buffer; when a graphic unit changes, determining the target first-level drawing layer to which the changed graphic unit belongs; determining the drawing order of the graphic units based on the second display level between the second-level drawing layers and the third display level within the second-level drawing layer; redrawing several graphic units in the target first-level drawing layer based on the drawing order to update the drawing result of the target first-level drawing layer; and superimposing the drawing results of several first-level drawing layers and the updated drawing result of the target first-level drawing layer based on the first display level between the first-level drawing layers to update the drawing. This method realizes precise local redrawing and improves visual consistency and display accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer graphics, and in particular to a layered rendering method, a computer device, and a storage medium. Background Art

[0002] As the scale of engineering projects continues to expand, the complexity of drawings in Computer Aided Design (CAD) systems also increases accordingly, and the overhead of loading drawings also increases accordingly. The current common strategy is to separate the drawing elements according to static and dynamic properties to reduce computational overhead.

[0003] For example, an invention patent application with patent application publication number CN106780659A discloses a method for generating a two-dimensional situation map and an electronic device, the method comprising: establishing an icon drawing layer, wherein the icon drawing layer comprises 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 combination with a geographic information image, and saving them in a static graphic buffer; drawing dynamic graphic elements in the dynamic graphic element drawing layer at a preset time interval, and saving them in a dynamic graphic buffer; obtaining a two-dimensional situation map based on the first data in the static graphic buffer and the second data in the dynamic graphic buffer.

[0004] For another example, the invention patent application with the patent application publication number CN109582409A discloses a display overlay method based on double buffering, in which two frame buffers are created in the memory, and the display driver reads information from the two buffers alternately. When reading information 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 interactive 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 interactive control layer and the dynamic image layer respectively; using independent threads to draw the UI interactive control layer and the dynamic image layer respectively; and using a hardware accelerator to mix and overlay the drawn UI interactive control layer and the dynamic image layer to obtain the image to be displayed.

[0005] However, the current hierarchical loading of graphic units is difficult to cope with the increasingly complex requirements of engineering drawings, and the actual optimization effect is limited and the practicality is low. Summary of the Invention

[0006] The main purpose of this application is to provide a layered rendering method, computer device and storage medium. In order to solve the above-mentioned technical problems, this application specifically adopts the following technical solutions:

[0007] A first aspect of the present application is to provide a layered rendering method, the method comprising:

[0008] S1, establishing a plurality of primary drawing layers and a buffer for each of the primary drawing layers, wherein the primary drawing layer includes a plurality of secondary drawing layers, and the plurality of secondary drawing layers within the same primary drawing layer share the same buffer; the buffer is used to store drawing results of a plurality of graphic units in the corresponding primary drawing layer;

[0009] S2, when a graphic unit is changed, determining the target primary drawing layer to which the changed graphic unit belongs;

[0010] S3, determining a drawing order of graphic units based on a second display layer between the secondary drawing layers and a third display layer within the secondary drawing layer; and redrawing a plurality of graphic units in the target primary drawing layer based on the drawing order to update a drawing result of the target primary drawing layer;

[0011] S4 , based on the first display level between the first-level drawing layers, superimpose the drawing results of the plurality of first-level drawing layers and the updated drawing result of the target first-level drawing layer to update the drawing.

[0012] In some embodiments, S2 further includes: when the changed graphic unit is a newly created graphic unit, based on a preset layering rule, dividing the changed graphic unit into a corresponding target first-level drawing layer; or, when the changed graphic unit is an existing graphic unit, using the first-level drawing layer in which the changed graphic unit is currently located as the target first-level drawing layer.

[0013] In some embodiments, the method further includes: dividing a plurality of graphic units in the primary drawing layer into corresponding secondary drawing layers based on a preset layering rule.

[0014] In some embodiments, the drawing order includes a global drawing order, and S3 includes: determining a global drawing order between the plurality of graphic units in the target primary drawing layer based on a second display level between the secondary drawing layers and a third display level within the secondary drawing layer; and redrawing the plurality of graphic units in the target primary drawing layer in sequence based on the global drawing order to update a drawing result of the target primary drawing layer.

[0015] 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 based on the position of the changed graphic unit, and there is at least one redrawing graphic unit in the target area; obtaining the target second-level drawing layer to which at least one redrawing graphic unit belongs; 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, determining the local drawing order between the redrawing graphic units; based on the local drawing order, redrawing the redrawing graphic units in sequence to update the drawing result of the target area.

[0016] In some embodiments, the S3 includes: generating a minimum rectangular frame surrounding the changed graphic unit based on the changed graphic unit, and taking the area divided by the minimum rectangular frame as the target area; determining a number of associated graphic units that are within the target area and / or intersect with the target area; and taking the changed graphic unit and the several associated graphic units as the redrawing graphic units.

[0017] In some embodiments, the secondary drawing layer includes a preset auxiliary secondary drawing layer and several ordinary secondary drawing layers, and the display level of the auxiliary secondary drawing layer is higher than the display levels of the several ordinary secondary drawing layers. S3 further includes: transferring the changed graphic unit from the ordinary secondary drawing layer to which it belongs to, and executing step S3; when the changed graphic unit stops changing, reallocating the changed graphic unit from the auxiliary secondary drawing layer to the ordinary secondary drawing layer to which it originally belonged, and executing step S3.

[0018] In some embodiments, the buffer of each primary drawing layer is set with display attributes; the method further comprises: drawing a plurality of graphic units in the corresponding primary drawing layer according to the display attributes of the buffer.

[0019] A second aspect of the present application is to provide a computer device, the device comprising:

[0020] memory for storing computer programs;

[0021] A processor is used to execute the computer program and implement the steps of the layered rendering method provided in any embodiment of the present application when executing the computer program.

[0022] The third aspect of the present application is to provide a corresponding computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor performs the steps of the layered drawing method provided in any embodiment of the present application.

[0023] Beneficial effects:

[0024] The embodiments of the present application provide a layered drawing method, a computer device, and a storage medium, and specifically provide an efficient local refresh strategy based on hierarchical constraints. By nesting a hierarchical structure, a feasibility basis is provided for local refresh and strict constraints are established, thereby achieving precisely positioned local redrawing in complex graphic scenes, while improving the visual consistency and display accuracy in this process.

[0025] Specifically, 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 within each first-level drawing layer, and the second-level drawing layers of the shared buffer are divided. Drawing order constraints for multiple graphics units are formed 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.

[0026] When a graphic unit changes, the target first-level drawing layer is quickly located based on the hierarchical affiliation and the initial redraw range is delineated. Each first-level drawing layer is equipped with an independent buffer so that local redrawing of a specific layer will not interfere with the content of other layers. Furthermore, through change analysis, specific graphic units are accurately locked to determine the areas in the redraw range that actually require local refresh. The rest can reuse historical drawing results, and the redraw calculation amount is refined to the minimum range based on the shared buffer. Among them, the redrawing order strictly follows the preset three-level display rules, so that the drawing results always meet the stacking order constraints and drawing order constraints, so that high-level elements always cover low-level elements, and effectively avoid visual logic confusion such as occlusion of graphic elements and reversed display timing that may be caused by local refresh.

[0027] Furthermore, a dynamic hierarchical transition mechanism is introduced for continuous interactive scenarios, allowing specific graphics to break through the strict hierarchical constraints of the second and third display levels, and temporarily elevate elements in operations such as dragging to a dedicated high-level level for independent refresh, which not only improves the visibility of the operation but also avoids repeated redrawing of the bottom layer. After the operation is completed, it intelligently resets and triggers a global update. During this process, only the first display level maintains key occlusion relationships, so as to improve drawing efficiency in complex scenarios while taking into account the user's visual experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the embodiments or the description of the prior art. In all drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the various elements or parts are not necessarily drawn according to the actual scale. Obviously, the drawings described below are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without paying any creative work.

[0029] Figure 1 is a schematic diagram of a drawing scene provided in an embodiment of the present application;

[0030] Figure 2 is a schematic flow chart of a layered rendering method provided in an embodiment of the present application;

[0031] Figure 3 This is a schematic diagram of a primary drawing layer provided in an embodiment of the present application;

[0032] Figure 4 is a schematic diagram of another drawing scene provided in an embodiment of the present application;

[0033] Figure 5 is a schematic diagram of a secondary drawing layer provided in an embodiment of the present application;

[0034] Figure 6 is a schematic diagram of another drawing scene provided in an embodiment of the present application;

[0035] Figure 7 is a schematic diagram of different display attributes of a buffer zone provided by an embodiment of the present application;

[0036] Figure 8 This is a schematic diagram of another buffer zone with different display attributes provided by an embodiment of the present application;

[0037] Figure 9 This is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] To make the purpose, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0039] Herein, suffixes such as "module," "component," or "unit" used to represent elements are only used to facilitate the description of the present application and have no specific meaning. Therefore, "module," "component," or "unit" can be used interchangeably.

[0040] As used herein, terms such as "upper," "lower," "inner," "outer," "front," "back," "one end," and "the other end" indicate positions or locations based on those shown in the accompanying drawings. These terms are intended solely to facilitate the description of this application and simplify the description. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate 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.

[0041] As used herein, unless otherwise expressly specified or limited, the terms "installed," "provided with," "connected," etc., should be understood broadly. For example, "connected" may refer to a fixed connection, a detachable connection, or an integral connection; it may refer to a mechanical connection, a direct connection, an indirect connection through an intermediate medium, or internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in this application.

[0042] As used herein, "and / or" includes any and all combinations of one or more of the associated listed items.

[0043] Herein, "plurality" means two or more than two, ie, it includes two, three, four, five, etc.

[0044] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0045] Modern engineering projects are becoming increasingly complex, requiring drawings to include more specialized details, such as multi-disciplinary integrated design in architecture and precise assembly relationships in machinery. At the same time, CAD system functionality continues to upgrade, supporting advanced analysis such as 3D modeling and simulation, significantly improving design quality. However, this also brings larger amounts of data and higher computing requirements, further exacerbating the complexity of drawings. This directly leads to increased drawing loading time and consumption of computing resources. Currently, the optimization strategy is to separate the drawing elements 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 the frequently changing dynamic parts are updated in real time, in order to reduce unnecessary repeated calculations.

[0046] However, this categorized drawing method is overly simplistic and crude in practical applications. As drawings continue to become more complex and interaction modes diversify, the proportion of graphics elements with dynamic properties has significantly surpassed that of those with purely static properties. Even redrawing only dynamic graphics elements still incurs significant computational overhead. Furthermore, the relationships between graphics elements have become increasingly complex, increasing the difficulty and computational overhead of localized drawing. Consequently, the current hierarchical loading of graphics elements is unable to cope with the increasingly complex demands of engineering drawings, severely limiting the actual performance improvements.

[0047] Based on this, the embodiments of the present application provide a layered drawing method, a computer device and a storage medium, and specifically provide an efficient local refresh strategy based on hierarchical constraints. By nesting the hierarchical structure, a feasibility basis is provided for local refresh and strict constraints are established, thereby realizing precise positioning of local redrawing in complex graphic scenes, while improving the visual consistency and display accuracy in this process.

[0048] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.

[0049] In this article, the drawing can be a CAD drawing, and the format of the drawing can be dwg format, dxf format, dwt format, etc. It can also be a proe drawing, SolidWorks drawing, etc., which is not limited here.

[0050] In this article, graphic units refer to the various basic elements in the drawing, which can also be referred to as 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 output and are part of the final output drawing. They include but are not limited to geometric shapes such as points, lines, circles, arcs, polygons, as well as dimension annotations and text descriptions; auxiliary graphic units, which are temporary, non-persistent interface elements or auxiliary tools generated by the user when operating CAD software. These graphic units are mainly used to improve the visibility and accuracy of the drawing process, but will not be retained in the final drawing. They include but are not limited to cursors, selection boxes, coordinate systems, grids, alignment guides, etc.

[0051] See also Figure 1 , Figure 1 This is a schematic diagram of a drawing scene provided by an embodiment of the present application. Figure 1 As shown, in a CAD software drawing scene, there are a first composite entity 10, a second composite entity 20, and a third composite entity 30, each composed of at least one primitive. The first composite entity 10 is a circular primitive being adjusted, 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 composite entity 20 is a user-drawn custom graphic, including basic graphic units such as circles, polygons, and dimensioning; and the third composite entity 30 is a coordinate system icon, an auxiliary graphic unit that indicates coordinate direction.

[0052] See also Figure 2 , Figure 2 This is a schematic flow chart of a layered rendering method provided in an embodiment of the present application. Figure 2 As shown, an embodiment of the present application provides a layered rendering method, which includes S1 to S4.

[0053] S1. Establishing a plurality of primary drawing layers and a buffer for each of the primary drawing layers. The primary drawing layer includes a plurality of secondary drawing layers, and the secondary drawing layers within the same primary drawing layer share a common buffer. The buffer is used to store drawing results of a plurality of graphics units in the corresponding primary drawing layer.

[0054] Among them, the first-level drawing layer is a macro-hierarchical structure that is physically divided based on the functional attributes of the graphics elements. Each first-level drawing layer is physically isolated through an independent buffer, which is used to store the drawing results of all graphics units in the layer. At the same time, the stacking order between 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.

[0055] Furthermore, the secondary drawing layer is a hierarchical structure further subdivided within the primary drawing layer, logically divided based on the functional attributes of the primitives. Secondary drawing layers within the same primary drawing layer share the primary drawing layer's buffer, with only logical division. Furthermore, the stacking order between secondary drawing 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 primary drawing layer clarifies the macroscopic visual hierarchy, the secondary drawing layer can further refine the local order, and within the secondary drawing layer, the drawing order (i.e., the third display layer) is determined by the generation time of the graphic units.

[0056] In some embodiments, the layering rules for the first-level drawing layer and the second-level drawing layer (i.e., preset layering rules) can be pre-set based on the functional characteristics of different CAD software and the usage requirements of the graphic units, and then the affiliation of different graphic units with each first-level drawing layer and second-level drawing layer can be determined based on the preset layering rules, so as to quickly allocate various graphic units generated during the use of the CAD software (such as graphic units drawn by the user, graphic units that come with the software functions or automatically generated in response to user operations, etc.) to the corresponding levels, 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.

[0057] For example, see Figure 3 , Figure 3 This is a schematic diagram of a primary drawing layer provided in an embodiment of the present application. Figure 1 The multiple composite entities in the can be assigned to the corresponding primary drawing layer 100 according to their functional attributes, such as Figure 3 As shown, the specific hierarchical structure, in descending order of priority, includes the interactive control layer 101, the interface information layer 102, the operation assistance layer 103, the main drawing layer 104, and the background reference layer 105. The interactive control layer 101 hosts graphical elements with which the user directly interacts (such as cursors, selection boxes, and drag prompts) and must always be at the top level to enhance operational visibility. The interface information layer 102 displays information directly related to the software interface (such as the coordinate system, status bar, scale, and view navigation tools) and must remain visible. The operation assistance layer 103 stores temporary, non-persistent auxiliary graphical elements and must overlay the base graphical elements to reflect operational effects. The main drawing layer 104 hosts core basic graphical elements drawn by the user and supports subsequent operations (such as modification, grouping, and alignment). The background reference layer 105 serves as background elements (such as grids and guides), providing a drawing baseline and allowing them to be obscured by all other elements.

[0058] like Figure 3As shown, the background reference layer 105 is at the lowest display level, providing a drawing baseline while avoiding obstruction of the drawing content. The main drawing layer 104, serving as the core drawing area, carries the user's basic graphical elements (e.g., circular graphical element 10c and second composite entity 20). It is positioned lower in the visual hierarchy, allowing subsequently generated auxiliary graphical elements to be overlaid on top. Furthermore, auxiliary graphical elements 10b (e.g., grips, highlighting tips, adjustment preview circles, etc.) generated when the user modifies the circular basic graphical element are assigned to the operation assistance layer 103, located above the main drawing layer 104. This allows these elements to overlay the basic graphical elements, clarifying the objects and effects of user operations.

[0059] Furthermore, the graphics elements in the interface information layer 102 must remain visible at all times to assist users in understanding the current operating environment. For example, if the coordinate system icon is obscured by other graphics elements, it will be difficult for users to determine the drawing direction or scale. Therefore, the interface information layer 102 is placed below the interactive control layer 101 and above the operation assistance layer 103. This maintains the display priority of the interface information while avoiding interference with directly interactive elements. The interactive control layer 101 is responsible for presenting components such as the cursor 10a that directly interact with the user. To meet the real-time and dynamic requirements of user interaction, the interactive control layer 101 must always be at the top layer, ensuring that the cursor 10a or other interactive elements (such as selection boxes and drag prompts) are not obscured by other graphics elements.

[0060] It can be seen that the cursor 10a, the circular basic graphic unit 10c, and the multiple auxiliary graphic units 10b generated when the user modifies the circular basic graphic unit in the first combined entity 10 are allocated to the corresponding primary drawing layer according to functional attributes and occlusion relationships.

[0061] For example, the layering method and / or number of the first-level drawing layer can be modified based on the original layering logic, such as dynamically adding new first-level drawing layers and deleting old first-level drawing layers to flexibly adapt to functional requirements. For example, see Figure 4 , Figure 4 This is a schematic diagram of another drawing scene provided by an embodiment of the present application, such as Figure 4 As shown in the figure, some CAD software has a special function of a magnifying glass, which is used to temporarily magnify a local area in the drawing to observe or edit details. In this case, based on the aforementioned layered structure, a base layer can be added below the background reference layer, and the view before magnification can be cached in the base layer for display, such as Figure 4 The area outside the circular, white magnified area is displayed. A mask layer is superimposed on top of the operation assistance layer, with semi-transparent gray graphics elements to cover non-critical content outside the circular, white magnified area. It should be noted that the hierarchical structure within the magnified area is exactly the same as the original hierarchical structure, but the display range is limited to the circular area.

[0062] It should be understood that this not only preserves the integrity of the original hierarchical logic, but also achieves functional expansion through dynamic updating of the hierarchical division. Moreover, when the user completes the operation, the base layer and the cover layer can be removed or hidden, restoring the original hierarchical structure, thus avoiding redundant resource usage.

[0063] For example, see Figure 5 , Figure 5 is a schematic diagram of a secondary drawing layer provided in an embodiment of the present application. Figure 3 The plurality of auxiliary graphic units 10b in the operation auxiliary layer 103 can be allocated 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 to modify its radius. The hierarchical structure, in descending order of priority, includes a high-level layer 201, an upper-middle layer 202, a middle layer 203, and a low-level layer 204. The multiple auxiliary graphic elements 10b can include grips, blue circles, radius lengths, and adjustment preview circles. The grips are assigned to the high-level layer 201 for priority display and real-time feedback on user actions. The blue circle, indicating the selected circular element, is located in the upper-middle layer 202. The radius length is schematically indicated as being placed in the middle layer 203. The adjustment preview circle is assigned to the low-level layer 204.

[0064] In some embodiments, the secondary drawing layers can be distinguished by index values, and entities between the secondary drawing layers are drawn strictly from bottom to top according to the layered index values, and the primitives within the secondary drawing layers are drawn from bottom to top according to the actual drawing order. For example, Figure 5 The index values ​​of the four secondary drawing layers in the drawing are 90 to 93 from bottom to top. The lower layer 204, with an index value of 90, first draws a straight line from the center of the circle to the cursor position, and then draws a preview of the circle after the radius property is modified, i.e., the adjusted preview circle. The middle layer 203, with an index value of 91, draws a set of dashed lines representing the radius value of the circle, i.e., the radius length. The upper-middle layer 202, with an index value of 92, draws a blue ring indicating the selected state of the circle. The upper layer 201, with an index value of 93, draws a set of blue or red squares (i.e., grips) indicating the vertices of the circle that can be dragged and edited. When drawing the operation auxiliary layer 103, the drawing is carried out in the order of the index values ​​from 90 to 93.

[0065] It should be noted that the hierarchical rules and number of levels for the primary and secondary drawing layers can be flexibly determined based on the functional characteristics of different CAD software and the usage requirements of graphic units, and are not limited to the above examples. For example, in some CAD software, if the selected state of a design element is the display subject during the modification process of a graphic unit, the blue ring will be assigned to the upper layer; for another example, in some CAD software, if there is no visual cue element for the selected state of a design element, the upper-middle layer 202 may not be set. In addition, the higher the display level, the later the drawing order is to avoid obstruction of graphics elements in higher display levels.

[0066] It should be understood that the division of the drawing layer incorporates the dual constraints of functional attributes and occlusion relationships, which not only ensures the logical independence between graphics elements, but also maintains the orderly control of the visual hierarchy. First, graphics elements with the same macro functions are classified into the same first-level drawing layer and share a buffer. Physical isolation is used to avoid data interference between layers. For example, the graphics elements in the interface information layer are only used to display interface information, and the graphics elements in the interactive control layer are only used to respond to user operations, avoiding drawing conflicts or logical errors caused by mixed functions, and ensuring the stability of software operation during local refreshes. Secondly, each first-level drawing layer can be further divided into multiple second-level drawing layers to refine the visual hierarchy and control the stacking order of graphics elements under the same functional category. In addition, the second-level drawing layer is a logical division, which supports flexible expansion in quantity without increasing the resource overhead of the buffer.

[0067] This layered structure provides the foundation for local refreshes. When a primitive within a primary drawing layer changes, only the buffer contents of that layer need to be updated, without redrawing other primary drawing layers. This allows for 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 remaining primary drawing layers remain stable, effectively improving drawing efficiency and system responsiveness.

[0068] On this basis, through the step-by-step control of the first display layer between primary drawing layers, the second display layer between secondary drawing layers, and the third display layer within the secondary drawing layer, the stacking order between graphic elements is further refined, visual consistency is improved, and confusion in graphic occlusion or display timing is avoided. For example, in the operation auxiliary layer, auxiliary graphic elements such as grip points and highlight circles are precisely controlled for occlusion according to the drawing order of the secondary drawing layer. At the same time, because the primary drawing layer to which they belong has a higher display priority, these auxiliary graphic elements are always covered on the main drawing layer, avoiding occlusion by the underlying basic graphic elements.

[0069] 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 separate buffer for each primitive, and ensures the accuracy and visual consistency of local refresh through strict hierarchical constraints, thereby enabling CAD software to achieve efficient and orderly graphics management in complex scenarios.

[0070] In some embodiments, the method further includes: dividing the plurality of graphic units into corresponding first-level drawing layers based on a preset layering rule.

[0071] In some embodiments, several graphics units in the primary drawing layer are divided into corresponding secondary drawing layers. Specifically, based on preset layering rules, several graphics units in the primary drawing layer or modified graphics units in the target primary drawing layer are further divided into corresponding secondary drawing layers. It should be understood that the secondary drawing layers share the primary drawing layer's buffers and are visually distinguished only by the drawing order. This reduces the number of independent buffers and refines the hierarchical priority of graphics elements within the same functional category, thereby improving performance while optimizing visual consistency.

[0072] In some embodiments, when the number of graphic units within a primary drawing layer exceeds a preset number, the hierarchical structure of the secondary drawing layer is triggered, and several graphic units in the corresponding primary drawing layer are divided into corresponding secondary drawing layers. As a result, some primary drawing layers include several secondary drawing layers, while some graphic units within the primary drawing layer are temporarily not divided into secondary drawing layers. It should be understood that even if the entire primary drawing layer with fewer graphic units is redrawn, the workload is low, and the division into secondary drawing layers can be omitted to avoid excessive consumption of system resources. In this case, the drawing order within the primary drawing layer is determined by the generation time of the graphic units (i.e., the fourth display layer).

[0073] S2: When a graphic unit is changed, determining a target primary drawing layer to which the changed graphic unit belongs.

[0074] Specifically, a changed graphic unit refers to a graphic unit whose state is added, modified, or deleted during the graphic drawing or interaction process, and its change behavior will directly or indirectly affect the drawing result. When a change in a graphic unit is detected, the target first-level drawing layer to which it belongs is determined based on the functional properties 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 a grip point or highlight prompt), the target first-level drawing layer is the operation auxiliary layer; if it is basic drawing content (such as a circle or rectangle), the target first-level drawing layer is the main drawing layer.

[0075] It should be understood that the relationship between graphic units with different functional attributes and each first-level drawing layer and second-level drawing layer is determined according to the preset layering rules, and then the target first-level drawing layer to which the changed graphic unit belongs is determined, the physical buffer to be updated is accurately located, local refresh is achieved, and drawing efficiency is improved.

[0076] In some embodiments, S2 further includes: when the changed graphic unit is a newly created graphic unit, based on a preset layering rule, dividing the changed graphic unit into a corresponding target first-level drawing layer; or, when the changed graphic unit is an existing graphic unit, using the first-level drawing layer in which the changed graphic unit is currently located as the target first-level drawing layer.

[0077] Specifically, when the graphic unit is changed to a newly created graphic unit, it is divided into the corresponding target first-level drawing layer based on the preset layering rules. For example, the circle drawn by the user is classified into the main drawing layer, and the grip is classified into the operation auxiliary layer; when the graphic unit is changed to an existing graphic unit, its current first-level drawing layer is used as the target first-level drawing layer.

[0078] In some embodiments, when the changed graphic unit is a newly created graphic unit, after dividing the changed graphic unit into the corresponding target primary drawing layer, the method further includes dividing the changed graphic unit into the corresponding target secondary drawing layer based on a preset layering rule.

[0079] In some embodiments, when the changed graphic unit is an existing graphic unit, after setting the primary drawing layer where the changed graphic unit is currently located as the target primary drawing layer, the method further includes: setting the secondary drawing layer where the changed graphic unit is currently located as the target secondary drawing layer.

[0080] It should be understood that each graphic element in the drawing strictly belongs to a specific secondary drawing layer under a certain primary drawing layer, forming a dual constraint system of functional characteristics and occlusion relationships.

[0081] S3: Determine a drawing order of graphic units based on a second display layer between the secondary drawing layers and a third display layer within the secondary drawing layer; and redraw a plurality of graphic units in the target primary drawing layer based on the drawing order to update a drawing result of the target primary drawing layer.

[0082] The second display level is the stacking order between secondary drawing layers within the same primary drawing layer, determined by occlusion relationships. It controls the display priority of different graphics within the same functional category. The higher the second display level, the later the drawing order. Correspondingly, within the same secondary drawing layer, the third display level determines the drawing order based on the order of their creation time. Graphics with earlier draw times are drawn earlier, resulting in a localized visual stacking relationship.

[0083] The drawing order refers to the order in which the graphics elements are drawn one by one in the buffer, which will affect the hierarchical effect in the final display. The drawing order can be used to redraw the graphic units that need to be updated in the target first-level drawing layer in the correct order, avoiding the full refresh of all first-level drawing layers, thereby improving drawing efficiency while ensuring visual consistency.

[0084] Specifically, the drawing order between graphic units within the primary drawing layer is comprehensively determined based on the second display level between secondary drawing layers and the third display level within the secondary drawing layer. First, a preliminary first drawing order is determined for graphic units at different second display levels within the target primary drawing layer, whereby graphic units with lower second display levels are drawn first. Secondly, the graphic units within the secondary drawing layer are arranged in parallel in the first drawing order. The third display level within the secondary drawing layer further differentiates the second drawing order between multiple graphic units within the same secondary drawing layer, whereby graphic units with earlier generation times are drawn first. Ultimately, the drawing order is determined by combining the first drawing order between layers and the second drawing order within a layer.

[0085] like Figure 3 and Figure 5 As shown, if the operation assistance layer 103 is the target first-level drawing layer, the graphic units in the operation assistance layer 103 need to be redrawn to update the drawing results in the buffer of the operation assistance layer 103. At this time, since the second display level of the high-level layer 201 is higher than the second display level of the upper-middle layer 202, the blue circle needs to be drawn before the grip point. In the high-level layer 201, assuming that the blue grip point is generated before the red grip point, the third display level of the red grip point is higher than the third display level of the blue grip point, and the blue grip point needs to be drawn before the red grip point.

[0086] In some embodiments, the drawing order includes a global drawing order, and S3 includes: determining a global drawing order between the plurality of graphic units in the target primary drawing layer based on a second display level between the secondary drawing layers and a third display level within the secondary drawing layer; and redrawing the plurality of graphic units in the target primary drawing layer in sequence based on the global drawing order to update a drawing result of the target primary drawing layer.

[0087] The global drawing order refers to the drawing order of each graphic element in the target primary drawing layer, which is determined by combining the second display level between the secondary drawing layers and the third display level within the secondary drawing layer.

[0088] Exemplarily, the third drawing order of all graphic units within the primary drawing layer is preliminarily determined based on the second display level between each secondary drawing layer. Secondly, when multiple graphic units are in the same secondary drawing layer, these graphic units are in parallel order in the third drawing order. The fourth drawing order between multiple graphic units in the same secondary drawing layer is further distinguished based on the third display level within the secondary drawing layer, that is, the graphic units with earlier generation time are drawn first. Ultimately, the global drawing order can be determined by combining the third drawing order between layers and the fourth drawing order within a layer.

[0089] Based on the global drawing order, the graphics units within the target first-level drawing layer are redrawn one by one, rather than redrawing all the first-level drawing layers. This ensures visual consistency while reducing redundant calculations and improving drawing efficiency. As a result, the graphics elements in the buffer are overlaid layer by layer according to logical priority and time order, ultimately forming a correct overlay effect.

[0090] 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 based on the position of the changed graphic unit, and there is at least one redrawing graphic unit in the target area; obtaining the target second-level drawing layer to which at least one redrawing graphic unit belongs; 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, determining the local drawing order between the redrawing graphic units; based on the local drawing order, redrawing the redrawing graphic units in sequence to update the drawing result of the target area.

[0091] The historical drawing result refers to the complete graphics data of the target first-level drawing layer that was previously drawn, including the final display state of all graphics units within that first-level drawing layer, such as position, color, and shape. The historical drawing result is used as the basis for the current drawing, and only the drawing results of the target area are updated.

[0092] Specifically, the historical drawing results of the target first-level drawing layer are called, and then the target area where the drawing results need to be updated is determined based on the location of the changed graphic unit (such as position coordinates, geometric range), and the graphic units in the target area are determined as redrawn graphic units that need to be redrawn. Among them, the target area refers to the local range that needs to be updated due to the existence of the changed graphic unit, such as the area range that may be affected by the change of the preset changed graphic unit. The value of the specific area range can be flexibly set according to different scenarios and is not limited here. Correspondingly, the redrawn graphic unit refers to the graphic unit in the target area, including the changed graphic unit whose status has changed due to addition, modification or deletion, and other graphic units in the target area, such as graphic units in the area that partially or completely overlap with the changed graphic unit. These graphic units also need to be refreshed in conjunction to improve display accuracy.

[0093] Obtain the target secondary drawing layer to which the redrawing graphic unit belongs, and determine a local drawing order based on the second display level and / or the third display level. For example, if there are multiple redrawing graphic units belonging to different secondary drawing layers, the fifth drawing order of the multiple redrawing graphic units is preliminarily determined based on the second display level between the target secondary drawing layers, i.e., redrawing graphic units with lower display levels are drawn first. Furthermore, if there are multiple redrawing graphic units in the same target secondary drawing layer, these redrawing graphic units are arranged in parallel in the fifth drawing order. In this case, the sixth drawing order between the multiple redrawing graphic units in the same target secondary drawing layer is further differentiated based on the third display level within the target secondary drawing layer, i.e., redrawing graphic units with earlier generation times are drawn first. Ultimately, the local drawing order can be determined by combining the fifth drawing order between layers and the sixth drawing order within a layer.

[0094] In other words, the local drawing order refers to the order in which multiple redrawn graphical units are drawn, determined by combining the second display layer between the secondary drawing layers and the third display layer within the secondary drawing layer. This order redraws only the redrawn graphical units one by one, updating only the drawing results in the target area rather than refreshing the entire target primary drawing layer. This allows for partial reuse of historical drawing results from the target primary drawing layer, thereby ensuring visual consistency while reducing redundant calculations and improving redraw efficiency.

[0095] It should be understood that the first drawing order, the third drawing order, and the fifth drawing order in the embodiments of the present application are all constraints on the drawing order by the second display level between the secondary drawing layers, and the second drawing order, the fourth drawing order, and the sixth drawing order are all constraints on the drawing order by the third display level within the secondary drawing layer. The difference lies in that the graphic units constrained by the drawing order may be different. When the constrained graphic units are completely consistent, the first drawing order, the third drawing order, and the fifth drawing order are the same, and the second drawing order, the fourth drawing order, and the sixth drawing order are the same.

[0096] See also Figure 6 , Figure 6 This is a schematic diagram of another drawing scene provided by an embodiment of the present application. Figure 6 As shown, there are three composite entities within the target primary drawing layer, and these three composite entities belong to different secondary 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 changed graphic unit. 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 redrawing graphic units.

[0097] Furthermore, the secondary drawing layer of the text editing window and the coordinate system icon is used as the target secondary drawing layer. The coordinate system icon's second display level is higher than the text editing window's second display level. The text editing window also includes two graphic units: the positioning box and the text box. The text box's third display level is higher than the positioning box's third display level. In this case, the local drawing order, from first to last, is: positioning box, text box, coordinate system icon.

[0098] In some embodiments, the S3 includes: generating a minimum rectangular frame surrounding the changed graphic unit based on the changed graphic unit, and taking the area divided by the minimum rectangular frame as the target area; determining a number of associated graphic units that are within the target area and / or intersect with the target area; and taking the changed graphic unit and the several associated graphic units as the redrawing graphic units.

[0099] The minimum rectangular frame refers to the minimum covering rectangular area generated based on the geometric boundary of the changed graphic unit, and is used to define the scope of the target area.

[0100] The associated graphic unit refers to a graphic unit located in the target area or intersecting with the target area, and its display status may need to be synchronously updated due to the modification of the changed graphic unit.

[0101] Specifically, based on the position of the changed graphic unit, a minimum rectangular box enclosing the graphic unit is generated as the target area to be updated. Several associated graphic units within or intersecting the rectangular box are then identified, such as those that geometrically overlap or occlude the changed graphic unit. The changed graphic unit and its associated graphic units are then used together as the redrawn graphic units. A partial refresh mechanism is used to update only the graphic units within the target area, rather than fully redrawing the entire hierarchy, thus reducing redundant calculations.

[0102] In some embodiments, when a graphics unit becomes invalid (e.g., due to addition, deletion, or modification), it is identified as a changed graphics unit. The target primary drawing layer corresponding to the changed graphics unit is set to an invalid state, and the invalid target primary drawing layer is redrawn. All graphics units in the target primary drawing layer can be redrawn according to the global drawing order. Alternatively, a local refresh method can be used to retrieve the target area where the changed graphics unit is located. For example, the minimum rectangle surrounding the changed graphics unit can be used to approximate the intersecting redrawn graphics units, and these redrawn graphics units are redrawn in the target area of ​​the changed graphics unit according to the local drawing order.

[0103] The embodiment of the present application introduces a dynamic hierarchical transition mechanism for continuous interactive scenarios, allowing specific graphics elements to break through the strict hierarchical constraints of the second and third display levels, and temporarily elevating elements in operations such as dragging to a dedicated high-level level for independent refresh, thereby improving the visibility of the operation and avoiding repeated redrawing of the bottom layer. After the operation is completed, it intelligently resets and triggers a global update. During this process, only the first display level maintains key occlusion relationships, so as to improve drawing efficiency in complex scenarios while taking into account the user's visual experience.

[0104] In some embodiments, the secondary drawing layer includes a preset auxiliary secondary drawing layer and several ordinary secondary drawing layers, and the display level of the auxiliary secondary drawing layer is higher than the display levels of the several ordinary secondary drawing layers. S3 further includes: transferring the changed graphic unit from the ordinary secondary drawing layer to which it belongs to, and executing step S3; when the changed graphic unit stops changing, reallocating the changed graphic unit from the auxiliary secondary drawing layer to the ordinary secondary drawing layer to which it originally belonged, and executing step S3.

[0105] An auxiliary secondary drawing layer is a special secondary drawing layer with a preset display level higher than the normal secondary drawing layer. It is used to temporarily host dynamically changing graphics units and has the highest display level within the primary drawing layer. In contrast, a normal secondary drawing layer is a normalized secondary drawing layer set based on preset layering rules, and has a display level lower than the auxiliary secondary drawing layer.

[0106] Specifically, when changes are detected in one or more graphic units, they can be transferred from the ordinary secondary drawing layer to which they belong to to the auxiliary secondary drawing layer, so that the changed graphic unit has the highest secondary display level in the primary drawing layer to which it belongs, ensuring the visualization of the operation. When the changed graphic unit stops changing, it will be reallocated to the ordinary secondary drawing layer to which it originally belonged to restore normal display.

[0107] In some embodiments, the attribute changes (such as position, size, shape, etc.) and change frequency of the graphic unit are monitored within a first preset time period. If the number of changes per unit time exceeds a preset number 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 monitored to be continuously changing, the dynamic level transition mechanism is triggered to transfer them from the ordinary secondary drawing layer to which they belong to to the auxiliary secondary drawing layer, so as to separate the unstable graphic elements with high-frequency changes from the stable graphic elements with low-frequency changes; when the graphic unit is monitored to no longer change within a second preset time period, it is determined to stop changing, and then it is reallocated to the ordinary secondary drawing layer to which it originally belonged, and normal display is restored, thereby optimizing local refresh efficiency and level management flexibility. Among them, the specific values ​​of the first preset time period and the second preset time period can be set according to the application scenario requirements or response sensitivity of the dynamic level transition mechanism, and are not limited here.

[0108] For example, when the user drags the grip to adjust the graphics, the number of times the position coordinates change is detected in real time. If the frequency of change of the grip's position coordinates exceeds the set threshold, the graphic element is marked as continuously changing and transferred to the auxiliary secondary drawing layer for dynamic management.

[0109] The dynamic hierarchical transition mechanism is particularly suitable for graphics units in the first-level drawing layer that have an occlusion relationship with multiple graphics units. It not only improves the visual priority of continuously changing graphics units, but also reduces the associated refresh of redrawn graphics units during local refresh processes, thereby improving operation visibility and avoiding repeated redrawing of the underlying layer.

[0110] The dynamic level transition mechanism is also applicable to packaged drawing graphics units. For example, in a secondary drawing layer, there are three lines A, B, and C. The coordinates of these three lines are different, but the other properties (such as line type, line width, color, and transparency) are exactly the same. At this time, these three lines can be packaged and drawn to reduce resource consumption. If the position coordinates of line B continue to change due to drag adjustment, each change requires repackaging of data and triggering a local refresh, which will lead to performance loss. At this time, line B is promoted to the dynamic auxiliary secondary drawing layer. Subsequent adjustments to line B are independently managed by the dynamic auxiliary secondary drawing layer, which no longer triggers or affects the packaged drawing of lines A and C. Repackaging will only occur when line B is first transferred to the auxiliary secondary drawing layer and when line B is finally lowered back to the ordinary secondary drawing layer, reducing the amount of data for local refresh and improving the rationality of resource utilization.

[0111] S4 , based on the first display level between the first-level drawing layers, superimpose the drawing results of the plurality of first-level drawing layers and the updated drawing result of the target first-level drawing layer to update the drawing.

[0112] Among them, the first display level 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.

[0113] 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 superimposed in sequence based on the first display level between the first-level drawing layers to finally generate a complete drawing. For example, the interactive control layer preferentially covers the interface information layer, the interface information layer covers the operation assistance layer, and so on. All graphics elements will be displayed correctly according to the occlusion relationship. After the superposition is completed, the drawing status is updated synchronously to reflect the latest graphic unit changes and hierarchical relationships. Among them, the drawing refers to the user interface of the CAD software or the output graphic results, that is, the complete image generated by superimposing the drawing results of all first-level drawing layers according to the first display level.

[0114] In some embodiments, multiple first-level drawing layers are preset according to a preset layering rule. When a first-level drawing layer does not contain a graphic unit, the corresponding first-level drawing layer does not participate in the drawing.

[0115] It should be understood that in the embodiment of the present application, a plurality of primary drawing layers are initially divided according to the display hierarchy, and the first display hierarchy between the primary drawing layers forms an overall stacking order constraint. The display hierarchy relationship is further refined within each primary drawing layer, and the secondary drawing layers of the shared buffer are divided. Drawing order constraints for multiple graphics units are formed based on the second display hierarchy of several secondary drawing layers within the same primary drawing layer and the third display hierarchy between graphics units within the same secondary drawing layer.

[0116] When a graphic unit changes, the target first-level drawing layer is quickly located based on the hierarchical affiliation and the initial redrawing range is delineated. Each first-level drawing layer is equipped with an independent buffer so that local redrawing of a specific level will not interfere with the content of other levels. Furthermore, through change analysis, specific graphic units are accurately locked to determine the area in the redrawing range that actually needs to be locally refreshed. The rest can reuse historical drawing results, and the redrawing calculation amount is refined to the minimum range based on the shared buffer. Among them, the redrawing order strictly follows the preset three-level display rules, so that the drawing results always meet the stacking order constraints and drawing order constraints, so that high-level elements always cover low-level elements, and effectively avoid visual logic confusion such as occlusion of graphic elements and inverted display timing that may be caused by local refresh. In other words, in the embodiment of the present application, the constraints of multiple display levels provide a feasibility basis for local refresh, and local redrawing with precise positioning can be achieved in complex graphic scenes, while improving the visual consistency and display accuracy in this process.

[0117] In some embodiments, the buffer of each primary drawing layer is set with display attributes; the method further comprises: drawing a plurality of graphic units in the corresponding primary drawing layer according to the display attributes of the buffer.

[0118] Specifically, display properties refer to a set of parameters used to control the drawing effects of graphics units, including transparency, blending mode, visibility, color coverage rules, etc. The buffer of each first-level drawing layer is set with unified display properties to improve the consistency of visual presentation and functional adaptability between layers.

[0119] See also Figures 7 and 8 , Figure 7 is a schematic diagram of different display attributes of a buffer zone provided by an embodiment of the present application; Figure 8 This is another schematic diagram of different display attributes of a buffer provided by an embodiment of the present application. Figure 7 As shown in the figure, the display properties include anti-aliasing properties, which are used to smooth the graphic units in the display buffer. While improving the visual effect, it will increase certain system overhead. The two images on the left are schematic diagrams of the effect of turning on anti-aliasing, and the two images on the right are schematic diagrams of the effect of turning off anti-aliasing. Figure 8 As shown, the display properties include transparency properties. The transparency property is used to draw semi-transparent entities. After it is turned on, it can also improve the visual effect, but it increases system overhead. The image on the left is a schematic diagram of the effect of turning on semi-transparency, and the image on the right is a schematic diagram of the effect of turning off semi-transparency.

[0120] In some embodiments, the display attributes of the buffer can be controlled by corresponding switches in the graphics engine. The graphics primitives on the buffer will automatically be drawn with the corresponding attributes when drawn.

[0121] In some embodiments, the size of all buffers is the same as the display window size of the current drawing. The relationship between graphic units and drawing layers can be pre-defined within the CAD software according to preset layering rules, and the first-level drawing layer and the buffer are one-to-one corresponding. When drawing each graphic element, it will be automatically drawn to the corresponding buffer.

[0122] In some embodiments, several first-level drawing layers and a buffer for each of the first-level drawing layers are established, wherein the buffer is used to store the drawing results of several graphic units in the corresponding first-level drawing layer; when a graphic unit changes, the target first-level drawing layer to which the changed graphic unit belongs is determined; the several graphic units in the target first-level drawing layer are redrawn to update the drawing results of the target first-level drawing layer; and based on a first display level between the first-level drawing layers, the drawing results of the several first-level drawing layers are superimposed with the updated drawing results of the target first-level drawing layer to update the drawing. The specific implementation method can be found in the aforementioned embodiments and will not be repeated here.

[0123] In some embodiments, the drawing overhead of each secondary drawing layer is calculated; when the drawing overhead exceeds a preset drawing overhead, the corresponding secondary drawing layer is designated as a saturated drawing layer; a new backup drawing layer is added, and some graphics units in the saturated drawing layer are transferred to the backup drawing layer; the backup drawing layer and the saturated drawing layer have the same second display level. It should be understood that by monitoring the drawing pressure of each layer in real time and automatically splitting overloaded layers, the backup layer and the original layer have the same display level, effectively preventing overall performance degradation caused by overloading a single layer while maintaining the same graphics logic.

[0124] See also Figure 9 , Figure 9 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a terminal device or a server.

[0125] For example, the above method can be implemented in the form of a computer program. Figure 9 Runs on the computer device shown.

[0126] like Figure 9 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0127] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any layered rendering method.

[0128] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0129] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any layered rendering method.

[0130] This network interface is used for network communication, such as sending assigned tasks.

[0131] It should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0132] In one embodiment, the processor is configured to execute a computer program stored in the memory to implement the following steps:

[0133] S1, establishing a plurality of primary drawing layers and a buffer for each of the primary drawing layers, wherein the primary drawing layer includes a plurality of secondary drawing layers, and the plurality of secondary drawing layers within the same primary drawing layer share the same buffer; the buffer is used to store drawing results of a plurality of graphic units in the corresponding primary drawing layer;

[0134] S2, when a graphic unit is changed, determining the target primary drawing layer to which the changed graphic unit belongs;

[0135] S3, determining a drawing order of graphic units based on a second display layer between the secondary drawing layers and a third display layer within the secondary drawing layer; and redrawing a plurality of graphic units in the target primary drawing layer based on the drawing order to update a drawing result of the target primary drawing layer;

[0136] S4 , based on the first display level between the first-level drawing layers, superimpose the drawing results of the plurality of first-level drawing layers and the updated drawing result of the target first-level drawing layer to update the drawing.

[0137] In some embodiments, when implementing step S2, the processor is further configured to: when the changed graphics unit is a newly created graphics unit, divide the changed graphics unit into a corresponding target first-level drawing layer based on a preset layering rule; or, when the changed graphics unit is an existing graphics unit, use the first-level drawing layer in which the changed graphics unit is currently located as the target first-level drawing layer.

[0138] In some embodiments, the processor is further configured to: divide a plurality of graphic units in the primary drawing layer into corresponding secondary drawing layers based on a preset layering rule.

[0139] In some embodiments, the drawing order includes a global drawing order, and the processor, when implementing step S3, is further configured to: determine a global drawing order among the plurality of graphics units in the target primary drawing layer based on a second display level between the secondary drawing layers and a third display level within the secondary drawing layer; and redraw the plurality of graphics units in the target primary drawing layer in sequence based on the global drawing order to update a drawing result of the target primary drawing layer.

[0140] In some embodiments, the drawing order includes a local drawing order, and the processor, when implementing step S3, is further used to implement: 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 based on the position of the changed graphic unit, and there is at least one redrawing graphic unit in the target area; obtaining the target second-level drawing layer to which at least one redrawing graphic unit belongs; determining the local drawing order between the redrawing graphic units based on the second display layer between the target second-level drawing layers and the third display layer within the target second-level drawing layer; and redrawing the redrawing graphic units in sequence based on the local drawing order to update the drawing result of the target area.

[0141] In some embodiments, when implementing step S3, the processor is also used to implement: generating a minimum rectangular frame surrounding the changed graphic unit based on the changed graphic unit, and taking the area divided by the minimum rectangular frame as the target area; determining several associated graphic units that are within the target area and / or intersect with the target area; and taking the changed graphic unit and several of the associated graphic units as the redrawing graphic units.

[0142] In some embodiments, the secondary drawing layer includes a preset auxiliary secondary drawing layer and several ordinary secondary drawing layers, and the display level of the auxiliary secondary drawing layer is higher than the display levels of the several ordinary secondary drawing layers. When implementing step S3, the processor is further configured to: transfer the changed graphics unit from the ordinary secondary drawing layer to which it belongs to to the auxiliary secondary drawing layer, and execute step S3; when the changed graphics unit stops changing, reallocate the changed graphics unit from the auxiliary secondary drawing layer to the ordinary secondary drawing layer to which it originally belonged, and execute step S3.

[0143] In some embodiments, the buffer of each primary drawing layer is set with display attributes; and the processor is further configured to implement: drawing a plurality of graphic units in the corresponding primary drawing layer according to the display attributes of the buffer.

[0144] Exemplarily, the processor is used to run a computer program stored in the memory, and is also used to implement the steps of the layered rendering method provided in any embodiment of the present application, which will not be described in detail here.

[0145] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement the steps of any one of the layered drawing methods provided in the embodiments of the present application.

[0146] The computer-readable storage medium may be an internal storage unit of the computer device described in the aforementioned embodiment, such as a 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, a SmartMedia Card (SMC), a Secure Digital (SD) card, a flash memory card, etc., equipped on the computer device.

[0147] The above description is merely a specific embodiment of the present application, but the scope of protection of the present 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 the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A layered rendering method, characterized in that: The method comprises: S1, establishing a plurality of primary drawing layers and a buffer for each of the primary drawing layers, wherein the primary drawing layer includes a plurality of secondary drawing layers, and the plurality of secondary drawing layers within the same primary drawing layer share the same buffer; the buffer is used to store drawing results of a plurality of graphic units in the corresponding primary drawing layer; S2, when a graphic unit is changed, determining the target primary drawing layer to which the changed graphic unit belongs; S3, determining a drawing order of graphic units based on a second display layer between the secondary drawing layers and a third display layer within the secondary drawing layer; and redrawing a plurality of graphic units in the target primary drawing layer based on the drawing order to update a drawing result of the target primary drawing layer; S4, based on the first display level between the first-level drawing layers, superimposing the drawing results of the plurality of first-level drawing layers and the updated drawing result of the target first-level drawing layer to update the drawing; Among them, the first-level drawing layer and the second-level drawing layer are divided based on the functional attributes of the primitives; the first display level and the second display level are determined by the occlusion relationship between the primitives; and the third display level is determined according to the order of primitive generation time.

2. The method according to claim 1, wherein Said S2 further comprises: When the changed graphic unit is a newly created graphic unit, the changed graphic unit is divided into a corresponding target first-level drawing layer based on a preset layering rule; or When the changed graphic unit is an existing graphic unit, the primary drawing layer where the changed graphic unit is currently located is used as the target primary drawing layer.

3. The method according to claim 1, wherein The method further includes: dividing a plurality of graphic units in the primary drawing layer into corresponding secondary drawing layers based on a preset layering rule.

4. The method according to claim 3, wherein The drawing order includes a global drawing order, and S3 includes: determining a global drawing order among the plurality of graphic units in the target primary drawing layer based on a second display level between the secondary drawing layers and a third display level within the secondary drawing layer; Based on the global drawing order, the plurality of graphic units in the target first-level drawing layer are redrawn in sequence to update the drawing result of the target first-level drawing layer.

5. The method according to claim 3, wherein The drawing order includes a local drawing order, and S3 includes: Calling the historical drawing results of the target first-level drawing layer; Determining a target area in the historical drawing result that needs to be redrawn according to the position of the changed graphic unit, wherein at least one redrawn graphic unit exists in the target area; Obtaining a target secondary drawing layer to which at least one of the redrawing graphics units belongs; determining a local drawing order among the redrawing graphics units based on a second display level between the target secondary drawing layers and a third display level within the target secondary drawing layer; Based on the local drawing order, the redrawing graphics units are redrawn in sequence to update the drawing result of the target area.

6. The method according to claim 5, wherein The S3 includes: generating a minimum rectangular frame surrounding the changed graphic unit based on the changed 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; The changed graphic unit and a plurality of the associated graphic units are used as the redrawing graphic units.

7. The method according to any one of claims 1 to 6, wherein: The secondary drawing layer includes a preset auxiliary secondary drawing layer and a plurality of common secondary drawing layers. The display level of the auxiliary secondary drawing layer is higher than the display levels of the common secondary drawing layers. S3 further includes: Transferring the changed graphic unit from the ordinary secondary drawing layer to the auxiliary secondary drawing layer, and executing step S3; When the changed graphic unit stops changing, the changed graphic unit is reallocated from the auxiliary secondary drawing layer to the normal secondary drawing layer to which it originally belonged, and step S3 is executed.

8. The method according to claim 1, wherein The buffer of each first-level drawing layer is provided with display attributes; the method further comprises: drawing a plurality 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 comprises: memory for storing computer programs; A processor, configured to execute the computer program and implement the layered rendering method according to any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to implement the layered rendering method according to any one of claims 1 to 8.