文档介绍:HOOPS基本培训课程日程安排
内容
第3天课程
拾取与高亮
3
大模型显示
3
动画
3
HOOPS Stream
3
HOOPS/ACIS Bridge
3
选择和高亮
HOOPS选择事件
选择示例
联系11:选择
高亮实现
段间的移动
联系12:高亮
HOOPS选择事件
一般来说输入的是鼠标位置
定义选择涉嫌
定义选择体
探测和选择射线相交的可选几何对象
选择事件执行以下操作
遍历段结构树
将可选几何对象转换到窗口空间
用选择区域和可选几何对象比较
在列表中的对象执行Z排序
‘selection sorting’选项可以控制是否执行Z排序
选择结果保存在选择队列中
与搜索函数返回的对象格式相同
pute_Selection
得到选中对象int pute_Selection(const char *display, const char *start_seg, const char *action, double x, double y)
display:拥有驱动的段
start_seg:搜索起始段
action:作用于对象的鼠标事件
x,y:选择点在窗口空间的坐标值
函数变形
By_Area
By_Polygon
By_Polyline
By_Volume
By_Shell
pute_Selection
选中的对象存储在选择列表中
按从前到后顺序排列
可以设置选择邻近区域的大小
HC_Set_Driver_Option函数的”selection proximity”选项
可以设置选择列表中可以保存的对象的数目
HC_Set_Driver_Option函数的”related selection limit”选项
可以搜索选择列表中的对象
HC_Show_Selection_XXX()
使用键值得到需要的几何对象
HC_Show_Selection_XXX()
搜索选择列表中的对象
void HC_Show_Selection_XXX()
函数变形
Show_Selection
Show_Selection_Element
Show_Selection_Elements
Show_Selection_Keys
Show_Selection_Original_Key
Show_Selection_Original_Keys
Show_Selection_Pathname
Show_Selection_Position
Show_Selection_Source
HC_Find_Related_Selection
在选择列表中移动,指向下一个对象HC_BOOLEAN HC_Find_Related_Selection(void)
do
{
HC_Show_Selection_Element(&key,NULL,NULL,NULL);
char type[MVO_BUFFER_SIZE];
HC_Show_Key_Type(key,type);
HC_KEY temp = (key);
if(temp != -1)
{
m_pNoteKey = temp;
break;
}
}while(HC_Fine_Related_Selection());
HC_Set_Selectability
设置段或基本图元的可选择性void HC_Set_Selectability(const char *list)
list:设置字符串
缺省情况下不可见的对象是无法选中的
通过指定”invisible”或”on!”可以打开对不可见对象的选择
HC_Set_Selectability(“eveything = off”);
选择示例
long primitive;
int count,offset1,offset2,offset3;
char type[32],pathname[128];
count = pute_Selection(“.”,”.”,”v”,,);
HC_Show_Selection_Element(&primitive,&offset1,&offset2,&offset3);
HC_Show_Key_Type(primitive,type);
if(streq(type,”marker”))
HC_delete_By_Key(&primitive);
else
Highlight_Primitive(&primitive);
练习11:选择
找出HOOPS可以从几何中得到的信息
参考在线帮助
提示HC_Show_Selection_element(key,offs