Specific property maps now passed as arguments

This commit is contained in:
Fernando Cacciola 2006-08-28 15:53:54 +00:00
parent a563557048
commit 289f04cd5c
7 changed files with 145 additions and 156 deletions

3
.gitattributes vendored
View File

@ -1905,6 +1905,8 @@ Surface_mesh_parameterization/test/Surface_mesh_parameterization/data/cube.off -
Surface_mesh_parameterization/test/Surface_mesh_parameterization/data/high_genus.off -text svneol=unset#application/octet-stream
Surface_mesh_parameterization/test/Surface_mesh_parameterization/data/knot2.off -text svneol=unset#application/octet-stream
Surface_mesh_parameterization/test/Surface_mesh_parameterization/data/oni.off -text svneol=unset#application/octet-stream
Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Edge_cached_pointer_map.h -text
Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Edge_index_map.h -text
Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Cached_cost.h -text
Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Cached_placement.h -text
Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Full_collapse_data.h -text
@ -1914,7 +1916,6 @@ Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Ed
Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Partial_collapse_data.h -text
Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Set_full_collapse_data.h -text
Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Set_partial_collapse_data.h -text
Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Polyhedron_edge_cached_pointer_map.h -text
Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_test.cpp -text
Surface_mesh_simplification/test/Surface_mesh_simplification/edge_collapse_test.kdevelop -text
Surface_mesher/demo/Surface_mesher/windows/Mesh.suo -text

View File

@ -0,0 +1,45 @@
// Copyright (c) 2006 Geometry Factory (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: svn+ssh://fcacciola@scm.gforge.inria.fr/svn/cgal/trunk/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Edge_stored_extra_pointer_map.h $
// $Id: Edge_stored_extra_pointer_map.h 32048 2006-06-23 13:59:36Z lsaboret $
//
//
// Author(s): Fernando Cacciola <fernando.cacciola@gmail.com>
#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_EDGE_STORED_EXTRA_POINTER_MAP_H
#define CGAL_SURFACE_MESH_SIMPLIFICATION_EDGE_STORED_EXTRA_POINTER_MAP_H
namespace boost
{
template<class Graph_>
class Edge_stored_extra_pointer_map : public put_get_helper<void*&, Edge_stored_extra_pointer_map<Graph_> >
{
private:
typedef Graph_ Graph ;
public:
typedef lvalue_property_map_tag category;
typedef void* value_type;
typedef void*& reference;
typedef typename graph_traits<Graph>::edge_descriptor key_type;
reference operator[](key_type const& e) const { return e->extra_pointer() ; }
};
} // namespace boost
#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_EDGE_STORED_EXTRA_POINTER_MAP_H

View File

@ -0,0 +1,47 @@
// Copyright (c) 2006 Geometry Factory (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: svn+ssh://fcacciola@scm.gforge.inria.fr/svn/cgal/trunk/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Polyhedron_edge_cached_pointer_map.h $
// $Id: Polyhedron_edge_cached_pointer_map.h 32048 2006-06-23 13:59:36Z lsaboret $
//
//
// Author(s): Fernando Cacciola <fernando.cacciola@gmail.com>
#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_EDGE_STORED_INDEX_MAP_H
#define CGAL_SURFACE_MESH_SIMPLIFICATION_EDGE_STORED_INDEX_MAP_H
namespace boost
{
template<class Graph>
class Edge_stored_index_map : public put_get_helper< typename Graph_::size_type, Edge_stored_index_map<Graph_> >
{
private:
typedef Graph_ Graph ;
public:
typedef typename G::size_type size_type ;
typedef readable_property_map_tag category;
typedef size_type value_type;
typedef size_type reference;
typedef typename graph_traits<Graph const>::edge_descriptor key_type;
reference operator[](key_type const& e) const { return e->id(); }
};
} // namespace boost
#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_EDGE_STORED_INDEX_MAP_H

View File

@ -1,76 +0,0 @@
// Copyright (c) 2006 Geometry Factory (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: svn+ssh://fcacciola@scm.gforge.inria.fr/svn/cgal/trunk/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Polyhedron_edge_cached_pointer_map.h $
// $Id: Polyhedron_edge_cached_pointer_map.h 32048 2006-06-23 13:59:36Z lsaboret $
//
//
// Author(s): Fernando Cacciola <fernando.cacciola@gmail.com>
#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_POLYHEDRON_EDGE_CACHED_POINTER_MAP_H
#define CGAL_SURFACE_MESH_SIMPLIFICATION_POLYHEDRON_EDGE_CACHED_POINTER_MAP_H
#include <CGAL/boost/graph/Polyhedron_BGL_properties.h>
#include <CGAL/Surface_mesh_simplification/Detail/TSMS_common.h>
#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
# define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS
#else
# define CGAL_HDS_PARAM_ class HDS
#endif
namespace boost
{
struct edge_cached_pointer_t {} ;
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
class Polyhedron_edge_cached_pointer_map : public put_get_helper<void*&, Polyhedron_edge_cached_pointer_map<Gt, I, HDS, A> >
{
private:
typedef CGAL::Polyhedron_3<Gt,I,HDS,A> Polyhedron ;
public:
typedef lvalue_property_map_tag category;
typedef void* value_type;
typedef void*& reference;
typedef typename graph_traits<Polyhedron>::edge_descriptor key_type;
reference operator[](key_type const& e) const { return e->cached_pointer() ; }
};
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline Polyhedron_edge_cached_pointer_map<Gt, I, HDS, A>
get(edge_cached_pointer_t, CGAL::Polyhedron_3<Gt,I,HDS,A>& p)
{
Polyhedron_edge_cached_pointer_map<Gt, I, HDS, A> m(p);
return m;
}
template <>
struct Polyhedron_property_map<edge_cached_pointer_t>
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_ {
typedef Polyhedron_edge_cached_pointer_map<Gt, I, HDS, A> type;
typedef Polyhedron_edge_cached_pointer_map<Gt, I, HDS, A> const_type;
};
};
} // namespace boost
#undef CGAL_HDS_PARAM_
#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLYHEDRON_EDGE_CACHED_POINTER_MAP_H

