Disclosure of Invention
In order to solve the technical problem, the invention provides a touch screen human-computer interaction accurate positioning method, which comprises the following steps:
step 120, creating a movable control on a display interface of the touch screen, wherein the movable control comprises a pressing area and a pointer; the pointer of the movable component is provided with at least one positioning point, and the distance between the positioning point and the center of the pressing area is kept constant;
the actual display area of the pressing area of the movable control on the touch screen is larger than the contact area of the user finger and the touch screen, so that when the user finger presses the pressing area of the movable control, the sight between the user and the pointer of the movable control cannot be shielded by the user finger; and when the user moves the press region of the movable control by operating the press region of the movable control, the pointer of the movable control moves following the press region of the movable control.
In the above technical solution, the method further comprises:
step 130, encapsulating the user operation received by the pressing area of the movable control into mouse information, and taking the coordinate position of the positioning point of the pointer of the movable control as the mouse coordinate contained in the mouse information;
wherein the mouse message includes, but is not limited to, one or more of a mouse movement message, a mouse click message, a mouse double click message, a mouse button down message, and a mouse button down message.
In the above technical solution, before step 120, the method further includes:
step 110, creating a transparent layer on a display interface of a touch screen;
the transparent layer is at the top layer of the display interface, the movable control created in step 120 is created on the transparent layer, and the movable control moves within the transparent layer.
In the above technical solution, the pixel area displayed on the display interface by the movable control is determined according to the pixel density parameter of the touch screen, so that the actual length and width value of the pressing area of the movable member displayed on the display interface is 0.3-1 inch.
In the technical scheme, the pressing area of the movable control is separated from the pointer by a certain distance; or the pressing area of the movable control is arranged close to the pointer; or the press area of the movable control is connected with the pointer through a virtual or physical connecting piece; and the pointer of the movable control is positioned at the upper left corner or the upper right corner of the press area, or the position relation of the pointer of the movable control positioned at the press area is adjusted according to the moving direction of the press area.
The invention also provides a size measuring method for the touch screen for the accurate positioning of the man-machine interaction, which comprises the following steps:
step 220, receiving a mouse moving message in the touch screen human-computer interaction accurate positioning method of any one of claims 2 to 5, extracting mouse coordinates in the mouse moving message, performing feature point capture by taking the mouse coordinates as input, and marking captured feature points in a design area according to the positions of the captured feature points;
step 230, receiving a mouse click message in the touch screen human-computer interaction accurate positioning method according to any one of claims 2 to 5, extracting a mouse coordinate in the mouse click message, performing feature point capture by using the mouse coordinate as an input, and if at least one capturable feature point is found, using the capturable feature point closest to the mouse coordinate as an actual coordinate point; otherwise, directly taking the mouse coordinate as an actual coordinate point;
step 240, removing the mark made in the step 220 when the feature point is captured, marking the actual coordinate point obtained in the step 230 on the design area, and saving the actual coordinate point as a coordinate point of the subsequent measurement or drawing operation;
repeating the step 220 and the step 240 to obtain a plurality of actual coordinate points to form a coordinate point list;
and judging the type of the geometric shape formed by the formed coordinate point list according to the input of the user, so as to calculate the length and/or the area of the user selection area according to the formed coordinate point list.
In the above technical solution, before step 220, the method further includes:
step 210, reading a design drawing on the handheld mobile terminal, and displaying the content of the design drawing in a design area;
the design drawings comprise but are not limited to AutoCAD design drawings, PDF format drawings and Photoshop design files.
In the above technical solution, the feature point capturing in step 220 and step 230 specifically includes:
step 221, pre-calculating the cross relationship of all the primitives in the design drawing, searching all the characteristic points, and constructing a tree-shaped data structure for searching according to the coordinates of each characteristic point; the characteristic points comprise end points, intersection points, middle points, vertical points and circle centers of the graphic primitives;
the tree-shaped data structure divides a plane area displaying a design drawing step by step, and constructs a plane division relation from a global coordinate range to a local coordinate range, namely, the whole design drawing is divided into a plurality of first-level plane sub-areas, each first-level plane sub-area is divided into a plurality of second-level plane sub-areas, each second-level plane sub-area is divided into a plurality of third-level plane sub-areas, and the like;
step 222, searching a corresponding first-level plane sub-region according to the position of the input coordinate point, then continuously searching a corresponding second-level plane sub-region in the first-level plane sub-region, and so on until a highest-level sub-region with a small enough range is reached, traversing each feature point in the sub-region, and inspecting whether the distance between the feature point and the input coordinate point is within a tolerance range; if the feature point is within the range, finding a characteristic point which can be captured, and entering step 223; otherwise, returning if the characteristic points can not be captured;
and 223, marking the found characteristic points which can be captured on the current design area through a specific mark, and distinguishing the types of the characteristic points through different mark shapes.
In the above solution, the shape and/or color of the mark used in step 220 is different from the mark used in step 240.
The invention also provides a computer device, which comprises a processor and a memory for storing processor executable instructions, wherein the steps in the technical scheme are realized when the processor executes the instructions.
The invention also provides a computer storage medium on which a computer program is stored, which, when executed by a processor, performs the steps of the above-described solution.
The invention achieves the following technical effects:
1. the mobile handheld terminal with the small touch screen is convenient for a user to perform operations requiring accurate positioning input on the mobile handheld terminal, and the user can perform related operations such as drawing measurement and drawing.
2. The operation experience on the computer terminal similar to a PC can be realized without external input equipment of other physical entities such as a touch pen, a mouse and the like.
3. The convenience degree of the operation on the engineering design drawing on the small touch screen can basically reach the degree on a desktop computer, and the operation mode of editing or measuring the drawing is similar to that on the desktop computer.
Detailed Description
The invention is described in further detail below with reference to the accompanying drawings and detailed description, in order to facilitate the understanding and implementation of the invention by those skilled in the art.
In order to solve the technical problem, the invention provides a touch screen human-computer interaction accurate positioning method, which comprises the following steps:
and step 110, creating a transparent layer on a screen of a touch screen of the handheld mobile terminal.
The transparent layer can be a transparent window body arranged on the top layer of the screen, or a drawing layer arranged on the topmost layer in the application window, and the subsequent displayed contents are drawn in the transparent layer.
And step 120, creating a movable control on the transparent layer, wherein the movable control comprises a pressing area 21 and a pointer 22, and the actual display area of the pressing area 21 on the screen is larger than the area of the finger of a common person in contact with the screen.
A preferred embodiment of a movable control is shown in fig. 3-5, which comprises a pressing area 21 and a pointer 22, wherein the pressing area 21 may be arranged at a distance from the pointer 22 (as shown in fig. 3), the pressing area 21 may also be arranged in close proximity to the pointer 22 (as shown in fig. 4), and the pressing area 21 may also be connected to the pointer 22 by a virtual or physical connection (e.g. a connection line 23) (as shown in fig. 5).
The user may move the movable control within the transparent layer by holding down a press area 21 of the movable control using a finger or other body part or a touch implement.
Since the screen sizes of different mobile handheld terminals are different and the screen resolutions are also different, the corresponding relationship between the screen logical size and the screen physical size needs to be calculated, so that the actual area of the pressing area 21 of the movable member displayed on the screen is larger than the area of the common finger in contact with the screen, and further, when the user finger presses the pressing area 21 to move the movable member, the movable member is not completely shielded by the user finger.
According to the statistics of the usage habits of the general users, when performing fine operations on the mobile handheld terminal, the users generally use the index finger of a right hand (also called a dominant hand, such as the right hand known as "right-handed person" or the left hand of "left-handed person" or "left-handed person") to perform touch control. The first knuckle of the index finger is usually related to height, and has a length in the range of 1.5-4 cm and a width in the range of 1-2.5 cm, and when the user performs a touch operation using the index finger's abdomen (as shown in fig. 1), the first knuckle touches a screen area in the range of approximately (1.5-2 cm) × (1-2 cm), and when the user performs a touch operation using the tip of the index finger, the first knuckle touches a screen area in the range of approximately (0.8-1.2 cm) × (0.3-0.7 cm). Therefore, the actual area of the pressing region 21 of the movable member displayed may be preferably (0.5-1 inch) × (0.5-1 inch) for a large-sized screen of the mobile handset (e.g., a screen size greater than 8 inches), and (0.3-0.5 inch) × (0.3-0.5 inch) for a medium-sized and small-sized screen of the mobile handset (e.g., a screen size of 5-8 inches).
For example, for an iPhone6 cell phone, with a pixel density (PPI, Pixels Per Inc) of 330, when a movable control in the form of a rectangle with a physical size of 0.5 × 0.5 inches is displayed, it has a rectangular area with a logical pixel size of 165 × 165 Pixels; for the iPhone6Plus phone, the pixel density is 401, and the logical pixels are a rectangular area of 200 × 200 pixels when a movable control with an actual size of 0.5 × 0.5 inches is displayed. The actual shape of the pressing area of the movable member can be drawn arbitrarily as required, preferably in a shape that is adapted to the user's operating habits and ergonomics, such as a circle-like shape, an ellipse-like shape, or a mouse outline shape, for example.
Preferably, as shown in FIG. 3, the
pointer 22 of the movable member is proximate to the
press region 21 and spaced a distance from the
press region 21 such that the user's finger does not obstruct the user's view of the
pointer 22 when the user's finger is pressing on the
press region 21, and the
pointer 22 moves with the
press region 21 when the user moves the movable control within the transparent layer by pressing on the
press region 21 of the movable control. The pointer 22 may be located at the upper left corner, the upper right corner, or the lower left corner, the lower right corner of the pressing area 21, and the position relationship between the pointer 22 and the pressing area 21 may be determined according to the operation habit of the left and right hands of the user, for example, when the user is the operation habit of the right hand, the pointer 22 may be located above, the upper left corner, the left side, the lower left corner, or the lower left corner of the pressing area 21; when the user is left-handed, the pointer 22 can be above, right, below, and below the pressing area 21; or the positional relationship of the pointer 22 with the pressing area 21 may be determined by the moving direction of the pressing area 21, for example, when the pressing area 21 moves a distance L on the screen within a prescribed time period t1 to t2, and when L is greater than a threshold, for example, when the user's finger drags the pressing area 21 to move a physical distance of 0.1-1 inch or a physical plane size of 0.05-0.2 times within 0.5-2 seconds, the positional relationship of the pointer 22 with the pressing area 21 is determined by the direction vector between the coordinates (x1, y1) of the center point of the pressing area 21 at time t1 and the coordinates (x2, y2) of the center point of the pressing area 21 at time t2
To be determined.
When the embodiment of the movable member shown in fig. 3 is adopted, it is conceivable for those skilled in the art to set the pressing area 21 of the movable member to be smaller, so that only when the user presses the pressing area 21, the user does not need to block the view of the observation pointer 22 with a finger, that is, the actual display area of the movable member formed by the pressing area 21 and the pointer 22 is larger than the aforementioned range. The actual area of the movable member displayed may be preferably (0.5-1 inch) × (0.5-1 inch) for a large-sized screen of the mobile handset (e.g., a screen size greater than 8 inches), and (0.3-0.5 inch) × (0.3-0.5 inch) for a medium-sized and small-sized screen of the mobile handset (e.g., a screen size of 5-8 inches).
The pointer 22 of the movable member has a location point 24, which location point 24 may be the tip or the intersection of crosshairs (as shown in fig. 5), the location point 24 being kept at a fixed distance from the coordinates of the center point of the compression zone 22.
Step 130, the pressing area 21 of the movable control on the transparent layer receives the operation of the user and encapsulates the operation message into a mouse message to be sent to the operating system, and the coordinate position of the positioning point 24 of the pointer 22 of the movable control is taken as the mouse coordinate contained in the mouse message sent to the operating system.
Specifically, when the user holds down the pressing area 21 of the movable control and moves or drags on the screen, a mouse move message (MouseMove _ EVENT) in which the coordinates of the pointer positioning point 24 are used as the mouse coordinates in the mouse move message is transmitted to the system, and when the user operates the pressing area 21 of the movable control with a finger click, a mouse click message (MouseClick _ EVENT) in which the coordinates of the pointer positioning point 24 are used as the mouse coordinates in the mouse click message is transmitted to the system.
As shown in fig. 6, a button 25 is further drawn in the pressing area 21 of the movable control, and a mouse click message is triggered only when the user clicks the button 25, so as to prevent misoperation by the user. Those skilled in the art will appreciate that the press region 21 shown in fig. 6 may be employed in the embodiments of the movable controls shown in fig. 3-5 as well as other movable controls.
For the Android system, touch screen events (mouse events) are: pressing, bouncing, moving, double-clicking, long-pressing, sliding and rolling; among them, press, pop, move are simple touch screen events. Any control and Activity in the android system is inherited indirectly or directly from android. A View object may handle range finding, layout, drawing, focus changing, scroll bars, and the touch screen area's own rendering of keys and gestures. Therefore, the step 110 and 130 do not affect the touch operation (hereinafter referred to as direct touch operation) of the user on the touch screen of the handheld mobile terminal for the View object or any control or Activity inherited from the View object; through the above step 110 and 130, the touch operation of the user on the touch screen of the handheld mobile terminal can be converted into a mouse message of the system, and any control or Activity of the system can be operated (hereinafter referred to as touch mouse operation), and the operation mode and habit of the operation can be completely the same as the operation mode of a physical mouse connected through a physical mode such as USB, bluetooth, network, RF, etc. That is to say, according to the touch screen human-computer interaction accurate positioning method provided by the invention, a user can perform human-computer interaction operation on the touch screen of the handheld mobile terminal through direct touch operation and/or touch mouse operation, so that the user experience is greatly enhanced, and meanwhile, the user can meet the accurate operation requirements of performing size measurement and the like on a design drawing on the handheld mobile terminal.
Based on the touch screen human-computer interaction accurate positioning method provided by the invention, the invention also provides a method for measuring the size of the design drawing on the handheld mobile terminal.
And step 210, reading the design drawing data on the handheld mobile terminal, and displaying the information visible by the user in the design drawing in the design area.
The following description is given using architectural design drawings, and it will be understood by those skilled in the art that the design drawings herein may include, but are not limited to: mechanical design drawings, electrical design drawings, or other non-vector graphic design files, such as PhotoShop files, and the like.
The displayed design drawings described herein contain information that is visible to the user, including but not limited to: the frame lines of the components, the rendering materials of the components, marking information, user comments, design drawing file information and the like. Those skilled in the art will appreciate the meaning of "visible" as used herein, including both visible layers or visible elements corresponding to invisible layers or invisible elements in the design drawings, and information that can or must be presented to the user at the current user perspective, current user window, current scale, current user display settings, etc.
Step 220, receiving the mouse moving event forwarded by the operating system, extracting the mouse coordinates, using the mouse coordinates as input to implement the feature point capturing logic, and marking the captured feature points in the design area according to the positions of the captured feature points.
Specifically, the feature point capture logic comprises:
step 221, pre-calculating the cross relationship of all the primitives in the design drawing, searching all the characteristic points, including the end points, intersection points, middle points, vertical points, circle centers and the like of the primitives, and constructing a tree-like data structure for searching according to the coordinates of each characteristic point. The tree-like structure is characterized in that a plane division relation from a global coordinate range to a local coordinate range is constructed by dividing a plane area step by step, namely, the whole design drawing is divided into a plurality of first-level plane sub-areas, each first-level plane sub-area is divided into a plurality of second-level plane sub-areas, each second-level plane sub-area is divided into a plurality of third-level plane sub-areas, and the like.
Through the tree-shaped data structure for searching, the computing resources required to be consumed when the characteristic points are searched and the searching speed can be reasonably balanced by adjusting the number of the levels and the partition granularity of the plane sub-regions. Generally, the finer the tree-shaped data structure for searching is divided, the faster the search speed can be achieved, and more memory is consumed for maintaining the data structure. Therefore, the levels of the tree-shaped data structure and the division granularity of the plane sub-regions can be reasonably determined according to the complexity of the design drawing displayed on the handheld mobile terminal, such as one or more items of the breadth size of the drawing, the size of the drawing file, the number of controls in the drawing and the number of basic primitives in the drawing. For example, for general applications, the search speed can be satisfied by dividing the search space into about 4 layers, and the required memory overhead can be accepted. Meanwhile, the characteristic points can be organized in the same or different plane sub-regions according to the range after being calculated; the mode plane division mode can be flexible, for example, the mode plane division mode can be organized according to the positions of lines, circular arcs and the like, so that the function of capturing shapes of lines, circular arcs and the like can be realized, and not only capturing points can be realized.
Step 222, searching a corresponding first-level plane sub-region according to the position of the input coordinate point, then continuously searching a corresponding second-level plane sub-region in the first-level plane sub-region, and so on until a highest-level sub-region with a small enough range is reached, traversing each feature point in the sub-region, and inspecting whether the distance between the feature point and the input coordinate point is within a tolerance range. If the feature point is within the range, finding a characteristic point which can be captured, and entering step 223; otherwise, returning if the characteristic points are not capturable. The tolerance range may be a certain pixel value, e.g., 10-50 pixels, or a certain physical distance, e.g., 0.1-1 inch, or a certain multiple of the screen size, e.g., 0.01-0.1 times the screen size.
And 223, marking the found characteristic points which can be captured on the current design area through a specific mark, and distinguishing the types of the characteristic points through different mark shapes. For example, feature points such as end points, intersection points, middle points, vertical points, circle centers, and the like are marked using mark shapes such as cross lines, stars, circles, square boxes, diamond boxes, triangular boxes, circles, squares, diamonds, and triangles.
Step 230, when a mouse click event forwarded by the system is received, extracting a mouse coordinate, similarly using the mouse coordinate as an input to implement a feature point capturing logic, and if a capturable feature point is found, using the capturable feature point closest to the mouse coordinate as an actual coordinate point; otherwise, directly using the mouse coordinate as the actual coordinate point.
And 240, removing the characteristic point mark during capturing, and marking the obtained actual coordinate point on the design area through another mark shape to represent the final positioning coordinate of the current accurate positioning method. And saving the final coordinate as a coordinate point for subsequent measurement or drawing operation.
Fig. 7 is a schematic diagram illustrating the effect of obtaining the coordinate point of the subsequent measurement or drawing operation through the steps 220-240. As can be seen from fig. 7, when the user operates the pressing area 21 of the movable control and moves or drags the pointer 22 of the movable control on the screen close to the intersection of two primitives (line segments), the captured feature point is highlighted by the specific mark ("□") of the square frame shape, and when the user clicks the pressing area 21 of the movable control, the intersection coordinates of the two primitives (line segments) of the mark by the specific mark ("□") of the square frame shape are determined as final location coordinates as coordinate points of the subsequent measurement or drawing operation, and at this time, the final location coordinates may be marked with a circle (in the case of the length measurement operation shown in fig. 9) and may also be marked with a cross line (in the case of the area and circumference measurement operations shown in fig. 11-13). Therefore, through the operation method provided by the invention, the user does not need to move the pointer positioning point 24 of the pointer 22 of the movable control to be precisely superposed with the position of the feature point (namely, the intersection point of the two line segments positioned in the center of the □ mark in fig. 7) needing to be input, and the corresponding feature point coordinate can be automatically captured only by approaching, so that the requirement on the touch operation precision of the user in the component size measurement is reduced, and the convenience of man-machine operation is greatly improved.
The above step 220 and 240 are repeated to obtain a plurality of positioning coordinates, and a coordinate point list is formed.
Optionally step 250, drawing connecting lines between the coordinate points of the positioning coordinates formed in step 240 and the coordinate points formed last time.
The connecting line is an exemplary connecting line for performing measurement, and is used for highlighting a measurement area or range set by a user. The color and line type of the connecting line may be designated by a user or automatically set by a program in distinction from the color and line type employed in the displayed design drawing.
An optional step 260 of determining a type of geometry formed by the formed list of coordinate points based on the user input, thereby calculating a perimeter of the user selected area based on the formed list of coordinate points. Optionally, step 270, determining the type of geometry formed by the formed coordinate point list according to the user input, and calculating the area of the user-selected area according to the formed coordinate point list.
Optionally, in step 280, the perimeter data obtained in step 260 and/or the area data obtained in step 270 are displayed and output on the handheld mobile terminal.
An example of length measurement and marking of an engineering design drawing component on a mobile phone by a user using the method for accurately measuring the component dimension in the engineering design drawing provided by the invention is shown in fig. 9-10.
The user may trigger the component measurement operation through a menu, a toolbar, a button, an icon or a designated area on a touchscreen of the handheld mobile terminal or a specific gesture, as shown in fig. 8, the user triggers the corresponding operation by selecting/clicking a corresponding function button, such as a length measurement, an area measurement, an angle measurement, a coordinate pick/label, a scaling, and the like.
When the user selects to perform the length measurement, a feature point is formed through the above step 210 and 240, and is indicated by using the reference numeral 101 in fig. 9, and the feature point serves as a starting point of the line segment measurement. Meanwhile, prompt information can be further displayed above the screen interface so as to prompt the user to carry out the next operation.
By repeating the above step 220 and step 240, another feature point is obtained, and the feature point is used as the end point of the line segment measurement. At this time, a mark line 102 is drawn between the start point and the end point, and a length measurement result 103 between the start point and the end point is displayed on the mark line. Further, it is also possible to draw a sizing adjustment frame 104 around the mark-up line 102 and the length measurement result 103, display an adjustment button 105 on at least two corners of the sizing adjustment frame 104, and adjust the size and position of the length measurement result 103 by the user by dragging the position of the button 105 to further adjust the size and position of the sizing adjustment frame 104.
The movable members in the display interface are hidden in fig. 9-10 to further highlight the interactive process of the user operation and the presented results.
The user uses the method for accurately measuring the dimensions of the components in the engineering drawing provided by the invention to measure the area and/or the perimeter of the components in the engineering drawing on a mobile phone, as shown in fig. 11-13.
When the user selects to perform the area measurement, a coordinate point of the first measurement operation, which is shown as "x" in fig. 11, is obtained through the above step 210 and 240, and this coordinate point serves as a starting point of the area measurement. Obtaining the coordinate point of the second measurement operation through the above step 220-240, and simultaneously drawing a connection line between the coordinate point of the second measurement operation and the coordinate point of the first measurement operation to prompt the user of the graphic area to be selected; and so on, until the user selects the coordinate point of the first measurement operation again, at this time, these coordinate points are used as the vertices of the quadrangle to enclose a closed graph, these coordinate points are shown as "x" in fig. 12, area and/or perimeter calculation can be performed, as shown in fig. 13, the calculation result of the area and/or perimeter is presented in the center of the formed closed graph (shown as a rectangle in fig. 12-13), and the measurement result can also be presented in the form of a text editing box (as shown in the lower part of fig. 13), so that the user can select to copy the corresponding data value to be copied to other applications, programs or files. Meanwhile, in the operation steps, prompt information can be further displayed above the screen interface so as to prompt a user to perform the next operation; function selection buttons appear below the screen; the method comprises the steps of selecting a 'function guide' button, presenting prompt or help information for assisting a user to operate and a guide page for carrying out related measurement operation, selecting a 'close' button, automatically taking three or more coordinate points which are selected as vertexes of polygons (including triangles and quadrangles) and closing the circumferences of the vertexes when the user selects the coordinate points, and selecting a 'back to last point' button, so that the last set coordinate point can be deleted.
The above embodiment is only one embodiment of the present invention, and the description is specific and detailed, but not construed as limiting the scope of the invention. The specific structure and the size of the device can be adjusted correspondingly according to actual needs. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention.