几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-05-07, 04:08 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】snap Functionality

snap functionality
snap functionality
i'm trying to implement this functionality. before i start i would like to know:
- i can't see this funtionality implemented in odamfcapp although it appears
that have introduced a little interface related with it, so it could mean
that you are planning to introduce it in next releases, am i right?.
- if i'm right, are you going to implement it at application level or at libraries
level as you have made with grip funtionality?.
best regards.
i assume all your team is really busy but i "believe" this is a question that doesn't need a very long or a very difficult answer. i need some orientation in order to plan my approach.
also, if there is a memeber of this forum that could help me, i'd appreciate it very much.
thanks in advance and best regards.
snap points functionality is intended to be handled exactly as grip points. the date for having it implemented for all entities is not determined yet. maybe half an year..
sergey slezkin
i assume that you have looked at examples\grippoints\dbarcgrippoints.cpp, oddbarcgrippointspe::getosnappoints()
this is the way to implement snapping behaviour currently.
vladimir
thanks for your replies.
yes i have seen that function and when i saw it i looked for a similar function correspondent to other kind of entities, i didn't found.
so, could you tell me a brief description of the code that is needed to add in order to complete the implementation of snap functionality?.
i'd like to know whether it's more difficult to me trying to implement the code that is needed in your libraries or write a code that doesn't use the same schema.
for example an alternative approach maybe could be the following:
when in viewer onmousemove funtion, it could be made a selection near "point" and if there are elements in selection set, compare distances between point and snap points of the selected entities and make the mouse move to the nearest of those points.
i guess this approach is too simple but i'd like a lot a comment about my dilemma.
i'd also appreciate help by other users.
thanks in advance.
oddbgrippointspe::getosnappoints just returns the snap points, for the given snap mode. it's the application task to do something with them. we added some trivial snapping implementation to the grippoints sample, but you are on your own in enchancing it further.
that is - it should be distinguished: getosnappoints() implementation, for all the entities, and snapping behaviour in the application, that will use snap points obtained from the entities.
vladimir
hello,
i need some advice about the following question:
in odamfcapp grip (also snap) functionality is restricted to a set of selected entities, i mean user must select entities, at that moment grip points of the selected entities are saved and then used in functions like onmousemove.
but, what if i need to implement snap functionality for all entities present in a drawing?, would it be efficient to save all snap points for all posible snap modes for all entities?, could you tell me which "dwgdirect related" technique/s could i use or something about what is important to be taken in account?.
thanks again.
you may build some kind of spatial index of the entities, and, when user moves the mouse, look in the index for the list of entities being passed over, and ask them for their snap points. building such index may be integrated in the drawing device. of course you may just collect all the snap points in the first regen, but that might slow down initial rendering a bit. (depends on the entities, and their amount)
vladimir
imple point snap
hi , we use the dd viewer functionality in our own application for drawing referenced dwg/dxf files.
on mouse move we want to detect e.g the endpoint of a line inside dwg.
we doesn磘 need is any highlighting or box drawing, we want to get only the coordinates of the nearest point.
i looked in odamfcappl and found
odexeditorobject:nmouseleftbuttonclick
is there an easier entry point to do the point snap ?
regards,
uwe
hi uwe,
odexeditorobject is only an example of how editing could be implemented, so you are free to use it or not (for simple tasks most part of it might be redundant).
i don't sure i understand what you mean "easier entry point" ?..
quote:
on mouse move we want to detect e.g. the endpoint of a line inside dwg.
odexeditorobject:nmousemove
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】odstack class functionality yang686526 DirectDWG 0 2009-05-06 09:09 PM
【转帖】implementing selection functionality yang686526 DirectDWG 0 2009-05-06 03:42 PM
【转帖】how to replicate the functionality of the extrude and revolve buttons yang686526 SolidWorks二次开发 0 2009-04-13 12:01 PM
【转帖】api hooks for new bom reorganization functionality yang686526 SolidWorks二次开发 0 2009-04-12 11:04 PM


所有的时间均为北京时间。 现在的时间是 12:33 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多