CN113553635A - Method and device for configuring graph base primitive, electronic equipment and storage medium - Google Patents

Method and device for configuring graph base primitive, electronic equipment and storage medium Download PDF

Info

Publication number
CN113553635A
CN113553635A CN202110722169.8A CN202110722169A CN113553635A CN 113553635 A CN113553635 A CN 113553635A CN 202110722169 A CN202110722169 A CN 202110722169A CN 113553635 A CN113553635 A CN 113553635A
Authority
CN
China
Prior art keywords
primitive
configuration file
gallery
sub
attribute
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110722169.8A
Other languages
Chinese (zh)
Inventor
袁子薇
骆正新
杨艳京
叶伟
于磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CRSC Urban Rail Transit Technology Co Ltd
Original Assignee
CRSC Urban Rail Transit Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CRSC Urban Rail Transit Technology Co Ltd filed Critical CRSC Urban Rail Transit Technology Co Ltd
Priority to CN202110722169.8A priority Critical patent/CN113553635A/en
Publication of CN113553635A publication Critical patent/CN113553635A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2111/00Details relating to CAD techniques
    • G06F2111/20Configuration CAD, e.g. designing by assembling or positioning modules selected from libraries of predesigned modules

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a method and a device for configuring a graph base primitive, electronic equipment and a storage medium, wherein the method comprises the following steps: reading a graphic library graphic element configuration file and a graphic element attribute configuration file; the diagram library primitive configuration file comprises sub-diagram element composition description of each primitive; when the gallery is loaded, dynamically assembling each sub-primitive based on the gallery primitive configuration file to form a corresponding parent primitive, and dynamically configuring the attribute of the parent primitive based on the primitive attribute configuration file. According to the gallery primitive configuration method, the gallery primitive configuration device, the electronic equipment and the storage medium, the gallery primitive configuration file and the primitive attribute configuration file are read, when the gallery is loaded, each sub-primitive is dynamically assembled based on the gallery primitive configuration file to form a corresponding parent primitive, and dynamic attribute configuration is performed on the parent primitive based on the primitive attribute configuration file, so that the complexity of primitive configuration is reduced, and the flexibility and the universality of primitive configuration are improved.

Description

