Additions and changes to the manual

This commit is contained in:
Fernando Cacciola 2006-09-21 15:06:42 +00:00
parent bb56e2b05b
commit 2824fa73c0
9 changed files with 210 additions and 11 deletions

2
.gitattributes vendored
View File

@ -393,6 +393,7 @@ BGL/doc_tex/BGL_ref/HalfedgeDS_halfedge_max_base_with_id.tex -text
BGL/doc_tex/BGL_ref/HalfedgeDS_vertex_max_base_with_id.tex -text
BGL/doc_tex/BGL_ref/HalfedgeGraph.tex -text
BGL/doc_tex/BGL_ref/Polyhedron_edge_is_border_map.tex -text
BGL/doc_tex/BGL_ref/Polyhedron_items_with_id_3.tex -text
BGL/doc_tex/BGL_ref/Polyhedron_vertex_is_border_map.tex -text
BGL/doc_tex/BGL_ref/Polyhedron_vertex_point_const_map.tex -text
BGL/doc_tex/BGL_ref/Polyhedron_vertex_point_map.tex -text
@ -403,6 +404,7 @@ BGL/doc_tex/BGL_ref/graph_traits_Polyhedron_3.tex -text
BGL/doc_tex/BGL_ref/halfedge_graph_traits_Polyhedron_3.tex -text
BGL/doc_tex/BGL_ref/intro.tex -text
BGL/doc_tex/BGL_ref/main.tex -text
BGL/examples/BGL/Polyhedron_3/kruskal_with_stored_id.cpp -text
BGL/include/CGAL/boost/graph/BGL_properties.h -text
BGL/include/CGAL/boost/graph/Embedded_graph_traits.h -text
BGL/include/CGAL/boost/graph/HalfedgeDS_graph_traits_aux.h -text

View File

@ -26,6 +26,7 @@ It can be used for deriving own faces.
Note that the user is in charge to set the index correctly before
running a graph algorithm.
\ccInclude{CGAL/HalfedgeDS_face_max_base_with_id.h}
\ccIsModel
@ -41,7 +42,7 @@ running a graph algorithm.
{Returns the index.}
\ccGlue
\ccMethod{int& id();}
{Returns a reference to the index stored in the vertex.}
{Returns a reference to the index stored in the face.}
\ccSeeAlso
@ -51,7 +52,10 @@ running a graph algorithm.
\ccRefIdfierPage{CGAL::HalfedgeDS_min_items}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_vertex_min_base<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_halfedge_min_base<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_face_base<Refs>}
\ccRefIdfierPage{CGAL::HalfedgeDS_face_base<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_vertex_max_base_with_id<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_halfedge_max_base_with_id<Refs>}\\
\ccRefIdfierPage{CGAL::Polyhedron_items_with_id_3}\\
\end{ccRefClass}

View File

@ -28,6 +28,7 @@ It can be used for deriving own halfedges.
Note that the user is in charge to set the index correctly before
running a graph algorithm.
\ccInclude{CGAL/HalfedgeDS_halfedge_max_base_with_id.h}
\ccIsModel
@ -43,7 +44,7 @@ running a graph algorithm.
{Returns the index.}
\ccGlue
\ccMethod{int& id();}
{Returns a reference to the index stored in the vertex.}
{Returns a reference to the index stored in the halfedge.}
\ccSeeAlso
@ -53,7 +54,10 @@ running a graph algorithm.
\ccRefIdfierPage{CGAL::HalfedgeDS_min_items}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_vertex_min_base<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_face_min_base<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_halfedge_base<Refs>}
\ccRefIdfierPage{CGAL::HalfedgeDS_halfedge_base<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_vertex_max_base_with_id<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_face_max_base_with_id<Refs>}\\
\ccRefIdfierPage{CGAL::Polyhedron_items_with_id_3}\\
\end{ccRefClass}

View File

@ -25,6 +25,7 @@ It can be used for deriving own vertices.
Note that the user is in charge to set the index correctly before
running a graph algorithm.
\ccInclude{CGAL/HalfedgeDS_vertex_max_base_with_id.h}
\ccIsModel
@ -53,7 +54,10 @@ running a graph algorithm.
\ccRefIdfierPage{CGAL::HalfedgeDS_min_items}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_halfedge_min_base<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_face_min_base<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_vertex_base<Refs>}
\ccRefIdfierPage{CGAL::HalfedgeDS_vertex_base<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_halfedge_max_base_with_id<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_face_max_base_with_id<Refs>}\\
\ccRefIdfierPage{CGAL::Polyhedron_items_with_id_3}\\
\end{ccRefClass}

