2016-11-20 47 views
0

我在CGAL中實現了一些代碼。我做了一個安排。現在我想在排列中添加一些數據給每一張臉。所以我通過下面的方法訪問一張臉。它返回const句柄。所以我嘗試將其轉換爲non_const_handle。但它顯示錯誤,「無法調用沒有對象的成員函數」。const_handle到CGAL中的non_const_handle

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); 
      } 
    } 
} 

回答

1
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並查找 「虛擲常量性」