JPH05324556A - Already executed operation canceller - Google Patents

Already executed operation canceller

Info

Publication number
JPH05324556A
JPH05324556A JP4152679A JP15267992A JPH05324556A JP H05324556 A JPH05324556 A JP H05324556A JP 4152679 A JP4152679 A JP 4152679A JP 15267992 A JP15267992 A JP 15267992A JP H05324556 A JPH05324556 A JP H05324556A
Authority
JP
Japan
Prior art keywords
undo
elements
stack
information
changed
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
JP4152679A
Other languages
Japanese (ja)
Inventor
Yoshiharu Toguchi
佳治 戸口
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.)
Mutoh Industries Ltd
Original Assignee
Mutoh Industries 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 Mutoh Industries Ltd filed Critical Mutoh Industries Ltd
Priority to JP4152679A priority Critical patent/JPH05324556A/en
Publication of JPH05324556A publication Critical patent/JPH05324556A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To restore plural elements by one operation at the time or execution of undoing in the case that plural elements are changed by one operation. CONSTITUTION:An element data base 3 is provided with an undo stack and a redo stack. The undo stack is provided to save information before the change of elements changed by execution of an operation, and information before the change of plural changed elements are related like a chain and are stored in the case of multiple operations. A write/read control part 12 relates information before the change of elements changed by execution of multiple operations like a chain and saves these information in the undo stack, and this part 12 relates information of elements as the restore object like a chain and saves these information in the redo stack and restores plural elements based on information from the undo stack when undo to cancel multiple operations is executed.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、CADシステム等にお
いて、実行されたオペレーションを取消して、オペレー
ション実行前のデータを復元するアンドゥ処理を実行す
る既実行オペレーションの取消装置に関し、特に1度の
オペレーションによって複数の要素が変更されるオペレ
ーションを実行した後のアンドゥ処理を実現する既実行
オペレーションの取消装置にに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus for canceling an executed operation in a CAD system or the like, which executes an undo process for canceling an executed operation and restoring the data before the execution of the operation, and particularly to a single operation. The present invention relates to a device for canceling an already-executed operation, which realizes undo processing after executing an operation in which a plurality of elements are changed by.

【0002】[0002]

【従来の技術】CADシステム等で、図面を誤って消去
してしまったり、複写すべき部分を移動してしまった場
合、直前のオペレーションを取消して、前の画面を復元
するためのアンドゥ処理が知られている。従来のアンド
ゥ処理は、図面を構成する要素データの変更時に、その
要素データの変更前の情報をコピーして保存しておき、
アンドゥ実行時には、保存していた前情報を復元するこ
とにより、データの復元を行うようにしている。
2. Description of the Related Art In a CAD system or the like, if a drawing is accidentally erased or a portion to be copied is moved, an undo process for canceling the immediately preceding operation and restoring the previous screen is required. Are known. In the conventional undo process, when the element data that makes up the drawing is changed, the information before the change of the element data is copied and saved,
When the undo is executed, the data is restored by restoring the saved previous information.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、上述し
た従来の既実行オペレーションの取消方式では、取消可
能なオペレーションが直前のオペレーションに限られて
いるため、操作ミスに気が付かないでオペレーションを
続けて実行してしまうと、もはや過去のデータを復元す
ることはできないという問題点がある。そこで、オペレ
ーションの度に変更される要素をスタックに順次格納し
ていき、アンドゥ実行時には、スタックから1つ1つ前
の要素データを復元していくことにより、複数ステップ
前までの状態を復元可能にしたものを本出願人により、
提案している。しかし、通常のスタック構造では、要素
を1つ1つ復元する必要があるため、例えば長方形を1
度に描くようなマルチオペレーションを実行した場合、
復元時には、直線を1本1本復元しなくてはならず、操
作が煩雑になるだけでなく、アンドゥ時のオペレーショ
ンが作図時のオペレーションと1対1に対応しないとい
う問題点がある。
However, in the above-mentioned conventional canceling method for executed operations, since the cancelable operation is limited to the immediately preceding operation, the operation is continuously executed without noticing the operation error. If it happens, there is a problem that past data can no longer be restored. Therefore, it is possible to restore the state up to multiple steps by sequentially storing the elements that change each operation in the stack and restoring the previous element data from the stack when undoing. What was made by the applicant,
is suggesting. However, in a normal stack structure, it is necessary to restore each element one by one.
If you perform a multi-operation that you draw every time,
At the time of restoration, straight lines must be restored one by one, which not only complicates the operation, but also has a problem that the operation at the time of undo does not correspond to the operation at the time of drawing one to one.

【0004】本発明はかかる問題点に鑑みてなされたも
ので、複数のオペレーションを実行した後でも、任意の
過去のオペレーションまで遡ってデータを復元すること
ができ、しかも1回のオペレーションで複数の要素が変
更された場合には、アンドゥ実行時にも1度に複数の要
素を復元することができる既実行オペレーションの取消
装置を提供することを目的とする。
The present invention has been made in view of the above problems, and even after executing a plurality of operations, it is possible to restore data to any past operation and restore a plurality of data in one operation. It is an object of the present invention to provide a canceling device for an already-executed operation that can restore a plurality of elements at once even when an undo is executed when the element is changed.

【0005】[0005]

【課題を解決するための手段】本発明に係る既実行オペ
レーションの取消装置は、オペレーションの実行によっ
て変更される要素の変更前の情報を退避させるためのも
のであって、1度のオペレーションで複数の要素が変更
される場合、これら要素の変更前の情報をチェイン状に
関連させて記憶するアンドゥスタックと、1度のオペレ
ーションによって複数の要素が変更されるオペレーショ
ンを実行したときに前記アンドゥスタックへ前記変更さ
れる複数の要素の変更前の情報をチェイン状に関連付け
て退避させ、アンドゥを実行したときに前記アンドゥス
タックからの情報に基づいて前記複数の要素を一度に復
元する手段とを備えたことを特徴とする。
An apparatus for canceling an already-executed operation according to the present invention is for saving the information before the change of the element changed by the execution of the operation. When the elements of are changed, the undo stack that stores the information before the changes of these elements in a chain-like manner and the undo stack when the operation of changing a plurality of elements by one operation is executed. The information before the change of the plurality of elements to be changed is associated with each other in a chain form and saved, and when the undo is executed, the plurality of elements are restored at one time based on the information from the undo stack. It is characterized by

