Layered drawing method, computer equipment and storage medium

A hierarchical rendering method for CAD graphics optimizes computational load and visual consistency by using nested buffer zones to manage dynamic and static elements, addressing inefficiencies in complex CAD systems.

CN120318368AActive Publication Date: 2025-07-15SUZHOU CAD SOFTWARE CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently manage the hierarchical loading of graphics units in complex engineering drawings, resulting in large computing overhead, insufficient visual consistency and display accuracy.

Method used

Using the hierarchical drawing method, local refresh and precise positioning are achieved by establishing several first-level drawing layers and second-level drawing layers, and hierarchical constraints and buffers are used to manage the drawing order and overlay of graphics units.

Benefits of technology

It improves the efficiency of graphics drawing, improves visual consistency and display accuracy, reduces computing resource consumption, and adapts to the needs of complex graphics scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318368A_ABST
    Figure CN120318368A_ABST
Patent Text Reader

Abstract

The invention relates to the field of computer graphics, in particular to a layered drawing method, computer equipment and a storage medium. The method comprises the following steps: establishing a plurality of first-level drawing layers and corresponding buffer areas, wherein the first-level drawing layers comprise a plurality of second-level drawing layers which share the same buffer area; when the graphic unit is changed, determining a target first-level drawing layer to which the changed graphic unit belongs; determining a drawing sequence of the graphic units based on a second display level between the second-level drawing layers and a third display level in the second-level drawing layers; redrawing the plurality of graphic units in the target first-level drawing layer based on the drawing sequence to update the drawing result of the target first-level drawing layer; and based on a first display level between the first-level drawing layers, superposing the drawing results of the plurality of first-level drawing layers and the updated drawing result of the target first-level drawing layer so as to update the drawing. Local redrawing of precise positioning is achieved, and the visual consistency and the display accuracy are improved.
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 has also increased accordingly, and the overhead of drawing loading has increased accordingly. The current common strategy is to draw graphic units separately according to static and dynamic properties to reduce computing 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 primitive drawing layer and a static primitive drawing layer; drawing static primitives in the static primitive drawing layer in combination with a geographic information image, and saving them in a static graphics buffer; drawing dynamic primitives in the dynamic primitive drawing layer at a preset time interval, and saving 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.

[0004] For another example, an invention patent application with 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, real-time drawing of the image to be displayed is performed 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; respectively 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; 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 drawing method, a computer device and a storage medium. In order to solve the above-mentioned technical problems, this application specifically adopts the following technical solutions: A first aspect of the present application is to provide a layered rendering method, the method comprising: S1. Establish a number of first-level drawing layers and buffers for each of the first-level drawing layers. Among them, each first-level drawing layer includes a number of second-level drawing layers, and the number of second-level drawing layers in the same first-level drawing layer share the same buffer; the buffer is used to store the drawing results of a number of graphic units in the corresponding first-level drawing layer; S2. When a graphic unit changes, determine the target first-level drawing layer to which the changed graphic unit belongs; S3. Based on the second display hierarchy between the second-level drawing layers and the third display hierarchy within the second-level drawing layers, determine the drawing order of the graphic units; redraw a number of 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; S4. Based on the first display hierarchy between the first-level drawing layers, superimpose the drawing results of a number of the first-level drawing layers and the updated drawing result of the target first-level drawing layer to update the drawing sheet.

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

[0008] In some embodiments, the method further includes: based on a preset layering rule, divide a number of graphic units in the first-level drawing layer into the corresponding second-level drawing layers.

[0009] In some embodiments, the drawing order includes a global drawing order, and S3 includes: based on the second display hierarchy between the second-level drawing layers and the third display hierarchy within the second-level drawing layers, determine the global drawing order between a number of the graphic units in the target first-level drawing layer; based on the global drawing order, sequentially redraw a number of the graphic units in the target first-level drawing layer to update the drawing result of the target first-level drawing layer.

[0010] In some embodiments, the drawing order includes a local drawing order, and S3 includes: calling the historical drawing result of the target primary drawing layer; determining a target area that needs to be redrawn in the historical drawing result according to the position where the changed graphic unit is located, and there is at least one redrawing graphic unit in the target area; obtaining the target secondary drawing layer to which at least one of the redrawing graphic units belongs; determining the local drawing order among the redrawing graphic units based on the second display hierarchy between the target secondary drawing layers and the third display hierarchy inside the target secondary drawing layer; and sequentially redrawing the redrawing graphic units based on the local drawing order to update the drawing result of the target area.

[0011] In some embodiments, 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 plurality of associated graphic units located inside and / or intersecting with the target area; and taking the changed graphic unit and the plurality of associated graphic units as the redrawing graphic units.

[0012] In some embodiments, the secondary drawing layer includes a preset auxiliary secondary drawing layer and a plurality of ordinary secondary drawing layers, and the display hierarchy of the auxiliary secondary drawing layer is higher than that of the plurality of ordinary secondary drawing layers; S3 further includes: moving the changed graphic unit from the ordinary secondary drawing layer to which it belongs to the auxiliary secondary drawing layer, and executing step S3; when the changed graphic unit stops changing, reassigning 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.

[0013] In some embodiments, each buffer of the primary drawing layer is provided with a display attribute; the method further includes: drawing a plurality of graphic units in the corresponding primary drawing layer according to the display attribute of the buffer.

[0014] The second aspect of the present application lies in providing a computer device, and the device includes: a memory for storing a computer program; a processor for executing the computer program and implementing the steps of the hierarchical drawing method provided in any embodiment of the present application when executing the computer program.

[0015] The third aspect of the present application correspondingly provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the processor implements the steps of the hierarchical drawing method provided in any embodiment of the present application.

[0016] Beneficial effects: The embodiments of the present application provide a hierarchical drawing method, a computer device, and a storage medium. Specifically, an efficient local refresh strategy based on hierarchical constraints is provided, which provides a feasibility basis for local refresh through a nested hierarchical structure and establishes strict constraints, achieving precise local redrawing in complex graphic scenes while enhancing visual consistency and display accuracy during this process.