View File

@ -0,0 +1,99 @@
% +------------------------------------------------------------------------+
% | Reference manual page: Polyhedron_items_with_id_3.tex
% +------------------------------------------------------------------------+
% | 17.03.1999 Lutz Kettner
% | Package: Polyhedron
% |
% +------------------------------------------------------------------------+
\ccRefPageBegin
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
\begin{ccRefClass}{Polyhedron_items_with_id_3}
\ccDefinition
The class \ccRefName\ is a model of the \ccc{PolyhedronItems_3}
concept. It provides definitions for vertices with points, halfedges,
and faces with plane equations, all of them with an additional integer
field which can be used to index the items in a {\sc Bgl} algorithm.
The polyhedron traits class must provide the respective types for
the point and the plane equation.
Vertices and facets both contain a halfedge handle to an incident
halfedge.
\ccInclude{CGAL/Polyhedron_items_with_id_3.h}
\ccIsModel
\ccRefIdfierPage{PolyhedronItems_3}
\ccHeading{Types in
\ccc{Polyhedron_items_with_id_3::Vertex_wrapper<Refs,Traits>::Vertex}}
\ccThree{CGAL::Polyhedron_items_with_id_3}{items;;;;}{}
\ccThreeToTwo
%%\ccTwo{CGAL::Polyhedron_items_with_id_3 items;;;}{}
\ccTypedef{typedef Traits::Point_3 Point;}{}
\ccGlue
\ccTypedef{typedef CGAL::Tag_true Supports_vertex_point;}{}
\ccHeading{Types in \ccc{Polyhedron_items_with_id_3::Face_wrapper<Refs,Traits>::Face}}
\ccTypedef{typedef Traits::Plane_3 Plane;}{}
\ccGlue
\ccTypedef{typedef CGAL::Tag_true Supports_face_plane;}{}
% No longer required.
%\ccGlue
%\ccTypedef{typedef Traits::Normal Normal;}{}
%\ccGlue
%\ccTypedef{typedef CGAL::Tag_true Supports_face_normal;}{}
\ccHeading{Additional methods in all three items.}
\ccMethod{int id() const;}
{Returns the index.}
\ccGlue
\ccMethod{int& id();}
{Returns a reference to the index stored in the item.}
\ccCreation
\ccCreationVariable{items} %% choose variable name
\ccConstructor{Polyhedron_items_with_id_3();}{default constructor.}
\ccOperations
Supported as required by the \ccc{PolyhedronItems_3} concept.
\ccSeeAlso
\ccRefIdfierPage{CGAL::Polyhedron_3<Traits>}\\
\ccRefIdfierPage{CGAL::Polyhedron_min_items_3}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_min_items}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_items_2}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_vertex_max_base_with_id<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_halfedge_max_base_with_id<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_face_max_base_with_id<Refs>}\\
\ccExample
The following example program shows a call to the {\sc Bgl}
Kruskal's minimun spanning tree algorithm accesing the id()
field stored in a Polyhedron vertex.\\
The main function illustrates the access to the id() field.
\ccIncludeExampleCode{BGL/Polyhedron_3/kruskal_with_stored_id.cpp}
\end{ccRefClass}
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
\ccRefPageEnd
% EOF
% +------------------------------------------------------------------------+

View File

@ -4,8 +4,6 @@
% | 10.12.2005 Andreas Fabri
% | Package: boost
% |
\RCSdef{\RCSTriangulationvertexbaseRev}{$Revision$}
\RCSdefDate{\RCSTriangulationvertexbaseDate}{$Date$}
% |
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+

View File