【0006】また、本発明に係る他の既実行オペレーシ
ョンの取消装置は、オペレーションの実行によって変更
される要素の変更前の情報を退避させるためのものであ
って、1度のオペレーションで複数の要素が変更される
場合、これら要素の変更前の情報をチェイン状に関連さ
せて記憶するアンドゥスタックと、アンドゥ実行時に直
前のオペレーションによって変更された要素の情報を退
避させるためのものであって、1度のアンドゥで複数の
要素が復元される場合、これら要素の復元前の情報をチ
ェイン状に関連させて記憶するリドゥスタックと、1度
のオペレーションによって複数の要素が変更されるオペ
レーションを実行したときに前記アンドゥスタックへ前
記変更される要素の変更前の情報をチェイン状に関連付
けて退避させ、1度のアンドゥによって複数の要素が復
元されるアンドゥを実行したときに復元の対象となる複
数の要素の情報を前記リドゥスタックにチェイン状に関
連付けて退避したのち、前記アンドゥスタックからの情
報に基づいて前記複数の要素を復元し、1度のリドゥに
よって複数の要素が復元されるリドゥを実行したときに
復元の対象となる複数の要素の情報を前記アンドゥスタ
ックにチェイン状に関連付けて退避したのち、前記リド
ゥスタックからの情報に基づいて前記複数の要素を復元
する手段とを備えたことを特徴とする。
Another device for canceling an already-executed operation according to the present invention is for saving the information before the change of the element changed by the execution of the operation. When the undo is changed, the undo stack stores the information before the change of these elements in a chain-like manner and the information of the element changed by the previous operation at the time of executing the undo. When multiple elements are restored by undoing once, a redo stack that stores the pre-restoration information of these elements in a chained manner and when an operation that changes multiple elements by one operation is performed In the undo stack, the information before the change of the changed element is associated with the chain and saved. A plurality of elements are restored by the undo of the above. When the undo is executed, the information of the plurality of elements to be restored is saved in the redo stack in a chained manner, and then based on the information from the undo stack. After restoring a plurality of elements and performing a redo in which a plurality of elements are restored by one redo, the information of the plurality of elements to be restored is saved in the undo stack in a chained manner, and then, Means for restoring the plurality of elements based on information from the redo stack.

【0007】[0007]

【作用】本発明に係る既実行オペレーションの取消装置
によれば、オペレーションの実行の度に、変更される要
素の変更前の情報がアンドゥスタックに格納されてい
く。アンドゥスタックは、複数オペレーション分の前記
情報が格納可能な容量を持つ。そして、アンドゥ実行の
度に、前記アンドゥスタックから順次情報が読み出さ
れ、この情報に基づいて要素が復元される。1度のオペ
レーションで複数の要素が変更された場合には、変更さ
れた複数の要素が前記アンドゥスタックにチェイン状に
関連付けられて記憶され、アンドゥ実行時には、これら
関連付けされた複数の要素の情報が一度に復元される。
したがって、この発明によれば、複数のオペレーション
が実行された後でも、任意のオペレーションまで遡って
要素を復元することができると共に、マルチオペレーシ
ョンの実行によって複数の要素が一度に変更された場合
には、アンドゥ処理においても上記複数の要素を一度に
復元させることができる。
According to the cancel device for an already-executed operation according to the present invention, the information before the change of the changed element is stored in the undo stack every time the operation is executed. The undo stack has a capacity capable of storing the information for a plurality of operations. Then, each time the undo is executed, information is sequentially read from the undo stack, and the element is restored based on this information. When a plurality of elements are changed in one operation, the changed plurality of elements are stored in the undo stack in a chained manner, and when the undo is executed, the information of the plurality of related elements is stored. Restored at once.
Therefore, according to the present invention, even after a plurality of operations have been executed, it is possible to restore an element dating back to an arbitrary operation, and in the case where a plurality of elements are changed at one time by executing a multi-operation. Also in the undo processing, it is possible to restore the plurality of elements at once.

【0008】また、本発明に係る他の既実行オペレーシ
ョンの取消装置によれば、アンドゥスタックに加えてリ
ドゥスタックが設けられ、アンドゥ実行時に、直前のオ
ペレーションによって変更された要素の情報が上記リド
ゥスタックに退避される。このリドゥスタックも、複数
オペレーション分の情報を格納可能な容量を有してい
る。そして、アンドゥ実行時には、復元の対象となる要
素の情報がリドゥスタックに退避される。このため、ア
ンドゥの連続的な実行により、任意のオペレーション実
行時までデータが復元された後に、リドゥを実行するこ
とにより、再度、直前のオペレーション実行後のデータ
まで戻ることができる。1度のオペレーションで複数の
要素が変更された場合には、変更された複数の要素が前
記アンドゥスタックにチェイン状に関連付けられて記憶
され、アンドゥ実行時には、これら関連付けされた複数
の要素の情報が一度に復元されると共に、復元前の複数
の要素の情報がリドゥスタックにチェイン状に関連付け
られて記憶される。。したがって、この発明によれば、
複数のオペレーションの実行後に、任意のオペレーショ
ンまで遡ったり、また元に戻すといった操作が可能にな
ると共に、マルチオペレーションの実行によって複数の
要素が一度に変更された場合には、アンドゥ処理及びリ
ドゥ処理においても上記複数の要素を一度に復元させる
ことができる。このため、システムの操作性が向上し、
作業効率もアップする。
Further, according to another undoing device for an already executed operation according to the present invention, a redo stack is provided in addition to the undo stack, and at the time of undo execution, the information of the element changed by the immediately preceding operation is added to the redo stack. Are evacuated to. This redo stack also has a capacity capable of storing information for a plurality of operations. Then, at the time of executing the undo, the information of the element to be restored is saved in the redo stack. Therefore, by continuously executing the undo, the data is restored until the arbitrary operation is executed, and then by executing the redo, it is possible to return to the data after the immediately previous operation is executed again. When a plurality of elements are changed in one operation, the changed plurality of elements are stored in the undo stack in a chained manner, and when the undo is executed, the information of the plurality of related elements is stored. The information of a plurality of elements before being restored at the same time is stored in the redo stack in a chained manner. .. Therefore, according to the present invention,
After execution of multiple operations, operations such as going back to any operation and undoing are possible, and when multiple elements are changed at once by execution of multi-operation, undo processing and redo processing Can restore the above multiple elements at once. Therefore, the operability of the system is improved,
Work efficiency is also improved.