[0017] Specifically, a number of first-level drawing layers are initially divided according to the display hierarchy, and the first display hierarchy among the first-level drawing layers forms an overall stacking order constraint; the display hierarchy relationship is further refined in each first-level drawing layer to divide the second-level drawing layers of the shared buffer, and according to the second display hierarchy of several second-level drawing layers within the same first-level drawing layer and the third display hierarchy among graphic units within the same second-level drawing layer, a drawing order constraint for multiple graphic units is formed.

[0018] When a graphic unit changes, the target first-level drawing layer is quickly located based on the hierarchical subordination relationship and the initial redrawing range is delimited. 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. Further, the specific graphic unit is accurately locked through change analysis to determine the area that actually needs local refresh in the redrawing range, and the rest can reuse the historical drawing results, and the redrawing calculation amount is refined to the smallest range on the basis of the shared buffer. Among them, the redrawing order strictly follows the preset three-level display rule, so that the drawing result always satisfies the stacking order constraint and the drawing order constraint, and the high-level elements always cover the low-level elements, effectively avoiding visual logic disorders such as occlusion confusion and display timing inversion of graphic elements that may be caused by local refresh.

[0019] Further, a dynamic hierarchical transition mechanism is introduced for continuous interaction scenarios, enabling specific graphic primitives to break through the strict hierarchical constraints of the second display hierarchy and the third display hierarchy, temporarily promoting the elements in operations such as dragging to a dedicated high level for independent refresh, which not only improves the visibility of operations but also avoids repeated redrawing of the bottom layer. After the operation ends, it is intelligently reset and a global update is triggered. During this process, only the first display hierarchy maintains the key occlusion relationship to improve the drawing efficiency in complex scenarios and take into account the user's visual experience. Description of the Drawings

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for description in the embodiments or the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts do not necessarily draw according to the actual scale. Obviously, the following drawings are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to these drawings without creative efforts.

[0021] Figure 1 It is a schematic diagram of a drawing scene provided by an embodiment of the present application; Figure 2 It is a schematic flowchart of a hierarchical drawing method provided by an embodiment of the present application; Figure 3 It is a schematic diagram of a primary drawing layer provided by an embodiment of the present application; Figure 4 It is another schematic diagram of a drawing scene provided by an embodiment of the present application; Figure 5 It is a schematic diagram of a secondary drawing layer provided by an embodiment of the present application; Figure 6 It is another schematic diagram of a drawing scene provided by an embodiment of the present application; Figure 7 It is a schematic diagram of different display attributes of a buffer provided by an embodiment of the present application; Figure 8 It is another schematic diagram of different display attributes of a buffer provided by an embodiment of the present application; Figure 9 It is a schematic block diagram of the structure of a computer device provided by an embodiment of the present application. Detailed implementation manners

[0022] To make the objectives, 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 with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the scope of protection of the present application.

[0023] In this article, suffixes such as "module", "component", or "unit" used to represent elements are only for the convenience of description of the present application, and they have no specific meaning themselves. Therefore, "module", "component", or "unit" can be used interchangeably.

[0024] In this article, the orientation or positional relationship indicated by terms such as "upper", "lower", "inner", "outer", "front", "rear", "one end", "the other end", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present application. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.

[0025] In this article, unless otherwise clearly defined and limited, terms such as "installation", "equipped with", "connection", etc. should be understood in a broad sense. 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, and can be the communication inside two components. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific situations.

[0026] In this article, "and / or" includes any and all combinations of one or more of the listed related items.

[0027] In this article, "a plurality of" means two or more, that is, it includes two, three, four, five, etc.

[0028] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising that element.

[0029] Modern engineering projects are becoming increasingly complex, requiring drawings to carry more professional details, such as multi-disciplinary integrated design in architecture and precise assembly relationships in machinery. At the same time, the functions of CAD systems are constantly upgraded to support advanced analyses such as 3D modeling and simulation, significantly improving the design quality, but also bringing larger data volumes and higher computing requirements, further exacerbating the complexity of drawings, which directly leads to an increase in drawing loading time and consumption of computing resources. Currently, the optimization strategy is to separately draw graphic units according to static and dynamic attributes, that is, to pre-generate graphic caches for static elements that do not change frequently during the rendering process, and only to perform real-time updates on the frequently changing dynamic parts, in order to reduce unnecessary repeated calculations.

[0030] However, this classified drawing is too simple and rough in practical applications. With the continuous improvement of drawing complexity and the diversified development of interaction modes, the proportion of graphic elements with dynamic attributes has significantly exceeded that of completely static attributes. Even if only the dynamic graphic elements are redrawn, the computing overhead is still large; and the correlation relationships between graphic elements have also become further complicated, resulting in an increase in the implementation difficulty and computing overhead of local drawing. Thus, the current hierarchical loading of graphic units is difficult to meet the increasingly complex requirements of engineering drawings, and the actual performance improvement effect is severely limited.

[0031] Based on this, the embodiments of the present application provide a hierarchical drawing method, a computer device, and a storage medium, specifically providing an efficient local refresh strategy based on hierarchical constraints, providing a feasibility basis for local refresh through a nested hierarchical structure and establishing strict constraints, achieving precise local redrawing in complex graphic scenes, and improving visual consistency and display accuracy during this process.

[0032] The following will describe in detail some embodiments of the present application with reference to the accompanying drawings. Without conflict, the embodiments described below and the features in the embodiments can be combined with each other.

[0033] In this article, the drawing can be a CAD drawing, and the format of this drawing can be the dwg format, the dxf format, the dwt format, etc., and can also be a proe drawing, a SolidWorks drawing, etc., which are not limited herein.

[0034] In this article, a graphic unit refers to various basic elements existing in the drawing, and can also be simply referred to as a graphic element. Specifically, it can be divided into two categories: basic graphic units, that is, geometric entities or objects actually drawn by the user in the drawing. These graphic units constitute the core content of the design result and belong to the components of the final output drawing, including but not limited to geometric graphics such as points, lines, circles, arcs, polygons, as well as dimension markings, text descriptions, etc.; auxiliary graphic units, that is, temporary and non-persistent interface elements or auxiliary tools generated by the user during the operation of the CAD software. These graphic units are mainly used to improve the visibility and accuracy during the drawing process, but will not be retained in the final drawing, including but not limited to the cursor, selection box, coordinate system, grid, alignment assist lines, etc.

