Graphic object selection method and system
By setting technical means of intersection testing and outline display in the graphic object selection method, the problem of difficult graphic object selection operation in traditional methods is solved, and more efficient and accurate graphic object selection is achieved.
Patent Information
- Application Number
- CN202510059300.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-05-16
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional graphic object selection method is difficult to operate when selecting multiple graphic objects with similar distances or overlapping relationships, especially when the objects are small or overlapping, operation is difficult, and frequent scaling of the picture will reduce the efficiency of the operation.
By setting different test methods, the areas are intersected, the test results of the test area are obtained, and the sets containing the graphic objects to be selected are filtered out. According to the names of each graphic object in the set, the outline corresponding to the graphic object is determined, and the graphic object to be selected is selected.
It improves the accuracy of mouse operations and simplifies the selection process of graphic objects, especially when the objects are small or overlapping, improving the operation efficiency and selection effect.
Smart Images

Figure CN120010981A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer graphics technology, and more specifically to a method and system for selecting a graphic object. Background Art
[0002] The traditional method of selecting graphic objects is difficult to operate when selecting multiple graphic objects that are close to each other or have overlapping relationships. Take the point selection in CAD software as an example. Suppose there is a very dense series of graphic objects in the software, and now you need to select a specific one. When operating, you need to move the mouse very carefully or zoom in the picture first before you can select it conveniently. Frequent zooming in and out of the picture will reduce the efficiency of the operation.
[0003] At present, the existing graphic object selection action is too dependent on the precise control of the mouse position. When the selected objects are small or overlapping, the operation is difficult. Although the difficulty of mouse control can be reduced by zooming the screen, it brings additional operational burden, resulting in poor selection effect of overlapping objects. Summary of the invention
[0004] In response to the problems existing in the above-mentioned fields, the present invention proposes a method and system for selecting graphic objects. By setting different test methods, intersection tests are performed on areas, and test results of the test areas are obtained. A set containing graphic objects to be selected is screened out, and the contours corresponding to the graphic objects are determined according to the names of the graphic objects in the set. The graphic objects to be selected are selected, and the names of the graphic objects are combined with the contours to accurately select the graphic objects.
[0005] In order to solve the above technical problems, the present invention discloses a method for selecting a graphic object, comprising the following steps:
[0006] Determine the execution of graphic object selection based on the duration of the mouse click;
[0007] According to the position where the mouse is clicked, the preset area type and shape attributes corresponding to the position are determined, and areas of different shapes are generated;
[0008] Determine the test method of the graphic object to be selected according to the shape, size and position of the area; perform an intersection test on the area according to the test method of the graphic object to be selected, and obtain the test results of the intersection graphics of all different area types in the test area;
[0009] Test the test results of all intersecting graphics of different area types in the test area, and filter out a set containing the graphic objects to be selected;
[0010] According to the name of each graphic object in the set, the outline corresponding to the graphic object is determined; according to the outline corresponding to the graphic object, the graphic object to be selected is selected.
[0011] Preferably, the determining of the preset area type and shape attribute corresponding to the position specifically includes:
[0012] Pre-set area types include circle, square, and rectangle;
[0013] When the preset area type is a circle, the shape attribute corresponding to the circle graphic object is the radius;
[0014] When the preset area type is a square, the shape attribute corresponding to the square graphic object is the side length;
[0015] When the preset area type is a rectangle, the shape attributes corresponding to the rectangle graphic object are length and width.
[0016] Preferably, generating regions of different shapes comprises the following steps:
[0017] By detecting the mouse click action, the position of the mouse click is recorded;
[0018] The type of mouse click is determined by the duration of the mouse click. When it is greater than the set value, it is a long press and graphic object selection is performed. Areas of different shapes are generated according to the position of the mouse click and the pre-set area type and size. When it is less than the set value, it is a short press and is processed as a single selection.
[0019] Preferably, the test method for determining the graphic object to be selected specifically includes:
[0020] According to the different shapes of the graphic objects to be selected, the test parameters of the graphic objects are set differently, and the test methods are also different;
[0021] When the graphic object to be selected is a circular area, according to the center position coordinates and radius of the circular area, the test returns an integer including 0, 1, 2 and 3, where 0 means that the test area does not intersect with the graphic object, 1 means that the test area partially intersects with the graphic object, 2 means that the test area contains the graphic object, and 3 means that the graphic object contains the test area;
[0022] When the graphic object to be selected is a square area, input the upper left corner position of the square area to be tested and the side length of the square area to be tested. If the test passes, an integer is returned, including 0, 1, 2 and 3, where 0 means that the test area does not intersect with the graphic object, 1 means that the test area partially intersects with the graphic object, 2 means that the test area contains the graphic object, and 3 means that the graphic object contains the test area;
[0023] When the graphic object to be selected is a rectangular area, input the upper left corner position of the test rectangular area, the width and height of the test rectangular area. If the test passes, an integer is returned, including 0, 1, 2 and 3, where 0 indicates that the test area does not intersect with the graphic object, 1 indicates that the test area partially intersects with the graphic object, 2 indicates that the test area contains the graphic object, and 3 indicates that the graphic object contains the test area.
[0024] Preferably, obtaining the test results of all intersection graphs of different area types in the test area includes the following steps:
[0025] When the intersection area is a circular area, according to the center position coordinates of the tested circular area and the radius of the tested circular area, when the tested area intersects with the graphic object, the test result corresponding to the case where the intersection area is a circular area is obtained;
[0026] When the intersecting area is a square area, according to the upper left corner position of the tested square area and the side length of the tested square area, when the tested area intersects with the graphic object, the test result corresponding to the case where the intersecting area is a square area is obtained;
[0027] When the intersecting area is a rectangular area, according to the upper left corner position of the tested rectangular area, the width and height of the tested rectangular area, when the test area intersects with the graphic object, the corresponding test result when the intersecting area is a rectangular area is obtained.
[0028] Preferably, the step of filtering out a set of graphic objects to be selected specifically includes:
[0029] For a single graphic object, select by clicking it; for multiple graphic objects, select by boxing them. The working process is as follows:
[0030] Detect the mouse pressing action and record the mouse pressing position;
[0031] Track mouse movements and draw selection boxes on the screen;
[0032] Detect the mouse release action and record the mouse release position;
[0033] Calculate the selection range based on the mouse press and release positions;
[0034] Design a grid area according to the selection range; filter out the graphic objects to be selected according to the designed grid area;
[0035] Perform intersection or containment tests on the graphic objects to be selected, add the graphic objects that pass the test to the selected object set, and return the objects in the set after all tests are completed to obtain a set containing the graphic objects to be selected.
[0036] Preferably, determining the contour corresponding to the graphic object specifically includes:
[0037] The menu that pops up next to the mouse click position displays the names of the graphic objects that passed the intersection test;
[0038] When the mouse moves over a menu item, the corresponding graphic object is temporarily moved to the top layer, and the outline of the graphic object is displayed accordingly; when the mouse moves away, the corresponding graphic object returns to the original layer and the outline is no longer displayed.
[0039] Preferably, the selecting of the graphic object to be selected comprises the following steps:
[0040] The selection of the graphic objects to be selected includes single selection and multiple selection;
[0041] The single selection process is to click the mouse on the menu item, the corresponding graphic object is selected, and the single selection is completed;
[0042] The multiple selection process is to hold down the CTRL key on the keyboard and click the menu items. The corresponding graphic objects are added to the selection list, and a check mark is displayed in front of the menu items. Click the blank area or press the ESC key on the keyboard to complete the multiple selection.
[0043] Preferably, a system for selecting a graphic object is also included, comprising:
[0044] The area test module is used to determine the execution of graphic object selection according to the duration of the mouse click; determine the preset area type and shape attribute corresponding to the position according to the position of the mouse click, and generate areas of different shapes; determine the test method of the graphic object to be selected according to the shape, size and position of the area; perform intersection test on the area according to the test method of the graphic object to be selected, and obtain the test results of all intersection graphics of different area types in the test area;
[0045] A module for filtering a set of graphic objects to be selected, which is used to test the test results of all intersecting graphics of different area types in the test area, and filter out a set containing the graphic objects to be selected;
[0046] The graphic object selection module is used to determine the outline corresponding to the graphic object according to the name of each graphic object in the set; and select the graphic object to be selected according to the outline corresponding to the graphic object.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] The method for selecting a graphic object proposed in the present invention determines the preset area type and shape attribute corresponding to the position of the mouse click, generates areas of different shapes, and determines the test method of the graphic object to be selected according to the shape, size and position of the area. By setting different test methods, it is convenient to test areas of different shapes. According to the test method of the graphic object to be selected, the area is tested for intersection, the test results of all the intersection graphics of different area types in the test area are obtained, and a set containing the graphic object to be selected is screened out, and the operation accuracy of the mouse is improved by area screening. According to the name of each graphic object in the set, the outline corresponding to the graphic object is determined, and the graphic object to be selected is selected, and the name of the graphic object is combined with the outline, avoiding the problem of difficult operation in the prior art due to over-reliance on the precise control of the mouse position when the selected object is small or overlapped, facilitating the accurate selection of the graphic object, and making the selection process more intuitive by displaying the outline. When the selected object is small or overlapped, the method can improve the operation efficiency and selection effect of graphic selection. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a flow chart of the method for selecting a graphic object proposed by the present invention.
[0050] Figure 2 It is a framework diagram of the steps of executing the method for selecting a graphic object proposed by the present invention;
[0051] Figure 3 is an example diagram of a circle and two rectangles provided in an embodiment of the present invention;
[0052] Figure 4 is an example diagram of a test of an intersection area of a circle and two rectangles provided in an embodiment of the present invention;
[0053] Figure 5 This is an example diagram of drawing the outline of a circular and two rectangular graphic objects provided by an embodiment of the present invention;
[0054] Figure 6 This is an example diagram of multiple selection of one circular and two rectangular graphic objects provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The following will be combined with the attached embodiment of the present invention Figure 1-Figure 6 , the technical solutions in the embodiments of the present invention are clearly and completely described. It should be understood that the terms described in the present invention are only used to describe specific implementation methods and are not used to limit the present invention.
[0056] like Figure 1 As shown, a method for selecting a graphic object proposed by the present invention includes the following steps:
[0057] S1: Determine the execution of graphic object selection according to the duration of the mouse click; determine the preset area type and shape attribute corresponding to the position according to the position of the mouse click, and generate areas of different shapes; determine the test method of the graphic object to be selected according to the shape, size and position of the area; perform intersection test on the area according to the test method of the graphic object to be selected, and obtain the test results of all intersection graphics of different area types in the test area;
[0058] S2: Filter out a set of graphic objects to be selected according to the test results of all intersecting graphics of different area types in the test area;
[0059] S3: Determine the outline corresponding to the graphic object according to the name of each graphic object in the set; and select the graphic object to be selected according to the outline corresponding to the graphic object.
[0060] Specifically, in step S1, the pre-set region type and shape attributes specifically include:
[0061] Pre-set area types include circle, square, and rectangle;
[0062] When the preset area type is a circle, the shape attribute corresponding to the circle graphic object is the radius; when the preset area type is a square, the shape attribute corresponding to the square graphic object is the side length; when the preset area type is a rectangle, the shape attributes corresponding to the rectangle graphic object are the length and width.
[0063] Generating regions of different shapes includes the following steps:
[0064] By detecting the mouse click action, the position of the mouse click is recorded;
[0065] The type of mouse click is determined by the duration of the mouse click. When it is greater than the set value, it is a long press and the graphic object selection is executed. According to the position of the mouse click and the pre-set area type and size, areas of different shapes are generated; when it is less than the set value, it is a short press and single selection is processed, such as Figure 2 shown.
[0066] The test method for determining the graphic object to be selected includes:
[0067] According to the different shapes of the graphic objects to be selected, the test parameters of the graphic objects are set differently, and the test methods are also different;
[0068] When the graphic object to be selected is a circular area, according to the center position coordinates and radius of the circular area, the test returns an integer including 0, 1, 2 and 3, where 0 means that the test area does not intersect with the graphic object, 1 means that the test area partially intersects with the graphic object, 2 means that the test area contains the graphic object, and 3 means that the graphic object contains the test area;
[0069] When the graphic object to be selected is a square area, input the upper left corner position of the square area to be tested and the side length of the square area to be tested. If the test passes, an integer is returned, including 0, 1, 2 and 3, where 0 means that the test area does not intersect with the graphic object, 1 means that the test area partially intersects with the graphic object, 2 means that the test area contains the graphic object, and 3 means that the graphic object contains the test area;
[0070] When the graphic object to be selected is a rectangular area, input the upper left corner position of the test rectangular area, the width and height of the test rectangular area. If the test passes, an integer is returned, including 0, 1, 2 and 3, where 0 indicates that the test area does not intersect with the graphic object, 1 indicates that the test area partially intersects with the graphic object, 2 indicates that the test area contains the graphic object, and 3 indicates that the graphic object contains the test area.
[0071] Obtaining the test results of the test area includes the following steps:
[0072] When the intersection area is a circular area, according to the center position coordinates of the tested circular area and the radius of the tested circular area, when the tested area intersects with the graphic object, the test result corresponding to the case where the intersection area is a circular area is obtained;
[0073] When the intersecting area is a square area, according to the upper left corner position of the tested square area and the side length of the tested square area, when the tested area intersects with the graphic object, the test result corresponding to the case where the intersecting area is a square area is obtained;
[0074] When the intersecting area is a rectangular area, according to the upper left corner position of the tested rectangular area, the width and height of the tested rectangular area, when the test area intersects with the graphic object, the corresponding test result when the intersecting area is a rectangular area is obtained.
[0075] In step S2, a set of graphic objects to be selected is screened out, specifically including:
[0076] For a single graphic object, select by clicking it; for multiple graphic objects, select by boxing them. The working process is as follows:
[0077] Detect the mouse pressing action and record the mouse pressing position;
[0078] Track mouse movements and draw selection boxes on the screen;
[0079] Detect the mouse release action and record the mouse release position;
[0080] Calculate the selection range based on the mouse press and release positions;
[0081] Design a grid area according to the selection range; filter out the graphic objects to be selected according to the designed grid area;
[0082] Perform intersection or containment tests on the graphic objects to be selected, add the graphic objects that pass the test to the selected object set, and return the objects in the set after all tests are completed to obtain a set containing the graphic objects to be selected.
[0083] In step S3, determining the contour corresponding to the graphic object specifically includes:
[0084] The menu that pops up next to the mouse click position displays the names of the graphic objects that passed the intersection test;
[0085] When the mouse moves over a menu item, the corresponding graphic object is temporarily moved to the top layer, and the outline of the graphic object is displayed accordingly; when the mouse moves away, the corresponding graphic object returns to the original layer and the outline is no longer displayed.
[0086] Selecting the graphic object to be selected includes the following steps:
[0087] The selection of the graphic objects to be selected includes single selection and multiple selection;
[0088] The single selection process is to click the mouse on the menu item, the corresponding graphic object is selected, and the single selection is completed;
[0089] The multiple selection process is to hold down the CTRL key on the keyboard and click the menu items. The corresponding graphic objects are added to the selection list, and a check mark is displayed in front of the menu items. Click the blank area or press the ESC key on the keyboard to complete the multiple selection.
[0090] The present invention also proposes a system for selecting a graphic object, comprising:
[0091] The area test module is used to determine the execution of graphic object selection according to the duration of the mouse click; determine the preset area type and shape attribute corresponding to the position according to the position of the mouse click, and generate areas of different shapes; determine the test method of the graphic object to be selected according to the shape, size and position of the area; perform intersection test on the area according to the test method of the graphic object to be selected, and obtain the test results of all intersection graphics of different area types in the test area;
[0092] A module for filtering a set of graphic objects to be selected, which is used to test the test results of all intersecting graphics of different area types in the test area, and filter out a set containing the graphic objects to be selected;
[0093] The graphic object selection module is used to determine the outline corresponding to the graphic object according to the name of each graphic object in the set; and select the graphic object to be selected according to the outline corresponding to the graphic object.
[0094] The method proposed by the present invention simplifies the operation steps and improves the operation efficiency when accurately selecting multiple small-sized graphics.
[0095] Graphics objects include basic graphics objects and specific graphics object data structures, where:
[0096] The basic graphic object is the abstract base class of all graphic objects and is stored in a linked list. Its data structure is shown in the following pseudo code:
[0097] Object
[0098] {
[0099] Const Int type;
[0100] String name;
[0101] Double posX;
[0102] Double posY;
[0103] Object next;
[0104] Bool hitTest(Double x,Double y);
[0105] Int circleIntersectTest(Double x,Double y,Double r);
[0106] Int squareIntersectTest(Double x,Double y,Double w,Double h);
[0107] Void draw(Double x,Double y);
[0108] Void drawFrame(Double x,Double y);
[0109] }
[0110] The attribute type is the graphic object type, which is read-only. Specific graphic objects are distinguished by rewriting type during the initialization process.
[0111] name is the name of the graphic object, which can be automatically generated or manually modified.
[0112] posX and posY are the positions of the graphic objects. Their meanings are defined by different types of graphic objects. For example, for a circle, they can represent the center position, and for a rectangle, they can represent the upper left corner position.
[0113] next is a pointer to the next object.
[0114] The method hitTest is a click test method. The input parameters x and y are the mouse click positions. If the click test passes, true is returned; otherwise, false is returned. The specific code needs to be implemented in a specific graphic object.
[0115] The method circleIntersectTest is a circular area intersection test method. The input parameters x and y are the center position of the test circular area, and r is the radius of the test circular area. If the test passes, an integer is returned. 0 means that the test area does not intersect with the graphic object, 1 means that the test area partially intersects with the graphic object, 2 means that the test area contains the graphic object, and 3 means that the graphic object contains the test area. The specific code needs to be implemented in a specific graphic object.
[0116] The method rectangleIntersectTest is a rectangular area intersection test method. The input parameters x and y are the upper left corner position of the test rectangular area, w and h are the width and height of the test rectangular area. If the test passes, an integer is returned. 0 means that the test area does not intersect with the graphic object, 1 means that the test area partially intersects with the graphic object, 2 means that the test area contains the graphic object, and 3 means that the graphic object contains the test area. The specific code needs to be implemented in a specific graphic object.
[0117] The method squareIntersectTest is a square area intersection test method. The input parameters x and y are the upper left corner position of the test square area, and a is the side length of the test square area. If the test passes, an integer is returned. 0 indicates that the test area does not intersect with the graphic object, 1 indicates that the test area partially intersects with the graphic object, 2 indicates that the test area contains the graphic object, and 3 indicates that the graphic object contains the test area. The specific code needs to be implemented in a specific graphic object.
[0118] The method draw is used to draw objects. The input parameters x and y are the drawing positions. The specific code needs to be implemented in a specific graphics object.
[0119] The method drawFrame is used to draw the outline of an object. The input parameters x and y are the drawing positions. The specific code needs to be implemented in a specific graphics object.
[0120] Specific graphic objects inherit from basic graphic objects and are used to represent characteristic type graphics such as circles and rectangles. Their data structure is shown in the following pseudo code:
[0121] Circle override Object
[0122] {
[0123] Const Int type = CIRCLE;
[0124] Double radius;
[0125] }
[0126] Rectangle override Object
[0127] {
[0128] Const Int type = RECTANGLE;
[0129] Double width;
[0130] Double height;
[0131] }
[0132] During the initialization process, the circle object rewrites type to the constant CIRCLE, and the new attribute radius of the circle object represents the radius r; during the initialization process, the rectangle object rewrites type to the constant RECTANGLE, and the new attributes width and height of the rectangle object represent the width w and height h; during the initialization process, the square object rewrites type to the constant SQUARE, and the new attribute side length of the square object represents the side length a.
[0133] The circle, rectangle, and square objects also need to override hitTest, draw, and drawFrame to implement their respective behaviors.
[0134] Example
[0135] The present invention takes a specific scene as an example to introduce the selection process. The scene includes a circle and two rectangles. The distribution of graphic objects is as follows: Figure 3 shown. Figure 3 The three graphic images in the figure cover each other, and it is difficult to accurately select them using traditional methods. The specific process of the method for selecting graphic objects proposed by the present invention is introduced below, including the following steps:
[0136] ①Detect mouse click action and record click position;
[0137] ② Determine the mouse click time. If it is less than the set value, process it according to the single selection. If it is greater than the set value, go to step ③;
[0138] ③ Generate a circular, square or rectangular area according to the click position (generated according to the pre-set area type and size, hereinafter referred to as "area"), and filter out graphic objects that may intersect with the area according to the grid where the area is located;
[0139] ④ Perform region intersection test on graphic objects that may intersect with the region, and record those that pass the test in an array;
[0140] ⑤ A menu pops up next to the click position. The menu items are the names of the graphic objects that passed the intersection test, such as Figure 4 As shown;
[0141] ⑥ When the mouse moves to a menu item, the corresponding graphic object is temporarily moved to the top layer and the outline of the graphic object is displayed. When the mouse moves away, the corresponding graphic object returns to the original layer and the outline is no longer displayed. Figure 5 As shown in Figures (a) and (b);
[0142] ⑦ Click the menu item with the mouse, the corresponding graphic object is selected, and the single selection is completed;
[0143] ⑧If you hold down the CTRL key on the keyboard and click a menu item, the corresponding graphic object will be added to the selection list, and a check mark will be displayed in front of the menu item. Click a blank area or press the ESC key on the keyboard to complete the multiple selection. Figure 6 shown.
[0144] When selecting multiple small-sized graphics, the method provided by the embodiment of the present invention has simpler operation steps, and improved operation accuracy and efficiency compared to traditional click selection or frame selection.
[0145] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
[0146] In addition, unless otherwise specified, all technical and scientific terms used in the present invention have the same meanings as commonly understood by those skilled in the art to which the present invention belongs. All documents mentioned in this specification are incorporated by reference to disclose and describe the methods related to the documents. In the event of any conflict with any incorporated document, the content of this specification shall prevail.
Claims
1. A method for selecting a graphic object, characterized in that: The following steps are involved: Determine the execution of graphic object selection based on the duration of the mouse click; According to the position where the mouse is clicked, the preset area type and shape attributes corresponding to the position are determined, and areas of different shapes are generated; Determine the test method of the graphic object to be selected according to the shape, size and position of the area; According to the test method of the graphic object to be selected, the region is subjected to intersection test, and the test results of all the intersection graphics of different region types in the test region are obtained; Test the test results of all intersecting graphics of different area types in the test area, and filter out a set containing the graphic objects to be selected; According to the name of each graphic object in the set, the outline corresponding to the graphic object is determined; according to the outline corresponding to the graphic object, the graphic object to be selected is selected.
2. The method for selecting a graphic object according to claim 1, characterized in that: The determining of the preset area type and shape attribute corresponding to the position specifically includes: Pre-set area types include circle, square, and rectangle; When the preset area type is a circle, the shape attribute corresponding to the circle graphic object is the radius; When the preset area type is a square, the shape attribute corresponding to the square graphic object is the side length; When the preset area type is a rectangle, the shape attributes corresponding to the rectangle graphic object are length and width.
3. The method for selecting a graphic object according to claim 2, characterized in that: The generating of regions of different shapes comprises the following steps: By detecting the mouse click action, the position of the mouse click is recorded; The type of mouse click is determined by the duration of the mouse click. When it is greater than the set value, it is a long press and graphic object selection is performed. Areas of different shapes are generated according to the position of the mouse click and the pre-set area type and size. When it is less than the set value, it is a short press and is processed as a single selection.
4. The method for selecting a graphic object according to claim 3, characterized in that: The test method for determining the graphic object to be selected specifically includes: According to the different shapes of the graphic objects to be selected, the test parameters of the graphic objects are set differently, and the test methods are also different; When the graphic object to be selected is a circular area, according to the center position coordinates and radius of the circular area, the test returns an integer including 0, 1, 2 and 3, where 0 means that the test area does not intersect with the graphic object, 1 means that the test area partially intersects with the graphic object, 2 means that the test area contains the graphic object, and 3 means that the graphic object contains the test area; When the graphic object to be selected is a square area, input the upper left corner position of the square area to be tested and the side length of the square area to be tested. If the test passes, an integer is returned, including 0, 1, 2 and 3, where 0 means that the test area does not intersect with the graphic object, 1 means that the test area partially intersects with the graphic object, 2 means that the test area contains the graphic object, and 3 means that the graphic object contains the test area; When the graphic object to be selected is a rectangular area, input the upper left corner position of the test rectangular area, the width and height of the test rectangular area. If the test passes, an integer is returned, including 0, 1, 2 and 3, where 0 indicates that the test area does not intersect with the graphic object, 1 indicates that the test area partially intersects with the graphic object, 2 indicates that the test area contains the graphic object, and 3 indicates that the graphic object contains the test area.
5. The method for selecting a graphic object according to claim 4, characterized in that: The method of obtaining the test results of all intersection graphs of different area types in the test area includes the following steps: When the intersection area is a circular area, according to the center position coordinates of the tested circular area and the radius of the tested circular area, when the tested area intersects with the graphic object, the test result corresponding to the case where the intersection area is a circular area is obtained; When the intersecting area is a square area, according to the upper left corner position of the tested square area and the side length of the tested square area, when the tested area intersects with the graphic object, the test result corresponding to the case where the intersecting area is a square area is obtained; When the intersecting area is a rectangular area, according to the upper left corner position of the tested rectangular area, the width and height of the tested rectangular area, when the test area intersects with the graphic object, the corresponding test result when the intersecting area is a rectangular area is obtained.
6. The method for selecting a graphic object according to claim 5, characterized in that: The step of filtering out a set of graphic objects to be selected specifically includes: For a single graphic object, select by clicking it; for multiple graphic objects, select by boxing them. The working process is as follows: Detect the mouse pressing action and record the mouse pressing position; Track mouse movements and draw selection boxes on the screen; Detect the mouse release action and record the mouse release position; Calculate the selection range based on the mouse press and release positions; Design a grid area according to the selection range; filter out the graphic objects to be selected according to the designed grid area; Perform intersection or containment tests on the graphic objects to be selected, add the graphic objects that pass the test to the selected object set, and return the objects in the set after all tests are completed to obtain a set containing the graphic objects to be selected.
7. The method for selecting a graphic object according to claim 6, characterized in that: The determining of the contour corresponding to the graphic object specifically includes: The menu that pops up next to the mouse click position displays the names of the graphic objects that passed the intersection test; When the mouse moves over a menu item, the corresponding graphic object is temporarily moved to the top layer, and the outline of the graphic object is displayed accordingly; when the mouse moves away, the corresponding graphic object returns to the original layer and the outline is no longer displayed.
8. The method for selecting a graphic object according to claim 7, characterized in that: The step of selecting the graphic object to be selected comprises the following steps: The selection of the graphic objects to be selected includes single selection and multiple selection; The single selection process is to click the mouse on the menu item, the corresponding graphic object is selected, and the single selection is completed; The multiple selection process is to hold down the CTRL key on the keyboard and click the menu items. The corresponding graphic objects are added to the selection list, and a check mark is displayed in front of the menu items. Click the blank area or press the ESC key on the keyboard to complete the multiple selection.
9. A system for selecting a graphic object, characterized in that: include: The area test module is used to determine the execution of graphic object selection based on the duration of the mouse click; According to the position where the mouse is clicked, the pre-set area type and shape attribute corresponding to the position are determined, and areas of different shapes are generated; according to the shape, size and position of the area, the test method of the graphic object to be selected is determined; According to the test method of the graphic object to be selected, the region is subjected to intersection test, and the test results of all the intersection graphics of different region types in the test region are obtained; A module for filtering a set of graphic objects to be selected, which is used to test the test results of all intersecting graphics of different area types in the test area, and filter out a set containing the graphic objects to be selected; The graphic object selection module is used to determine the outline corresponding to the graphic object according to the name of each graphic object in the set; and select the graphic object to be selected according to the outline corresponding to the graphic object.