【0009】[0009]

【実施例】以下、添付の図面を参照して本発明の一実施
例に係るCADシステムについて説明する。図1は本実
施例に係るCADシステムの機能ブロック図である。こ
のシステムは、入力装置1、CAD処理部2、要素デー
タベース3、表示装置4及び図面出力装置5を備えて構
成されている。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A CAD system according to an embodiment of the present invention will be described below with reference to the accompanying drawings. FIG. 1 is a functional block diagram of a CAD system according to this embodiment. This system includes an input device 1, a CAD processing unit 2, an element database 3, a display device 4, and a drawing output device 5.

【0010】入力装置1は、キーボード及びマウス等か
ら構成されたもので、表示装置4に表示されるコマンド
メニューから必要なコマンドを指定したり、表示装置4
上で作図及び編集作業を行う際のポイント、図形要素及
び領域等を指定するものである。また、入力装置1に
は、アンドゥ処理の実行を指示するためのアンドゥキー
と、リドゥ処理の実行を指示するためのリドゥキーが備
えられている。
The input device 1 is composed of a keyboard, a mouse, etc., and specifies a necessary command from a command menu displayed on the display device 4, or the display device 4
It is intended to specify points, graphic elements, areas, etc. when the above drawing and editing work is performed. Further, the input device 1 is provided with an undo key for instructing execution of undo processing and a redo key for instructing execution of redo processing.

【0011】CAD処理部2は、作図・編集処理部1
1、書込・読出制御部12、表示制御部13及び図面出
力制御部14を備えて構成されている。作図・編集処理
部11は、入力装置1によって指示されたコマンドを解
釈して入力装置1によって指示された位置に必要な図形
要素データを発生させたり、指定された要素データや入
力された付加情報に対して削除、複写、移動等の編集処
理を施す。書込・読出制御部12は、作図・編集処理部
11で作成及び編集された要素データ及び付加情報を要
素データベース3に書込んだり、作図・編集処理部11
の制御のもとに要素データベース3から必要な要素デー
タや付加情報を読み出す機能を有している。また、書込
・読出制御部12は、オペレーションの実行の度に後述
するアンドゥスタック24に必要な情報を退避させた
り、アンドゥ実行時やリドゥ実行時にアンドゥスタック
24や後述するリドゥスタック25に必要な情報を退避
させたり、これらのスタック24,25から必要な情報
を取り出してデータを復元する機能を有している。表示
制御部13は、作図・編集処理部11で生成・編集され
た図形要素データ、付加情報及びコマンドメニュー等を
CRTディスプレイ等の表示装置4に表示させるための
表示制御を行う。図面出力制御部14は、作図・編集処
理部11で生成・編集された図形要素データをペンプロ
ッタ等の図面出力装置5に出図する際の出力制御を行
う。
The CAD processing unit 2 is a drawing / editing processing unit 1.
1, a writing / reading control unit 12, a display control unit 13, and a drawing output control unit 14. The drawing / editing processing unit 11 interprets a command instructed by the input device 1 to generate necessary graphic element data at a position instructed by the input device 1, or specifies specified element data or input additional information. Edit processing such as deleting, copying, moving, etc. The writing / reading control unit 12 writes the element data and the additional information created and edited by the drawing / editing processing unit 11 into the element database 3, and the drawing / editing processing unit 11
Under the control of 1), it has a function of reading necessary element data and additional information from the element database 3. The writing / reading control unit 12 saves necessary information in an undo stack 24 described later each time an operation is executed, and is necessary in the undo stack 24 and a redo stack 25 described later during undo execution or redo execution. It has a function of saving information and retrieving data by taking out necessary information from these stacks 24 and 25. The display control unit 13 performs display control for displaying the graphic element data, the additional information, the command menu, etc. generated / edited by the drawing / editing processing unit 11 on the display device 4 such as a CRT display. The drawing output control unit 14 performs output control when drawing the graphic element data generated and edited by the drawing / editing processing unit 11 to the drawing output device 5 such as a pen plotter.