[0035] Please refer to Figure 1 , Figure 1 which is a schematic diagram of a drawing scene provided by the embodiments of the present application. As Figure 1 shown, in the drawing scene of the CAD software, there are 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. Among them, the first combined entity 10 is a circular graphic element being adjusted, including a cursor, a circular basic graphic unit, and multiple auxiliary graphic units generated when the user modifies the circular basic graphic unit; the second combined entity 20 is a custom graphic drawn by the user, including basic graphic units such as circles, polygons, and dimension markings; the third combined entity 30 is a coordinate system icon, which is an auxiliary graphic unit indicating the coordinate direction.

[0036] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a hierarchical drawing method provided by the embodiments of the present application. As Figure 2 shown, the embodiments of the present application provide a hierarchical drawing method, and the method includes S1 to S4.

[0037] 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 in 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.

[0038] Among them, the first-level drawing layer is a macro-hierarchical structure that is physically divided based on the functional attributes of the graphics primitives. 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.

[0039] Furthermore, the secondary drawing layer is a hierarchical structure that is further subdivided within the primary drawing layer. It is logically divided based on the functional attributes of the primitives. The secondary drawing layers within the same primary drawing layer share the buffer of the primary drawing layer and are only logically divided. At the same time, the stacking order between the secondary drawing layers (i.e., the second display layer) is determined by the occlusion relationship, 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 the drawing order (i.e., the third display layer) is determined by the order of the generation time of the graphic units within the secondary drawing layer.

[0040] 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 according to 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 the second-level drawing layer can be determined according to the preset layering rules, so as to quickly allocate various types of graphic units generated during the use of the CAD software (such as graphic units drawn by users, graphic units automatically generated by software functions or in response to user operations, etc.) to corresponding levels, thereby optimizing the functionality and user experience of the CAD software user interface. The specific layering rules and number of layers are not limited here.

[0041] For example, see Figure 3 , Figure 3 It is a schematic diagram of a primary drawing layer provided in an embodiment of the present application. Figure 1 The multiple combined entities in can be assigned to the corresponding primary drawing layer 100 according to their functional attributes, such as Figure 3As shown in the figure, the specific hierarchical structure includes an interaction control layer 101, an interface information layer 102, an operation assistance layer 103, a main drawing layer 104, and a background reference layer 105 in descending hierarchical priority. Among them, the interaction control layer 101 is used to carry graphic elements for direct user interaction (such as the cursor, selection box, drag hint, etc.), and it needs to always be at the topmost layer to enhance the visibility of operations. The interface information layer 102 is used to display information directly related to the software interface (such as the coordinate system, status bar, scale, view navigation tool, etc.), and it needs to maintain visibility for a long time. The operation assistance layer 103 is used to store temporary and non-persistent auxiliary graphic units, and it needs to cover the basic graphic units to reflect the operation effect. The main drawing layer 104 is used to carry the core basic graphic units drawn by the user, supporting subsequent operations (such as modification, combination, alignment). The background reference layer 105 is used as background graphic elements (such as grid meshes, reference lines), providing a drawing reference and allowing it to be occluded by all other graphic elements.

[0042] As Figure 3 shown in the figure, the background reference layer 105 is at the lowest display level to provide a drawing reference while avoiding occluding 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, the second combined entity 20), and it is at a relatively low position in the visual hierarchy so that the subsequently generated auxiliary graphic units can cover it. Further, the auxiliary graphic units 10b (such as grips, highlight tips, adjustment preview circles, etc.) generated when the user modifies the basic graphic unit of the circle are assigned to the operation assistance layer 103, which is above the main drawing layer 104, so that these graphic elements cover the basic graphic units, clarifying the object and effect of the user's operation.

[0043] In addition, the graphic elements in the interface information layer 102 need to maintain visibility for a long time to assist the user in understanding the current operation environment. For example, if the coordinate system icon is occluded by other graphic elements, it will be difficult for the user to judge 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 not only maintains the display priority of the interface information but also avoids interfering with the direct interaction elements. The interaction control layer 101 is responsible for presenting components directly interacting with the user such as the cursor 10a. To meet the requirements of real-time and dynamic user interaction, the interaction control layer 101 needs to always be at the topmost layer so that the cursor 10a or other interaction elements (such as selection boxes, drag hints) will not be occluded by other graphic elements.

[0044] It can be seen that the cursor 10a in the first combined entity 10, the basic graphic unit 10c of the circle, and the multiple auxiliary graphic units 10b generated when the user modifies the basic graphic unit of the circle are assigned to the corresponding first-level drawing layers according to their functional attributes and occlusion relationships.

[0045] Exemplarily, the layering method and / or the number of layers of the first-level drawing layer can be modified based on the original layering logic. For example, new first-level drawing layers can be dynamically added or old first-level drawing layers can be deleted to flexibly adapt to functional requirements. For example, please refer to Figure 4 , Figure 4 which is a schematic diagram of another drawing scenario provided by an embodiment of the present application. As Figure 4 shown, some CAD software has a special function of a magnifying glass for temporarily magnifying a local area in the drawing to observe or edit details. At this time, based on the foregoing layering structure, a bottom layer can be added below the background reference layer, and the view before magnification is cached and displayed on this bottom layer, such as Figure 4 the part outside the magnified area with a white circular background in the figure. At the same time, a covering layer is superimposed above the operation assistance layer, and a semi-transparent gray primitive is set to cover the non-critical content outside the magnified area with a white circular background. It should be noted that the layering structure within the magnified area is exactly the same as the original layering structure, but the display range is limited within the circular area.

[0046] It should be understood that the integrity of the original layering logic is retained, and the function is extended by dynamically updating the layer division. And when the user finishes the operation, the bottom layer and the covering layer can be removed or hidden to restore the original layering structure, thus avoiding the occupation of redundant resources.