Method and device for configuring graph base primitive, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for configuring a diagram base primitive, an electronic device and a storage medium.
Background
CAD (Computer Aided Design) software is the most widely used general Computer Aided Design and drawing software at present, and has strong two-dimensional drawing capability and editing function. The secondary development of CAD can be used for customizing and expanding CAD functions, and the secondary development is supported by both AutoCAD software and domestic CAD software. Among the commonly used secondary development interfaces are AutoLisp,. Net and ObjectARX. By the aid of the interface, a gallery panel can be added in the CAD interface, a CAD application program plug-in is developed and formed, and after the plug-in is loaded in the CAD, a custom gallery with professional characteristics can be displayed in the user drawing interface.
The primitive entity types added by the secondary development mode are divided into block entities and custom entities. The block entity is a type carried in CAD, and can be operated by directly using the interface provided by the block entity, and all secondary development interfaces can define and draw primitives by means of the block entity. The custom entity is unique to ObjectARX secondary development approach, since ObjectARX shares address space with AutoCAD, it can quickly access and manipulate the AutoCAD graphic database. On the basis of the CAD base class entity, a developer can create a new entity, namely a self-defined entity. The operations of drawing and modifying the custom entity can be redefined by a developer.
However, the block entity definition method needs to set the attributes of the primitives in the dwg file defined by the tile block in advance, and needs to define the attributes once for each primitive, and primitives of the same category generally have the same attribute domain, but still need to define the attributes for each primitive, which is a large amount of repetition. And each new primitive needs a corresponding dwg file, because professional galleries of each industry need a large number of primitives, even if only partial characteristics need to be changed, a new primitive dwg file needs to be created, and when the number of the primitives is large, the modification and maintenance difficulty of the primitives is large. Attributes can be added to each type of custom entity in the program by using the custom entity, but in this way, the attributes need to be defined in the program, if the attribute definition needs to be modified, the source code of the program needs to be modified, and a dwg file still needs to be set for each primitive.
Disclosure of Invention
The invention provides a method and a device for configuring graphics primitives of a gallery, electronic equipment and a storage medium, which are used for solving the defects of complex operation and large repeated workload of graphics primitive configuration in the prior art.
The invention provides a method for configuring a graph base primitive, which comprises the following steps:
reading a graphic library graphic element configuration file and a graphic element attribute configuration file; the diagram library primitive configuration file comprises sub-diagram element composition description of each primitive;
when the gallery is loaded, dynamically assembling each sub-primitive based on the gallery primitive configuration file to form a corresponding parent primitive, and dynamically configuring the attribute of the parent primitive based on the primitive attribute configuration file.
According to the method for configuring the graph base graphic elements, provided by the invention, when the graph base is loaded, each sub graphic element is dynamically assembled based on the graph base graphic element configuration file to form a corresponding parent graphic element, and the method specifically comprises the following steps:
determining a selected primitive in a panel;
determining relative coordinates of sub-primitives of the selected primitive based on a sub-primitive composition description of the selected primitive in the gallery primitive configuration file;
drawing each sub-primitive in the working space in a combined manner based on the relative coordinates of each sub-primitive of the selected primitive to form a parent primitive corresponding to the selected primitive.
According to the method for configuring the graph library primitive provided by the invention, the step of drawing each sub-primitive in the working space in a combined manner based on the relative coordinates of each sub-primitive of the selected primitive specifically comprises the following steps:
determining the absolute coordinates of each sub-primitive in the working space based on the coordinates of the insertion point of the selected primitive in the working space and the relative coordinates of each sub-primitive;
reading dwg files of all the sub-primitives;
and drawing the dwg file corresponding to each sub-primitive in the working space based on the absolute coordinates of each sub-primitive in the working space.
According to the method for configuring the graphic primitives of the gallery, provided by the invention, the graphic primitive attribute configuration file comprises attribute information contained in each type of graphic primitive.
According to the method for configuring the graph library primitive provided by the invention, the dynamic attribute configuration is performed on the parent primitive based on the primitive attribute configuration file, and the method specifically comprises the following steps:
inquiring attribute information of the parent primitive from the primitive attribute configuration file based on the type of the parent primitive;
and storing the attribute information of the parent primitive in an extended dictionary of the parent primitive.
According to the method for configuring the diagram library graphic elements, the reading of the diagram library graphic element configuration file and the graphic element attribute configuration file specifically comprises the following steps:
acquiring the gallery primitive configuration file and the primitive attribute configuration file;
performing deserialization extraction on the gallery primitive configuration file and the primitive attribute configuration file to obtain primitive configuration information of each primitive and attribute information of each type of primitive;
and associating the primitives and the primitive attributes according to the primitive types based on the primitive configuration information of each primitive and the attribute information of each primitive.
According to the method for configuring the diagram base graphic element, the diagram base graphic element configuration file and the graphic element attribute configuration file are structured data or semi-structured data.
The invention also provides a device for configuring the graphics primitives of the gallery, comprising:
the configuration file reading unit is used for reading the graphic library graphic element configuration file and the graphic element attribute configuration file; the diagram library primitive configuration file comprises sub-diagram element composition description of each primitive;
and the dynamic loading unit of the gallery is used for dynamically assembling each sub-primitive based on the primitive configuration file of the gallery to form a corresponding parent primitive when the gallery is loaded, and carrying out dynamic attribute configuration on the parent primitive based on the primitive attribute configuration file.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the steps of any one of the gallery primitive configuration methods.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the gallery primitive configuration method as described in any one of the above.
According to the gallery primitive configuration method, the gallery primitive configuration device, the electronic equipment and the storage medium, the gallery primitive configuration file and the primitive attribute configuration file are read, when the gallery is loaded, each sub-primitive is dynamically assembled based on the gallery primitive configuration file to form a corresponding parent primitive, and dynamic attribute configuration is performed on the parent primitive based on the primitive attribute configuration file, so that the complexity of primitive configuration is reduced, and the flexibility and the universality of primitive configuration are improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a method for configuring a diagram base primitive according to the present invention;
FIG. 2 is a schematic diagram of a diagram library primitive configuration method according to the present invention;
FIG. 3 is an exemplary configuration of a gallery primitive configuration file provided by the present invention;
FIG. 4 is an exemplary configuration of a primitive attribute configuration file provided by the present invention;
FIG. 5 is a schematic structural diagram of a gallery primitive configuration apparatus provided in the present invention;
fig. 6 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flowchart of a method for configuring a gallery primitive provided in an embodiment of the present invention, as shown in fig. 1, the method includes:
step 110, reading a gallery primitive configuration file and a primitive attribute configuration file; the diagram library diagram element configuration file comprises the sub-diagram element composition description of each diagram element;
and 120, when the gallery is loaded, dynamically assembling each sub-primitive based on the gallery primitive configuration file to form a corresponding parent primitive, and dynamically configuring the attributes of the parent primitive based on the primitive attribute configuration file.
Specifically, the gallery primitive configuration file is used to define each primitive in the gallery, where configuration information of each primitive is contained, such as a sub-primitive composition description of each primitive. Here, the library primitive configuration file may include, but is not limited to, a category of the primitive, a name of the primitive, a thumbnail of the primitive, a primitive execution command, a sub-primitive composition description, and primitive attributes, among others. The sub-primitive composition description of the primitive can include but is not limited to a path where a file of the sub-primitive is located and an offset of the sub-primitive, and the sub-primitive composition description at least includes a description of one sub-primitive; primitive attributes may include, but are not limited to, an attribute name and its corresponding attribute value. The primitive attribute configuration file may include, but is not limited to, an attribute name, an attribute type, an attribute meaning, and the like of each primitive.
And when the definition or the update of the gallery primitive configuration file and the primitive attribute configuration file is finished, reading the gallery primitive configuration file and the primitive attribute configuration file.
In the process of loading the gallery, each sub-primitive can be dynamically assembled based on the gallery primitive configuration file to form a corresponding parent primitive. Specifically, the description may be formed according to the sub-primitive group corresponding to each primitive in the primitive configuration file of the gallery, and it is determined from which sub-primitive group each primitive is combined. When the graph library is loaded, each sub-primitive can be dynamically assembled into a corresponding parent primitive according to the combination information of each primitive. In addition, dynamic attribute configuration can be performed on the parent primitive based on the primitive attribute configuration file.
The embodiment of the invention disassembles the primitives in the graph library into the sub-primitives of each basis, and describes the sub-primitives contained in each primitive in the graph library primitive configuration file, so that a plurality of sub-primitives can be dynamically assembled into corresponding parent primitives when the graph library is loaded, and a corresponding dwg file does not need to be drawn and stored for each primitive, thereby reducing the complexity of primitive configuration and improving the flexibility of primitive configuration.
In addition, the definition of the primitive and the attribute are respectively stored in an independent configuration file, the definition is separated from the software coding, and the primitive configuration process is dynamically completed in the process of loading the gallery. Therefore, when a designer needs to modify the primitive configuration in the gallery, for example, needs to modify the sub-primitive components or partial attributes of the primitive, the gallery primitive configuration file or the primitive attribute configuration file only needs to be updated correspondingly, and software does not need to be recompiled. After the primitive configuration file or the primitive attribute configuration file of the gallery is updated, the loading process of the gallery is executed, so that the dynamic update of the primitive configuration can be realized, and the flexibility and the universality of the primitive configuration are further improved.
According to the method provided by the embodiment of the invention, the chart base graphic element configuration file and the graphic element attribute configuration file are read, each sub graphic element is dynamically assembled based on the chart base graphic element configuration file when the chart base is loaded, the corresponding parent graphic element is formed, and the dynamic attribute configuration is carried out on the parent graphic element based on the graphic element attribute configuration file, so that the complexity of graphic element configuration is reduced, and the flexibility and the universality of graphic element configuration are improved.
Based on the above embodiment, when loading the gallery, dynamically assembling each sub-primitive based on the gallery primitive configuration file to form a corresponding parent primitive, specifically including:
determining a selected primitive in a panel;
determining relative coordinates of each sub-primitive of the selected primitive based on the sub-primitive composition description of the selected primitive in the gallery primitive configuration file;
and drawing each sub-primitive group in a working space in a combined manner based on the relative coordinates of each sub-primitive of the selected primitive to form a parent primitive corresponding to the selected primitive.
Specifically, for one or more custom entity classes predefined by the ObjectARX development kit, the custom entity class corresponding to the primitive type may be instantiated and configured dynamically according to the primitive definition in the gallery primitive configuration file.
Specifically, after a user clicks on a primitive in a gallery panel, a selected primitive in the current panel may be determined. The relative coordinates of each sub-primitive contained in a selected primitive may be determined based on the sub-primitive composition descriptions of the selected primitive in the library primitive configuration file. The relative coordinates of each sub-primitive can indicate the relative position relationship of each sub-primitive in the corresponding parent primitive. Here, the relative coordinates of each sub-primitive may be determined from the offset of the sub-primitive composition description. According to the relative coordinates of each sub-primitive, each sub-primitive can be drawn in a working space in a combined mode to form a parent primitive corresponding to the selected primitive.
Based on any of the above embodiments, drawing each sub-primitive in the working space in combination based on the relative coordinates of each sub-primitive of the selected primitive, specifically including:
determining the absolute coordinates of each sub-primitive in the working space based on the coordinates of the insertion point of the selected primitive in the working space and the relative coordinates of each sub-primitive;
reading dwg files of all the sub-primitives;
and drawing the dwg file corresponding to each sub-primitive in the working space based on the absolute coordinates of each sub-primitive in the working space.
Specifically, after the user selects the insertion point of the primitive in the workspace, the coordinates of the insertion point of the selected primitive in the workspace are obtained. In combination with the coordinates of the insertion point of the selected primitive in the workspace and the relative coordinates of each sub-primitive, the absolute coordinates of each sub-primitive in the workspace can be determined. The dwg file for each sub-primitive is read. Here, dwg files of the respective sub-primitives may be stored in a primitive source file directory, which may also store thumbnails of the respective sub-primitives, wherein the thumbnails may be files in any picture format, such as jpg files, bmp files, png files, and the like. And then drawing the dwg file corresponding to each sub-primitive in the working space according to the absolute coordinates of each sub-primitive in the working space.
Based on any of the above embodiments, the primitive attribute configuration file includes attribute information included in each type of primitive.
Specifically, the primitive attribute configuration file stores attribute information included in each type of primitive by using the primitive type as a basic storage unit. Therefore, when a designer needs to update the primitive attributes, especially needs to update a certain type of primitives identically, the primitive attribute configuration file can be used for performing update operations such as addition, deletion or modification according to the primitive categories, and attribute update operations do not need to be performed once for each primitive, so that the complexity of primitive attribute configuration is greatly reduced, and the flexibility of primitive configuration is further improved.
According to the method provided by the embodiment of the invention, the attribute information contained in each type of primitive is stored in the primitive attribute configuration file according to the primitive type, so that the complexity of primitive attribute configuration is reduced, and the flexibility of primitive configuration is further improved.
Based on any of the embodiments, the dynamic attribute configuration is performed on the parent primitive based on the primitive attribute configuration file, which specifically includes:
inquiring attribute information of the parent primitive from the primitive attribute configuration file based on the type of the parent primitive;
and storing the attribute information of the parent primitive in an extended dictionary of the parent primitive.
Specifically, the type of the parent primitive is obtained, and the attribute information of the parent primitive is obtained by querying from the primitive attribute configuration file. And then storing the attribute information of the parent primitive in an extended dictionary of the parent primitive to realize the dynamic configuration of the parent primitive attributes. The attribute information may include each attribute and its corresponding default value. If the attribute values of some or all attributes of the parent primitive are also set in the gallery primitive configuration file, the attribute values set in the gallery primitive configuration file need to be stored in the attributes corresponding to the parent primitive extension dictionary, so as to realize the personalized attribute configuration of the primitives.
Based on any of the above embodiments, step 110 specifically includes:
acquiring a graphic library graphic element configuration file and a graphic element attribute configuration file;
performing deserialization extraction on the graph library primitive configuration file and the primitive attribute configuration file to obtain primitive configuration information of each primitive and attribute information of various primitives;
and associating the primitives and the primitive attributes according to the primitive types based on the primitive configuration information of each primitive and the attribute information of each primitive.
Specifically, a gallery primitive configuration file and a primitive attribute configuration file are obtained. The configuration file can be read through a database interface, and can also be dynamically read into the memory variable in a file form (xml, json, EXCEL and other files). And then, performing deserialization extraction on the gallery primitive configuration file and the primitive attribute configuration file to obtain primitive configuration information of each primitive and attribute information of various primitives, and associating the primitives and the primitive attributes according to primitive types based on the primitive configuration information of each primitive and the attribute information of various primitives so as to conveniently read the attribute information of each primitive.
Based on any of the above embodiments, the gallery primitive configuration file and the primitive attribute configuration file are structured data or semi-structured data.
Specifically, the gallery primitive configuration file and the primitive attribute configuration file may be any structured data or semi-structured data to satisfy various application scenarios. For example, the format of the configuration file may include, but is not limited to, an xml text file, a json text file, a relational database, a non-relational database, a text expression or EXCEL table having a fixed semantic grammar format, and the like.
Based on any of the above embodiments, fig. 2 is a schematic diagram of a diagram library primitive configuration method provided by an embodiment of the present invention, as shown in fig. 2, the method mainly includes the following three steps:
defining a graphic library graphic element configuration file and a graphic element attribute configuration file, taking the definition of the graphic element and the definition of the graphic element attribute as configuration items of software, and separating the configuration items from program source codes. Exemplary configurations of the gallery primitive configuration file and primitive attribute configuration file are shown in fig. 3 and 4, respectively.
And reading and preprocessing the gallery primitive configuration file and the primitive attribute configuration file.
And dynamically loading the gallery according to the gallery primitive configuration file and the primitive attribute configuration file. The program defines one or more self-defined entity classes by using an ObjectARX development kit, rewrites functions related to drawing primitives in the classes, then dynamically assembles sub-primitives in a configuration file mode to form a final parent primitive instance, and adds attributes to the primitives. The specific primitive configuration manner is as described in the above embodiments, and is not described herein again.
Based on any of the above embodiments, fig. 5 is a schematic structural diagram of a gallery primitive configuration device provided in an embodiment of the present invention, as shown in fig. 5, the device includes: a configuration file reading unit 510 and a gallery dynamic loading unit 520.
The configuration file reading unit 510 is configured to read a gallery primitive configuration file and a primitive attribute configuration file; the diagram library diagram element configuration file comprises the sub-diagram element composition description of each diagram element;
the gallery dynamic loading unit 520 is configured to, when loading a gallery, dynamically assemble each sub-primitive based on the gallery primitive configuration file to form a corresponding parent primitive, and perform dynamic attribute configuration on the parent primitive based on the primitive attribute configuration file.
According to the device provided by the embodiment of the invention, the chart base graphic element configuration file and the graphic element attribute configuration file are read, each sub graphic element is dynamically assembled based on the chart base graphic element configuration file when the chart base is loaded, the corresponding parent graphic element is formed, and the dynamic attribute configuration is carried out on the parent graphic element based on the graphic element attribute configuration file, so that the complexity of graphic element configuration is reduced, and the flexibility and the universality of graphic element configuration are improved.
Based on any of the above embodiments, when loading the gallery, dynamically assembling each sub-primitive based on the gallery primitive configuration file to form a corresponding parent primitive, specifically including:
determining a selected primitive in a panel;
determining relative coordinates of each sub-primitive of the selected primitive based on the sub-primitive composition description of the selected primitive in the gallery primitive configuration file;
and drawing each sub-primitive group in a working space in a combined manner based on the relative coordinates of each sub-primitive of the selected primitive to form a parent primitive corresponding to the selected primitive.
Based on any of the above embodiments, drawing each sub-primitive in the working space in combination based on the relative coordinates of each sub-primitive of the selected primitive, specifically including:
determining the absolute coordinates of each sub-primitive in the working space based on the coordinates of the insertion point of the selected primitive in the working space and the relative coordinates of each sub-primitive;
reading dwg files of all the sub-primitives;
and drawing the dwg file corresponding to each sub-primitive in the working space based on the absolute coordinates of each sub-primitive in the working space.
Based on any of the above embodiments, the primitive attribute configuration file includes attribute information included in each type of primitive.
According to the device provided by the embodiment of the invention, the attribute information contained in each type of primitive is stored in the primitive attribute configuration file according to the primitive type, so that the complexity of primitive attribute configuration is reduced, and the flexibility of primitive configuration is further improved.
Based on any of the embodiments, the dynamic attribute configuration is performed on the parent primitive based on the primitive attribute configuration file, which specifically includes:
inquiring attribute information of the parent primitive from the primitive attribute configuration file based on the type of the parent primitive;
and storing the attribute information of the parent primitive in an extended dictionary of the parent primitive.
Based on any of the above embodiments, the configuration file reading unit 510 is specifically configured to:
acquiring a graphic library graphic element configuration file and a graphic element attribute configuration file;
performing deserialization extraction on the graph library primitive configuration file and the primitive attribute configuration file to obtain primitive configuration information of each primitive and attribute information of various primitives;
and associating the primitives and the primitive attributes according to the primitive types based on the primitive configuration information of each primitive and the attribute information of each primitive.
Based on any of the above embodiments, the gallery primitive configuration file and the primitive attribute configuration file are structured data or semi-structured data.
Fig. 6 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 6: a processor (processor)610, a communication Interface (Communications Interface)620, a memory (memory)630 and a communication bus 640, wherein the processor 610, the communication Interface 620 and the memory 630 communicate with each other via the communication bus 640. Processor 610 may invoke logic instructions in memory 630 to perform a method of gallery primitive configuration, the method comprising: reading a graphic library graphic element configuration file and a graphic element attribute configuration file; the diagram library primitive configuration file comprises sub-diagram element composition description of each primitive; when the gallery is loaded, dynamically assembling each sub-primitive based on the gallery primitive configuration file to form a corresponding parent primitive, and dynamically configuring the attribute of the parent primitive based on the primitive attribute configuration file.
In addition, the logic instructions in the memory 630 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer being capable of executing the method for gallery primitive configuration provided by the above methods, the method including: reading a graphic library graphic element configuration file and a graphic element attribute configuration file; the diagram library primitive configuration file comprises sub-diagram element composition description of each primitive; when the gallery is loaded, dynamically assembling each sub-primitive based on the gallery primitive configuration file to form a corresponding parent primitive, and dynamically configuring the attribute of the parent primitive based on the primitive attribute configuration file.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform the method for gallery primitive configuration provided in the above aspects, the method including: reading a graphic library graphic element configuration file and a graphic element attribute configuration file; the diagram library primitive configuration file comprises sub-diagram element composition description of each primitive; when the gallery is loaded, dynamically assembling each sub-primitive based on the gallery primitive configuration file to form a corresponding parent primitive, and dynamically configuring the attribute of the parent primitive based on the primitive attribute configuration file.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for configuring a gallery primitive, comprising:
reading a graphic library graphic element configuration file and a graphic element attribute configuration file; the diagram library primitive configuration file comprises sub-diagram element composition description of each primitive;
when the gallery is loaded, dynamically assembling each sub-primitive based on the gallery primitive configuration file to form a corresponding parent primitive, and dynamically configuring the attribute of the parent primitive based on the primitive attribute configuration file.
2. The method for configuring a primitive in a gallery according to claim 1, wherein, when loading the gallery, dynamically assembling each sub-primitive based on the gallery primitive configuration file to form a corresponding parent primitive, specifically comprising:
determining a selected primitive in a panel;
determining relative coordinates of sub-primitives of the selected primitive based on a sub-primitive composition description of the selected primitive in the gallery primitive configuration file;
drawing each sub-primitive in the working space in a combined manner based on the relative coordinates of each sub-primitive of the selected primitive to form a parent primitive corresponding to the selected primitive.
3. The method for configuring a gallery primitive according to claim 2, wherein the drawing of each sub-primitive in the working space based on the relative coordinates of each sub-primitive of the selected primitive in combination comprises:
determining the absolute coordinates of each sub-primitive in the working space based on the coordinates of the insertion point of the selected primitive in the working space and the relative coordinates of each sub-primitive;
reading dwg files of all the sub-primitives;
and drawing the dwg file corresponding to each sub-primitive in the working space based on the absolute coordinates of each sub-primitive in the working space.
4. The method for configuring the primitive in the gallery according to claim 1, wherein the primitive attribute configuration file includes attribute information included in each type of primitive.
5. The gallery primitive configuration method according to claim 4, wherein the dynamic attribute configuration of the parent primitive based on the primitive attribute configuration file specifically includes:
inquiring attribute information of the parent primitive from the primitive attribute configuration file based on the type of the parent primitive;
and storing the attribute information of the parent primitive in an extended dictionary of the parent primitive.
6. The gallery primitive configuration method according to claim 4, wherein reading the gallery primitive configuration file and the primitive attribute configuration file specifically includes:
acquiring the gallery primitive configuration file and the primitive attribute configuration file;
performing deserialization extraction on the gallery primitive configuration file and the primitive attribute configuration file to obtain primitive configuration information of each primitive and attribute information of each type of primitive;
and associating the primitives and the primitive attributes according to the primitive types based on the primitive configuration information of each primitive and the attribute information of each primitive.
7. The method of any of claims 1-6, wherein the gallery primitive configuration file and the primitive attribute configuration file are structured data or semi-structured data.
8. A gallery primitive configuration apparatus, comprising:
the configuration file reading unit is used for reading the graphic library graphic element configuration file and the graphic element attribute configuration file; the diagram library primitive configuration file comprises sub-diagram element composition description of each primitive;
and the dynamic loading unit of the gallery is used for dynamically assembling each sub-primitive based on the primitive configuration file of the gallery to form a corresponding parent primitive when the gallery is loaded, and carrying out dynamic attribute configuration on the parent primitive based on the primitive attribute configuration file.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method for gallery primitive configuration according to any one of claims 1 to 7 when executing the program.
10. A non-transitory computer readable storage medium, having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the gallery primitive configuration method according to any one of claims 1 to 7.
CN202110722169.8A 2021-06-28 2021-06-28 Method and device for configuring graph base primitive, electronic equipment and storage medium Pending CN113553635A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110722169.8A CN113553635A (en) 2021-06-28 2021-06-28 Method and device for configuring graph base primitive, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110722169.8A CN113553635A (en) 2021-06-28 2021-06-28 Method and device for configuring graph base primitive, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113553635A true CN113553635A (en) 2021-10-26