【0012】要素データベース3は、作成された図面を
構成する要素データを登録するデータベースで、例えば
図2に示すように、エントノード21、セグメント2
2、ポイントデータベース23、アンドゥスタック24
及びリドゥスタック25から構成されている。エントノ
ード21には、要素番号、セグメントへのアドレス、要
素タイプ及び選択フラグ等が格納される。セグメント2
2には、両端点を示すデータ(直線)や中心点、長径ベ
クトル、短径ベクトル(円及び楕円)等を示すデータが
格納される。点及びベクトルデータには、ポイントデー
タベース23へのインデックスが格納され、その座標値
自体はポイントデータベース23に格納される。アンド
ゥスタック24には、オペレーションの実行の度に変更
される要素の情報、具体的にはエントノード21の要素
番号(No. )、セグメント22へのアドレス(AD)及び
要素タイプ(TYP )等の要素の情報が格納される。アン
ドゥスタック24は、例えば20オペレーション分の要
素の情報を格納することができる容量を備えている。ま
た、リドゥスタック25もアンドゥスタック24と同様
の構造を有しており、アンドゥ実行時に、復元される要
素の情報、即ちエントノード21の要素番号(No. )、
セグメント22へのアドレス(AD)及び要素タイプ(TY
P )等の要素の情報が格納されるようになっている。
The element database 3 is a database for registering element data constituting the created drawing. For example, as shown in FIG.
2, point database 23, undo stack 24
And a redo stack 25. The element number, the segment address, the element type, the selection flag, and the like are stored in the ent node 21. Segment 2
2 stores data (straight lines) indicating both end points, data indicating a center point, a major axis vector, a minor axis vector (circle and ellipse), and the like. Indexes to the point database 23 are stored in the point and vector data, and the coordinate values themselves are stored in the point database 23. The undo stack 24 stores information on elements that change each time the operation is executed, specifically, the element number (No.) of the ent node 21, the address (AD) to the segment 22 and the element type (TYP). Element information is stored. The undo stack 24 has a capacity capable of storing element information for 20 operations, for example. The redo stack 25 also has a structure similar to that of the undo stack 24, and the information of the element to be restored when the undo is executed, that is, the element number (No.) of the ent node 21,
Address (AD) to segment 22 and element type (TY
Information of elements such as P) is stored.

【0013】次にこのように構成された本システムの動
作を説明する。まず、図3〜図5を参照して新たに要素
が追加される場合の処理について説明する。要素データ
ベース3に要素データが全く記憶されていない状態を図
3に示す。エントノード21のセグメントへのアドレス
及び要素タイプには“NULL”コードが格納され、フラグ
は“0”に設定されている。また、アンドゥスタック2
4のスタックポインタASP及びリドゥスタック25の
スタックポインタRSPは、共にスタック24,25の
0番目を指している。この状態で、入力装置1のマウス
等を使用して、図4(a)に示すように、直線P1−P
2が新規に描かれると、まず、エントノード21の要素
番号“1”の領域に新たにデータが書込まれるので、こ
の書込に先立って、図4(b)に示すように、ASPが
1つ進められ、エントノード21の要素番号“1”の領
域のデータ(要素番号“1”、セグメント22へのアド
レス“NULL”及び要素タイプ“NULL”)がアンドゥスタ
ック24に退避される。次に点P1,P2の座標値がポ
インデータベース23に書込まれ、セグメント22に
は、ポイントデータベース23の点P1,P2の格納場
所へのインデックスが登録される。そして、エントノー
ド21の要素番号“1”の領域には、点P1,P2のイ
ンデックスが格納されたセグメント22へのアドレス
“AD1 ”が格納され、要素タイプとして“Line”が書込
まれる。
Next, the operation of the present system configured as described above will be described. First, the processing when a new element is added will be described with reference to FIGS. FIG. 3 shows a state in which no element data is stored in the element database 3. The "NULL" code is stored in the address to the segment of the ent node 21 and the element type, and the flag is set to "0". Also, undo stack 2
The stack pointer ASP of No. 4 and the stack pointer RSP of the redo stack 25 both point to the 0th stack 24, 25. In this state, using the mouse or the like of the input device 1, as shown in FIG.
When 2 is newly drawn, first, data is newly written in the area of the element number “1” of the ent node 21. Therefore, prior to this writing, as shown in FIG. The data is advanced by one, and the data (element number “1”, address “NULL” to segment 22 and element type “NULL”) in the area of the element number “1” of the ent node 21 is saved in the undo stack 24. Next, the coordinate values of the points P1 and P2 are written in the point database 23, and the index to the storage location of the points P1 and P2 of the point database 23 is registered in the segment 22. Then, in the area of the element number "1" of the ent node 21, the address "AD1" to the segment 22 storing the indexes of the points P1 and P2 is stored, and "Line" is written as the element type.

【0014】続いて、図5(a)に示すように、直線P
1−P3が描かれると、同図(b)に示すように、AS
Pが1つ進められ、要素番号“2”の領域のデータ(要
素番号“1”、セグメント22へのアドレス“NULL”及
び要素タイプ“NULL”)がアンドゥスタック24に退避
されたのち、点P3の座標値がポイントデータベース2
3に書込まれ、点P1,P3へのインデックスがセグメ
ント22に登録される。そして、エントノード21の要
素番号“2”の領域には、点P1,P3のインデックス
が格納されたセグメント22へのアドレス“AD2 ”が格
納され、要素タイプとして“Line”が格納される。
Then, as shown in FIG. 5A, a straight line P
When 1-P3 is drawn, as shown in FIG.
After P is advanced by 1 and the data (element number “1”, address “NULL” to segment 22 and element type “NULL”) in the area of element number “2” is saved in the undo stack 24, point P3 Coordinate values of point database 2
3 and the indexes to the points P1 and P3 are registered in the segment 22. Then, in the area of the element number "2" of the ent node 21, the address "AD2" to the segment 22 storing the indexes of the points P1 and P3 is stored, and "Line" is stored as the element type.