[0047] Exemplarily, please refer to Figure 5 , Figure 5 which is a schematic diagram of a second-level drawing layer provided by an embodiment of the present application. Figure 3 Among the multiple auxiliary graphic units 10b in the operation assistance layer 103 in Figure 5 , they can be assigned to the corresponding second-level drawing layers 200 according to their functional attributes. As

[0048] shown, the operation of adjusting the circular primitive is to modify its radius attribute by dragging and selecting the grip points of the circular primitive. The specific layering structure includes a high layer 201, an upper-middle layer 202, a middle layer 203, and a low layer 204 in descending order of layer priority. Among them, the multiple auxiliary graphic units 10b can include grip points, a blue ring, a radius length, and an adjustment preview circle. The grip points are assigned to the high layer 201 because they need to be preferentially displayed to provide real-time feedback on the user's operation; the blue ring, indicating the selected state of the circular primitive, is located in the upper-middle layer 202; the radius length indication is placed in the middle layer 203; and the adjustment preview circle is assigned to the low layer 204.

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

[0049] It should be noted that the layer rules and the number of layers of the primary drawing layer and the secondary drawing layer can be flexibly determined according to the functional characteristics of different CAD software and the usage requirements of graphic units, not limited to the above examples. For example, in some CAD software, the selected state of the design primitive is the display main body during the modification process of the graphic unit, then the blue ring will be assigned to the upper layer; another example is that in some CAD software, there is no visual cue element for the selected state of the primitive, then the upper middle layer 202 can be not set. And, the higher the display layer, the later the drawing order, to avoid the primitives of the high display layer being blocked.

[0050] It should be understood that the division of the drawing layer integrates the dual constraints of functional attributes and occlusion relationships, which not only ensures the logical independence between primitives but also maintains the orderly control of the visual hierarchy. First, primitives with the same macroscopic function are grouped into the same primary drawing layer and share a buffer. Through physical isolation, data interference between layers is avoided. For example, the primitives in the interface information layer are only used to display interface information, and the primitives in the interaction control layer are only used to respond to user operations, avoiding drawing conflicts or logical errors caused by function mixing, and ensuring the running stability of the software during the local refresh process. Second, each primary drawing layer can be further divided into multiple secondary drawing layers to refine the visual hierarchy and control the stacking order of primitives within the same functional category. And, the secondary drawing layer is a logical division, supporting flexible expansion in quantity without increasing the resource overhead of the buffer.

[0051] This hierarchical structure provides a basis for local refresh. When the primitives in a certain primary drawing layer change, only the content of the buffer of this primary drawing layer needs to be updated, without redrawing other primary drawing layers, thus realizing the reuse of the drawing result and reducing the calculation overhead. For example, when the user moves the cursor, only the interaction control layer needs to be refreshed, and the other primary drawing layers remain stable, effectively improving the drawing efficiency and the system response speed.

[0052] On this basis, by gradually controlling the first display level between the first-level drawing layers, the second display level between the second-level drawing layers, and the third display level within the second-level drawing layers, the stacking order between the primitives is further refined, enhancing visual consistency and avoiding confusion in graphic occlusion or incorrect display timing. For example, in the operation assistance layer, auxiliary graphic units such as grip points and highlighted circles achieve precise occlusion control through the drawing order of the second-level drawing layers. At the same time, since the first-level drawing layer to which they belong has a higher display priority, these auxiliary graphic units always cover the main drawing layer, preventing them from being occluded by the underlying basic graphic units.

[0053] That is to say, through the two-level structure of the first-level drawing layer and the second-level drawing layer, it avoids the waste of resources caused by separately allocating buffers for each primitive, and ensures the accuracy and visual consistency of local refreshing through strict hierarchical constraints. Furthermore, it enables the CAD software to achieve efficient and orderly graphic management in complex scenarios.

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

[0055] In some embodiments, a number of graphic units in the first-level drawing layer are divided into corresponding second-level drawing layers. Specifically, based on a preset layering rule, a number of graphic units in the first-level drawing layer or the changed graphic units in the target first-level drawing layer are further divided into 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 achieve visual differentiation only through the drawing order, which not only reduces the number of independent buffers but also refines the hierarchical priority of primitives in the same functional category, thereby optimizing visual consistency while improving performance.

[0056] In some embodiments, when the number of graphic units in the first-level drawing layer is greater than a preset number, the layering structure of the second-level drawing layer is triggered, and a number of graphic units in the corresponding first-level drawing layer are divided into corresponding second-level drawing layers. Thus, some first-level drawing layers include several second-level drawing layers, while the graphic units in some first-level drawing layers are not divided into second-level drawing layers for the time being. It should be understood that even if the entire layer of the first-level drawing layer with fewer graphic units is redrawn, the workload is relatively low, and it can be not divided into second-level drawing layers to avoid excessive consumption of system resources. Moreover, at this time, the drawing order within the first-level drawing layer is determined by the order of generation time of the graphic units (i.e., the fourth display level).

[0057] S2. When a graphic unit changes, determine the target first-level drawing layer to which the changed graphic unit belongs.

[0058] Specifically, a changed graphic unit refers to a graphic unit whose state is newly 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 according to the functional attributes of the changed graphic unit. For example, if the change involves user interaction operations (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, highlight prompt), the target first-level drawing layer is the operation assistance layer; if it is basic drawing content (such as a circle, rectangle), the target first-level drawing layer is the main drawing layer.

[0059] It should be understood that according to the preset layering rules, the attribution relationships of graphic units with different functional attributes to each first-level drawing layer and second-level drawing layer are determined, and then the target first-level drawing layer to which the changed graphic unit belongs is determined, accurately positioning the physical buffer area to be updated, achieving local refreshing, and improving the drawing efficiency.

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

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

[0062] In some embodiments, after dividing the changed graphic unit into the corresponding target first-level drawing layer when the changed graphic unit is a newly created graphic unit, it further includes: based on the preset layering rules, dividing the changed graphic unit into the corresponding target second-level drawing layer.

[0063] In some embodiments, after using the first-level drawing layer where the changed graphic unit is currently located as the target first-level drawing layer when the changed graphic unit is an existing graphic unit, it further includes: using the second-level drawing layer where the changed graphic unit is currently located as the target second-level drawing layer.

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

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

