规划多个反应堆
用户可能在屏幕上有多条花园小径,并且可能正在擦除多条花园小径。您需要为这种可能性做好计划。 与实体关联的反应堆是对象反应堆。如果图形中有多个图元,则也可能有多个对象反应器,每个图元对应一个。特定的编辑事件(如命令)可以触发许多回调,具体取决于所选实体中连接了多少个反应器。另一方面,编辑反应堆本质上是单一的。您的应用程序应该只附加一个事件反应器。erase:vlr-commandEnded 两种修改(更改顶点位置和擦除折线)的事件序列最终都会产生需要在函数中执行的操作。确定要针对每个条件执行的操作集。以下伪代码概述了逻辑:gp:command-ended Defun gp:command-ended (2nd version) Retrieve the pointer to the polyline (from a global variable) Conditional: If the polyline has been modified then: Erase the tiles Get information on the previous polyline vertex locations Get information on the new polyline vertex locations Redefine the polyline (straighten it up) Redraw the tiles End conditional expression If the polyline has been erased then: Erase the tiles End conditional expression End Conditional End function |
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-3-5 17:40
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.