首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CGAL中const_handle到non_const_handle的转换

CGAL中const_handle到non_const_handle的转换
EN

Stack Overflow用户
提问于 2016-11-21 04:55:14
回答 1查看 53关注 0票数 0

我正在用CGAL实现一些代码。我做了安排。现在我想给排列中的每个面添加一些数据。所以我通过下面的方法访问一个人脸。它返回常量句柄。所以我试着把它转换成non_const_handle。但是它显示错误“没有对象就不能调用成员函数”。

代码语言:javascript
复制
const Face_const_handle* f;
if(f = boost::get<Face_const_handle>(&(it->second))){

  Arrangement_2::Face_handle fh = Arrangement_2::non_const_handle(*f); // ERROR HERE
  for(int i=1;i<convexPts.size();i++){
    CGAL::Gmpq temp = CGAL::squared_distance(convexPts[0],convexPts[i]);
            if(temp>max){
                max = temp;
                fh->set_data(max);
            }
   }
}
EN

回答 1

Stack Overflow用户

发布于 2016-11-21 15:05:25

代码语言:javascript
复制
Vertex_handle arr.non_const_handle(Vertex_const_handle v)
Halfedge_handle arr.non_const_handle(Halfedge_const_handle e)
Face_handle non_arr.const_handle(Face_const_handle f)

查看Arangement_2 template并查找“抛弃常态”

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40709284

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档