[0066] Among them, the second display hierarchy is the stacking order between secondary drawing layers within the same primary drawing layer, which is determined by the occlusion relationship and is used to control the display priority of different graphic elements under the same major function category. The higher the second display hierarchy, the later the drawing order. Correspondingly, the third display hierarchy is within the same secondary drawing layer, and the drawing order of graphic elements is determined according to the chronological order of generation. The earlier the drawing time, the earlier the drawing order, forming a local visual stacking relationship.

[0067] Among them, the drawing order refers to the sequence in which graphic elements are drawn one by one in the buffer, which will affect the hierarchical effect in the final display. Through the drawing order, the graphic units to be updated in the target primary drawing layer can be redrawn in the correct order, avoiding a full refresh of all primary drawing layers, thereby improving the drawing efficiency while ensuring visual consistency.

[0068] Specifically, based on the second display hierarchy between secondary drawing layers and the third display hierarchy within secondary drawing layers, comprehensively determine the drawing order between graphic units within this primary drawing layer. First, preliminarily determine the first drawing order between graphic units of different secondary drawing levels within the target primary drawing layer, that is, the graphic units with a lower second display hierarchy are drawn first. Secondly, the graphic units within the secondary drawing layer are in a parallel order in the first drawing order. According to the third display hierarchy within the secondary drawing layer, further distinguish the second drawing order between multiple graphic units in the same secondary drawing layer, that is, the graphic units with an earlier generation time are drawn first. Finally, the drawing order can be determined by combining the first drawing order between layers and the second drawing order within layers.

[0069] Such as Figure 3 and Figure 5 As shown, if the operation assistance layer 103 is the target primary drawing layer, it is necessary to redraw the graphic units in the operation assistance layer 103 to update the drawing result in the buffer of the operation assistance layer 103. At this time, since the second display hierarchy of the high layer 201 is higher than that of the middle upper layer 202, the blue ring needs to be drawn before the grip point. And in the high layer 201, assuming that the blue grip point is generated before the red grip point, then the third display hierarchy of the red grip point is higher than that of the blue grip point, and the blue grip point needs to be drawn before the red grip point.

[0070] 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 the drawing result of the target primary drawing layer.

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

[0072] Exemplarily, the third drawing order of all graphic units in 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 according to the third display level inside the secondary drawing layer, that is, the graphic units with earlier generation time are drawn first. Finally, the global drawing order can be determined by combining the third drawing order between layers and the fourth drawing order within a layer.

[0073] Based on the global drawing order, the graphic units in the target first-level drawing layer are redrawn in sequence instead of all first-level drawing layers, thereby reducing redundant calculations and improving drawing efficiency while ensuring visual consistency. As a result, the graphics elements are overlaid layer by layer in the buffer according to logical priority and time order, and finally form a correct stacking effect.

[0074] 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 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 turn to update the drawing results of the target area.

[0075] The historical drawing result refers to the complete graphics data of the last completed drawing of the target first-level drawing layer, including the final display status of all graphics units in the first-level drawing layer, such as position, color, shape, etc. The historical drawing result is used as the basis for the current drawing, and only the drawing result of the target area is updated.

[0076] 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 according to 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.

[0077] The target secondary drawing layer to which the redrawing graphic unit belongs is obtained, and a local drawing order is determined according to the second display level and / or the third display level. For example, if there are multiple redrawing graphic units and they belong to different secondary drawing layers, the fifth drawing order of the multiple redrawing graphic units is preliminarily determined according to the second display level between the target secondary drawing layers, that is, the redrawing graphic units with lower display levels are drawn earlier. Furthermore, if there are multiple redrawing graphic units in the same target secondary drawing layer, these redrawing graphic units are in parallel order in the fifth drawing order. At this time, the sixth drawing order between the multiple redrawing graphic units in the same target secondary drawing layer is further distinguished according to the third display level inside the target secondary drawing layer, that is, the redrawing graphic units with earlier generation time are drawn earlier. Finally, the local drawing order can be determined by combining the fifth drawing order between layers and the sixth drawing order within a layer.

[0078] In other words, the local drawing order refers to the order of drawing a number of redrawn graphic units determined by the second display layer between the secondary drawing layers and the third display layer within the secondary drawing layer. In this order, only the redrawn graphic units are redrawn one by one, and only the drawing results of the target area are updated, rather than the entire target primary drawing layer being fully refreshed, so as to achieve partial reuse of the historical drawing results of the target primary drawing layer, thereby reducing redundant calculations and improving redrawing efficiency while ensuring visual consistency.

[0079] 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 exactly the same, 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.

[0080] Please refer to Figure 6 , Figure 6 which is a schematic diagram of another drawing scenario provided by the embodiments of the present application. As Figure 6 shown, there are three combined entities in the target primary drawing layer, and these three combined entities belong to different secondary drawing layers, namely 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. According to the position of the text editing window, the target area 40 that needs to be redrawn in the historical drawing result is determined. The drawing area of the coordinate system icon intersects with the target area 40, and 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.

[0081] Furthermore, the secondary drawing layers of the text editing window and the coordinate system icon are used as the target secondary drawing layers. The second display level of the coordinate system icon is higher than that of the text editing window, and the text editing window includes two graphic units, namely the positioning frame and the text box, and the third display level of the text box is higher than that of the positioning frame. At this time, the local drawing order from first to last is: the positioning frame, the text box, and the coordinate system icon.

[0082] In some embodiments, S3 includes: generating a minimum rectangle box surrounding the changed graphic unit based on the changed graphic unit, using the area divided by the minimum rectangle box as the target area; determining several associated graphic units within and / or intersecting with the target area; using the changed graphic unit and several of the associated graphic units as the redrawing graphic units.

[0083] Among them, the minimum rectangle box refers to the minimum covering rectangle area generated based on the geometric boundary of the changed graphic unit, which is used to define the scope of the target area.

[0084] Among them, the associated graphic unit refers to a graphic unit located within or intersecting with the target area, and its display state may need to be updated synchronously due to the modification of the changed graphic unit.