Family

ID=78131011

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110722169.8A Pending CN113553635A (en) 2021-06-28 2021-06-28 Method and device for configuring graph base primitive, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113553635A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115033329A (en) * 2022-06-22 2022-09-09 北京世冠金洋科技发展有限公司 Virtual subsystem creating method and related device
CN116385253A (en) * 2023-01-06 2023-07-04 格兰菲智能科技有限公司 Primitive drawing method, device, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092585A (en) * 2011-11-04 2013-05-08 上海宝信软件股份有限公司 Image library configuration design system for integrated supervision software
CA2758363A1 (en) * 2011-11-14 2013-05-14 Ian M. Baranesky Machine and method for modifying, extracting and displaying cad drawing block attributes in an intuitive workflow
CN104573213A (en) * 2014-12-30 2015-04-29 国电南瑞科技股份有限公司 G-language-based generating method of intelligent electronic equipment electric wiring graph
CN105653515A (en) * 2016-03-09 2016-06-08 国电南瑞科技股份有限公司 Method for maintaining graphic file of power system off line
CN106250129A (en) * 2016-07-26 2016-12-21 南京航空航天大学 The vector quantization dynamic drawing method of symbol based on meta graph recognition model
CN109960538A (en) * 2017-12-21 2019-07-02 深圳市金证科技股份有限公司 A kind of configuration interface management method, configuration interface managing device and electronic equipment
CN111897503A (en) * 2020-06-28 2020-11-06 通号城市轨道交通技术有限公司 Display control method and display control terminal

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092585A (en) * 2011-11-04 2013-05-08 上海宝信软件股份有限公司 Image library configuration design system for integrated supervision software
CA2758363A1 (en) * 2011-11-14 2013-05-14 Ian M. Baranesky Machine and method for modifying, extracting and displaying cad drawing block attributes in an intuitive workflow
CN104573213A (en) * 2014-12-30 2015-04-29 国电南瑞科技股份有限公司 G-language-based generating method of intelligent electronic equipment electric wiring graph
CN105653515A (en) * 2016-03-09 2016-06-08 国电南瑞科技股份有限公司 Method for maintaining graphic file of power system off line
CN106250129A (en) * 2016-07-26 2016-12-21 南京航空航天大学 The vector quantization dynamic drawing method of symbol based on meta graph recognition model
CN109960538A (en) * 2017-12-21 2019-07-02 深圳市金证科技股份有限公司 A kind of configuration interface management method, configuration interface managing device and electronic equipment
CN111897503A (en) * 2020-06-28 2020-11-06 通号城市轨道交通技术有限公司 Display control method and display control terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郑晖;刘艳敏;马小康;: "基于ArcGIS for AutoCAD的空间数据建库方法研究", 城市勘测, no. 01, 30 April 2020 (2020-04-30) *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115033329A (en) * 2022-06-22 2022-09-09 北京世冠金洋科技发展有限公司 Virtual subsystem creating method and related device
CN115033329B (en) * 2022-06-22 2023-09-26 北京世冠金洋科技发展有限公司 Virtual subsystem creation method and related device
CN116385253A (en) * 2023-01-06 2023-07-04 格兰菲智能科技有限公司 Primitive drawing method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
TWI808393B (en) Page processing method, device, apparatus and storage medium
CN105511873B (en) User interface control display method and device
CN111045655B (en) Page rendering method and device, rendering server and storage medium
CN112099792B (en) Visual UI style design method and system
CN113553635A (en) Method and device for configuring graph base primitive, electronic equipment and storage medium
US20140317563A1 (en) Generate field mapping
CN111249736B (en) Code processing method and device
CN110309461B (en) Page display method and device
US20050289450A1 (en) User interface virtualization
CN110941614A (en) Form generation method and device, electronic equipment and computer readable storage medium
CN106055535B (en) Chart generation method and device
JPH06290086A (en) Structure data processor
CN112732239A (en) Page dynamic generation method and system, corresponding equipment and storage medium
CN109408322B (en) A kind of automatic business process implementation method of cloud platform
CN112181409A (en) Application construction method, application rendering method and device
CN115827809A (en) Method and device for generating Geographic Information System (GIS) application
CN112486378B (en) Graph generation method, device, terminal and storage medium
CN114489619A (en) Interface view display method, terminal equipment and computer readable storage medium
CN115080046A (en) Multi-component abstract association fusion method and device in page design
CN115687704A (en) Information display method and device, electronic equipment and computer readable storage medium
CN113642054A (en) CAD drawing data processing method, device and storage medium
CN112883044A (en) Data processing method and device for database and computer readable medium
CN111078337A (en) Pattern adjusting method, system and computer readable storage medium
CN110688108A (en) Model generation method and device and storage medium
CN112988136B (en) User interface editing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination