Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Retrieving Subconstraints in CDTplus

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Retrieving Subconstraints in CDTplus


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] Retrieving Subconstraints in CDTplus
  • Date: Tue, 12 May 2009 15:00:03 +0200

Hi Matthias,

Damian is right. The value_type of the CDTplus::Subconstraint_iterator
is std::pair< std::pair<Vertex_handle, Vertex_handle>, undocumentedClass >
so it->first.first and it->first.second do the job.

We will fix the code, as the manual is right.

andreas



Damian Sheehy wrote:
Hi Matthias,

I believe it's a bug in the documentation.
Can someone from the CGAL dev team confirm?

Try this. . . .

CDTplus::Vertex_handle v1, v2;

for (CDTplus::Subconstraint_
iterator c_it = cdt.subconstraints_begin(); c_it != cdt.subconstraints_end(); ++c_it)
{
v1 = c_it->first.first;
v2 = c_it->first.second;
}


Regards,

Damian


On Mon, May 11, 2009 at 6:40 AM, Matthias Teich < <mailto:>> wrote:

Hi again!

I am still looking for a way to retrieve the vertex_handles from a
subconstraint in a constrained triangluation plus.

Any hints are really appreciated.

Best Regards,
Matthias


Matthias schrieb:

Hi!

The documentation says:

"Constrained triangulation plus 2<Tr>:: Subconstraint iterator
An iterator to visit all the sub-constraints of the triangulation.
The order of visit is arbitrary. The value type of this iterator is
a pair std::pair<Vertex handle, Vertex handle> corresponding
to the vertices of the sub-constraint"

So I thought the following should work:

for (CDTplus::Subconstraint_iterator c_it =
cdt.subconstraints_begin(); c_it != cdt.subconstraints_end();
++c_it)
{
std::pair<CDTplus::Vertex_handle,CDTplus::Vertex_handle>
pair = *c_it;
// do sth with pair
}

Can anyone explain how I can retrieve the subconstraints?

What follows is the lengthy error message from visual studio:

::CC_iterator<DSC,Const>::CC_iterator(const
CGAL::CGALi::CC_iterator<DSC,Const> &)' : cannot convert
parameter 1 from 'const std::pair<_Ty1,_Ty2>' to 'const
CGAL::CGALi::CC_iterator<DSC,Const> &'
1> with
1> [
1> DSC=CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<Kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vb,Fb>>>>,

1> Const=false
1> ]
1> and
1> [
1> _Ty1=CGAL::CGALi::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<Kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vb,Fb>>>>,false>,

1> _Ty2=CGAL::CGALi::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<Kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vb,Fb>>>>,false>

1> ]
1> and
1> [
1> DSC=CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<Kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vb,Fb>>>>,

1> Const=false
1> ]
1> Reason: cannot convert from 'const
std::pair<_Ty1,_Ty2>' to 'const CGAL::CGALi::CC_iterator<DSC,Const>'
1> with
1> [
1> _Ty1=CGAL::CGALi::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<Kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vb,Fb>>>>,false>,

1> _Ty2=CGAL::CGALi::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<Kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vb,Fb>>>>,false>

1> ]
1> and
1> [
1> DSC=CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<Kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vb,Fb>>>>,

1> Const=false
1> ]
1> No user-defined-conversion operator available that can
perform this conversion, or the operator cannot be called
1> .\MeshOffsetter.cpp(534) : see reference to function
template instantiation 'std::pair<_Ty1,_Ty2>::pair<const
_Kty,_Ty>(const std::pair<const _Kty,_Ty> &)' being compiled
1> with
1> [
1> _Ty1=CGAL::CGALi::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<Kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vb,Fb>>>>,false>,

1> _Ty2=CGAL::CGALi::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<Kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vb,Fb>>>>,false>,

1> _Kty=std::pair<CGAL::CGALi::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<Kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vb,Fb>>>>,false>,CGAL::CGALi::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<Kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vb,Fb>>>>,false>>,

1> _Ty=std::list<CGAL::Constraint_hierarchy_2<CGAL::CGALi::CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<Kernel,CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<Vb,Fb>>>>,false>,bool>::H_context>
*
1> ]


------------------------------------------------------------------------


Eingehende eMail ist virenfrei.
Von AVG überprüft - www.avg.de <http://www.avg.de> Version:
8.5.325 / Virendatenbank: 270.12.23/2106 - Ausgabedatum:
05/09/09 06:54:00


-- You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss






Archive powered by MHonArc 2.6.16.

Top of Page