[0085] Specifically, based on the position change of the graphic unit, the smallest rectangle enclosing the graphic unit is generated as the target area to be updated, and then several associated graphic units within or intersecting with the rectangle are determined, such as the primitives having a geometric overlap or occlusion relationship with the changed graphic unit. The changed graphic unit and the associated graphic units are jointly used as the redrawn graphic units, and only the primitives within the target area are updated through the local refresh mechanism instead of redrawing the entire hierarchy in full, thus reducing redundant calculations.

[0086] In some embodiments, when a certain graphic unit fails (such as being added, deleted, or modified), it is determined as the changed graphic unit, and the corresponding target first drawing layer of the changed graphic unit is set to an invalid state, and the target first drawing layer in the invalid state is redrawn. All graphic units in the target first drawing layer can be redrawn in the global drawing order, or a local refresh method can also be adopted to retrieve the target area where the changed graphic unit is located, such as approximately expressing the intersecting redrawn graphic units with the smallest rectangle enclosing the changed graphic unit, and redrawing these redrawn graphic units in the local drawing order in the target area of the changed graphic unit.

[0087] The embodiment of the present application introduces a dynamic hierarchy transition mechanism for continuous interaction scenarios, enabling specific primitives to break through the strict hierarchy constraints of the second display hierarchy and the third display hierarchy. The elements in operations such as dragging are temporarily promoted to a dedicated high-level hierarchy for independent refreshing, which not only improves the visibility of the operation but also avoids repeated redrawing of the underlying layer. After the operation ends, it is intelligently reset and triggers a global update. During this process, only the key occlusion relationship is maintained at the first display hierarchy to improve the drawing efficiency in complex scenarios while taking into account the user's visual experience.

[0088] In some embodiments, the second drawing layer includes a preset auxiliary second drawing layer and several ordinary second drawing layers, and the display hierarchy of the auxiliary second drawing layer is higher than that of the several ordinary second drawing layers; the S3 further includes: moving the changed graphic unit from the ordinary second drawing layer to which it belongs to the auxiliary second drawing layer, and performing step S3; when the changed graphic unit stops changing, reassigning the changed graphic unit from the auxiliary second drawing layer to the ordinary second drawing layer to which it originally belonged, and performing step S3.

[0089] Among them, the auxiliary second drawing layer refers to a special second drawing layer with a preset display hierarchy higher than that of the ordinary second drawing layer, which is used to temporarily carry the graphic units in a dynamically changing state, and it has the highest display hierarchy in this first drawing layer. Correspondingly, the ordinary second drawing layer refers to the second drawing layer that exists normally based on the preset layering rules, and its display hierarchy is lower than that of the auxiliary second drawing layer.

[0090] Specifically, when one or more graphic units are detected to have changed, they can be transferred from the ordinary secondary drawing layer to which they belong to the auxiliary secondary drawing layer, so that the changed graphic units have the highest secondary display level in the primary drawing layer to which they belong, ensuring the visualization of operations. When the changed graphic units stop changing, they are then reassigned to the ordinary secondary drawing layer to which they originally belonged to restore the normal display.

[0091] In some embodiments, the attribute changes (such as position, size, shape, etc.) and change frequency of the monitored graphic units within the first preset duration are monitored. If the number of changes per unit time exceeds the preset number threshold and / or the change interval time is shorter than the preset interval threshold, it is determined as continuous change. When one or more graphic units are detected 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 the auxiliary secondary drawing layer to separate the unstable primitives with high-frequency changes from the stable primitives with low-frequency changes; when it is detected that the graphic units do not change within the second preset duration, it is determined that the change has stopped, and then they are reassigned to the ordinary secondary drawing layer to which they originally belonged to restore the normal display, thereby optimizing the local refresh efficiency and the flexibility of level management. Among them, the specific values of the first preset duration and the second preset duration can be set according to the application scenario requirements or response sensitivity of the dynamic level transition mechanism, and are not limited here.

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

[0093] The dynamic level transition mechanism is particularly applicable to the graphic units in the primary drawing layer that have an occlusion relationship with multiple graphic units. It not only improves the visual priority of the continuously changing graphic units but also reduces the associated refresh of the redrawn graphic units during the local refresh process, enhancing both the operation visibility and avoiding repeated redrawing of the underlying layer.

[0094] The dynamic hierarchical transition mechanism is also applicable to the graphic units drawn in a packed manner. For example, in a secondary drawing layer, there are three straight lines A, B, and C. These three straight lines have different coordinates, and the rest of the attributes (such as line type, line width, color, transparency) are exactly the same. At this time, these three straight lines can be drawn in a packed manner to reduce resource consumption. If the position coordinates of line B continue to change due to dragging adjustment, then each change requires re-packing the data and triggering a partial refresh, which instead causes performance loss. At this time, line B is promoted to a dynamic auxiliary secondary drawing layer, and subsequent adjustments of line B are independently managed by the dynamic auxiliary secondary drawing layer, no longer triggering and no longer affecting the packed drawing of lines A and C. Re-packing will only occur when line B is first moved 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 partial refresh and improving the rationality of resource utilization.

[0095] S4. Based on the first display hierarchy between the first-level drawing layers, superimpose the drawing results of several of the first-level drawing layers and the updated drawing result of the target first-level drawing layer to update the drawing.

[0096] Among them, the first display hierarchy 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 graphic element belongs in the entire drawing system.

[0097] Specifically, obtain the current drawing results of all first-level drawing layers, including the updated drawing result of the target first-level drawing layer and the historical drawing results of other first-level drawing layers. Based on the first display hierarchy between the first-level drawing layers, stack these current drawing results in order, and finally generate a complete drawing. For example, the interaction control layer preferentially covers the interface information layer, and the interface information layer covers the operation assistance layer, and so on. All graphic elements will be correctly displayed according to the occlusion relationship. After the stacking 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 CAD software user interface or the output graphic result, that is, the complete image generated after the drawing results of all first-level drawing layers are superimposed according to the first display hierarchy.

[0098] In some embodiments, a plurality of first-level drawing layers are preset according to a preset layering rule. When there are no graphic units in a first-level drawing layer, the corresponding first-level drawing layer does not participate in the drawing.