@ -37,10 +37,11 @@ with the algorithms of the {\sc Bgl}, as well as a new graph concept.
\ccRefIdfierPage{boost::graph_traits< CGAL::Polyhedron_3<Traits> > }\\
\ccRefIdfierPage{CGAL::halfedge_graph_traits< CGAL::Polyhedron_3<Traits> > }\\
\ccRefIdfierPage{boost::graph_traits< CGAL::Triangulation_2<GT, TDS> >}\\
\ccRefIdfierPage{CGAL::Triangulation_vertex_base_with_id_2<TriangulationTraits_2, TriangulationVertexBase_2>}
\ccRefIdfierPage{CGAL::HalfedgeDS_vertex_max_base_with_id<Refs>}
\ccRefIdfierPage{CGAL::HalfedgeDS_halfedge_max_base_with_id<Refs>}
\ccRefIdfierPage{CGAL::HalfedgeDS_face_max_base_with_id<Refs>}
\ccRefIdfierPage{CGAL::Triangulation_vertex_base_with_id_2<TriangulationTraits_2, TriangulationVertexBase_2>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_vertex_max_base_with_id<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_halfedge_max_base_with_id<Refs>}\\
\ccRefIdfierPage{CGAL::HalfedgeDS_face_max_base_with_id<Refs>}\\
\ccRefIdfierPage{CGAL::Polyhedron_items_with_id_3}
% +------------------------------------------------------------------------+

View File

@ -10,6 +10,7 @@
\input{BGL_ref/HalfedgeDS_halfedge_max_base_with_id.tex}
\input{BGL_ref/HalfedgeDS_face_max_base_with_id.tex}
\input{BGL_ref/HalfedgeDS_vertex_max_base_with_id.tex}
\input{BGL_ref/Polyhedron_items_with_id_3.tex}
\input{BGL_ref/Edge_index_t_enum.tex}
\input{BGL_ref/Edge_is_border_t_enum.tex}
\input{BGL_ref/Vertex_is_border_t_enum.tex}

View File

@ -0,0 +1,86 @@
#include <CGAL/Cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/graph_traits_Polyhedron_3.h>
#include <iostream>
#include <algorithm>
#include <list>
#include <boost/graph/kruskal_min_spanning_tree.hpp>
typedef CGAL::Cartesian<double> Kernel;
typedef Kernel::Vector_3 Vector;
typedef Kernel::Point_3 Point;
typedef CGAL::Polyhedron_3<Kernel,Polyhedron_items_with_id_3> Polyhedron;
typedef boost::graph_traits<Polyhedron>::vertex_descriptor vertex_descriptor;
typedef boost::graph_traits<Polyhedron>::vertex_iterator vertex_iterator;
typedef boost::graph_traits<Polyhedron>::edge_descriptor edge_descriptor;
void
kruskal(const Polyhedron& P)
{
// associate indices to the vertices using the "id()" field of the vertex.
{
vertex_iterator vb, ve;
int index = 0;
// boost::tie assigns the first and second element of the std::pair
// returned by boost::vertices to the variables vit and ve
for(boost::tie(vb,ve)=boost::vertices(P); vb!=ve; ++vb ){
vertex_descriptor vd = *vb;
vd->id() = index++;
}
}
// We use the default edge weight which is the squared length of the edge
// This property map is defined in graph_traits_Polyhedron_3.h
// This function call requires a vertex_index_map named parameter which
// when ommitted defaults to "get(vertex_index,graph)".
// That default works here because the vertex type supports the "id()"
// field which is used by the vertex_index internal property.
std::list<edge_descriptor> mst;
boost::kruskal_minimum_spanning_tree(P,std::back_inserter(mst));
vertex_iterator vb, ve;
std::cout << "#VRML V2.0 utf8\n"
"Shape {\n"
"appearance Appearance {\n"
"material Material { emissiveColor 1 0 0}}\n"
"geometry\n"
"IndexedLineSet {\n"
"coord Coordinate {\n"
"point [ \n";
for(boost::tie(vb,ve) = boost::vertices(P); vb!=ve; ++vb){
std::cout << (*vb)->point() << "\n";
}
std::cout << "]\n"
"}\n"
"coordIndex [\n";
for(std::list<edge_descriptor>::iterator it = mst.begin(); it != mst.end(); ++it){
std::cout << vertex_id_map[boost::source(*it,P)]
<< ", " << boost::target(*it,P)->id() << ", -1\n";
}
std::cout << "]\n"
"}#IndexedLineSet\n"
"}# Shape\n";
}
int main() {
Polyhedron P;
std::cin >> P;
kruskal(P);
return 0;
}