Embodiment
Below with reference to the accompanying drawings and in conjunction with the embodiments, describe the present invention in detail.
Fig. 1 shows the process flow diagram of the method for focus of organic chemical structural formula switching according to the embodiment of the present invention, comprising:
Step S10, monitors the input from keyboard;
Step S20, determines the focus in the organic chemical structural formula in the chemical typesetting interface of interactive mode;
Step S30, in response to input to switch focus.
In existing organic chemistry software for composing, the switching of focus is all lean on the operation of mouse to complete.Mouse action has its limitation, can not meet continuous print switching and carry out with editor simultaneously.And in the present embodiment, using the input from keyboard as the adjustment operation switching focus, the advantage that keyboard operation has mouse action not substitute is exactly fast, directly, continuously.In interactively chemical software for composing, the operation of keyboard can improve the efficiency of user greatly, eliminates the operation finding chemical bond or atom with mouse, facilitates user to make the various structure wanted, improve ease for use and the typesetting efficiency of chemical typesetting.
In addition, by the method achieving the ability being switched focus by linear method in reticulate texture, operation is made to become simple and fast.
Inventor finds, the rule of the switching focus of organic chemical structural formula is if focus is on atom, and so next step switching result must be chemical bond, and when focus is chemical bond, next step switching result must be atom.
Fig. 5 shows the schematic diagram of focus on chemical bond according to the preferred embodiment of the invention; Fig. 6 shows the different directionkeys focus possibility switching direction schematic diagram of Fig. 5; Fig. 7 shows the focus switching flow figure of Fig. 6.Preferably, when determine focus current be key time, step S30 comprises: if determine that input is the first button or key combination, then focus is switched to the atom of the first end of key; If determine that input is the second button or key combination, then focus is switched to the atom of the second end of key.When chemical bond is selected focus, switches focus and only have two selections, i.e. two atoms at chemical bond two ends.Because chemical bond can not depart from atom and independently exist, formed about it has two atoms mutually.
Preferably, first button or key combination comprise " ← " button, the atom of first end is atom to the left in two atoms of key connection, second button or key combination comprise " → " button, the atom of the second end is atom to the right in two atoms of key connection, wherein, if two atom right sides not to the left, then specify that on the lower side or larger atom is the atom of first end, another atom is the atom of the second end; And/or first button or key combination comprise " ↓ " button, the atom of first end is atom on the lower side in two atoms of key connection, second button or key combination comprise " ↑ " button, the atom of the second end is atom on the upper side in two atoms of key connection, wherein, if under two atoms are not on the upper side, then specify that to the left or larger atom is the atom of first end, another atom is the atom of the second end.Utilization orientation key adjusts, both intuitively, again fast.
Time current focus is chemical bond, obtain the coordinate of the atom at chemical bond two ends, according to the sensing of directionkeys, calculate coordinate figure maximum in the direction in which, the atom with this maximum coordinate value among is exactly the next focus atom switched.As shown in Figure 5, focus chemically key goes to the atomic time, because optional atom only has two, so the switching direction of the corresponding atom of both direction key meeting.Which reduces the chance switching and make mistakes.
In specific implementation, the coordinate of selected chemical bond two ends atom can be obtained, compare according to coordinate, judge that corresponding button chooses different atoms as the object of next focus.Left and right directions compares x coordinate, and above-below direction compares y coordinate, if the coordinate of some axles is identical, and the atoms of left side or upper side position.
Fig. 2 shows the situation schematic diagram of focus on single atom according to the preferred embodiment of the invention; The different directionkeys focus that Fig. 3 shows Fig. 2 may walk (namely switching) direction schematic diagram; Fig. 4 shows the focus switching result schematic diagram pressed after upward direction key of Fig. 3.Preferably, when determine focus current be the atomic time, in response to input comprise to switch focus:
If determine that input is the first button or key combination, then focus is switched to the key of the first direction of atom;
If determine that input is the second button or key combination, then focus is switched to the key of the second direction of atom;
If determine that input is the 3rd button or key combination, then focus is switched to the key of the third direction of atom;
If determine that input is the 4th button or key combination, then focus is switched to the key of the fourth direction of atom;
If determine that input is the 5th button or key combination, then focus is switched to the key in the 5th direction of atom;
If determine that input is the 6th button or key combination, then focus is switched to the key in the 6th direction of atom;
If determine that input is the 7th button or key combination, then focus is switched to the key in the 7th direction of atom;
If determine that input is the 8th button or key combination, then focus is switched to the key of the eighth direction of atom.
When atom is selected focus, the selection switching focus is unfixed, and can be 0 to any selection, the chemical bond that certain atomic energy connects in principle can not be a lot, can not more than eight.Map so this preferred embodiment is provided with eight buttons, be enough to realize the switching of focus from atom to chemical bond.
Preferably, the first button or key combination comprise " ↑ " button, and the key of first direction is the key (namely near the chemical bond of upward direction) at direct north in multiple keys of atom connection with the longest projection; Second button or key combination comprise " ↑ " button+" → " button, and the key of second direction is the key (namely near the chemical bond of upper right) in clockwise 45 ° of directions in multiple keys of atom connection with the longest projection; 3rd button or key combination comprise " → " button, and the key of third direction is the key (namely near the chemical bond of right direction) in clockwise 90 ° of directions in multiple keys of atom connection with the longest projection; 4th button or key combination comprise " → " button+" ↓ " button, and the key of fourth direction is the key (namely near the chemical bond of lower right) in clockwise 135 ° of directions in multiple keys of atom connection with the longest projection; 5th button or key combination comprise " ↓ " button, and the key in the 5th direction is the key (namely near chemical bond in downward direction) in clockwise 180 ° of directions in multiple keys of atom connection with the longest projection; 6th button or key combination comprise " ↓ " button+" ← " button, and the key in the 6th direction is the key (namely near the chemical bond of lower left) in clockwise 225 ° of directions in multiple keys of atom connection with the longest projection; 7th button or key combination comprise " ← " button, and the key in the 7th direction is the key (namely near the chemical bond of left direction) in clockwise 270 ° of directions in multiple keys of atom connection with the longest projection; 8th button or key combination comprise " ← " button+" ↑ " button, and the key of eighth direction is the key (namely near the chemical bond of upper left) in clockwise 315 ° of directions in multiple keys of atom connection with the longest projection.
Current focus is the atomic time, obtains all chemical bonds connecting this atom, then obtains the coordinate that all chemical bonds are not other one end of current focus atom.And then according to the sensing of directionkeys, calculating coordinate figure maximum in the direction in which, the chemical bond with this maximum coordinate value among is exactly the next focus chemical bond switched.Utilization orientation key adjusts, both intuitively, again fast.By the combination of both direction key, eight direct focus switching directions can be realized at most.The orientation that four direction key is corresponding respective, upper left, lower-left, upper right, bottom right combination can realize other four oblique line orientation.The flow process of concrete judgement can be first obtain the chemical bond of all connections of this atom, then obtains the coordinate of the atom of other one end of this chemical bond.The matching relationship of direction and the chemical bond recommended is determined by the coordinate comparing these all atoms.Secondly, again according to directionkeys and the angular relationship obtaining chemical bond, analyze the mobile intention of user, what user pressed is upward direction key and right direction key, the chemical bond in 45 ° of key directions is then first recommended to be first-selected, if there is plural chemical bond in this direction, then judge according to coordinate.
Preferably, this method also comprises: if there is multiple key to have with the longest isometric projection, then focus is switched to multiple key simultaneously; The next one monitored from keyboard inputs; Determine that next input comprises " ↑ " button, then focus is switched to the key at direct north in multiple key with the longest projection; Determine that next input comprises " ↑ " button+" → " button, then focus is switched to the key in clockwise 45 ° of directions in multiple key with the longest projection; Determine that next input comprises " → " button, then focus is switched to the key in clockwise 90 ° of directions in multiple key with the longest projection; Determine that next input comprises " → " button+" ↓ " button, then focus is switched to the key in clockwise 135 ° of directions in multiple key with the longest projection; Determine that next input comprises " ↓ " button, then focus is switched to the key in clockwise 180 ° of directions in multiple key with the longest projection; Determine that next input comprises " ↓ " button+" ← " button, then focus is switched to the key in clockwise 225 ° of directions in multiple key with the longest projection; Determine that next input comprises " ← " button, then focus is switched to the key in clockwise 270 ° of directions in multiple key with the longest projection; Determine that next input comprises " ← " button+" ↑ " button, then focus is switched to the key in clockwise 315 ° of directions in multiple key with the longest projection.
As shown in Figure 2, the quantity of the chemical bond connected due to atom is unfixed, so there will be the corresponding chemical bond switched of multiple directions key, or the direction of some directionkeys does not just have switchable chemical bond with this, the direction even had has multiple chemical bond available.So there will be sky directionkeys and the situation that chemical bond cannot be gone to.For the situation of the corresponding multiple chemical bond of a directionkeys, adopt the mode of both direction key combination, left and right and upper and lower key combination just can realize the sensing ability in 8 orientation.But still there will be some extreme situations not deal with, so just can only assist with mouse.But due to the characteristic of chemical structural formula, the chance that this situation occurs lacking, so be to meet most switching when keyboard bearing sense is limited in one's ability very.In this preferred embodiment, if the chemical bond that direction coordinate and angle two conditions do not reach in addition, just this chemical bond is together chosen with the chemical bond that condition is unique, carry out the selection of two secondary focis for user.The condition of the selection of two secondary focis is centre coordinates of chemical bond, because it is very little once to choose the contracting of possible scope, so the requirement of accuracy that secondary chooses the focus that can meet user to switch.
It should be noted that in the above embodiment of the present invention, the switching of focus is not single, but switches with the circular order of atom-chemical bond, can realize the continuous editor of atomic element title and chemical bond types like this.
Fig. 8 shows the schematic diagram of the device for focus of organic chemical structural formula switching according to the embodiment of the present invention, comprising:
Monitoring module 10, for monitoring the input from keyboard;
Current focus module 20, for determining the focus in the organic chemical structural formula in the chemical typesetting interface of interactive mode;
Switch focus module 30, in response to input to switch focus.
This device improves ease for use and the typesetting efficiency of chemical typesetting.
Preferably, when current focus module determination focus is current be key time, if determine that input is the first button or key combination, then switch focus module and focus be switched to the atom of the first end of key; If determine that input is the second button or key combination, then switch the atom that focus is switched to the second end of key by focus module.
Preferably, be the atomic time when current focus module determination focus is current, if determine that input is the first button or key combination, then switch the key that focus is switched to the first direction of atom by focus module; If determine that input is the second button or key combination, then switch the key that focus is switched to the second direction of atom by focus module; If determine that input is the 3rd button or key combination, then switch the key that focus is switched to the third direction of atom by focus module; If determine that input is the 4th button or key combination, then switch the key that focus is switched to the fourth direction of atom by focus module; If determine that input is the 5th button or key combination, then switch the key that focus is switched to the 5th direction of atom by focus module; If determine that input is the 6th button or key combination, then switch the key that focus is switched to the 6th direction of atom by focus module; If determine that input is the 7th button or key combination, then switch the key that focus is switched to the 7th direction of atom by focus module; If determine that input is the 8th button or key combination, then switch the key that focus is switched to the eighth direction of atom by focus module.
Preferably, the first button or key combination comprise " ↑ " button, and the key of first direction is the key at direct north in multiple keys of atom connection with the longest projection; Second button or key combination comprise " ↑ " button+" → " button, and the key of second direction is the key in clockwise 45 ° of directions in multiple keys of atom connection with the longest projection; 3rd button or key combination comprise " → " button, and the key of third direction is the key in clockwise 90 ° of directions in multiple keys of atom connection with the longest projection; 4th button or key combination comprise " → " button+" ↓ " button, and the key of fourth direction is the key in clockwise 135 ° of directions in multiple keys of atom connection with the longest projection; 5th button or key combination comprise " ↓ " button, and the key in the 5th direction is the key in clockwise 180 ° of directions in multiple keys of atom connection with the longest projection; 6th button or key combination comprise " ↓ " button+" ← " button, and the key in the 6th direction is the key in clockwise 225 ° of directions in multiple keys of atom connection with the longest projection; 7th button or key combination comprise " ← " button, and the key in the 7th direction is the key in clockwise 270 ° of directions in multiple keys of atom connection with the longest projection; 8th button or key combination comprise " ← " button+" ↑ " button, and the key of eighth direction is the key in clockwise 315 ° of directions in multiple keys of atom connection with the longest projection.
As can be seen from the above description, the above embodiments of the present invention can strengthen ease for use and the efficiency of chemical typesetting, but also reduce the learning difficulty of user.
Obviously, those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on network that multiple calculation element forms, alternatively, they can realize with the executable program code of calculation element, thus they storages can be performed by calculation element in the storage device, or they are made into each integrated circuit modules respectively, or the multiple module in them or step are made into single integrated circuit module to realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.