[0099] It should be understood that in the embodiments of the present 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 the secondary drawing layers of the shared buffer are divided. According to the second display hierarchy of several secondary drawing layers within the same first-level drawing layer and the third display hierarchy between graphic units within the same secondary drawing layer, the drawing order constraint of multiple graphic units is formed.

[0100] When a graphic unit changes, quickly locate the target first-level drawing layer based on the hierarchical subordination relationship and delimit the initial redrawing range. Each first-level drawing layer is equipped with an independent buffer, so that when locally redrawing a specific level, it will not interfere with the content of other levels. Further, by analyzing the change, accurately lock the specific graphic unit, determine the area that actually needs to be locally refreshed in the redrawing range, and the rest can reuse the historical drawing result. On the basis of sharing the buffer, refine the redrawing calculation amount to the smallest range. Among them, the redrawing order strictly follows the preset three-level display rule, so that the drawing result always meets the stacking order constraint and the drawing order constraint, so that the high-level elements always cover the low-level elements, effectively avoiding visual logic disorders such as occlusion and confusion of graphic elements and reversal of display time sequence that may be caused by local refreshing. That is to say, in the embodiments of the present application, through the constraints of multi-level display levels, a feasibility basis is provided for local refreshing, and accurate local redrawing can be achieved in a complex graphic scene, while improving the visual consistency and display accuracy in this process.

[0101] In some embodiments, the buffer of each of the first-level drawing layers is provided with a display attribute; the method further includes: drawing a plurality of graphic units in the corresponding first-level drawing layer according to the display attribute of the buffer.

[0102] Specifically, the display attribute refers to a set of parameters for controlling the drawing effect of graphic units, including transparency, blending mode, visibility, color overlay rule, etc. The buffer of each first-level drawing layer is provided with a unified display attribute, which improves the consistency of visual presentation and functional adaptability between levels.

[0103] Please refer to Figures 7 to 8 , Figure 7 which is a schematic diagram of different display attributes of a buffer provided by an embodiment of the present application; Figure 8 which is another schematic diagram of different display attributes of a buffer provided by an embodiment of the present application. As Figure 7 shown, the display attribute includes an anti-aliasing attribute, and the anti-aliasing attribute is used to smoothly display the graphic units in the buffer. While improving the visual effect, it will increase a certain amount of system overhead. The two images on the left are the effect schematics of turning on anti-aliasing, and the two images on the right are the effect schematics of turning off anti-aliasing. As Figure 8 shown, the display attribute includes a transparency attribute, and the transparency attribute is used to draw semi-transparent entities. After being turned on, it can also improve the visual effect, but it increases the system overhead. The left image is the effect schematic of turning on semi-transparency, and the right image is the effect schematic of turning off semi-transparency.

[0104] In some embodiments, the display attribute of the buffer can be controlled by a corresponding switch in the graphics engine. The primitives on this buffer will automatically use the corresponding attributes for drawing when being drawn.

[0105] In some embodiments, the sizes of all buffers are the same as the size of the display window of the current drawing. The CAD software can pre-define the relationship between graphic units and each drawing layer according to a preset layering rule internally. The first-level drawing layers and the buffers are in one-to-one correspondence. When each graphic element is drawn, it will be automatically drawn onto the corresponding buffer.

[0106] In some embodiments, a number of first-level drawing layers and buffers for each of the first-level drawing layers are established, where the buffers are used to store the drawing results of a number of graphic units in the corresponding first-level drawing layers; when a graphic unit changes, determine the target first-level drawing layer to which the changed graphic unit belongs; redraw the number of graphic units in the target first-level drawing layer to update the drawing result of the target first-level drawing layer; based on the first display hierarchy between the first-level drawing layers, superimpose the drawing results of the number of first-level drawing layers and the updated drawing result of the target first-level drawing layer to update the drawing. For the specific implementation manner, reference can be made to the foregoing embodiments, which will not be elaborated here.

[0107] In some embodiments, count the drawing overhead of each of the second-level drawing layers; when the drawing overhead is greater than the preset drawing overhead, use the corresponding second-level drawing layer as a saturated drawing layer; add a spare drawing layer, and transfer some graphic units in the saturated drawing layer to the spare drawing layer; where the spare drawing layer has the same second display hierarchy as the saturated drawing layer. It should be understood that by monitoring the drawing pressure of each layer in real time and automatically splitting the overloaded layer, the spare layer and the original layer have the same display hierarchy, and on the premise that the graphic logic remains unchanged, it can effectively prevent the overall performance from decreasing due to the overload of a single layer.

[0108] Please refer to Figure 9 , Figure 9 which is a schematic block diagram of the structure of a computer device provided by an embodiment of the present application. The computer device can be a terminal device or a server.

[0109] Exemplarily, the above method can be implemented in the form of a computer program, and the computer program can run on a computer device as shown in Figure 9 .

[0110] As shown in Figure 9 , the computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the memory can include a non-volatile storage medium and an internal memory.

[0111] 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 one of the hierarchical drawing methods.

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

[0113] The internal memory provides an environment for the operation of computer programs in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any one of the hierarchical rendering methods.

[0114] The network interface is used for network communication, such as sending assigned tasks, etc.

[0115] It should be understood that the processor can be a central processing unit (CPU), and the processor 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 them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0116] Among them, in one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps: S1. Establish a number of first-level rendering layers and buffers for each of the first-level rendering layers. Among them, each of the first-level rendering layers includes a number of second-level rendering layers, and a number of the second-level rendering layers in the same first-level rendering layer share the same buffer; the buffer is used to store the rendering results of a number of graphic units in the corresponding first-level rendering layer; S2. When a graphic unit changes, determine the target first-level rendering layer to which the changed graphic unit belongs; S3. Based on the second display hierarchy between the second-level rendering layers and the third display hierarchy within the second-level rendering layers, determine the rendering order of the graphic units; redraw a number of graphic units in the target first-level rendering layer based on the rendering order to update the rendering result of the target first-level rendering layer; S4. Based on the first display hierarchy between the first-level rendering layers, superimpose the rendering results of a number of the first-level rendering layers and the updated rendering result of the target first-level rendering layer to update the drawing.

