iCAx开思网

标题: CAA :如何解决CATI3DGeoVisu->BuildRep()后实体模型Dispatch 失效问题 [打印本页]

作者: HNBoTree    时间: 2006-1-17 12:02
标题: CAA :如何解决CATI3DGeoVisu->BuildRep()后实体模型Dispatch 失效问题
当我做一个product 后,加上一个part,做一个立方体模型。

1。用CATI3DGeoVisu接口做buildRep 来得到他的Rep 图像。
2。然后修改option精度,在对整个的product进行redraw操作
     CATISpecObject->SetUpToDate(FALSE);
     CATIRedrawEvent->Redraw();
     CATIModelEvents ->Dispatch(CATModify);
    ,但是CATIA的visualize 没有变化。

而,如果我仅仅执行第二步操作,则可以实现redraw()操作。

我的问题是怎么样能够让Viz和model 在buildRep 后仍然能够link到一起?
谢谢大家!
作者: acoka    时间: 2006-1-17 16:17
参考以下interface
CATIVisuChildren
CATI3DGeoVisu
试试看能不能用

如果你CATISpecObject->SetUpToDate,那么试试看 CATISpecObject->Update()后再redraw()了话如何

有时候你不单要dispatch它本身,还得dispatch它爸,^_^
作者: HNBoTree    时间: 2006-1-19 10:17
呵呵,谢谢acoka,
问题是我直接deispatch root object,也是不行。
我发现每当我把一个part 或一个product 用CATIVisuChildren来buildRep 后,我直接修改options 上的精度,
实体模型不跟着发生变化了。这是我头痛的问题。
作者: acoka    时间: 2006-1-19 11:22
做annotation的时候碰到过类似问题,view的更新有问题
关做TPSSet,或关做View都不起作用,结果得把所有的tps元素都redraw一下
作者: HNBoTree    时间: 2006-1-19 16:38
acoka  兄,
你知道CATI3DGeoVisu 中GiveRep和BuildRep 有什么区别吗?
作者: acoka    时间: 2006-1-19 17:00
我写过一个feature,imp了这个interface
只写了BuildRep, 不用写GiveRep
GiveRep应该会把你BuildRep的返回值从member里找出来
作者: acoka    时间: 2006-1-19 17:03
我写过一个feature,imp了这个interface
只写了BuildRep, 不用写GiveRep
GiveRep应该会把你BuildRep的返回值从member里找出来
你用了CATExtIVisu这个adapter了吧
作者: HNBoTree    时间: 2006-1-19 17:07
谢谢
我没有用过CATExtIVisu 接口,
我发现用GiveRep后options 可以操作。
只是不知道GiveRep 是不是像BuildRep那样得到CATIA 当前显示的图像。
作者: acoka    时间: 2006-1-19 17:22
[quote]原帖由 HNBoTree 于 2006-1-19 17:07 发表
谢谢
我没有用过CATExtIVisu 接口,  <---- 你管它叫接口,要不是你帮助没看,要不是你还不是太了解Ext的用法

估计是这里
+---CATI3DGeoVisu

Usage: you can reimplement this interface by deriving the supplied CATExtIVisu adapter class.
这里写得很明白,要不你得自己写所有的method


BuildRep
public virtual CATRep * BuildRep( )= 0  

Builds the graphical representation of the object.
Role : It is the general method that applications have to implement to built their geometry from modeling information. The _rep data member must be valuated.


o GiveRep
public virtual CATRep * GiveRep( )  

Returns the graphical representation of the object.

默认的GiveRep应该是返回_rep, 而这个 _rep由BuildRep 定(应该是吧)
作者: HNBoTree    时间: 2006-1-21 11:19
非常感谢acoka  兄。
经过我这两天的测试,我发现GiveRep 正是我所要的API,既可以得到CATIA 当前的Rep,又对CATIA的Visual 无影响。




欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3