mirror of https://github.com/CGAL/cgal
remove deprecated class
This commit is contained in:
parent
bf8f42b972
commit
50ae111378
|
|
@ -1,112 +0,0 @@
|
|||
// Copyright (c) 2014 GeometryFactory
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
// You can redistribute it and/or modify it under the terms of the GNU
|
||||
// General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
//
|
||||
// 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) : Yin Xu, Andreas Fabri and Ilker O. Yaz
|
||||
|
||||
#ifndef CGAL_DEFORM_MESH_H
|
||||
#define CGAL_DEFORM_MESH_H
|
||||
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
template <
|
||||
class HG,
|
||||
class VIM=Default,
|
||||
class HIM=Default,
|
||||
Deformation_algorithm_tag TAG = SPOKES_AND_RIMS,
|
||||
class WC = Default,
|
||||
class ST = Default,
|
||||
class CR = Default,
|
||||
class VPM = Default
|
||||
>
|
||||
class Surface_mesh_deformation;
|
||||
#endif
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
#define CGAL_DEPRECATED_HEADER "<CGAL/Deform_mesh.h>"
|
||||
#define CGAL_REPLACEMENT_HEADER "<CGAL/Surface_mesh_deformation.h>"
|
||||
#include <CGAL/internal/deprecation_warning.h>
|
||||
|
||||
#include <CGAL/Surface_mesh_deformation.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
///
|
||||
/// \ingroup PkgSurfaceModeling
|
||||
/// Class renamed to `Surface_mesh_deformation`.
|
||||
/// \deprecated This class name is deprecated and has been renamed to `Surface_mesh_deformation`.
|
||||
template <
|
||||
class HG,
|
||||
class VIM=Default,
|
||||
class HIM=Default,
|
||||
Deformation_algorithm_tag TAG = SPOKES_AND_RIMS,
|
||||
class WC = Default,
|
||||
class ST = Default,
|
||||
class CR = Default,
|
||||
class VPM = Default
|
||||
>
|
||||
class Deform_mesh : public Surface_mesh_deformation<HG, VIM, HIM, TAG, WC, ST, CR, VPM>
|
||||
{
|
||||
typedef Deform_mesh<HG, VIM, HIM, TAG, WC, ST, CR, VPM> Self;
|
||||
typedef Surface_mesh_deformation<HG, VIM, HIM, TAG, WC, ST, CR, VPM> Base;
|
||||
#ifndef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS
|
||||
public:
|
||||
Deform_mesh(const Self&) = delete; // no copy
|
||||
#else
|
||||
private:
|
||||
Deform_mesh(const Self&); // no copy
|
||||
#endif
|
||||
|
||||
public:
|
||||
typedef typename Base::Halfedge_graph Halfedge_graph;
|
||||
typedef typename Base::Vertex_index_map Vertex_index_map;
|
||||
typedef typename Base::Hedge_index_map Hedge_index_map;
|
||||
typedef typename Base::Weight_calculator Weight_calculator;
|
||||
typedef typename Base::Vertex_point_map Vertex_point_map;
|
||||
|
||||
//vertex_point_map set by default
|
||||
Deform_mesh(Halfedge_graph& halfedge_graph,
|
||||
Vertex_index_map vertex_index_map,
|
||||
Hedge_index_map hedge_index_map
|
||||
)
|
||||
: Base(halfedge_graph, vertex_index_map, hedge_index_map)
|
||||
{}
|
||||
|
||||
//vertex_point_map and hedge_index_map set by default
|
||||
Deform_mesh(Halfedge_graph& halfedge_graph,
|
||||
Vertex_index_map vertex_index_map)
|
||||
: Base(halfedge_graph, vertex_index_map)
|
||||
{}
|
||||
//vertex_point_map, hedge_index_map and vertex_index_map set by default
|
||||
Deform_mesh(Halfedge_graph& halfedge_graph)
|
||||
: Base(halfedge_graph)
|
||||
{}
|
||||
|
||||
// Constructor with all the parameters provided
|
||||
Deform_mesh(Halfedge_graph& halfedge_graph,
|
||||
Vertex_index_map vertex_index_map,
|
||||
Hedge_index_map hedge_index_map,
|
||||
Vertex_point_map vertex_point_map,
|
||||
Weight_calculator weight_calculator = Weight_calculator()
|
||||
)
|
||||
: Base(halfedge_graph, vertex_index_map, hedge_index_map, vertex_point_map, weight_calculator)
|
||||
{}
|
||||
};
|
||||
} //namespace CGAL
|
||||
|
||||
#endif //CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
#endif // CGAL_DEFORM_MESH_H
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
#define CGAL_NO_DEPRECATION_WARNINGS
|
||||
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
#include <CGAL/Polyhedron_items_with_id_3.h>
|
||||
#include <CGAL/IO/Polyhedron_iostream.h>
|
||||
// HalfedgeGraph adapters for Polyhedron_3
|
||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
|
||||
|
||||
#include <CGAL/Deform_mesh.h>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef CGAL::Polyhedron_3<Kernel, CGAL::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 CGAL::Deform_mesh<Polyhedron> Deform_mesh;
|
||||
|
||||
int main()
|
||||
{
|
||||
Polyhedron mesh;
|
||||
std::ifstream input("data/cactus.off");
|
||||
|
||||
if ( !input || !(input >> mesh) || mesh.empty() ) {
|
||||
std::cerr<< "Cannot open data/cactus.off" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Init the indices of the halfedges and the vertices.
|
||||
set_halfedgeds_items_id(mesh);
|
||||
|
||||
// Create a deformation object
|
||||
Deform_mesh deform_mesh(mesh);
|
||||
|
||||
// Definition of the region of interest (use the whole mesh)
|
||||
vertex_iterator vb,ve;
|
||||
boost::tie(vb, ve) = vertices(mesh);
|
||||
deform_mesh.insert_roi_vertices(vb, ve);
|
||||
|
||||
// Select two control vertices ...
|
||||
vertex_descriptor control_1 = *CGAL::cpp11::next(vb, 1);
|
||||
vertex_descriptor control_2 = *CGAL::cpp11::next(vb, 2);
|
||||
|
||||
// ... and insert them
|
||||
deform_mesh.insert_control_vertex(control_1);
|
||||
deform_mesh.insert_control_vertex(control_2);
|
||||
|
||||
// The definition of the ROI and the control vertices is done, call preprocess
|
||||
bool is_matrix_factorization_OK = deform_mesh.preprocess();
|
||||
if(!is_matrix_factorization_OK){
|
||||
std::cerr << "Error in preprocessing, check documentation of preprocess()" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Use set_target_position() to set the constained position
|
||||
// of control_1. control_2 remains at the last assigned positions
|
||||
Deform_mesh::Point constrained_pos_1(-0.35, 0.40, 0.60);
|
||||
deform_mesh.set_target_position(control_1, constrained_pos_1);
|
||||
|
||||
// Deform the mesh, the positions of vertices of 'mesh' are updated
|
||||
deform_mesh.deform();
|
||||
// The function deform() can be called several times if the convergence has not been reached yet
|
||||
deform_mesh.deform();
|
||||
|
||||
// Set the constained position of control_2
|
||||
Deform_mesh::Point constrained_pos_2(0.55, -0.30, 0.70);
|
||||
deform_mesh.set_target_position(control_2, constrained_pos_2);
|
||||
|
||||
// Call the function deform() with one-time parameters:
|
||||
// iterate 10 times and do not use energy based termination criterion
|
||||
deform_mesh.deform(10, 0.0);
|
||||
|
||||
|
||||
// Add another control vertex which requires another call to preprocess
|
||||
vertex_descriptor control_3 = *CGAL::cpp11::next(vb, 3);
|
||||
deform_mesh.insert_control_vertex(control_3);
|
||||
|
||||
// The prepocessing step is again needed
|
||||
if(!deform_mesh.preprocess()){
|
||||
std::cerr << "Error in preprocessing, check documentation of preprocess()" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Deform the mesh
|
||||
Deform_mesh::Point constrained_pos_3(0.55, 0.30, -0.70);
|
||||
deform_mesh.set_target_position(control_3, constrained_pos_3);
|
||||
|
||||
deform_mesh.deform(15, 0.0);
|
||||
}
|
||||
#else
|
||||
int main(){}
|
||||
#endif
|
||||
Loading…
Reference in New Issue