[0117] In some embodiments, when implementing step S2, the processor is further configured to: when the changed graphic unit is a newly created graphic unit, divide the changed graphic unit 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, use the first-level drawing layer where the changed graphic unit is currently located as the target first-level drawing layer.

[0118] In some embodiments, the processor is further configured to: divide several graphic units in the first-level drawing layer into corresponding second-level drawing layers based on a preset layering rule.

[0119] In some embodiments, the drawing order includes a global drawing order. When implementing step S3, the processor is further configured to: determine the global drawing order among several graphic units in the target first-level drawing layer based on the second display hierarchy between the second-level drawing layers and the third display hierarchy within the second-level drawing layers; and redraw several graphic units in the target first-level drawing layer in sequence based on the global drawing order to update the drawing result of the target first-level drawing layer.

[0120] 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 result of the target first-level drawing layer; determine a target area that needs to be redrawn in the historical drawing result according to the position where the changed graphic unit is located, and there is at least one redrawing graphic unit in the target area; obtain the target second-level drawing layer to which at least one redrawing graphic unit belongs; determine the local drawing order among the redrawing graphic units based on the second display hierarchy between the target second-level drawing layers and the third display hierarchy within the target second-level drawing layers; and redraw the redrawing graphic units in sequence based on the local drawing order to update the drawing result of the target area.

[0121] In some embodiments, when implementing step S3, the processor is further configured to: generate a minimum rectangular box surrounding the changed graphic unit based on the changed graphic unit, and use the area divided by the minimum rectangular box as the target area; determine several associated graphic units located within and / or intersecting with the target area; and use the changed graphic unit and several associated graphic units as the redrawing graphic units.

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

[0123] In some embodiments, a display attribute is set for the buffer of each of the primary drawing layers; the processor is further configured to: draw a plurality of graphic units in the corresponding primary drawing layer according to the display attribute of the buffer.

[0124] Exemplarily, the processor is used to run the computer program stored in the memory, and is further configured to implement the steps of the hierarchical drawing method provided in any embodiment of the present application, which will not be elaborated herein.

[0125] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program includes program instructions. The processor executes the program instructions to implement the steps of the hierarchical drawing method provided in any one of the embodiments of the present application.

[0126] Among them, 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, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device.

[0127] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or substitutions within the technical scope disclosed by the present application, and these modifications or substitutions should be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A hierarchical drawing method, characterized in that, The method includes: S1. Establish a number of first-level drawing layers and a buffer for each of the first-level drawing layers. Among them, each first-level drawing layer includes a number of second-level drawing layers, and the number of second-level drawing layers in the same first-level drawing layer share the same buffer; the buffer is used to store the drawing results of a number of graphic units in the corresponding first-level drawing layer; S2. When a graphic unit changes, determine the target first-level drawing layer to which the changed graphic unit belongs; S3. Based on the second display hierarchy between the second-level drawing layers and the third display hierarchy inside the second-level drawing layers, determine the drawing order of the graphic units; redraw a number of 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; S4. Based on the first display hierarchy between the first-level drawing layers, superimpose the drawing results of a number of the first-level drawing layers and the updated drawing result of the target first-level drawing layer to update the drawing.

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

3. The method according to claim 1, characterized in that, The method further includes: dividing a number of graphic units in the first-level drawing layer into the corresponding second-level drawing layers based on a preset layering rule.

4. The method according to claim 3, characterized in that, The drawing order includes a global drawing order, and the S3 includes: Based on the second display hierarchy between the second-level drawing layers and the third display hierarchy inside the second-level drawing layers, determine the global drawing order between a number of the graphic units in the target first-level drawing layer; Based on the global drawing order, sequentially redraw a number of the graphic units in the target first-level drawing layer to update the drawing result of the target first-level drawing layer.

5. The method according to claim 3, characterized in that The drawing order includes a local drawing order, and the S3 includes: Call the historical drawing result of the target first-level drawing layer; According to the position where the changed graphic unit is located, determine the target area that needs to be redrawn in the historical drawing result, and there is at least one redrawing graphic unit in the target area; Obtain the target second-level drawing layer to which at least one of the redrawing graphic units belongs; Based on the second display hierarchy between the target second-level drawing layers and the third display hierarchy inside the target second-level drawing layers, determine the local drawing order between the redrawing graphic units; Based on the local drawing order, sequentially redraw the redrawing graphic units to update the drawing result of the target area.

6. The method according to claim 5, wherein The S3 includes: Generate a minimum rectangle frame surrounding the changed graphic unit based on the changed graphic unit, and use the area divided by the minimum rectangle frame as the target area; Determine a number of associated graphic units located inside and / or intersecting with the target area; Use the changed graphic unit and a number of the associated graphic units as the redrawing graphic units.

7. The method according to any one of claims 1-6, characterized in that, The secondary drawing layer includes a preset auxiliary secondary drawing layer and a plurality of ordinary secondary drawing layers, and the display level of the auxiliary secondary drawing layer is higher than that of the plurality of ordinary secondary drawing layers; said S3 further includes: Transfer the changed graphic unit from the ordinary secondary drawing layer to which it belongs to the auxiliary secondary drawing layer, and execute step S3; When the changed graphic unit stops changing, reassign the changed graphic unit from the auxiliary secondary drawing layer to the ordinary secondary drawing layer to which it originally belonged, and execute step S3.

8. The method according to claim 1, characterized in that, Each buffer of the primary drawing layer is set with a display attribute; the method further includes: drawing a plurality of graphic units in the corresponding primary drawing layer according to the display attribute of the buffer.

9. A computer device, characterized in that, The device includes: A memory for storing a computer program; A processor for executing the computer program and implementing the hierarchical drawing 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, and when the computer program is executed by the processor, the processor is caused to implement the hierarchical drawing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Local drawing method and system based on multiple layers

    CN107357623A

  • Three-buffer fast interactive drawing method

    CN108710524A

  • Vector graph drawing method, device, storage medium and terminal

    CN110473273A

  • Display device and OSD interface drawing method

    CN115509661A

  • Waveform generation method and device for medical equipment terminal

    CN116245971A

Cited By

  • Nuclear industry drawing identification method, medium and equipment

    CN121033892A