获取选择对象控件

//获得selection0控件选择的对象
UF_initialize();
std::vector<TaggedObject*>objects=this->selection0->GetProperties()->GetTaggedObjectVector("SelectedObjects");
double Z = expression0->Value();
//获取枚举控件
PropertyList* EnumProps = enum0->GetProperties();
int EnumValue = EnumProps->GetEnum("Value");
delete EnumProps;
EnumProps = NULL;

int tran; // 1 :移动 2 :复制

if ( EnumValue == 0 )
{
tran=1;
}
else
{
tran=2;
}

double 移动量[3] = {0.0,0.0,Z};

//创建链表
uf_list_p_t List;
UF_MODL_create_list(&List);
//将tag添加到链表
for ( int i=0;i<objects.size();i++) // size 列表长度,这里指的是 对象个数
{
UF_MODL_put_list_item(List,objects[i]->Tag());
}
//查询链表数量

int Count;
UF_MODL_ask_list_count(List, &Count);

tag_t ObjectTag = NULL_TAG;
for (int i = 0; i < Count; i++)
{
//获取链表里的所有tag
UF_MODL_ask_list_item(List, i, &ObjectTag);

//把链表里的所有

double matrix [16]; //矩阵
tag_t wsc_t2=NULL_TAG; //变化后坐标tag
int status;
uf5943(移动量,matrix); //矩阵方法(线性)

//矩阵的实现
int numbers=1; // 数量
int layer=-1; // 0:最初层; -1: 工作层; 1 - 256 : 指定层
int trace_curves=2; // 轨迹状态, 1 开, 2 关
uf5947(matrix,&ObjectTag,&numbers,&tran,&layer,&trace_curves,&wsc_t2,NULL,&status);
}
UF_CSYS_set_wcs_display(1); //显示工作坐标


//删除链表,释放内存
UF_MODL_delete_list(&List);
UF_terminate();

  

猜你喜欢

转载自www.cnblogs.com/liuxiaoqing1/p/12014488.html