【0015】次に、この状態でアンドゥキーが2回押さ
れた場合の処理を図6及び図7を参照して説明する。ア
ンドゥキーが押されると、図6(a)に示すように、A
SPの現在指している(点線)内容からアンドゥの対象
が要素番号“2”の要素であることが分かるので、エン
トノード21の要素番号“2”のフラグを“1”にす
る。次に、RSPを1つ進め、エントノード21のフラ
グが“1”の要素の要素番号“2”、セグメントへのア
ドレス“AD2 ”及び要素タイプ“Line”をリドゥスタッ
ク25に退避させる。続いて、アンドゥスタック24の
ASPが指している内容(要素番号“2”、セグメント
22へのアドレス“NULL”及び要素タイプ“NULL”)を
エントノード21に復元させ、ASPを1つ戻す。この
結果、セグメント22へのアドレスが“NULL”になり、
図6(b)の点線で示す直線P1−P3が消去される。
即ち、2番目の直線が描かれる前の状態に戻る。
Next, the processing when the undo key is pressed twice in this state will be described with reference to FIGS. 6 and 7. When the undo key is pressed, as shown in FIG.
Since it is known from the contents of SP currently indicated (dotted line) that the undo target is the element of the element number "2", the flag of the element number "2" of the ent node 21 is set to "1". Next, the RSP is advanced by one and the element number “2” of the element having the flag of the ent node 21 of “1”, the address “AD2” to the segment and the element type “Line” are saved in the redo stack 25. Then, the contents pointed by the ASP of the undo stack 24 (element number “2”, address “NULL” to segment 22 and element type “NULL”) are restored in the ent node 21, and one ASP is returned. As a result, the address to segment 22 becomes "NULL",
The straight line P1-P3 shown by the dotted line in FIG. 6B is deleted.
That is, it returns to the state before the second straight line was drawn.