View File

@ -1,76 +0,0 @@
// Copyright (c) 2006 Geometry Factory (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s): Fernando Cacciola <fernando.cacciola@gmail.com>
#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_POLYHEDRON_IS_VERTEX_FIXED_MAP_H
#define CGAL_SURFACE_MESH_SIMPLIFICATION_POLYHEDRON_IS_VERTEX_FIXED_MAP_H
#include <CGAL/boost/graph/Polyhedron_BGL_properties.h>
#include <CGAL/Surface_mesh_simplification/Detail/TSMS_common.h>
#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
# define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS
#else
# define CGAL_HDS_PARAM_ class HDS
#endif
namespace boost
{
struct vertex_is_fixed_t {} ;
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
class Polyhedron_is_vertex_fixed_map : public put_get_helper<bool, Polyhedron_is_vertex_fixed_map<Gt, I, HDS, A> >
{
private:
typedef CGAL::Polyhedron_3<Gt,I,HDS,A> Polyhedron ;
public:
typedef readable_property_map_tag category;
typedef bool value_type;
typedef bool reference;
typedef typename graph_traits<Polyhedron const>::vertex_descriptor key_type;
reference operator[](key_type const& e) const { e->is_fixed() ; }
};
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline Polyhedron_is_vertex_fixed_map<Gt, I, HDS, A>
get(vertex_is_fixed_t, const CGAL::Polyhedron_3<Gt,I,HDS,A>& p)
{
Polyhedron_is_vertex_fixed_map<Gt, I, HDS, A> m(p);
return m;
}
template <>
struct Polyhedron_property_map<vertex_is_fixed_t>
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_ {
typedef Polyhedron_is_vertex_fixed_map<Gt, I, HDS, A> type;
typedef Polyhedron_is_vertex_fixed_map<Gt, I, HDS, A> const_type;
};
};
} // namespace boost
#undef CGAL_HDS_PARAM_
#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_POLYHEDRON_IS_VERTEX_FIXED_MAP_H

View File

@ -0,0 +1,46 @@
// Copyright (c) 2006 Geometry Factory (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s): Fernando Cacciola <fernando.cacciola@gmail.com>
#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_STORED_IS_VERTEX_FIXED_MAP_H
#define CGAL_SURFACE_MESH_SIMPLIFICATION_STORED_IS_VERTEX_FIXED_MAP_H
namespace boost
{
template<class Graph_>
class Vertex_stored_is_fixed_map : public put_get_helper<bool, Vertex_stored_is_fixed_map<Graph_> >
{
private:
typedef Graph_ Graph ;
public:
typedef readable_property_map_tag category;
typedef bool value_type;
typedef bool reference;
typedef typename graph_traits<Graph const>::vertex_descriptor key_type;
reference operator[](key_type const& v) const { v->is_fixed() ; }
};
} // namespace boost
#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_STORED_IS_VERTEX_FIXED_MAP_H

View File

@ -48,9 +48,9 @@ void Surface_simplification_external_trace( std::string s )
int exit_code = 0 ;
#include <CGAL/Surface_mesh_simplification/Polyhedron.h>
#include <CGAL/Surface_mesh_simplification/Polyhedron_is_vertex_fixed_map.h>
#include <CGAL/Surface_mesh_simplification/Polyhedron_edge_cached_pointer_map.h>
#include <CGAL/Surface_mesh_simplification/Polyhedron_edge_index_map.h>
#include <CGAL/Surface_mesh_simplification/Vertex_is_fixed_map.h>
#include <CGAL/Surface_mesh_simplification/Edge_cached_pointer_map.h>
#include <CGAL/Surface_mesh_simplification/Edge_index_map.h>
#include <CGAL/Surface_mesh_simplification/Edge_collapse.h>
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk.h>
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Midpoint_and_length.h>
@ -556,6 +556,8 @@ bool Test ( int aStopA, int aStopR, bool aJustPrintSurfaceData, string aName, Me
Dummy_params lDummy_params;
LT_params lLT_params ;
Edge_index_map<Polyhedron> P_Edge_index_map ;
Visitor lVisitor(lRequestedEdgeCount) ;