【0016】更に、もう一度アンドゥキーが押される
と、図7(a)に示すように、ASPの現在指している
(点線)内容からアンドゥの対象が要素番号“1”の要
素であることが分かるので、エントノード21の要素番
号“1”のフラグを“1”にする。次に、RSPを1つ
進め、エントノード21のフラグが“1”の要素の要素
番号“1”、セグメントへのアドレス“AD1 ”及び要素
タイプ“Line”をリドゥスタック25に退避させる。続
いて、アンドゥスタック24のASPが指している内容
(要素番号“1”、セグメント22へのアドレス“NUL
L”及び要素タイプ“NULL”)をエントノード21に復
元させ、ASPを1つ戻す。この結果、セグメント22
へのアドレスが“NULL”になり、図7(b)の点線で示
す直線P1−P2が消去される。即ち、1番目の直線が
描かれる前の状態に戻る。
Further, when the undo key is pressed again, as shown in FIG. 7A, it can be understood from the contents of the ASP currently indicated (dotted line) that the undo target is the element having the element number "1". Therefore, the flag of the element number "1" of the ent node 21 is set to "1". Next, the RSP is advanced by one, and the element number “1” of the element having the flag of the ent node 21 of “1”, the address “AD1” to the segment and the element type “Line” are saved in the redo stack 25. Then, the contents indicated by the ASP of the undo stack 24 (element number "1", address "NUL to segment 22"
L "and element type" NULL ") are restored to the ent node 21, and one ASP is returned.
Address becomes "NULL", and the straight line P1-P2 shown by the dotted line in FIG. 7B is erased. That is, it returns to the state before the first straight line was drawn.

【0017】次に、この状態でリドゥキーが押された場
合の処理を図8を参照して説明する。リドゥキーが押さ
れると、図8に示すように、RSPの現在指している
(点線)内容からリドゥの対象が要素番号“1”の要素
であることが分かるので、エントノード21の要素番号
“1”のフラグを“1”にする。次に、ASPを1つ進
め、エントノード21のフラグが“1”の要素の要素番
号“1”、セグメントへのアドレス“NULL”及び要素タ
イプ“NULL”をアンドゥスタック24に退避させる。続
いて、リドゥスタック25のRSPが指している内容
(要素番号“1”、セグメント22へのアドレス“AD1
”及び要素タイプ“Line”)をエントノード21に復
元させ、RSPを1つ戻す。この結果、セグメント22
へのアドレスが“AD1 ”になり、図4(a)に示した直
線P1−P2が復活する。即ち、1番目の直線が描かれ
た後の状態に戻る。
Next, the processing when the redo key is pressed in this state will be described with reference to FIG. When the redo key is pressed, as shown in FIG. 8, it can be known from the contents of the RSP currently indicated (dotted line) that the redo target is the element with the element number “1”, and therefore the element number “1” of the enent node 21. The "flag" is set to "1". Next, the ASP is advanced by one, and the element number “1” of the element having the flag “1” of the ent node 21, the address “NULL” to the segment, and the element type “NULL” are saved in the undo stack 24. Then, the contents pointed to by the RSP of the redo stack 25 (element number “1”, address “AD1 to segment 22
, And the element type “Line”) are restored to the ent node 21 and one RSP is returned. As a result, the segment 22
Address becomes "AD1", and the straight line P1-P2 shown in FIG. 4A is restored. That is, it returns to the state after the first straight line is drawn.

【0018】以上の処理は、基本的には複写及び削除の
オペレーション時にも全く同様に行われるので、その説
明は割愛する。
The above-mentioned processing is basically performed in the same manner at the time of copying and deleting operations, and the description thereof will be omitted.

【0019】次に、図9(a)に示すように、直線P1
−P2を直線P1′−P2′の位置に移動させた場合の
処理について説明する。この場合には、直線自体は残っ
ており、その端点の座標のみが変更になるので、ポイン
トデータベース23の内容が書き替えられる。したがっ
て、この書き替えに先立って、図9(b)に示すよう
に、アドレスAD1 に登録されていたセグメント22の内
容がアドレス AD1′の位置にコピーされる。ASPが1
つ進められ、要素番号“1”の領域のデータが退避され
る。このとき、セグメント22のアドレスとしては、コ
ピー先のアドレス“ AD1′”をアンドゥスタック24に
格納する。次に、点P1′,P2′の座標値がポイント
データベース23に書込まれ、アドレスAD1 のセグメン
トのポイントデータベース23へのインデックスが“P
1′,P2′”に書き替えられる。エントノード21の
要素番号“1”の領域の内容は変わらない。
Next, as shown in FIG. 9A, a straight line P1
The processing when -P2 is moved to the position of the straight line P1'-P2 'will be described. In this case, since the straight line itself remains and only the coordinates of the end points are changed, the contents of the point database 23 are rewritten. Therefore, prior to this rewriting, as shown in FIG. 9B, the contents of the segment 22 registered at the address AD1 are copied to the position of the address AD1 '. 1 ASP
Then, the data in the area of the element number “1” is saved. At this time, as the address of the segment 22, the copy destination address “AD1 ′” is stored in the undo stack 24. Next, the coordinate values of the points P1 'and P2' are written in the point database 23, and the index of the segment of the address AD1 into the point database 23 is "P.
1 ', P2'". The contents of the area of the element number" 1 "of the ent node 21 do not change.

【0020】この場合にも、アンドゥキーが押される
と、元の点座標のデータが復元されることになるので、
移動前の状態に戻すことができる。なお、この処理は、
一方の端点の位置が変更になったり、図形を回転させた
ような場合にも全く同様に行われるので、その説明は割
愛する。
Also in this case, when the undo key is pressed, the data of the original point coordinates will be restored.
You can return to the state before moving. In addition, this process is
Since the same operation is performed when the position of one end point is changed or when the figure is rotated, the description thereof will be omitted.

【0021】以上は、直線1本の描画といった単一オペ
レーション時の処理について説明したが、例えば、複数
の要素を一度に移動させたり、長方形を1回の操作で描
くといったマルチオペレーションを含む場合には、アン
ドゥスタック24及びリドゥスタック25の構造を次の
ように設定しておけばよい。図10は、この場合のアン
ドゥスタック24の要部構造を示す図である。なお、リ
ドゥスタック25もこれと同様の構造になっている。即
ち、アンドゥスタック24の各ASPが指す単位をアン
ドゥスタック要素31とすると、このアンドゥスタック
要素31には、前のアンドゥスタック要素31へのポイ
ンタBP及び次のアンドゥスタック要素31へのポイン
タAPが含まれている。これらポインタBP,APは、
アンドゥスタック要素31のアドレスが不連続である場
合に、スタック更新の際のASPの次アドレスを与える
のに使用される。
In the above, the processing in a single operation such as drawing one straight line has been described. For example, in the case of including a multi-operation in which a plurality of elements are moved at a time or a rectangle is drawn by one operation. For example, the structures of the undo stack 24 and the redo stack 25 may be set as follows. FIG. 10 is a diagram showing a main structure of the undo stack 24 in this case. The redo stack 25 has the same structure as this. That is, assuming that the unit pointed to by each ASP of the undo stack 24 is the undo stack element 31, this undo stack element 31 includes a pointer BP to the previous undo stack element 31 and a pointer AP to the next undo stack element 31. Has been. These pointers BP and AP are
Used to give the next address of the ASP when updating the stack when the addresses of the undo stack element 31 are discontinuous.

【0022】また、アンドゥスタック要素31には、そ
の実際の内容を記憶するためのアンドゥノード32への
ポインタNPが含まれている。アンドゥノード32に
は、前述した退避要素の情報、即ち要素番号No.、セ
グメントへのアドレスAD、要素タイプTYPが格納さ
れる他、次のアンドゥノード32へのポインタNPも格
納される。このポインタNPを介して図示のように複数
のアンドゥノード32をチェイン状に結合すれば、マル
チオペレーション実行時の複数要素の変更に対処するこ
とができる。
The undo stack element 31 also includes a pointer NP to the undo node 32 for storing its actual content. The undo node 32 contains information on the above-mentioned evacuation element, that is, the element number No. , The address AD to the segment, the element type TYP, and the pointer NP to the next undo node 32 are also stored. By connecting a plurality of undo nodes 32 in a chain via the pointer NP as shown in the figure, it is possible to cope with a change in a plurality of elements during execution of multi-operation.

【0023】図11〜図13は、以上の点を含めた書込
・読出制御部12の本発明で関係する部分についての処
理を説明するためのフローチャートである。図11は作
図・編集オペレーション実行時の処理を示している。作
図・編集オペレーション時には、まずリドゥスタック2
5の内容がクリアされる(S1)。具体的には、RSP
を0番目の位置に戻せばよい。続いて、オペレーション
がマルチオペレーションであるかどうかが判断される
(S2)。単一オペレーションの場合にはASPを1つ
進め(S3)、マルチオペレーションの場合には一連の
オペレーションの間はASPを固定したままにしてお
く。つまり、図10のアンドゥノード32のポインタN
Pを介した結合で各オペレーションを関連付ける。オペ
レーションが“変更”及び“移動”以外であれば(S
4)、エントノード21の所定情報をアンドゥスタック
24のポインタNPが指すアンドゥノード32にPUS
Hして(P5)、エントノード21の情報を書き替える
(S6)。また、オペレーションが“変更”又は“移
動”である場合には(S4)、セグメント22の情報を
コピーし(S7)、エントノード21の所定情報をアン
ドゥスタック24のポインタNPが指すアンドゥノード
32にPUSHする。但し、セグメント22へのアドレ
スは、コピー先アドレスとする(S8)。そして、セグ
メント22の情報を書き替える。
11 to 13 are flow charts for explaining the processing of the part of the write / read controller 12 including the above points, which is relevant to the present invention. FIG. 11 shows the processing when the drawing / editing operation is executed. During drawing / editing operations, first Redo Stack 2
The contents of 5 are cleared (S1). Specifically, RSP
Should be returned to the 0th position. Then, it is determined whether the operation is multi-operation (S2). In the case of a single operation, the ASP is advanced by one (S3), and in the case of multi-operation, the ASP remains fixed during a series of operations. That is, the pointer N of the undo node 32 in FIG.
Associate each operation with a join through P. If the operation is other than "change" and "move" (S
4) PUS the predetermined information of the ent node 21 to the undo node 32 pointed to by the pointer NP of the undo stack 24.
After H (P5), the information of the ent node 21 is rewritten (S6). When the operation is “change” or “move” (S4), the information of the segment 22 is copied (S7), and the predetermined information of the ennode node 21 is stored in the undo node 32 pointed to by the pointer NP of the undo stack 24. PUSH. However, the address to the segment 22 is the copy destination address (S8). Then, the information of the segment 22 is rewritten.

【0024】図12は、アンドゥ実行時の処理を示して
いる。アンドゥ実行時には、RSPを1つ進め(S1
1)、アンドゥスタック24のASPが指す内容からア
ンドゥの対象となる要素番号を抽出し、エントノード2
1の該当要素にフラグを立てる(S12)。次に、エン
トノード21のフラグが立った要素の所定情報をリドゥ
スタック25にPUSHする(S13)。そして、アン
ドゥスタック24の内容をエントノード21にPOPし
(S14)、ASPを一つ戻す(S15)。
FIG. 12 shows the processing at the time of executing undo. When executing undo, advance RSP by one (S1
1) Extract the element number to be undone from the contents indicated by the ASP of the undo stack 24, and
A flag is set to the corresponding element of 1 (S12). Next, the predetermined information of the flagged element of the ent node 21 is PUSHed to the redo stack 25 (S13). Then, the contents of the undo stack 24 are POP'd to the ent node 21 (S14), and one ASP is returned (S15).

【0025】図13は、リドゥ実行時の処理を示してい
る。リドゥ実行時には、ASPを1つ進め(S21)、
リドゥスタック25のRSPが指す内容からリドゥの対
象となる要素番号を抽出し、エントノード21の該当要
素にフラグを立てる(S22)。次に、エントノード2
1のフラグが立った要素の所定情報をアンドゥスタック
24にPUSHする(S23)。そして、リドゥスタッ
ク25の内容をエントノード21にPOPし(S2
4)、RSPを一つ戻す(S25)。
FIG. 13 shows a process at the time of executing redo. When executing redo, advance ASP by 1 (S21),
The element number to be redoed is extracted from the content indicated by the RSP of the redo stack 25, and a flag is set to the corresponding element of the ent node 21 (S22). Next, ent node 2
The predetermined information of the element for which the flag of 1 is set is pushed to the undo stack 24 (S23). Then, the contents of the redo stack 25 are popped to the ent node 21 (S2
4) Return one RSP (S25).

【0026】[0026]

【発明の効果】以上述べたように、本発明によれば、複
数のオペレーションが実行された後でも、任意のオペレ
ーションまで遡って要素を復元することができると共
に、マルチオペレーションの実行によって複数の要素が
一度に変更された場合には、アンドゥ処理においても上
記複数の要素を一度に復元させることができるので、シ
ステムの操作性が向上し、作業効率が向上するという効
果を奏する。
As described above, according to the present invention, even after a plurality of operations have been executed, it is possible to restore elements up to an arbitrary operation, and by executing multiple operations, a plurality of elements can be restored. When is changed at once, the plurality of elements can be restored at the same time even in the undo process, so that the operability of the system is improved and the working efficiency is improved.

【図面の簡単な説明】[Brief description of drawings]

【図1】 本発明の一実施例に係るCADシステムの要
部を示す機能ブロック図である。
FIG. 1 is a functional block diagram showing a main part of a CAD system according to an embodiment of the present invention.

【図2】 同システムにおける要素データベースの内容
を説明するための図である。
FIG. 2 is a diagram for explaining the contents of an element database in the system.

【図3】 同システムにおける要素書込時の処理を説明
するための図である。
FIG. 3 is a diagram for explaining a process at the time of element writing in the system.

【図4】 同システムにおける要素書込時の処理を説明
するための図である。
FIG. 4 is a diagram for explaining a process at the time of element writing in the system.

【図5】 同システムにおける要素書込時の処理を説明
するための図である。
FIG. 5 is a diagram for explaining a process at the time of element writing in the same system.

【図6】 同システムにおけるアンドゥ実行時の処理を
説明するための図である。
FIG. 6 is a diagram for explaining processing at the time of executing undo in the system.

【図7】 同システムにおけるアンドゥ実行時の処理を
説明するための図である。
FIG. 7 is a diagram for explaining a process during undo execution in the system.

【図8】 同システムにおけるリドゥ実行時の処理を説
明するための図である。
FIG. 8 is a diagram for explaining a process at the time of executing redo in the system.

【図9】 同システムにおける要素移動時の処理を説明
するための図である。
FIG. 9 is a diagram for explaining a process when moving an element in the system.

【図10】 同システムにおけるマルチオペレーション
対応が可能なアンドゥスタックの要部構造を示す図であ
る。
FIG. 10 is a diagram showing a main structure of an undo stack capable of supporting multiple operations in the system.

【図11】 同システムにおける作図・編集オペレーシ
ョン実行時の書込・読出制御部の処理を説明するための
フローチャートである。
FIG. 11 is a flowchart for explaining a process of a writing / reading control unit when executing a drawing / editing operation in the system.

【図12】 同システムにおけるアンドゥ実行時の書込
・読出制御部の処理を説明するためのフローチャートで
ある。
FIG. 12 is a flowchart for explaining processing of a writing / reading control unit at the time of executing undo in the system.

【図13】 同システムにおけるリドゥ実行時の書込・
読出制御部の処理を説明するためのフローチャートであ
る。
[Fig. 13] Writing at the time of redo execution in the system
7 is a flowchart for explaining the processing of the read control unit.

【符号の説明】[Explanation of symbols]

1…入力装置、2…CAD処理部、3…要素データベー
ス、4…表示装置、5…図面出力装置、11…作図・編
集処理部、12…書込・読出制御部、13…表示制御
部、14…図面出力制御部。
DESCRIPTION OF SYMBOLS 1 ... Input device, 2 ... CAD processing part, 3 ... Element database, 4 ... Display device, 5 ... Drawing output device, 11 ... Drawing / editing processing part, 12 ... Write / read control part, 13 ... Display control part, 14 ... Drawing output control unit.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 オペレーションの実行によって変更され
る要素の変更前の情報を退避させるためのものであっ
て、1度のオペレーションで複数の要素が変更される場
合、これら要素の変更前の情報をチェイン状に関連させ
て記憶するアンドゥスタックと、 1度のオペレーションによって複数の要素が変更される
オペレーションを実行したときに前記アンドゥスタック
へ前記変更される複数の要素の変更前の情報をチェイン
状に関連付けて退避させ、アンドゥを実行したときに前
記アンドゥスタックからの情報に基づいて前記複数の要
素を一度に復元する手段とを備えたことを特徴とする既
実行オペレーションの取消装置。
1. A method for saving information before change of an element changed by execution of an operation, and when a plurality of elements are changed by one operation, information before change of these elements is stored. An undo stack that is stored in association with a chain shape, and a chain of information before the change of the plurality of elements that are changed to the undo stack when an operation that changes a plurality of elements by one operation is executed And a unit for restoring the plurality of elements at a time based on information from the undo stack when the associated undo is performed and the undo is executed.
【請求項2】 オペレーションの実行によって変更され
る要素の変更前の情報を退避させるためのものであっ
て、1度のオペレーションで複数の要素が変更される場
合、これら要素の変更前の情報をチェイン状に関連させ
て記憶するアンドゥスタックと、 アンドゥ実行時に直前のオペレーションによって変更さ
れた要素の情報を退避させるためのものであって、1度
のアンドゥで複数の要素が復元される場合、これら要素
の復元前の情報をチェイン状に関連させて記憶するリド
ゥスタックと、 1度のオペレーションによって複数の要素が変更される
オペレーションを実行したときに前記アンドゥスタック
へ前記変更される要素の変更前の情報をチェイン状に関
連付けて退避させ、1度のアンドゥによって複数の要素
が復元されるアンドゥを実行したときに復元の対象とな
る複数の要素の情報を前記リドゥスタックにチェイン状
に関連付けて退避したのち、前記アンドゥスタックから
の情報に基づいて前記複数の要素を復元し、1度のリド
ゥによって複数の要素が復元されるリドゥを実行したと
きに復元の対象となる複数の要素の情報を前記アンドゥ
スタックにチェイン状に関連付けて退避したのち、前記
リドゥスタックからの情報に基づいて前記複数の要素を
復元する手段とを備えたことを特徴とする既実行オペレ
ーションの取消装置。
2. The information for saving the information before the change of the element changed by the execution of the operation, and when the plurality of elements are changed by one operation, the information before the change of these elements is stored. An undo stack that is stored in association with a chain, and for saving the information of the elements changed by the previous operation at the time of undo execution. If multiple elements are restored by one undo, these A redo stack that stores the information before the restoration of the elements in association with each other in a chain form, and a redo stack that stores the changed elements to the undo stack when a plurality of elements are changed by one operation. Saves information by linking it in a chain and recovers multiple elements with a single undo. When the information of the plurality of elements to be restored is saved in the redo stack in a chained manner, the plurality of elements are restored based on the information from the undo stack, and the plurality of elements are restored by one redo. When the redo that restores the element of is executed, the information of the plurality of elements to be restored is associated with the undo stack in a chain form and saved, and then the plurality of elements are saved based on the information from the redo stack. An apparatus for canceling an already-executed operation, comprising: means for restoring.
JP4152679A 1992-05-20 1992-05-20 Already executed operation canceller Pending JPH05324556A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4152679A JPH05324556A (en) 1992-05-20 1992-05-20 Already executed operation canceller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4152679A JPH05324556A (en) 1992-05-20 1992-05-20 Already executed operation canceller

Publications (1)

Publication Number Publication Date
JPH05324556A true JPH05324556A (en) 1993-12-07

Family

ID=15545748

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4152679A Pending JPH05324556A (en) 1992-05-20 1992-05-20 Already executed operation canceller

Country Status (1)

Country Link
JP (1) JPH05324556A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH076135A (en) * 1993-04-22 1995-01-10 Microsoft Corp Cancellation / rerun mechanism of multilevel
CN105528334A (en) * 2015-12-17 2016-04-27 广州视睿电子科技有限公司 Method for processing document operation and terminal
CN113360221A (en) * 2020-03-04 2021-09-07 北京字节跳动网络技术有限公司 Information processing method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH076135A (en) * 1993-04-22 1995-01-10 Microsoft Corp Cancellation / rerun mechanism of multilevel
JP2005310116A (en) * 1993-04-22 2005-11-04 Microsoft Corp Computer system and undo/redo method therefor
CN105528334A (en) * 2015-12-17 2016-04-27 广州视睿电子科技有限公司 Method for processing document operation and terminal
CN113360221A (en) * 2020-03-04 2021-09-07 北京字节跳动网络技术有限公司 Information processing method and device

Similar Documents

Publication Publication Date Title
US4905185A (en) Apparatus for transferring block data in original form and editing the block data
JPH04181423A (en) Version control system
JP2707175B2 (en) Graphic processing system
JPH05324555A (en) Already executed operation canceller
JPH05324556A (en) Already executed operation canceller
JPS6026235B2 (en) How to protect diagram data
JPH0318224B2 (en)
JPH02165353A (en) Conversation type data processing system
JP3501483B2 (en) Document processing apparatus and document processing method
JP3598594B2 (en) Document processing apparatus and document processing method
JP2646518B2 (en) Processing method in graphic data processing device
JP3444620B2 (en) Filing system equipment
JPH096981A (en) Drawing production and editing device
JPS60167059A (en) System for using chart and data in document
JPH0765186A (en) Graphic editing device
JPH07160560A (en) System and method for managing data storage version
JP2908050B2 (en) Drawing and record management system
JPH05233411A (en) Document processor
JPH08137976A (en) Document processor
JPH02250166A (en) Information processor
JPH0480821A (en) Source program editing system
JPH0384674A (en) Cad device
JPH03113674A (en) Design data control system
JPH07191990A (en) Document processor with specifying function for area
JP2799499B2 (en) Composition design equipment