mirror of https://github.com/CGAL/cgal
Merge remote-tracking branch 'cgal/master' into Google-readability-casting-maxGimeno
This commit is contained in:
commit
af1a69e193
|
|
@ -3,7 +3,7 @@ sudo add-apt-repository ppa:mikhailnov/pulseeffects -y
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libmpfr-dev \
|
sudo apt-get install -y libmpfr-dev \
|
||||||
libeigen3-dev qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev \
|
libeigen3-dev qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev \
|
||||||
libqt5svg5-dev qttools5-dev qttools5-dev-tools libboost1.72-dev zsh
|
libqt5svg5-dev qttools5-dev qttools5-dev-tools libboost-dev libinsighttoolkit4-dev zsh
|
||||||
#update cmake to 3.18.4
|
#update cmake to 3.18.4
|
||||||
sudo apt purge --auto-remove cmake
|
sudo apt purge --auto-remove cmake
|
||||||
cd /tmp
|
cd /tmp
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,15 @@ jobs:
|
||||||
if(asso == 'OWNER' || asso == 'MEMBER') {
|
if(asso == 'OWNER' || asso == 'MEMBER') {
|
||||||
const body = context.payload.comment.body
|
const body = context.payload.comment.body
|
||||||
if(body.includes("build:")) {
|
if(body.includes("build:")) {
|
||||||
const re = /\/build:(\w+)\s*/;
|
const re = /\/(force-)?build:(\w+)\s*/;
|
||||||
if(re.test(body)){
|
if(re.test(body)){
|
||||||
const res = re.exec(body)
|
const res = re.exec(body)
|
||||||
return res[1];
|
if(body.includes("force-")) {
|
||||||
|
return res[2]+":yes"
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return res[2]+":no"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -70,19 +75,22 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
set -ex
|
set -ex
|
||||||
PR_NUMBER=${{ steps.get_pr_number.outputs.result }}
|
PR_NUMBER=${{ steps.get_pr_number.outputs.result }}
|
||||||
ROUND=${{ steps.get_round.outputs.result }}
|
TMP_ROUND=${{ steps.get_round.outputs.result }}
|
||||||
|
ROUND=$(echo $TMP_ROUND | cut -d ":" -f 1)
|
||||||
|
force=$(echo $TMP_ROUND | cut -d ":" -f 2)
|
||||||
wget --no-verbose cgal.github.io -O tmp.html
|
wget --no-verbose cgal.github.io -O tmp.html
|
||||||
if ! egrep -q "\/$PR_NUMBER\/$ROUND" tmp.html; then
|
if ! egrep -q "\/$PR_NUMBER\/$ROUND" tmp.html || [ "$force" = "yes" ]; then
|
||||||
#list impacted packages
|
#list impacted packages
|
||||||
LIST_OF_PKGS=$(git diff --name-only HEAD^1 HEAD |cut -s -d/ -f1 |sort -u | xargs -I {} echo {} && ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true)
|
LIST_OF_PKGS=$(git diff --name-only HEAD^1 HEAD |cut -s -d/ -f1 |sort -u | xargs -I {} echo {} && ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true)
|
||||||
if [ "$LIST_OF_PKGS" = "" ]; then
|
if [ "$LIST_OF_PKGS" = "" ]; then
|
||||||
|
echo "::set-output name=DoxygenError::No package affected."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
cd build_doc && make -j2 doc
|
cd build_doc && make -j2 doc
|
||||||
make -j2 doc_with_postprocessing 2>tmp.log
|
make -j2 doc_with_postprocessing 2>tmp.log
|
||||||
if [ -s tmp.log ]; then
|
if [ -s tmp.log ]; then
|
||||||
content=`cat ./tmp.log`
|
content=`cat ./tmp.log`
|
||||||
echo ::set-output name=DoxygenError::$(cat tmp.log)
|
echo "::set-output name=DoxygenError::$(cat tmp.log)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
cd ..
|
cd ..
|
||||||
|
|
@ -101,6 +109,7 @@ jobs:
|
||||||
mv tmp.html index.html
|
mv tmp.html index.html
|
||||||
git add ${PR_NUMBER}/$ROUND index.html && git commit -q --amend -m "base commit" && git push -q -f -u origin master
|
git add ${PR_NUMBER}/$ROUND index.html && git commit -q --amend -m "base commit" && git push -q -f -u origin master
|
||||||
else
|
else
|
||||||
|
echo "::set-output name=DoxygenError::This round already exists. Overwrite it with /force-build"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -109,7 +118,10 @@ jobs:
|
||||||
if: ${{ success() && steps.get_round.outputs.result != 'stop' }}
|
if: ${{ success() && steps.get_round.outputs.result != 'stop' }}
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const address = "The documentation is built. It will be available, after a few minutes, here : https://cgal.github.io/${{ steps.get_pr_number.outputs.result }}/${{ steps.get_round.outputs.result }}/Manual/index.html"
|
const tmp_round = "${{ steps.get_round.outputs.result }}";
|
||||||
|
const id = tmp_round.indexOf(":");
|
||||||
|
const round = tmp_round.substring(0,id);
|
||||||
|
const address = "The documentation is built. It will be available, after a few minutes, here : https://cgal.github.io/${{ steps.get_pr_number.outputs.result }}/"+round+"/Manual/index.html"
|
||||||
github.issues.createComment({
|
github.issues.createComment({
|
||||||
owner: "CGAL",
|
owner: "CGAL",
|
||||||
repo: "cgal",
|
repo: "cgal",
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ jobs:
|
||||||
if [ -d ${PR_NUMBER} ]; then
|
if [ -d ${PR_NUMBER} ]; then
|
||||||
git rm -r ${PR_NUMBER}
|
git rm -r ${PR_NUMBER}
|
||||||
fi
|
fi
|
||||||
#git diff exits with 1 if there is a diff
|
#git diff exits with 1 if there is no diff
|
||||||
if ! git diff --quiet; then
|
if git diff --quiet; then
|
||||||
git commit -a --amend -m"base commit" && git push -f -u origin master
|
git commit -a --amend -m"base commit" && git push -f -u origin master
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
name: Filter Testsuite
|
||||||
|
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
if: (github.event.comment.user.login == 'sloriot' || github.event.comment.user.login == 'lrineau') && contains(github.event.comment.body, '/testme')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/github-script@v3
|
||||||
|
id: get_label
|
||||||
|
with:
|
||||||
|
result-encoding: string
|
||||||
|
script: |
|
||||||
|
//get branch name and username
|
||||||
|
const pr_url = context.payload.issue.pull_request.url
|
||||||
|
const pr_content = await github.request(pr_url)
|
||||||
|
const label = pr_content.data.head.label
|
||||||
|
const base = pr_content.data.base.ref
|
||||||
|
console.log(label)
|
||||||
|
return label+":"+base
|
||||||
|
- name: Run Testsuite
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
#ssh key
|
||||||
|
(
|
||||||
|
cat <<EOF
|
||||||
|
${{ secrets.ssh_key }}
|
||||||
|
EOF
|
||||||
|
)>> ~/.ssh/id_rsa
|
||||||
|
chmod 600 /home/runner/.ssh/id_rsa
|
||||||
|
#ssh public key
|
||||||
|
(
|
||||||
|
cat <<EOF
|
||||||
|
${{ secrets.ssh_key_pub }}
|
||||||
|
EOF
|
||||||
|
)>> ~/.ssh/id_rsa.pub
|
||||||
|
chmod 644 /home/runner/.ssh/id_rsa.pub
|
||||||
|
#known hosts
|
||||||
|
wget --no-check-certificate https://cgal.geometryfactory.com/CGAL/ssh_known_hosts -O ~/.ssh/known_hosts
|
||||||
|
#config file
|
||||||
|
wget --no-check-certificate https://cgal.geometryfactory.com/CGAL/ssh_config -O ~/.ssh/config
|
||||||
|
#list of hosts
|
||||||
|
wget --no-check-certificate https://cgal.geometryfactory.com/CGAL/ssh_host_list -O ~/ssh_host_list
|
||||||
|
#ssh command
|
||||||
|
LABEL="${{ steps.get_label.outputs.result }}"
|
||||||
|
USER_NAME=$(echo $LABEL | cut -d':' -f 1)
|
||||||
|
BRANCH_NAME=$(echo $LABEL | cut -d':' -f 2)
|
||||||
|
BASE=$(echo $LABEL | cut -d':' -f 3)
|
||||||
|
PR_NUMBER=${{ github.event.issue.number }}
|
||||||
|
mapfile -t HOSTS < ~/ssh_host_list;
|
||||||
|
for i in ${!HOSTS[@]}; do
|
||||||
|
HOST=$(echo ${HOSTS[$i]}|cut -d' ' -f 1 )
|
||||||
|
PATH_TO_SCRIPT=$(echo ${HOSTS[$i]}|cut -d' ' -f 2 )
|
||||||
|
echo "ssh ${HOST} ${PATH_TO_SCRIPT}/run_testsuite_from_branch_name.sh $USER_NAME $BRANCH_NAME $BASE $PR_NUMBER"
|
||||||
|
ssh ${HOST} "${PATH_TO_SCRIPT}/run_testsuite_from_branch_name.sh $USER_NAME $BRANCH_NAME $BASE $PR_NUMBER"
|
||||||
|
done
|
||||||
|
- name: Post address
|
||||||
|
uses: actions/github-script@v3
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const address = "The testsuite is lauched. results will be found, after it is done, here : https://cgal.geometryfactory.com/~mgimeno/test_suite/TESTRESULTS/index.shtml "
|
||||||
|
github.issues.createComment({
|
||||||
|
owner: "CGAL",
|
||||||
|
repo: "cgal",
|
||||||
|
issue_number: ${{ github.event.issue.number }},
|
||||||
|
body: address
|
||||||
|
});
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#define CGAL_DEPRECATED_HEADER "<CGAL/AABB_polyhedron_segment_primitive.h>"
|
#define CGAL_DEPRECATED_HEADER "<CGAL/AABB_polyhedron_segment_primitive.h>"
|
||||||
#define CGAL_REPLACEMENT_HEADER "<CGAL/AABB_halfedge_graph_segment_primitive.h>"
|
#define CGAL_REPLACEMENT_HEADER "<CGAL/AABB_halfedge_graph_segment_primitive.h>"
|
||||||
#include <CGAL/internal/deprecation_warning.h>
|
#include <CGAL/Installation/internal/deprecation_warning.h>
|
||||||
|
|
||||||
#include <boost/utility/enable_if.hpp>
|
#include <boost/utility/enable_if.hpp>
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
#define CGAL_DEPRECATED_HEADER "<CGAL/AABB_polyhedron_triangle_primitive.h>"
|
#define CGAL_DEPRECATED_HEADER "<CGAL/AABB_polyhedron_triangle_primitive.h>"
|
||||||
#define CGAL_REPLACEMENT_HEADER "<CGAL/AABB_face_graph_triangle_primitive.h>"
|
#define CGAL_REPLACEMENT_HEADER "<CGAL/AABB_face_graph_triangle_primitive.h>"
|
||||||
#include <CGAL/internal/deprecation_warning.h>
|
#include <CGAL/Installation/internal/deprecation_warning.h>
|
||||||
|
|
||||||
#include <boost/utility/enable_if.hpp>
|
#include <boost/utility/enable_if.hpp>
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#include <CGAL/disable_warnings.h>
|
#include <CGAL/disable_warnings.h>
|
||||||
|
|
||||||
#include <CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h>
|
#include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h>
|
||||||
#include <CGAL/property_map.h>
|
#include <CGAL/property_map.h>
|
||||||
#include <CGAL/tags.h>
|
#include <CGAL/tags.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,10 @@
|
||||||
#include <CGAL/Bbox_3.h>
|
#include <CGAL/Bbox_3.h>
|
||||||
#include <CGAL/Default.h>
|
#include <CGAL/Default.h>
|
||||||
#include <CGAL/intersections.h>
|
#include <CGAL/intersections.h>
|
||||||
#include <CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h>
|
#include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h>
|
||||||
#include <CGAL/internal/AABB_tree/Is_ray_intersection_geomtraits.h>
|
#include <CGAL/AABB_tree/internal/Is_ray_intersection_geomtraits.h>
|
||||||
#include <CGAL/internal/AABB_tree/Primitive_helper.h>
|
#include <CGAL/AABB_tree/internal/Primitive_helper.h>
|
||||||
#include <CGAL/internal/Has_boolean_tags.h>
|
#include <CGAL/Kernel_23/internal/Has_boolean_tags.h>
|
||||||
|
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,11 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <CGAL/internal/AABB_tree/AABB_traversal_traits.h>
|
#include <CGAL/AABB_tree/internal/AABB_traversal_traits.h>
|
||||||
#include <CGAL/internal/AABB_tree/AABB_node.h>
|
#include <CGAL/AABB_tree/internal/AABB_node.h>
|
||||||
#include <CGAL/internal/AABB_tree/AABB_search_tree.h>
|
#include <CGAL/AABB_tree/internal/AABB_search_tree.h>
|
||||||
#include <CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h>
|
#include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h>
|
||||||
#include <CGAL/internal/AABB_tree/Primitive_helper.h>
|
#include <CGAL/AABB_tree/internal/Primitive_helper.h>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <boost/lambda/lambda.hpp>
|
#include <boost/lambda/lambda.hpp>
|
||||||
|
|
||||||
|
|
@ -527,6 +527,36 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class Query, class Traversal_traits>
|
||||||
|
void traversal_with_priority(const Query& query, Traversal_traits& traits) const
|
||||||
|
{
|
||||||
|
switch(size())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
traits.intersection(query, singleton_data());
|
||||||
|
break;
|
||||||
|
default: // if(size() >= 2)
|
||||||
|
root_node()->template traversal_with_priority<Traversal_traits,Query>(query, traits, m_primitives.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Query, class Traversal_traits>
|
||||||
|
void traversal_with_priority_and_group_traversal(const Query& query, Traversal_traits& traits, const std::size_t group_traversal_bound) const
|
||||||
|
{
|
||||||
|
switch(size())
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
traits.intersection(query, singleton_data());
|
||||||
|
break;
|
||||||
|
default: // if(size() >= 2)
|
||||||
|
root_node()->template traversal_with_priority_and_group_traversal(m_primitives, query, traits, m_primitives.size(), 0, group_traversal_bound);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef AABB_node<AABBTraits> Node;
|
typedef AABB_node<AABBTraits> Node;
|
||||||
|
|
||||||
|
|
@ -1028,7 +1058,7 @@ public:
|
||||||
|
|
||||||
} // end namespace CGAL
|
} // end namespace CGAL
|
||||||
|
|
||||||
#include <CGAL/internal/AABB_tree/AABB_ray_intersection.h>
|
#include <CGAL/AABB_tree/internal/AABB_ray_intersection.h>
|
||||||
|
|
||||||
#include <CGAL/enable_warnings.h>
|
#include <CGAL/enable_warnings.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,321 @@
|
||||||
|
// Copyright (c) 2008 INRIA Sophia-Antipolis (France).
|
||||||
|
// All rights reserved.
|
||||||
|
//
|
||||||
|
// This file is part of CGAL (www.cgal.org).
|
||||||
|
//
|
||||||
|
// $URL$
|
||||||
|
// $Id$
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Author(s) : Camille Wormser, Pierre Alliez, Stephane Tayeb
|
||||||
|
|
||||||
|
#ifndef CGAL_AABB_NODE_H
|
||||||
|
#define CGAL_AABB_NODE_H
|
||||||
|
|
||||||
|
#include <CGAL/license/AABB_tree.h>
|
||||||
|
|
||||||
|
|
||||||
|
#include <CGAL/Profile_counter.h>
|
||||||
|
#include <CGAL/Cartesian_converter.h>
|
||||||
|
#include <CGAL/intersections.h>
|
||||||
|
#include <CGAL/Bbox_3.h>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace CGAL {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @class AABB_node
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
template<typename AABBTraits>
|
||||||
|
class AABB_node
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
typedef AABB_node<AABBTraits> Self;
|
||||||
|
|
||||||
|
public:
|
||||||
|
typedef typename AABBTraits::Bounding_box Bounding_box;
|
||||||
|
|
||||||
|
/// Constructor
|
||||||
|
AABB_node()
|
||||||
|
: m_bbox()
|
||||||
|
, m_p_left_child(nullptr)
|
||||||
|
, m_p_right_child(nullptr) { };
|
||||||
|
|
||||||
|
AABB_node(Self&& node) = default;
|
||||||
|
|
||||||
|
// Disabled copy constructor & assignment operator
|
||||||
|
AABB_node(const Self& src) = delete;
|
||||||
|
Self& operator=(const Self& src) = delete;
|
||||||
|
|
||||||
|
/// Returns the bounding box of the node
|
||||||
|
const Bounding_box& bbox() const { return m_bbox; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief General traversal query
|
||||||
|
* @param query the query
|
||||||
|
* @param traits the traversal traits that define the traversal behaviour
|
||||||
|
* @param nb_primitives the number of primitive
|
||||||
|
*
|
||||||
|
* General traversal query. The traits class allows using it for the various
|
||||||
|
* traversal methods we need: listing, counting, detecting intersections,
|
||||||
|
* drawing the boxes.
|
||||||
|
*/
|
||||||
|
template<class Traversal_traits, class Query>
|
||||||
|
void traversal(const Query& query,
|
||||||
|
Traversal_traits& traits,
|
||||||
|
const std::size_t nb_primitives) const;
|
||||||
|
|
||||||
|
template<class Traversal_traits, class Query>
|
||||||
|
void traversal_with_priority(const Query& query,
|
||||||
|
Traversal_traits& traits,
|
||||||
|
const std::size_t nb_primitives) const;
|
||||||
|
|
||||||
|
template<class Primitive_vector, class Traversal_traits, class Query>
|
||||||
|
void traversal_with_priority_and_group_traversal(const Primitive_vector& primitives,
|
||||||
|
const Query& query,
|
||||||
|
Traversal_traits& traits,
|
||||||
|
const std::size_t nb_primitives,
|
||||||
|
std::size_t first_primitive_index,
|
||||||
|
const std::size_t group_size_bound) const;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
typedef AABBTraits AABB_traits;
|
||||||
|
typedef AABB_node<AABB_traits> Node;
|
||||||
|
typedef typename AABB_traits::Primitive Primitive;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
/// Helper functions
|
||||||
|
const Node& left_child() const
|
||||||
|
{ return *static_cast<Node*>(m_p_left_child); }
|
||||||
|
const Node& right_child() const
|
||||||
|
{ return *static_cast<Node*>(m_p_right_child); }
|
||||||
|
const Primitive& left_data() const
|
||||||
|
{ return *static_cast<Primitive*>(m_p_left_child); }
|
||||||
|
const Primitive& right_data() const
|
||||||
|
{ return *static_cast<Primitive*>(m_p_right_child); }
|
||||||
|
template <class Left, class Right>
|
||||||
|
void set_children(Left& l, Right& r)
|
||||||
|
{
|
||||||
|
m_p_left_child = static_cast<void*>(std::addressof(l));
|
||||||
|
m_p_right_child = static_cast<void*>(std::addressof(r));
|
||||||
|
}
|
||||||
|
void set_bbox(const Bounding_box& bbox)
|
||||||
|
{
|
||||||
|
m_bbox = bbox;
|
||||||
|
}
|
||||||
|
|
||||||
|
Node& left_child() { return *static_cast<Node*>(m_p_left_child); }
|
||||||
|
Node& right_child() { return *static_cast<Node*>(m_p_right_child); }
|
||||||
|
Primitive& left_data() { return *static_cast<Primitive*>(m_p_left_child); }
|
||||||
|
Primitive& right_data() { return *static_cast<Primitive*>(m_p_right_child); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// node bounding box
|
||||||
|
Bounding_box m_bbox;
|
||||||
|
|
||||||
|
/// children nodes, either pointing towards children (if children are not leaves),
|
||||||
|
/// or pointing toward input primitives (if children are leaves).
|
||||||
|
void *m_p_left_child;
|
||||||
|
void *m_p_right_child;
|
||||||
|
|
||||||
|
}; // end class AABB_node
|
||||||
|
|
||||||
|
|
||||||
|
template<typename Tr>
|
||||||
|
template<class Traversal_traits, class Query>
|
||||||
|
void
|
||||||
|
AABB_node<Tr>::traversal(const Query& query,
|
||||||
|
Traversal_traits& traits,
|
||||||
|
const std::size_t nb_primitives) const
|
||||||
|
{
|
||||||
|
// Recursive traversal
|
||||||
|
switch(nb_primitives)
|
||||||
|
{
|
||||||
|
case 2:
|
||||||
|
traits.intersection(query, left_data());
|
||||||
|
if( traits.go_further() )
|
||||||
|
{
|
||||||
|
traits.intersection(query, right_data());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
traits.intersection(query, left_data());
|
||||||
|
if( traits.go_further() && traits.do_intersect(query, right_child()) )
|
||||||
|
{
|
||||||
|
right_child().traversal(query, traits, 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if( traits.do_intersect(query, left_child()) )
|
||||||
|
{
|
||||||
|
left_child().traversal(query, traits, nb_primitives/2);
|
||||||
|
if( traits.go_further() && traits.do_intersect(query, right_child()) )
|
||||||
|
{
|
||||||
|
right_child().traversal(query, traits, nb_primitives-nb_primitives/2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if( traits.do_intersect(query, right_child()) )
|
||||||
|
{
|
||||||
|
right_child().traversal(query, traits, nb_primitives-nb_primitives/2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename Tr>
|
||||||
|
template<class Traversal_traits, class Query>
|
||||||
|
void
|
||||||
|
AABB_node<Tr>::traversal_with_priority(const Query& query,
|
||||||
|
Traversal_traits& traits,
|
||||||
|
const std::size_t nb_primitives) const
|
||||||
|
{
|
||||||
|
// Recursive traversal
|
||||||
|
switch(nb_primitives)
|
||||||
|
{
|
||||||
|
case 2:
|
||||||
|
traits.intersection(query, left_data());
|
||||||
|
if( traits.go_further() )
|
||||||
|
{
|
||||||
|
traits.intersection(query, right_data());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
traits.intersection(query, left_data());
|
||||||
|
if( traits.go_further() && traits.do_intersect(query, right_child()) )
|
||||||
|
{
|
||||||
|
right_child().traversal_with_priority(query, traits, 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
bool ileft, iright;
|
||||||
|
typename Traversal_traits::Priority pleft, pright;
|
||||||
|
std::tie(ileft, pleft) = traits.do_intersect_with_priority(query, left_child());
|
||||||
|
std::tie(iright, pright) = traits.do_intersect_with_priority(query, right_child());
|
||||||
|
CGAL_precondition( (ileft || iright) ? traits.do_intersect(query, *this) : true );
|
||||||
|
|
||||||
|
if(ileft)
|
||||||
|
{
|
||||||
|
if(iright)
|
||||||
|
{
|
||||||
|
// Both children have to be inspected.
|
||||||
|
if(pleft >= pright)
|
||||||
|
{
|
||||||
|
// Inspect the left child first, has higher priority.
|
||||||
|
left_child().traversal_with_priority(query, traits, nb_primitives/2);
|
||||||
|
if( traits.go_further() )
|
||||||
|
right_child().traversal_with_priority(query, traits, nb_primitives-nb_primitives/2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Inspect the right child first, has higher priority.
|
||||||
|
right_child().traversal_with_priority(query, traits, nb_primitives-nb_primitives/2);
|
||||||
|
if( traits.go_further() )
|
||||||
|
left_child().traversal_with_priority(query, traits, nb_primitives/2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Only the left child has to be inspected.
|
||||||
|
left_child().traversal_with_priority(query, traits, nb_primitives/2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(iright)
|
||||||
|
{
|
||||||
|
// Only the right child has to be inspected.
|
||||||
|
right_child().traversal_with_priority(query, traits, nb_primitives-nb_primitives/2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: find a better name
|
||||||
|
template<typename Tr>
|
||||||
|
template<class Primitive_vector, class Traversal_traits, class Query>
|
||||||
|
void
|
||||||
|
AABB_node<Tr>::traversal_with_priority_and_group_traversal(const Primitive_vector& primitives,
|
||||||
|
const Query& query,
|
||||||
|
Traversal_traits& traits,
|
||||||
|
const std::size_t nb_primitives,
|
||||||
|
std::size_t first_primitive_index,
|
||||||
|
const std::size_t group_traversal_bound) const
|
||||||
|
{
|
||||||
|
// Group traversal
|
||||||
|
CGAL_assertion(group_traversal_bound >= 2);
|
||||||
|
if ( nb_primitives <= group_traversal_bound )
|
||||||
|
{
|
||||||
|
if ( !traits.do_intersect(query, *this) ) return;
|
||||||
|
CGAL_assertion(traits.do_intersect(query, *this));
|
||||||
|
traits.traverse_group(query, primitives.begin()+first_primitive_index, primitives.begin()+first_primitive_index+nb_primitives);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Recursive traversal
|
||||||
|
switch(nb_primitives)
|
||||||
|
{
|
||||||
|
case 2:
|
||||||
|
traits.intersection(query, left_data());
|
||||||
|
if( traits.go_further() )
|
||||||
|
{
|
||||||
|
traits.intersection(query, right_data());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
traits.intersection(query, left_data());
|
||||||
|
if( traits.go_further() && traits.do_intersect(query, right_child()) )
|
||||||
|
{
|
||||||
|
right_child().traversal_with_priority_and_group_traversal(primitives, query, traits, 2, first_primitive_index+1, group_traversal_bound);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
bool ileft, iright;
|
||||||
|
typename Traversal_traits::Priority pleft, pright;
|
||||||
|
std::tie(ileft, pleft) = traits.do_intersect_with_priority(query, left_child());
|
||||||
|
std::tie(iright, pright) = traits.do_intersect_with_priority(query, right_child());
|
||||||
|
CGAL_precondition( (ileft || iright) ? traits.do_intersect(query, *this) : true );
|
||||||
|
|
||||||
|
if(ileft)
|
||||||
|
{
|
||||||
|
if(iright)
|
||||||
|
{
|
||||||
|
// Both children have to be inspected.
|
||||||
|
if(pleft >= pright)
|
||||||
|
{
|
||||||
|
// Inspect the left child first, has higher priority.
|
||||||
|
left_child().traversal_with_priority_and_group_traversal(primitives, query, traits, nb_primitives/2, first_primitive_index, group_traversal_bound);
|
||||||
|
if( traits.go_further() )
|
||||||
|
right_child().traversal_with_priority_and_group_traversal(primitives, query, traits, nb_primitives-nb_primitives/2, first_primitive_index+nb_primitives/2, group_traversal_bound);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Inspect the right child first, has higher priority.
|
||||||
|
right_child().traversal_with_priority_and_group_traversal(primitives, query, traits, nb_primitives-nb_primitives/2, first_primitive_index+nb_primitives/2, group_traversal_bound);
|
||||||
|
if( traits.go_further() )
|
||||||
|
left_child().traversal_with_priority_and_group_traversal(primitives, query, traits, nb_primitives/2, first_primitive_index, group_traversal_bound);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Only the left child has to be inspected.
|
||||||
|
left_child().traversal_with_priority_and_group_traversal(primitives, query, traits, nb_primitives/2, first_primitive_index, group_traversal_bound);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(iright)
|
||||||
|
{
|
||||||
|
// Only the right child has to be inspected.
|
||||||
|
right_child().traversal_with_priority_and_group_traversal(primitives, query, traits, nb_primitives-nb_primitives/2, first_primitive_index+nb_primitives/2, group_traversal_bound);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // end namespace CGAL
|
||||||
|
|
||||||
|
#endif // CGAL_AABB_NODE_H
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
#include <boost/variant/apply_visitor.hpp>
|
#include <boost/variant/apply_visitor.hpp>
|
||||||
#if BOOST_VERSION >= 105000
|
|
||||||
# if defined(BOOST_MSVC)
|
# if defined(BOOST_MSVC)
|
||||||
# pragma warning(push)
|
# pragma warning(push)
|
||||||
# pragma warning(disable: 4996)
|
# pragma warning(disable: 4996)
|
||||||
|
|
@ -30,9 +29,6 @@
|
||||||
# if defined(BOOST_MSVC)
|
# if defined(BOOST_MSVC)
|
||||||
# pragma warning(pop)
|
# pragma warning(pop)
|
||||||
# endif
|
# endif
|
||||||
#else
|
|
||||||
# include <queue>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <CGAL/assertions.h>
|
#include <CGAL/assertions.h>
|
||||||
|
|
||||||
|
|
@ -54,11 +50,7 @@ public:
|
||||||
// BVH_node::traversal this is done through the function parameter
|
// BVH_node::traversal this is done through the function parameter
|
||||||
// nb_primitives in the recursion.
|
// nb_primitives in the recursion.
|
||||||
typedef
|
typedef
|
||||||
#if BOOST_VERSION >= 105000
|
|
||||||
boost::heap::priority_queue< Node_ptr_with_ft, boost::heap::compare< std::greater<Node_ptr_with_ft> > >
|
boost::heap::priority_queue< Node_ptr_with_ft, boost::heap::compare< std::greater<Node_ptr_with_ft> > >
|
||||||
#else
|
|
||||||
std::priority_queue< Node_ptr_with_ft>
|
|
||||||
#endif
|
|
||||||
Heap_type;
|
Heap_type;
|
||||||
|
|
||||||
typename AABB_traits::Intersection
|
typename AABB_traits::Intersection
|
||||||
|
|
@ -167,14 +159,8 @@ private:
|
||||||
const Node* node;
|
const Node* node;
|
||||||
size_type nb_primitives;
|
size_type nb_primitives;
|
||||||
FT value;
|
FT value;
|
||||||
#if BOOST_VERSION >= 105000
|
|
||||||
bool operator<(const Node_ptr_with_ft& other) const { return value < other.value; }
|
bool operator<(const Node_ptr_with_ft& other) const { return value < other.value; }
|
||||||
bool operator>(const Node_ptr_with_ft& other) const { return value > other.value; }
|
bool operator>(const Node_ptr_with_ft& other) const { return value > other.value; }
|
||||||
#else
|
|
||||||
bool operator>(const Node_ptr_with_ft& other) const { return value < other.value; }
|
|
||||||
bool operator<(const Node_ptr_with_ft& other) const { return value > other.value; }
|
|
||||||
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct as_ray_param_visitor {
|
struct as_ray_param_visitor {
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
#include <CGAL/license/AABB_tree.h>
|
#include <CGAL/license/AABB_tree.h>
|
||||||
|
|
||||||
|
|
||||||
#include <CGAL/internal/AABB_tree/AABB_node.h>
|
#include <CGAL/AABB_tree/internal/AABB_node.h>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
#include <CGAL/license/AABB_tree.h>
|
#include <CGAL/license/AABB_tree.h>
|
||||||
|
|
||||||
|
|
||||||
#include <CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h>
|
#include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h>
|
||||||
#include <boost/mpl/has_xxx.hpp>
|
#include <boost/mpl/has_xxx.hpp>
|
||||||
|
|
||||||
namespace CGAL{
|
namespace CGAL{
|
||||||
|
|
@ -1,157 +0,0 @@
|
||||||
// Copyright (c) 2008 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org).
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Camille Wormser, Pierre Alliez, Stephane Tayeb
|
|
||||||
|
|
||||||
#ifndef CGAL_AABB_NODE_H
|
|
||||||
#define CGAL_AABB_NODE_H
|
|
||||||
|
|
||||||
#include <CGAL/license/AABB_tree.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include <CGAL/Profile_counter.h>
|
|
||||||
#include <CGAL/Cartesian_converter.h>
|
|
||||||
#include <CGAL/intersections.h>
|
|
||||||
#include <CGAL/Bbox_3.h>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class AABB_node
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
template<typename AABBTraits>
|
|
||||||
class AABB_node
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
typedef AABB_node<AABBTraits> Self;
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef typename AABBTraits::Bounding_box Bounding_box;
|
|
||||||
|
|
||||||
/// Constructor
|
|
||||||
AABB_node()
|
|
||||||
: m_bbox()
|
|
||||||
, m_p_left_child(nullptr)
|
|
||||||
, m_p_right_child(nullptr) { };
|
|
||||||
|
|
||||||
AABB_node(Self&& node) = default;
|
|
||||||
|
|
||||||
// Disabled copy constructor & assignment operator
|
|
||||||
AABB_node(const Self& src) = delete;
|
|
||||||
Self& operator=(const Self& src) = delete;
|
|
||||||
|
|
||||||
/// Returns the bounding box of the node
|
|
||||||
const Bounding_box& bbox() const { return m_bbox; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief General traversal query
|
|
||||||
* @param query the query
|
|
||||||
* @param traits the traversal traits that define the traversal behaviour
|
|
||||||
* @param nb_primitives the number of primitive
|
|
||||||
*
|
|
||||||
* General traversal query. The traits class allows using it for the various
|
|
||||||
* traversal methods we need: listing, counting, detecting intersections,
|
|
||||||
* drawing the boxes.
|
|
||||||
*/
|
|
||||||
template<class Traversal_traits, class Query>
|
|
||||||
void traversal(const Query& query,
|
|
||||||
Traversal_traits& traits,
|
|
||||||
const std::size_t nb_primitives) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
typedef AABBTraits AABB_traits;
|
|
||||||
typedef AABB_node<AABB_traits> Node;
|
|
||||||
typedef typename AABB_traits::Primitive Primitive;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
/// Helper functions
|
|
||||||
const Node& left_child() const
|
|
||||||
{ return *static_cast<Node*>(m_p_left_child); }
|
|
||||||
const Node& right_child() const
|
|
||||||
{ return *static_cast<Node*>(m_p_right_child); }
|
|
||||||
const Primitive& left_data() const
|
|
||||||
{ return *static_cast<Primitive*>(m_p_left_child); }
|
|
||||||
const Primitive& right_data() const
|
|
||||||
{ return *static_cast<Primitive*>(m_p_right_child); }
|
|
||||||
template <class Left, class Right>
|
|
||||||
void set_children(Left& l, Right& r)
|
|
||||||
{
|
|
||||||
m_p_left_child = static_cast<void*>(std::addressof(l));
|
|
||||||
m_p_right_child = static_cast<void*>(std::addressof(r));
|
|
||||||
}
|
|
||||||
void set_bbox(const Bounding_box& bbox)
|
|
||||||
{
|
|
||||||
m_bbox = bbox;
|
|
||||||
}
|
|
||||||
|
|
||||||
Node& left_child() { return *static_cast<Node*>(m_p_left_child); }
|
|
||||||
Node& right_child() { return *static_cast<Node*>(m_p_right_child); }
|
|
||||||
Primitive& left_data() { return *static_cast<Primitive*>(m_p_left_child); }
|
|
||||||
Primitive& right_data() { return *static_cast<Primitive*>(m_p_right_child); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
/// node bounding box
|
|
||||||
Bounding_box m_bbox;
|
|
||||||
|
|
||||||
/// children nodes, either pointing towards children (if children are not leaves),
|
|
||||||
/// or pointing toward input primitives (if children are leaves).
|
|
||||||
void *m_p_left_child;
|
|
||||||
void *m_p_right_child;
|
|
||||||
|
|
||||||
}; // end class AABB_node
|
|
||||||
|
|
||||||
|
|
||||||
template<typename Tr>
|
|
||||||
template<class Traversal_traits, class Query>
|
|
||||||
void
|
|
||||||
AABB_node<Tr>::traversal(const Query& query,
|
|
||||||
Traversal_traits& traits,
|
|
||||||
const std::size_t nb_primitives) const
|
|
||||||
{
|
|
||||||
// Recursive traversal
|
|
||||||
switch(nb_primitives)
|
|
||||||
{
|
|
||||||
case 2:
|
|
||||||
traits.intersection(query, left_data());
|
|
||||||
if( traits.go_further() )
|
|
||||||
{
|
|
||||||
traits.intersection(query, right_data());
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
traits.intersection(query, left_data());
|
|
||||||
if( traits.go_further() && traits.do_intersect(query, right_child()) )
|
|
||||||
{
|
|
||||||
right_child().traversal(query, traits, 2);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if( traits.do_intersect(query, left_child()) )
|
|
||||||
{
|
|
||||||
left_child().traversal(query, traits, nb_primitives/2);
|
|
||||||
if( traits.go_further() && traits.do_intersect(query, right_child()) )
|
|
||||||
{
|
|
||||||
right_child().traversal(query, traits, nb_primitives-nb_primitives/2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if( traits.do_intersect(query, right_child()) )
|
|
||||||
{
|
|
||||||
right_child().traversal(query, traits, nb_primitives-nb_primitives/2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // end namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_AABB_NODE_H
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include <CGAL/disable_warnings.h>
|
#include <CGAL/disable_warnings.h>
|
||||||
|
|
||||||
#include <CGAL/internal/AABB_tree/Primitive_helper.h>
|
#include <CGAL/AABB_tree/internal/Primitive_helper.h>
|
||||||
#include <CGAL/use.h>
|
#include <CGAL/use.h>
|
||||||
|
|
||||||
#include <boost/mem_fn.hpp>
|
#include <boost/mem_fn.hpp>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#include <CGAL/assertions.h>
|
#include <CGAL/assertions.h>
|
||||||
#include <CGAL/internal/AABB_tree/Is_ray_intersection_geomtraits.h>
|
#include <CGAL/AABB_tree/internal/Is_ray_intersection_geomtraits.h>
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,11 +36,11 @@
|
||||||
#include <CGAL/Advancing_front_surface_reconstruction_cell_base_3.h>
|
#include <CGAL/Advancing_front_surface_reconstruction_cell_base_3.h>
|
||||||
#include <CGAL/Timer.h>
|
#include <CGAL/Timer.h>
|
||||||
#include <CGAL/Triangulation_data_structure_2.h>
|
#include <CGAL/Triangulation_data_structure_2.h>
|
||||||
#include <CGAL/internal/AFSR/Surface_vertex_base_2.h>
|
#include <CGAL/Advancing_front_surface_reconstruction/internal/Surface_vertex_base_2.h>
|
||||||
#include <CGAL/internal/AFSR/Surface_face_base_2.h>
|
#include <CGAL/Advancing_front_surface_reconstruction/internal/Surface_face_base_2.h>
|
||||||
#include <CGAL/internal/AFSR/construct_surface_2.h>
|
#include <CGAL/Advancing_front_surface_reconstruction/internal/construct_surface_2.h>
|
||||||
#include <CGAL/internal/AFSR/construct_polyhedron.h>
|
#include <CGAL/Advancing_front_surface_reconstruction/internal/construct_polyhedron.h>
|
||||||
#include <CGAL/internal/AFSR/write_triple_indices.h>
|
#include <CGAL/Advancing_front_surface_reconstruction/internal/write_triple_indices.h>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,135 +0,0 @@
|
||||||
// Copyright (c) 2015 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org).
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
|
||||||
//
|
|
||||||
// Author(s) : Frank Da, David Cohen-Steiner, Andreas Fabri
|
|
||||||
|
|
||||||
#ifndef CGAL_AFSR_ORIENT_H
|
|
||||||
#define CGAL_AFSR_ORIENT_H
|
|
||||||
|
|
||||||
#include <CGAL/license/Advancing_front_surface_reconstruction.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
namespace AFSR {
|
|
||||||
|
|
||||||
|
|
||||||
template <class Triangulation, class TDS, class Filter>
|
|
||||||
typename TDS::Vertex_handle
|
|
||||||
orient(TDS& tds, const Advancing_front_surface_reconstruction<Triangulation,Filter>& surface)
|
|
||||||
{
|
|
||||||
|
|
||||||
typedef typename TDS::Vertex_handle Vertex_handle;
|
|
||||||
typedef std::pair<Vertex_handle,Vertex_handle> Vh_pair;
|
|
||||||
typedef typename TDS::Face_handle Face_handle;
|
|
||||||
typedef typename TDS::Edge Edge;
|
|
||||||
|
|
||||||
Triangulation& T = surface.triangulation_3();
|
|
||||||
// create an infinite-vertex and infinite faces with the
|
|
||||||
// boundary edges if any.
|
|
||||||
// return the infinite vertex if created
|
|
||||||
Vertex_handle vinf;
|
|
||||||
|
|
||||||
std::vector<Vertex_handle > vvh;
|
|
||||||
if(tds.number_of_vertices() != 0) tds.clear();
|
|
||||||
int dim = 2;
|
|
||||||
tds.set_dimension(dim);
|
|
||||||
|
|
||||||
CGAL::Unique_hash_map<typename Triangulation::Vertex_handle, int> vertex_index_map(-1, T.number_of_vertices());
|
|
||||||
|
|
||||||
int i=0;
|
|
||||||
for (typename Triangulation::Finite_vertices_iterator v_it = T.finite_vertices_begin();
|
|
||||||
v_it != T.finite_vertices_end();
|
|
||||||
v_it++){
|
|
||||||
typename CGAL::Unique_hash_map<typename Triangulation::Vertex_handle, int>::Data& d = vertex_index_map[v_it];
|
|
||||||
if ((!v_it->is_exterior()) && d == -1){
|
|
||||||
d = i;
|
|
||||||
Vertex_handle vh = tds.create_vertex();
|
|
||||||
vvh.push_back(vh);
|
|
||||||
vh->set_point(v_it->point());
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::map<Vh_pair, Edge> edge_map;
|
|
||||||
|
|
||||||
|
|
||||||
for(typename Triangulation::Finite_facets_iterator f_it = T.finite_facets_begin();
|
|
||||||
f_it != T.finite_facets_end();
|
|
||||||
f_it++)
|
|
||||||
{
|
|
||||||
typename Triangulation::Cell_handle n, c = (*f_it).first;
|
|
||||||
int ni, ci = (*f_it).second;
|
|
||||||
n = c->neighbor(ci);
|
|
||||||
ni = n->index(c);
|
|
||||||
int i1, i2 ,i3;
|
|
||||||
|
|
||||||
if (c->is_selected_facet(ci))
|
|
||||||
{
|
|
||||||
i1 = (ci+1) & 3;
|
|
||||||
i2 = (ci+2) & 3;
|
|
||||||
i3 = (ci+3) & 3;
|
|
||||||
|
|
||||||
Face_handle fh = tds.create_face(vvh[vertex_index_map[c->vertex(i1)]],
|
|
||||||
vvh[vertex_index_map[c->vertex(i2)]],
|
|
||||||
vvh[vertex_index_map[c->vertex(i3)]]);
|
|
||||||
vvh[vertex_index_map[c->vertex(i1)]]->set_face(fh);
|
|
||||||
vvh[vertex_index_map[c->vertex(i2)]]->set_face(fh);
|
|
||||||
vvh[vertex_index_map[c->vertex(i3)]]->set_face(fh);
|
|
||||||
for (int ih = 0; ih < 3; ++ih) {
|
|
||||||
tds.set_adjacency(fh, ih, edge_map);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (n->is_selected_facet(ni))
|
|
||||||
{
|
|
||||||
i1 = (ni+1) & 3;
|
|
||||||
i2 = (ni+2) & 3;
|
|
||||||
i3 = (ni+3) & 3;
|
|
||||||
Face_handle fh = tds.create_face(vvh[vertex_index_map[n->vertex(i1)]],
|
|
||||||
vvh[vertex_index_map[n->vertex(i2)]],
|
|
||||||
vvh[vertex_index_map[n->vertex(i3)]]);
|
|
||||||
vvh[vertex_index_map[n->vertex(i1)]]->set_face(fh);
|
|
||||||
vvh[vertex_index_map[n->vertex(i2)]]->set_face(fh);
|
|
||||||
vvh[vertex_index_map[n->vertex(i3)]]->set_face(fh);
|
|
||||||
for (int ih = 0; ih < 3; ++ih) {
|
|
||||||
tds.set_adjacency(fh, ih, edge_map);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !edge_map.empty()) {
|
|
||||||
vinf = tds.create_vertex();
|
|
||||||
std::map<Vh_pair, Edge> inf_edge_map;
|
|
||||||
while (!edge_map.empty()) {
|
|
||||||
Face_handle fh = edge_map.begin()->second.first;
|
|
||||||
int ih = edge_map.begin()->second.second;
|
|
||||||
Face_handle fn = tds.create_face( vinf,
|
|
||||||
fh->vertex(TDS::cw(ih)),
|
|
||||||
fh->vertex(TDS::ccw(ih)));
|
|
||||||
vinf->set_face(fn);
|
|
||||||
tds.set_adjacency(fn, 0, fh, ih);
|
|
||||||
tds.set_adjacency(fn, 1, inf_edge_map);
|
|
||||||
tds.set_adjacency(fn, 2, inf_edge_map);
|
|
||||||
edge_map.erase(edge_map.begin());
|
|
||||||
}
|
|
||||||
CGAL_assertion(inf_edge_map.empty());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tds.reorient_faces();
|
|
||||||
return vinf;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace AFSR
|
|
||||||
} // namespace CGAL
|
|
||||||
|
|
||||||
#endif //CGAL_AFSR_ORIENT_H
|
|
||||||
|
|
@ -14,7 +14,7 @@ for Cartesian kernels.
|
||||||
\cgalHasModel double
|
\cgalHasModel double
|
||||||
\cgalHasModel `CGAL::Gmpq`
|
\cgalHasModel `CGAL::Gmpq`
|
||||||
\cgalHasModel `CGAL::Interval_nt`
|
\cgalHasModel `CGAL::Interval_nt`
|
||||||
\cgalHasModel \ref CGAL::Interval_nt_advanced
|
\cgalHasModel `CGAL::Interval_nt_advanced`
|
||||||
\cgalHasModel `CGAL::Lazy_exact_nt<FieldNumberType>`
|
\cgalHasModel `CGAL::Lazy_exact_nt<FieldNumberType>`
|
||||||
\cgalHasModel `CGAL::Quotient<RingNumberType>`
|
\cgalHasModel `CGAL::Quotient<RingNumberType>`
|
||||||
\cgalHasModel `leda_rational`
|
\cgalHasModel `leda_rational`
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ for Homogeneous kernels.
|
||||||
\cgalHasModel `CGAL::Gmpq`
|
\cgalHasModel `CGAL::Gmpq`
|
||||||
\cgalHasModel `CGAL::Gmpz`
|
\cgalHasModel `CGAL::Gmpz`
|
||||||
\cgalHasModel `CGAL::Interval_nt`
|
\cgalHasModel `CGAL::Interval_nt`
|
||||||
\cgalHasModel \ref CGAL::Interval_nt_advanced
|
\cgalHasModel `CGAL::Interval_nt_advanced`
|
||||||
\cgalHasModel `CGAL::Lazy_exact_nt<RingNumberType>`
|
\cgalHasModel `CGAL::Lazy_exact_nt<RingNumberType>`
|
||||||
\cgalHasModel `CGAL::MP_Float`
|
\cgalHasModel `CGAL::MP_Float`
|
||||||
\cgalHasModel `CGAL::Gmpzf`
|
\cgalHasModel `CGAL::Gmpzf`
|
||||||
|
|
|
||||||
|
|
@ -338,6 +338,7 @@ void test_algebraic_structure_intern( const CGAL::Field_tag& ) {
|
||||||
test_algebraic_structure_intern< AS >( CGAL::Integral_domain_tag());
|
test_algebraic_structure_intern< AS >( CGAL::Integral_domain_tag());
|
||||||
AS a(1);
|
AS a(1);
|
||||||
AS b(3);
|
AS b(3);
|
||||||
|
AS& b_ref = b; b = b_ref; // to exercise self-copy
|
||||||
AS c = a / b;
|
AS c = a / b;
|
||||||
(void)c; // avoid warnings for unused variables
|
(void)c; // avoid warnings for unused variables
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,8 @@
|
||||||
The concept `AlphaShapeTraits_2` describes the requirements for the geometric traits
|
The concept `AlphaShapeTraits_2` describes the requirements for the geometric traits
|
||||||
class of the underlying Delaunay triangulation of a basic alpha shape.
|
class of the underlying Delaunay triangulation of a basic alpha shape.
|
||||||
|
|
||||||
\cgalRefines `DelaunayTriangulationTraits_2`
|
\cgalRefines `DelaunayTriangulationTraits_2`, if the underlying triangulation of the alpha shape is a Delaunay triangulation.
|
||||||
|
\cgalRefines `Periodic_2DelaunayTriangulationTraits_2`, if the underlying triangulation of the alpha shape is a periodic Delaunay triangulation.
|
||||||
In addition to the requirements described in the concept
|
|
||||||
::DelaunayTriangulationTraits_2, the geometric traits class of a
|
|
||||||
Delaunay triangulation plugged in a basic alpha shapes provides the
|
|
||||||
following.
|
|
||||||
|
|
||||||
\cgalHasModel All models of `Kernel`.
|
\cgalHasModel All models of `Kernel`.
|
||||||
\cgalHasModel Projection traits such as `CGAL::Projection_traits_xy_3<K>`.
|
\cgalHasModel Projection traits such as `CGAL::Projection_traits_xy_3<K>`.
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,7 @@ The concept `WeightedAlphaShapeTraits_2` describes the requirements
|
||||||
for the geometric traits class
|
for the geometric traits class
|
||||||
of the underlying regular triangulation of a weighted alpha shape.
|
of the underlying regular triangulation of a weighted alpha shape.
|
||||||
|
|
||||||
\cgalRefines `RegularTriangulationTraits_2`
|
\cgalRefines `RegularTriangulationTraits_2`, if the underlying triangulation of the alpha shape is a regular triangulation.
|
||||||
|
|
||||||
In addition to the requirements described in the concept
|
|
||||||
`RegularTriangulationTraits_2`, the geometric traits class of a
|
|
||||||
regular triangulation plugged in a basic alpha shapes provides the
|
|
||||||
following.
|
|
||||||
|
|
||||||
\cgalHasModel All models of `Kernel`.
|
\cgalHasModel All models of `Kernel`.
|
||||||
\cgalHasModel Projection traits such as `CGAL::Projection_traits_xy_3<K>`.
|
\cgalHasModel Projection traits such as `CGAL::Projection_traits_xy_3<K>`.
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#include <CGAL/license/Alpha_shapes_2.h>
|
#include <CGAL/license/Alpha_shapes_2.h>
|
||||||
|
|
||||||
#include <CGAL/internal/Lazy_alpha_nt_2.h>
|
#include <CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h>
|
||||||
|
|
||||||
// for convenience only
|
// for convenience only
|
||||||
#include <CGAL/Alpha_shape_vertex_base_2.h>
|
#include <CGAL/Alpha_shape_vertex_base_2.h>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <CGAL/utility.h>
|
#include <CGAL/utility.h>
|
||||||
#include <CGAL/internal/Lazy_alpha_nt_2.h>
|
#include <CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h>
|
||||||
#include <CGAL/Default.h>
|
#include <CGAL/Default.h>
|
||||||
#include <CGAL/Triangulation_face_base_2.h>
|
#include <CGAL/Triangulation_face_base_2.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <CGAL/Triangulation_vertex_base_2.h>
|
#include <CGAL/Triangulation_vertex_base_2.h>
|
||||||
#include <CGAL/internal/Lazy_alpha_nt_2.h>
|
#include <CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h>
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
#include <CGAL/license/Alpha_shapes_2.h>
|
#include <CGAL/license/Alpha_shapes_2.h>
|
||||||
|
|
||||||
#include <CGAL/assertions.h>
|
#include <CGAL/assertions.h>
|
||||||
#include <CGAL/internal/Exact_type_selector.h>
|
#include <CGAL/Number_types/internal/Exact_type_selector.h>
|
||||||
#include <CGAL/number_type_basic.h>
|
#include <CGAL/number_type_basic.h>
|
||||||
#include <CGAL/Cartesian_converter.h>
|
#include <CGAL/Cartesian_converter.h>
|
||||||
#include <CGAL/Has_conversion.h>
|
#include <CGAL/Has_conversion.h>
|
||||||
|
|
@ -7,12 +7,8 @@ The concept `AlphaShapeTraits_3` describes the requirements
|
||||||
for the geometric traits class
|
for the geometric traits class
|
||||||
of the underlying Delaunay triangulation of a basic alpha shape.
|
of the underlying Delaunay triangulation of a basic alpha shape.
|
||||||
|
|
||||||
\cgalRefines `DelaunayTriangulationTraits_3`
|
\cgalRefines `DelaunayTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a Delaunay triangulation.
|
||||||
|
\cgalRefines `Periodic_3DelaunayTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a periodic Delaunay triangulation.
|
||||||
In addition to the requirements described in the concept
|
|
||||||
::DelaunayTriangulationTraits_3, the geometric traits class of a
|
|
||||||
Delaunay triangulation plugged in a basic alpha shapes provides the
|
|
||||||
following.
|
|
||||||
|
|
||||||
\cgalHasModel All models of `Kernel`.
|
\cgalHasModel All models of `Kernel`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,8 @@ The concept `FixedAlphaShapeTraits_3` describes the requirements
|
||||||
for the geometric traits class
|
for the geometric traits class
|
||||||
of the underlying Delaunay triangulation of a basic alpha shape with a fixed value alpha.
|
of the underlying Delaunay triangulation of a basic alpha shape with a fixed value alpha.
|
||||||
|
|
||||||
\cgalRefines `DelaunayTriangulationTraits_3`
|
\cgalRefines `DelaunayTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a Delaunay triangulation.
|
||||||
|
\cgalRefines `Periodic_3DelaunayTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a periodic Delaunay triangulation.
|
||||||
In addition to the requirements described in the concept
|
|
||||||
`DelaunayTriangulationTraits_3`, the geometric traits class of a
|
|
||||||
Delaunay triangulation plugged in a basic alpha shape with fixed alpha
|
|
||||||
value provides the following.
|
|
||||||
|
|
||||||
\cgalHasModel All models of `Kernel`.
|
\cgalHasModel All models of `Kernel`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,8 @@
|
||||||
The concept `FixedWeightedAlphaShapeTraits_3` describes the requirements
|
The concept `FixedWeightedAlphaShapeTraits_3` describes the requirements
|
||||||
for the geometric traits class of the underlying regular triangulation of a weighted alpha shape with fixed alpha value.
|
for the geometric traits class of the underlying regular triangulation of a weighted alpha shape with fixed alpha value.
|
||||||
|
|
||||||
\cgalRefines `RegularTriangulationTraits_3`
|
\cgalRefines `RegularTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a regular triangulation.
|
||||||
|
\cgalRefines `Periodic_3RegularTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a periodic regular triangulation.
|
||||||
In addition to the requirements described in the concept
|
|
||||||
::RegularTriangulationTraits_3, the geometric traits class of a
|
|
||||||
regular triangulation plugged in a weighted alpha shape with fixed
|
|
||||||
alpha value provides the following.
|
|
||||||
|
|
||||||
\cgalHasModel All models of `Kernel`.
|
\cgalHasModel All models of `Kernel`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,8 @@ The concept `WeightedAlphaShapeTraits_3` describes the requirements
|
||||||
for the geometric traits class
|
for the geometric traits class
|
||||||
of the underlying regular triangulation of a weighted alpha shape.
|
of the underlying regular triangulation of a weighted alpha shape.
|
||||||
|
|
||||||
\cgalRefines `RegularTriangulationTraits_3`
|
\cgalRefines `RegularTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a regular triangulation.
|
||||||
|
\cgalRefines `Periodic_3RegularTriangulationTraits_3`, if the underlying triangulation of the alpha shape is a periodic regular triangulation.
|
||||||
In addition to the requirements described in the concept
|
|
||||||
`RegularTriangulationTraits_3`, the geometric traits class of a
|
|
||||||
regular triangulation plugged in a basic alpha shapes provides the
|
|
||||||
following.
|
|
||||||
|
|
||||||
\cgalHasModel All models of `Kernel`.
|
\cgalHasModel All models of `Kernel`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
#include <CGAL/license/Alpha_shapes_3.h>
|
#include <CGAL/license/Alpha_shapes_3.h>
|
||||||
|
|
||||||
#include <CGAL/internal/Lazy_alpha_nt_3.h>
|
#include <CGAL/Alpha_shapes_3/internal/Lazy_alpha_nt_3.h>
|
||||||
#include <CGAL/Alpha_shape_cell_base_3.h> // for Alpha_status
|
#include <CGAL/Alpha_shape_cell_base_3.h> // for Alpha_status
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
#include <CGAL/basic.h>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <CGAL/Compact_container.h>
|
#include <CGAL/Compact_container.h>
|
||||||
#include <CGAL/Delaunay_triangulation_cell_base_3.h>
|
#include <CGAL/Delaunay_triangulation_cell_base_3.h>
|
||||||
#include <CGAL/internal/Lazy_alpha_nt_3.h>
|
#include <CGAL/Alpha_shapes_3/internal/Lazy_alpha_nt_3.h>
|
||||||
#include <CGAL/Default.h>
|
#include <CGAL/Default.h>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
#include <CGAL/assertions.h>
|
#include <CGAL/assertions.h>
|
||||||
#include <CGAL/Cartesian_converter.h>
|
#include <CGAL/Cartesian_converter.h>
|
||||||
#include <CGAL/internal/Exact_type_selector.h>
|
#include <CGAL/Number_types/internal/Exact_type_selector.h>
|
||||||
#include <CGAL/Has_conversion.h>
|
#include <CGAL/Has_conversion.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
#include <CGAL/IO/Geomview_stream.h> // TBC
|
#include <CGAL/IO/Geomview_stream.h> // TBC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <CGAL/internal/Classification_type.h>
|
#include <CGAL/Alpha_shapes_3/internal/Classification_type.h>
|
||||||
|
|
||||||
#include <CGAL/Triangulation_3.h>
|
#include <CGAL/Triangulation_3.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <CGAL/Compact_container.h>
|
#include <CGAL/Compact_container.h>
|
||||||
#include <CGAL/Delaunay_triangulation_cell_base_3.h>
|
#include <CGAL/Delaunay_triangulation_cell_base_3.h>
|
||||||
#include <CGAL/internal/Classification_type.h>
|
#include <CGAL/Alpha_shapes_3/internal/Classification_type.h>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <CGAL/Triangulation_vertex_base_3.h>
|
#include <CGAL/Triangulation_vertex_base_3.h>
|
||||||
#include <CGAL/internal/Classification_type.h>
|
#include <CGAL/Alpha_shapes_3/internal/Classification_type.h>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
#include <CGAL/Apollonius_graph_vertex_base_2.h>
|
#include <CGAL/Apollonius_graph_vertex_base_2.h>
|
||||||
|
|
||||||
#include <CGAL/in_place_edge_list.h>
|
#include <CGAL/in_place_edge_list.h>
|
||||||
#include <CGAL/internal/TDS_2/edge_list.h>
|
#include <CGAL/TDS_2/internal/edge_list.h>
|
||||||
#include <CGAL/Apollonius_graph_2/Traits_wrapper_2.h>
|
#include <CGAL/Apollonius_graph_2/Traits_wrapper_2.h>
|
||||||
|
|
||||||
#include <CGAL/Apollonius_graph_2/Constructions_C2.h>
|
#include <CGAL/Apollonius_graph_2/Constructions_C2.h>
|
||||||
|
|
|
||||||
|
|
@ -44,20 +44,12 @@ public:
|
||||||
using Base::f;
|
using Base::f;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
#if defined(__POWERPC__) && \
|
|
||||||
defined(__GNUC__) && (__GNUC__ == 3 ) && (__GNUC_MINOR__ == 4)
|
|
||||||
// hack to avoid nasty warning for G++ 3.4 on Darwin
|
|
||||||
static FT OFFSET()
|
|
||||||
{
|
|
||||||
return FT(10000);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static const FT& OFFSET()
|
static const FT& OFFSET()
|
||||||
{
|
{
|
||||||
static const FT offset_(10000);
|
static const FT offset_(10000);
|
||||||
return offset_;
|
return offset_;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
template< class Stream >
|
template< class Stream >
|
||||||
inline
|
inline
|
||||||
|
|
|
||||||
|
|
@ -267,24 +267,29 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Line_2 line() const
|
inline const Line_2& line() const
|
||||||
{
|
{
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Point_2 center() const
|
inline const Point_2& center() const
|
||||||
{
|
{
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const Point_2& origin() const
|
||||||
|
{
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
template< class Stream >
|
template< class Stream >
|
||||||
void draw(Stream& W) const
|
void draw(Stream& W) const
|
||||||
{
|
{
|
||||||
std::vector< Point_2 > p;
|
std::vector< Point_2 > p;
|
||||||
std::vector< Point_2 > pleft, pright;
|
std::vector< Point_2 > pleft, pright;
|
||||||
|
|
||||||
pleft.push_back(o);
|
pleft.push_back(origin());
|
||||||
pright.push_back(o);
|
pright.push_back(origin());
|
||||||
const FT STEP(2);
|
const FT STEP(2);
|
||||||
for (int i = 1; i <= 100; i++) {
|
for (int i = 1; i <= 100; i++) {
|
||||||
p = compute_points(i * i * STEP);
|
p = compute_points(i * i * STEP);
|
||||||
|
|
@ -311,7 +316,7 @@ public:
|
||||||
W << Segment_2(pright[i], pright[i+1]);
|
W << Segment_2(pright[i], pright[i+1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
W << o;
|
W << origin();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_rational_arc_traits_2.h>"
|
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_rational_arc_traits_2.h>"
|
||||||
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_rational_function_traits_2.h>"
|
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_rational_function_traits_2.h>"
|
||||||
#include <CGAL/internal/deprecation_warning.h>
|
#include <CGAL/Installation/internal/deprecation_warning.h>
|
||||||
|
|
||||||
/*! \file
|
/*! \file
|
||||||
* Definition of the Arr_rational_arc_traits_2 class.
|
* Definition of the Arr_rational_arc_traits_2 class.
|
||||||
|
|
|
||||||
|
|
@ -3475,7 +3475,7 @@ This package provides an <I>inserter</I> (the `<<` operator) and an
|
||||||
`Arrangement_2<Traits,Dcel>` class that inserts and an arrangement
|
`Arrangement_2<Traits,Dcel>` class that inserts and an arrangement
|
||||||
object into an output stream and extracts an arrangement object from an
|
object into an output stream and extracts an arrangement object from an
|
||||||
input stream respectively. The arrangement is written using a simple
|
input stream respectively. The arrangement is written using a simple
|
||||||
predefined ASCII format that encodes the arrangement topology, as well
|
predefined \ascii format that encodes the arrangement topology, as well
|
||||||
as all geometric entities associated with vertices and edges.
|
as all geometric entities associated with vertices and edges.
|
||||||
|
|
||||||
The ability to use the input/output operators, requires that the
|
The ability to use the input/output operators, requires that the
|
||||||
|
|
@ -3560,7 +3560,7 @@ with the basic arrangement structure.
|
||||||
|
|
||||||
The arrangement package supplies an inserter and an extractor for the
|
The arrangement package supplies an inserter and an extractor for the
|
||||||
`Arrangement_with_history_2<Traits,Dcel>` class. The arrangement is
|
`Arrangement_with_history_2<Traits,Dcel>` class. The arrangement is
|
||||||
represented using a simple predefined ASCII format. An object of the
|
represented using a simple predefined \ascii format. An object of the
|
||||||
`Arrangement_with_history_2<Traits,Dcel>` type can be saved and
|
`Arrangement_with_history_2<Traits,Dcel>` type can be saved and
|
||||||
restored, as long as the `Curve_2` type defined by the traits
|
restored, as long as the `Curve_2` type defined by the traits
|
||||||
class - as well as the `Point_2` type and the `X_monotone_curve_2`
|
class - as well as the `Point_2` type and the `X_monotone_curve_2`
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_face_map.h>"
|
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_face_map.h>"
|
||||||
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_face_index_map.h>"
|
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_face_index_map.h>"
|
||||||
#include <CGAL/internal/deprecation_warning.h>
|
#include <CGAL/Installation/internal/deprecation_warning.h>
|
||||||
|
|
||||||
#include <CGAL/Arr_face_index_map.h>
|
#include <CGAL/Arr_face_index_map.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_geometry_traits/Polyline_2.h>"
|
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_geometry_traits/Polyline_2.h>"
|
||||||
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_geometry_traits/Polycurve_2.h>"
|
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_geometry_traits/Polycurve_2.h>"
|
||||||
#include <CGAL/internal/deprecation_warning.h>
|
#include <CGAL/Installation/internal/deprecation_warning.h>
|
||||||
|
|
||||||
#include <CGAL/Arr_geometry_traits/Polycurve_2.h>
|
#include <CGAL/Arr_geometry_traits/Polycurve_2.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_overlay.h>"
|
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_overlay.h>"
|
||||||
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_overlay_2.h>"
|
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_overlay_2.h>"
|
||||||
#include <CGAL/internal/deprecation_warning.h>
|
#include <CGAL/Installation/internal/deprecation_warning.h>
|
||||||
|
|
||||||
#include <CGAL/Arr_overlay_2.h>
|
#include <CGAL/Arr_overlay_2.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,15 +122,10 @@ public:
|
||||||
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::Around_point_circulator;
|
friend class Trapezoidal_decomposition_2<Traits>::Around_point_circulator;
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#elif defined(__GNUC__)
|
#elif (__GNUC__ > 0)
|
||||||
|
|
||||||
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
|
|
||||||
friend typename Trapezoidal_decomposition_2<Traits>::Around_point_circulator;
|
|
||||||
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
|
||||||
#else
|
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::Around_point_circulator;
|
friend class Trapezoidal_decomposition_2<Traits>::Around_point_circulator;
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
friend class Around_point_circulator;
|
friend class Around_point_circulator;
|
||||||
|
|
|
||||||
|
|
@ -94,14 +94,8 @@ public:
|
||||||
#ifdef CGAL_PM_FRIEND_CLASS
|
#ifdef CGAL_PM_FRIEND_CLASS
|
||||||
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#elif defined(__GNUC__)
|
#elif (__GNUC__ > 0)
|
||||||
|
|
||||||
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
|
|
||||||
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
|
||||||
#else
|
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
friend class In_face_iterator;
|
friend class In_face_iterator;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -94,14 +94,8 @@ public:
|
||||||
#ifdef CGAL_PM_FRIEND_CLASS
|
#ifdef CGAL_PM_FRIEND_CLASS
|
||||||
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#elif defined(__GNUC__)
|
#elif (__GNUC__ > 0)
|
||||||
|
|
||||||
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
|
|
||||||
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
|
||||||
#else
|
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
friend class In_face_iterator;
|
friend class In_face_iterator;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -91,14 +91,8 @@ public:
|
||||||
#ifdef CGAL_PM_FRIEND_CLASS
|
#ifdef CGAL_PM_FRIEND_CLASS
|
||||||
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#elif defined(__GNUC__)
|
#elif (__GNUC__ > 0)
|
||||||
|
|
||||||
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
|
|
||||||
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
|
||||||
#else
|
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
friend class In_face_iterator;
|
friend class In_face_iterator;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -96,14 +96,8 @@ public:
|
||||||
#ifdef CGAL_PM_FRIEND_CLASS
|
#ifdef CGAL_PM_FRIEND_CLASS
|
||||||
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#elif defined(__GNUC__)
|
#elif (__GNUC__ > 0)
|
||||||
|
|
||||||
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
|
|
||||||
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
|
||||||
#else
|
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
friend class In_face_iterator;
|
friend class In_face_iterator;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -93,14 +93,8 @@ public:
|
||||||
#ifdef CGAL_PM_FRIEND_CLASS
|
#ifdef CGAL_PM_FRIEND_CLASS
|
||||||
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#elif defined(__GNUC__)
|
#elif (__GNUC__ > 0)
|
||||||
|
|
||||||
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
|
|
||||||
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
|
||||||
#else
|
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
friend class In_face_iterator;
|
friend class In_face_iterator;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -96,14 +96,8 @@ public:
|
||||||
#ifdef CGAL_PM_FRIEND_CLASS
|
#ifdef CGAL_PM_FRIEND_CLASS
|
||||||
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#elif defined(__GNUC__)
|
#elif (__GNUC__ > 0)
|
||||||
|
|
||||||
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
|
|
||||||
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
|
||||||
#else
|
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
friend class In_face_iterator;
|
friend class In_face_iterator;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -92,14 +92,8 @@ public:
|
||||||
#ifdef CGAL_PM_FRIEND_CLASS
|
#ifdef CGAL_PM_FRIEND_CLASS
|
||||||
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
#if defined(__SUNPRO_CC) || defined(__PGI) || defined(__INTEL_COMPILER)
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#elif defined(__GNUC__)
|
#elif (__GNUC__ > 0)
|
||||||
|
|
||||||
#if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)))
|
|
||||||
friend typename Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
|
||||||
#else
|
|
||||||
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
friend class Trapezoidal_decomposition_2<Traits>::In_face_iterator;
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
friend class In_face_iterator;
|
friend class In_face_iterator;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -46,9 +46,7 @@
|
||||||
#define CGAL_TD_DEFAULT_SIZE_THRESHOLD 12
|
#define CGAL_TD_DEFAULT_SIZE_THRESHOLD 12
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
#if !defined __GNUC__ || __GNUC__> 3 || ((__GNUC__== 3) && (__GNUC_MINOR__> 4))
|
|
||||||
#define CGAL_PM_FRIEND_CLASS
|
#define CGAL_PM_FRIEND_CLASS
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Memeber-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Memeber-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Memeber-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Memeber-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Memeber-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Memeber-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Memeber-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Memeber-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_vertex_map.h>"
|
#define CGAL_DEPRECATED_HEADER "<CGAL/Arr_vertex_map.h>"
|
||||||
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_vertex_index_map.h>"
|
#define CGAL_REPLACEMENT_HEADER "<CGAL/Arr_vertex_index_map.h>"
|
||||||
#include <CGAL/internal/deprecation_warning.h>
|
#include <CGAL/Installation/internal/deprecation_warning.h>
|
||||||
|
|
||||||
#include <CGAL/Arr_vertex_index_map.h>
|
#include <CGAL/Arr_vertex_index_map.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -738,35 +738,12 @@ public:
|
||||||
|
|
||||||
// read values
|
// read values
|
||||||
is >> rep._m_xy;
|
is >> rep._m_xy;
|
||||||
#if BOOST_VERSION < 104300
|
|
||||||
// EBEB: This fixes a bug in optional_io.hpp, reported to Fernando on
|
|
||||||
// April 27, 2010, don't know whether the fix makes it into
|
|
||||||
// boost 1_43.
|
|
||||||
if (!rep._m_xy) {
|
|
||||||
swallow(is, '-');
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
swallow(is, ',');
|
swallow(is, ',');
|
||||||
is >> rep._m_x;
|
is >> rep._m_x;
|
||||||
#if BOOST_VERSION < 104300
|
|
||||||
if (!rep._m_x) {
|
|
||||||
swallow(is, '-');
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
swallow(is, ',');
|
swallow(is, ',');
|
||||||
is >> rep._m_curve;
|
is >> rep._m_curve;
|
||||||
#if BOOST_VERSION < 104300
|
|
||||||
if (!rep._m_curve) {
|
|
||||||
swallow(is, '-');
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
swallow(is, ',');
|
swallow(is, ',');
|
||||||
is >> rep._m_arcno;
|
is >> rep._m_arcno;
|
||||||
#if BOOST_VERSION < 104300
|
|
||||||
if (!rep._m_arcno) {
|
|
||||||
swallow(is, '-');
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
swallow(is, ',');
|
swallow(is, ',');
|
||||||
is >> rep._m_location;
|
is >> rep._m_location;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
/*! \class
|
/*! \class
|
||||||
* A class defining a textual (ASCII) input/output format for arrangements
|
* A class defining a textual (\ascii) input/output format for arrangements
|
||||||
* and supports reading and writing an arrangement from or to input/output
|
* and supports reading and writing an arrangement from or to input/output
|
||||||
* streams.
|
* streams.
|
||||||
*/
|
*/
|
||||||
|
|
@ -489,7 +489,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! \class
|
/*! \class
|
||||||
* A class defining a textual (ASCII) input/output format for arrangements
|
* A class defining a textual (\ascii) input/output format for arrangements
|
||||||
* that store auxiliary dat with their face records, as they are templated
|
* that store auxiliary dat with their face records, as they are templated
|
||||||
* by a face-extended DCEL class.
|
* by a face-extended DCEL class.
|
||||||
*/
|
*/
|
||||||
|
|
@ -546,7 +546,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! \class
|
/*! \class
|
||||||
* A class defining a textual (ASCII) input/output format for arrangements
|
* A class defining a textual (\ascii) input/output format for arrangements
|
||||||
* that store auxiliary dat with all their DCEL records, as they are templated
|
* that store auxiliary dat with all their DCEL records, as they are templated
|
||||||
* by a extended DCEL class.
|
* by a extended DCEL class.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
/*! \class
|
/*! \class
|
||||||
* A class defining a textual (ASCII) input/output format for arrangements
|
* A class defining a textual (\ascii) input/output format for arrangements
|
||||||
* with history and supports reading and writing an arrangement from or to
|
* with history and supports reading and writing an arrangement from or to
|
||||||
* input/output streams.
|
* input/output streams.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Memeber-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ public:
|
||||||
|
|
||||||
/*! using the additional data that we store at the event, we compute
|
/*! using the additional data that we store at the event, we compute
|
||||||
* how much we have to jump (he = he->next()->twin()) from the halfedge
|
* how much we have to jump (he = he->next()->twin()) from the halfedge
|
||||||
* that is stored in the event, to the halefge that is previous to 'curve'
|
* that is stored in the event, to the halfedge that is previous to 'curve'
|
||||||
* that is about to be inserted into the arrangement.
|
* that is about to be inserted into the arrangement.
|
||||||
*/
|
*/
|
||||||
int compute_halfedge_jump_count(Subcurve* curve)
|
int compute_halfedge_jump_count(Subcurve* curve)
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Memeber-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,21 @@ private:
|
||||||
X_monotone_curve_2 sub_cv1; // Auxiliary variables
|
X_monotone_curve_2 sub_cv1; // Auxiliary variables
|
||||||
X_monotone_curve_2 sub_cv2; // (used for splitting curves).
|
X_monotone_curve_2 sub_cv2; // (used for splitting curves).
|
||||||
|
|
||||||
|
|
||||||
|
// update halfedge pointing to events, case with overlaps
|
||||||
|
template <class Subcurve_>
|
||||||
|
void update_incident_halfedge_after_split(Subcurve_* sc,
|
||||||
|
Halfedge_handle he,
|
||||||
|
Halfedge_handle new_he,
|
||||||
|
Tag_true);
|
||||||
|
|
||||||
|
// update halfedge pointing to events, case without overlaps
|
||||||
|
template <class Subcurve_>
|
||||||
|
void update_incident_halfedge_after_split(Subcurve_* sc,
|
||||||
|
Halfedge_handle he,
|
||||||
|
Halfedge_handle new_he,
|
||||||
|
Tag_false);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*! A notification invoked when a new subcurve is created. */
|
/*! A notification invoked when a new subcurve is created. */
|
||||||
void add_subcurve(const X_monotone_curve_2& cv, Subcurve* sc);
|
void add_subcurve(const X_monotone_curve_2& cv, Subcurve* sc);
|
||||||
|
|
@ -99,6 +114,43 @@ public:
|
||||||
// Member-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// update halfedge pointing to events, case with overlaps
|
||||||
|
//
|
||||||
|
template <typename Hlpr, typename Vis>
|
||||||
|
template <class Subcurve_>
|
||||||
|
void Arr_insertion_ss_visitor<Hlpr, Vis>::
|
||||||
|
update_incident_halfedge_after_split(Subcurve_* sc,
|
||||||
|
Halfedge_handle he,
|
||||||
|
Halfedge_handle new_he,
|
||||||
|
Tag_true)
|
||||||
|
{
|
||||||
|
std::vector<Subcurve*> leaves;
|
||||||
|
sc->all_leaves( std::back_inserter(leaves) );
|
||||||
|
for(Subcurve* ssc : leaves)
|
||||||
|
{
|
||||||
|
Event* last_event_on_ssc = ssc->last_event();
|
||||||
|
if (last_event_on_ssc->halfedge_handle() == he)
|
||||||
|
last_event_on_ssc->set_halfedge_handle(new_he->next());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// update halfedge pointing to events, case without overlaps
|
||||||
|
//
|
||||||
|
template <typename Hlpr, typename Vis>
|
||||||
|
template <class Subcurve_>
|
||||||
|
void Arr_insertion_ss_visitor<Hlpr, Vis>::
|
||||||
|
update_incident_halfedge_after_split(Subcurve_* sc,
|
||||||
|
Halfedge_handle he,
|
||||||
|
Halfedge_handle new_he,
|
||||||
|
Tag_false)
|
||||||
|
{
|
||||||
|
Event* last_event_on_sc = sc->last_event();
|
||||||
|
if (last_event_on_sc->halfedge_handle() == he)
|
||||||
|
last_event_on_sc->set_halfedge_handle(new_he->next());
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Check if the halfedge associated with the given subcurve will be split
|
// Check if the halfedge associated with the given subcurve will be split
|
||||||
// at the given event.
|
// at the given event.
|
||||||
|
|
@ -132,9 +184,8 @@ Arr_insertion_ss_visitor<Hlpr, Vis>::split_edge(Halfedge_handle he, Subcurve* sc
|
||||||
Halfedge_handle new_he =
|
Halfedge_handle new_he =
|
||||||
this->m_arr_access.split_edge_ex(he, pt.base(),
|
this->m_arr_access.split_edge_ex(he, pt.base(),
|
||||||
sub_cv1.base(), sub_cv2.base());
|
sub_cv1.base(), sub_cv2.base());
|
||||||
Event* last_event_on_sc = sc->last_event();
|
// update the halfedge incident to events on the left of the split
|
||||||
if (last_event_on_sc->halfedge_handle() == he)
|
update_incident_halfedge_after_split(sc, he, new_he, typename Subcurve::Handle_overlaps());
|
||||||
last_event_on_sc->set_halfedge_handle(new_he->next());
|
|
||||||
|
|
||||||
return new_he;
|
return new_he;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Memeber-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -401,7 +401,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Memeber-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Memeber-function definitions:
|
// Member-function definitions:
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,20 @@ bool test_insert_at_vertices(){
|
||||||
return test_insert_at_vertices_1() && test_insert_at_vertices_2();
|
return test_insert_at_vertices_1() && test_insert_at_vertices_2();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool test_insert_on_overlap(){
|
||||||
|
Arrangement_2 arr;
|
||||||
|
|
||||||
|
std::vector<Segment_2> segs1, segs2;
|
||||||
|
segs1.emplace_back(Point_2(0, 0), Point_2(0, 4));
|
||||||
|
segs2.emplace_back(Point_2(0, 0), Point_2(4,4));
|
||||||
|
segs2.emplace_back(Point_2(0, 2), Point_2(0, 4));
|
||||||
|
segs2.emplace_back(Point_2(0, 2), Point_2(4,4));
|
||||||
|
CGAL::insert(arr, segs1.begin(), segs1.end());
|
||||||
|
CGAL::insert(arr, segs2.begin(), segs2.end());
|
||||||
|
|
||||||
|
return is_valid(arr);
|
||||||
|
}
|
||||||
|
|
||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
Arrangement_2 arr;
|
Arrangement_2 arr;
|
||||||
|
|
@ -136,6 +150,10 @@ int main ()
|
||||||
valid=test_insert_at_vertices();
|
valid=test_insert_at_vertices();
|
||||||
std::cout << ( valid ? "valid." : "NOT valid!") << std::endl;
|
std::cout << ( valid ? "valid." : "NOT valid!") << std::endl;
|
||||||
|
|
||||||
|
if (!valid) return 1;
|
||||||
|
std::cout << "Test insert on overlap\n";
|
||||||
|
valid=test_insert_on_overlap();
|
||||||
|
|
||||||
return valid?0:1;
|
return valid?0:1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,10 @@
|
||||||
#include <boost/range/has_range_iterator.hpp>
|
#include <boost/range/has_range_iterator.hpp>
|
||||||
#include <boost/unordered_set.hpp>
|
#include <boost/unordered_set.hpp>
|
||||||
|
|
||||||
|
#include <bitset>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#ifdef DOXYGEN_RUNNING
|
#ifdef DOXYGEN_RUNNING
|
||||||
#define CGAL_BGL_NP_TEMPLATE_PARAMETERS NamedParameters
|
#define CGAL_BGL_NP_TEMPLATE_PARAMETERS NamedParameters
|
||||||
#define CGAL_BGL_NP_CLASS NamedParameters
|
#define CGAL_BGL_NP_CLASS NamedParameters
|
||||||
|
|
@ -393,21 +397,68 @@ struct Face_filtered_graph
|
||||||
///returns a reference to the underlying graph.
|
///returns a reference to the underlying graph.
|
||||||
Graph& graph(){ return _graph; }
|
Graph& graph(){ return _graph; }
|
||||||
|
|
||||||
///change the set of selected faces using a patch id
|
// Handling of internal correspondency for index maps.
|
||||||
template<class FacePatchIndexMap>
|
// The indices must be kept valid when the selection changes.
|
||||||
void set_selected_faces(typename boost::property_traits<FacePatchIndexMap>::value_type face_patch_id,
|
void initialize_face_indices() const
|
||||||
FacePatchIndexMap face_patch_index_map)
|
{
|
||||||
|
if(face_indices.empty())
|
||||||
|
{
|
||||||
|
face_index_type index = 0;
|
||||||
|
face_indices.resize(num_faces(_graph));
|
||||||
|
for(std::size_t i=selected_faces.find_first(); i<selected_faces.npos; i=selected_faces.find_next(i))
|
||||||
|
face_indices[i] = index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void initialize_vertex_indices() const
|
||||||
|
{
|
||||||
|
if(vertex_indices.empty())
|
||||||
|
{
|
||||||
|
vertex_index_type index = 0;
|
||||||
|
vertex_indices.resize(num_vertices(_graph));
|
||||||
|
for(std::size_t i=selected_vertices.find_first(); i<selected_vertices.npos; i=selected_vertices.find_next(i))
|
||||||
|
vertex_indices[i] = index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void initialize_halfedge_indices() const
|
||||||
|
{
|
||||||
|
if(halfedge_indices.empty())
|
||||||
|
{
|
||||||
|
halfedge_index_type index = 0;
|
||||||
|
halfedge_indices.resize(num_halfedges(_graph));
|
||||||
|
for(std::size_t i=selected_halfedges.find_first(); i<selected_halfedges.npos; i=selected_halfedges.find_next(i))
|
||||||
|
halfedge_indices[i] = index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset_indices()
|
||||||
{
|
{
|
||||||
face_indices.clear();
|
face_indices.clear();
|
||||||
vertex_indices.clear();
|
vertex_indices.clear();
|
||||||
halfedge_indices.clear();
|
halfedge_indices.clear();
|
||||||
|
|
||||||
|
if(is_imap_in_use.test(0))
|
||||||
|
initialize_face_indices();
|
||||||
|
if(is_imap_in_use.test(1))
|
||||||
|
initialize_vertex_indices();
|
||||||
|
if(is_imap_in_use.test(2))
|
||||||
|
initialize_halfedge_indices();
|
||||||
|
}
|
||||||
|
|
||||||
|
///change the set of selected faces using a patch id
|
||||||
|
template<class FacePatchIndexMap>
|
||||||
|
void set_selected_faces(typename boost::property_traits<FacePatchIndexMap>::value_type face_patch_id,
|
||||||
|
FacePatchIndexMap face_patch_index_map)
|
||||||
|
{
|
||||||
selected_faces.resize(num_faces(_graph));
|
selected_faces.resize(num_faces(_graph));
|
||||||
selected_vertices.resize(num_vertices(_graph));
|
selected_vertices.resize(num_vertices(_graph));
|
||||||
selected_halfedges.resize(num_halfedges(_graph));
|
selected_halfedges.resize(num_halfedges(_graph));
|
||||||
|
|
||||||
selected_faces.reset();
|
selected_faces.reset();
|
||||||
selected_vertices.reset();
|
selected_vertices.reset();
|
||||||
selected_halfedges.reset();
|
selected_halfedges.reset();
|
||||||
|
|
||||||
for(face_descriptor fd : faces(_graph) )
|
for(face_descriptor fd : faces(_graph) )
|
||||||
{
|
{
|
||||||
if(get(face_patch_index_map, fd) == face_patch_id)
|
if(get(face_patch_index_map, fd) == face_patch_id)
|
||||||
|
|
@ -421,6 +472,8 @@ struct Face_filtered_graph
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reset_indices();
|
||||||
}
|
}
|
||||||
/// change the set of selected faces using a range of patch ids
|
/// change the set of selected faces using a range of patch ids
|
||||||
template<class FacePatchIndexRange, class FacePatchIndexMap>
|
template<class FacePatchIndexRange, class FacePatchIndexMap>
|
||||||
|
|
@ -433,16 +486,14 @@ struct Face_filtered_graph
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
face_indices.clear();
|
|
||||||
vertex_indices.clear();
|
|
||||||
halfedge_indices.clear();
|
|
||||||
|
|
||||||
selected_faces.resize(num_faces(_graph));
|
selected_faces.resize(num_faces(_graph));
|
||||||
selected_vertices.resize(num_vertices(_graph));
|
selected_vertices.resize(num_vertices(_graph));
|
||||||
selected_halfedges.resize(num_halfedges(_graph));
|
selected_halfedges.resize(num_halfedges(_graph));
|
||||||
|
|
||||||
selected_faces.reset();
|
selected_faces.reset();
|
||||||
selected_vertices.reset();
|
selected_vertices.reset();
|
||||||
selected_halfedges.reset();
|
selected_halfedges.reset();
|
||||||
|
|
||||||
typedef typename boost::property_traits<FacePatchIndexMap>::value_type Patch_index;
|
typedef typename boost::property_traits<FacePatchIndexMap>::value_type Patch_index;
|
||||||
boost::unordered_set<Patch_index> pids(boost::begin(selected_face_patch_indices),
|
boost::unordered_set<Patch_index> pids(boost::begin(selected_face_patch_indices),
|
||||||
boost::end(selected_face_patch_indices));
|
boost::end(selected_face_patch_indices));
|
||||||
|
|
@ -460,21 +511,22 @@ struct Face_filtered_graph
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reset_indices();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// change the set of selected faces using a range of face descriptors
|
/// change the set of selected faces using a range of face descriptors
|
||||||
template<class FaceRange>
|
template<class FaceRange>
|
||||||
void set_selected_faces(const FaceRange& selection)
|
void set_selected_faces(const FaceRange& selection)
|
||||||
{
|
{
|
||||||
face_indices.clear();
|
|
||||||
vertex_indices.clear();
|
|
||||||
halfedge_indices.clear();
|
|
||||||
|
|
||||||
selected_faces.resize(num_faces(_graph));
|
selected_faces.resize(num_faces(_graph));
|
||||||
selected_vertices.resize(num_vertices(_graph));
|
selected_vertices.resize(num_vertices(_graph));
|
||||||
selected_halfedges.resize(num_halfedges(_graph));
|
selected_halfedges.resize(num_halfedges(_graph));
|
||||||
|
|
||||||
selected_faces.reset();
|
selected_faces.reset();
|
||||||
selected_vertices.reset();
|
selected_vertices.reset();
|
||||||
selected_halfedges.reset();
|
selected_halfedges.reset();
|
||||||
|
|
||||||
for(face_descriptor fd : selection)
|
for(face_descriptor fd : selection)
|
||||||
{
|
{
|
||||||
selected_faces.set(get(fimap, fd));
|
selected_faces.set(get(fimap, fd));
|
||||||
|
|
@ -485,6 +537,8 @@ struct Face_filtered_graph
|
||||||
selected_vertices.set(get(vimap, target(hd, _graph)));
|
selected_vertices.set(get(vimap, target(hd, _graph)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reset_indices();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Is_simplex_valid
|
struct Is_simplex_valid
|
||||||
|
|
@ -543,45 +597,27 @@ struct Face_filtered_graph
|
||||||
Property_map_binder<FIM, typename Pointer_property_map<typename boost::property_traits<FIM>::value_type>::type>
|
Property_map_binder<FIM, typename Pointer_property_map<typename boost::property_traits<FIM>::value_type>::type>
|
||||||
get_face_index_map() const
|
get_face_index_map() const
|
||||||
{
|
{
|
||||||
if (face_indices.empty())
|
is_imap_in_use.set(0);
|
||||||
{
|
initialize_face_indices();
|
||||||
face_index_type index = 0;
|
|
||||||
face_indices.resize(num_faces(_graph));
|
|
||||||
for (std::size_t i=selected_faces.find_first(); i < selected_faces.npos; i = selected_faces.find_next(i))
|
|
||||||
{
|
|
||||||
face_indices[i] = index++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return bind_property_maps(fimap, make_property_map(face_indices));
|
return bind_property_maps(fimap, make_property_map(face_indices));
|
||||||
}
|
}
|
||||||
|
|
||||||
Property_map_binder<VIM, typename Pointer_property_map<typename boost::property_traits<VIM>::value_type>::type>
|
Property_map_binder<VIM, typename Pointer_property_map<typename boost::property_traits<VIM>::value_type>::type>
|
||||||
get_vertex_index_map() const
|
get_vertex_index_map() const
|
||||||
{
|
{
|
||||||
if (vertex_indices.empty())
|
is_imap_in_use.set(1);
|
||||||
{
|
initialize_vertex_indices();
|
||||||
vertex_index_type index = 0;
|
|
||||||
vertex_indices.resize(num_vertices(_graph));
|
|
||||||
for (std::size_t i=selected_vertices.find_first(); i < selected_vertices.npos; i = selected_vertices.find_next(i))
|
|
||||||
{
|
|
||||||
vertex_indices[i] = index++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return bind_property_maps(vimap, make_property_map(vertex_indices) );
|
return bind_property_maps(vimap, make_property_map(vertex_indices) );
|
||||||
}
|
}
|
||||||
|
|
||||||
Property_map_binder<HIM, typename Pointer_property_map<typename boost::property_traits<HIM>::value_type >::type>
|
Property_map_binder<HIM, typename Pointer_property_map<typename boost::property_traits<HIM>::value_type >::type>
|
||||||
get_halfedge_index_map() const
|
get_halfedge_index_map() const
|
||||||
{
|
{
|
||||||
if (halfedge_indices.empty())
|
is_imap_in_use.set(2);
|
||||||
{
|
initialize_halfedge_indices();
|
||||||
halfedge_index_type index = 0;
|
|
||||||
halfedge_indices.resize(num_halfedges(_graph));
|
|
||||||
for (std::size_t i=selected_halfedges.find_first(); i < selected_halfedges.npos; i = selected_halfedges.find_next(i))
|
|
||||||
{
|
|
||||||
halfedge_indices[i] = index++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return bind_property_maps(himap, make_property_map(halfedge_indices) );
|
return bind_property_maps(himap, make_property_map(halfedge_indices) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -649,9 +685,11 @@ private:
|
||||||
boost::dynamic_bitset<> selected_faces;
|
boost::dynamic_bitset<> selected_faces;
|
||||||
boost::dynamic_bitset<> selected_vertices;
|
boost::dynamic_bitset<> selected_vertices;
|
||||||
boost::dynamic_bitset<> selected_halfedges;
|
boost::dynamic_bitset<> selected_halfedges;
|
||||||
|
|
||||||
mutable std::vector<face_index_type> face_indices;
|
mutable std::vector<face_index_type> face_indices;
|
||||||
mutable std::vector<vertex_index_type> vertex_indices;
|
mutable std::vector<vertex_index_type> vertex_indices;
|
||||||
mutable std::vector<halfedge_index_type> halfedge_indices;
|
mutable std::vector<halfedge_index_type> halfedge_indices;
|
||||||
|
mutable std::bitset<3> is_imap_in_use; // one per descriptor type (face, vertex, halfedge)
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
@ -1206,40 +1244,6 @@ CGAL_FFG_DYNAMIC_PMAP_SPEC(dynamic_face_property_t)
|
||||||
|
|
||||||
#undef CGAL_FFG_DYNAMIC_PMAP_SPEC
|
#undef CGAL_FFG_DYNAMIC_PMAP_SPEC
|
||||||
|
|
||||||
//specializations for indices
|
|
||||||
template <class Graph,
|
|
||||||
typename FIMap,
|
|
||||||
typename VIMap,
|
|
||||||
typename HIMap>
|
|
||||||
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL::face_index_t >::type
|
|
||||||
get(CGAL::face_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
|
|
||||||
{
|
|
||||||
return w.get_face_index_map();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template <class Graph,
|
|
||||||
typename FIMap,
|
|
||||||
typename VIMap,
|
|
||||||
typename HIMap>
|
|
||||||
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::vertex_index_t >::type
|
|
||||||
get(boost::vertex_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
|
|
||||||
{
|
|
||||||
return w.get_vertex_index_map();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template <class Graph,
|
|
||||||
typename FIMap,
|
|
||||||
typename VIMap,
|
|
||||||
typename HIMap>
|
|
||||||
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL::halfedge_index_t >::type
|
|
||||||
get(CGAL::halfedge_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
|
|
||||||
{
|
|
||||||
return w.get_halfedge_index_map();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template <class Graph,
|
template <class Graph,
|
||||||
typename FIMap,
|
typename FIMap,
|
||||||
typename VIMap,
|
typename VIMap,
|
||||||
|
|
@ -1307,9 +1311,11 @@ CGAL_FILTERED_FACE_GRAPH_DYNAMIC_PMAP_SPECIALIZATION(dynamic_face_property_t)
|
||||||
|
|
||||||
//specializations for indices
|
//specializations for indices
|
||||||
template<typename Graph, typename FIMap, typename VIMap, typename HIMap>
|
template<typename Graph, typename FIMap, typename VIMap, typename HIMap>
|
||||||
struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL::face_index_t>
|
struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::face_index_t>
|
||||||
{
|
{
|
||||||
typedef typename CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>::FIM FIM;
|
typedef CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> FFG;
|
||||||
|
typedef typename FFG::FIM FIM;
|
||||||
|
|
||||||
typedef typename CGAL::Property_map_binder<FIM,
|
typedef typename CGAL::Property_map_binder<FIM,
|
||||||
typename CGAL::Pointer_property_map<
|
typename CGAL::Pointer_property_map<
|
||||||
typename boost::property_traits<FIM>::value_type>::type> type;
|
typename boost::property_traits<FIM>::value_type>::type> type;
|
||||||
|
|
@ -1319,20 +1325,21 @@ struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL:
|
||||||
template<typename Graph, typename FIMap, typename VIMap, typename HIMap>
|
template<typename Graph, typename FIMap, typename VIMap, typename HIMap>
|
||||||
struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::vertex_index_t>
|
struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::vertex_index_t>
|
||||||
{
|
{
|
||||||
typedef typename CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>::VIM VIM;
|
typedef CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> FFG;
|
||||||
|
typedef typename FFG::VIM VIM;
|
||||||
|
|
||||||
typedef typename CGAL::Property_map_binder<VIM,
|
typedef typename CGAL::Property_map_binder<VIM,
|
||||||
typename CGAL::Pointer_property_map<
|
typename CGAL::Pointer_property_map<
|
||||||
typename boost::property_traits<VIM>::value_type>::type> type;
|
typename boost::property_traits<VIM>::value_type>::type> type;
|
||||||
typedef type const_type;
|
typedef type const_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Graph,
|
template<typename Graph, typename FIMap, typename VIMap, typename HIMap>
|
||||||
typename FIMap,
|
struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::halfedge_index_t>
|
||||||
typename VIMap,
|
|
||||||
typename HIMap>
|
|
||||||
struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL::halfedge_index_t>
|
|
||||||
{
|
{
|
||||||
typedef typename CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>::HIM HIM;
|
typedef CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> FFG;
|
||||||
|
typedef typename FFG::HIM HIM;
|
||||||
|
|
||||||
typedef typename CGAL::Property_map_binder<HIM,
|
typedef typename CGAL::Property_map_binder<HIM,
|
||||||
typename CGAL::Pointer_property_map<
|
typename CGAL::Pointer_property_map<
|
||||||
typename boost::property_traits<HIM>::value_type>::type> type;
|
typename boost::property_traits<HIM>::value_type>::type> type;
|
||||||
|
|
@ -1341,4 +1348,52 @@ struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL:
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
|
namespace CGAL {
|
||||||
|
|
||||||
|
//specializations for indices
|
||||||
|
template <class Graph, typename FIMap, typename VIMap, typename HIMap>
|
||||||
|
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::face_index_t >::const_type
|
||||||
|
get(boost::face_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
|
||||||
|
{
|
||||||
|
return w.get_face_index_map();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Graph, typename FIMap, typename VIMap, typename HIMap>
|
||||||
|
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::vertex_index_t >::const_type
|
||||||
|
get(boost::vertex_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
|
||||||
|
{
|
||||||
|
return w.get_vertex_index_map();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Graph, typename FIMap, typename VIMap, typename HIMap>
|
||||||
|
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::halfedge_index_t >::const_type
|
||||||
|
get(boost::halfedge_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
|
||||||
|
{
|
||||||
|
return w.get_halfedge_index_map();
|
||||||
|
}
|
||||||
|
|
||||||
|
// non-const
|
||||||
|
template <class Graph, typename FIMap, typename VIMap, typename HIMap>
|
||||||
|
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::face_index_t >::type
|
||||||
|
get(boost::face_index_t, Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
|
||||||
|
{
|
||||||
|
return w.get_face_index_map();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Graph, typename FIMap, typename VIMap, typename HIMap>
|
||||||
|
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::vertex_index_t >::type
|
||||||
|
get(boost::vertex_index_t, Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
|
||||||
|
{
|
||||||
|
return w.get_vertex_index_map();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Graph, typename FIMap, typename VIMap, typename HIMap>
|
||||||
|
typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::halfedge_index_t >::type
|
||||||
|
get(boost::halfedge_index_t, Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
|
||||||
|
{
|
||||||
|
return w.get_halfedge_index_map();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_BOOST_GRAPH_FACE_FILTERED_GRAPH_H
|
#endif // CGAL_BOOST_GRAPH_FACE_FILTERED_GRAPH_H
|
||||||
|
|
|
||||||
|
|
@ -270,7 +270,7 @@ bool read_GOCAD(const std::string& fname, Graph& g,
|
||||||
/// \cgalParamNBegin{stream_precision}
|
/// \cgalParamNBegin{stream_precision}
|
||||||
/// \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
/// \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||||
/// \cgalParamType{int}
|
/// \cgalParamType{int}
|
||||||
/// \cgalParamDefault{`the precision of the stream `os``}
|
/// \cgalParamDefault{the precision of the stream `os`}
|
||||||
/// \cgalParamNEnd
|
/// \cgalParamNEnd
|
||||||
/// \cgalNamedParamsEnd
|
/// \cgalNamedParamsEnd
|
||||||
///
|
///
|
||||||
|
|
@ -378,7 +378,7 @@ bool write_GOCAD(std::ostream& os, const char* name, const Graph& g,
|
||||||
/// \cgalParamNBegin{stream_precision}
|
/// \cgalParamNBegin{stream_precision}
|
||||||
/// \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
/// \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||||
/// \cgalParamType{int}
|
/// \cgalParamType{int}
|
||||||
/// \cgalParamDefault{`the precision of the stream `os``}
|
/// \cgalParamDefault{the precision of the stream `os`}
|
||||||
/// \cgalParamNEnd
|
/// \cgalParamNEnd
|
||||||
/// \cgalNamedParamsEnd
|
/// \cgalNamedParamsEnd
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -230,7 +230,7 @@ bool read_OBJ(const std::string& fname, Graph& g,
|
||||||
\cgalParamNBegin{stream_precision}
|
\cgalParamNBegin{stream_precision}
|
||||||
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||||
\cgalParamType{int}
|
\cgalParamType{int}
|
||||||
\cgalParamDefault{`the precision of the stream `os``}
|
\cgalParamDefault{the precision of the stream `os`}
|
||||||
\cgalParamNEnd
|
\cgalParamNEnd
|
||||||
\cgalNamedParamsEnd
|
\cgalNamedParamsEnd
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -392,7 +392,7 @@ bool write_OFF_BGL(std::ostream& os,
|
||||||
\cgalParamNBegin{stream_precision}
|
\cgalParamNBegin{stream_precision}
|
||||||
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||||
\cgalParamType{int}
|
\cgalParamType{int}
|
||||||
\cgalParamDefault{`the precision of the stream `os``}
|
\cgalParamDefault{the precision of the stream `os`}
|
||||||
\cgalParamNEnd
|
\cgalParamNEnd
|
||||||
\cgalNamedParamsEnd
|
\cgalNamedParamsEnd
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ bool read_PLY(std::istream& is, Graph& g,
|
||||||
|
|
||||||
\cgalNamedParamsBegin
|
\cgalNamedParamsBegin
|
||||||
\cgalParamNBegin{use_binary_mode}
|
\cgalParamNBegin{use_binary_mode}
|
||||||
\cgalParamDescription{indicates whether data should be read in binary (`true`) or in ASCII (`false`)}
|
\cgalParamDescription{indicates whether data should be read in binary (`true`) or in \ascii (`false`)}
|
||||||
\cgalParamType{Boolean}
|
\cgalParamType{Boolean}
|
||||||
\cgalParamDefault{`true`}
|
\cgalParamDefault{`true`}
|
||||||
\cgalParamNEnd
|
\cgalParamNEnd
|
||||||
|
|
@ -310,8 +310,8 @@ bool read_PLY(const std::string& fname, Graph& g,
|
||||||
\cgalParamNBegin{stream_precision}
|
\cgalParamNBegin{stream_precision}
|
||||||
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||||
\cgalParamType{int}
|
\cgalParamType{int}
|
||||||
\cgalParamDefault{`the precision of the stream `os``}
|
\cgalParamDefault{the precision of the stream `os`}
|
||||||
\cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
|
\cgalParamExtra{This parameter is only meaningful while using \ascii encoding.}
|
||||||
\cgalParamNEnd
|
\cgalParamNEnd
|
||||||
\cgalNamedParamsEnd
|
\cgalNamedParamsEnd
|
||||||
|
|
||||||
|
|
@ -482,7 +482,7 @@ bool write_PLY(std::ostream& os, const Graph& g,
|
||||||
|
|
||||||
\cgalNamedParamsBegin
|
\cgalNamedParamsBegin
|
||||||
\cgalParamNBegin{use_binary_mode}
|
\cgalParamNBegin{use_binary_mode}
|
||||||
\cgalParamDescription{indicates whether data should be written in binary (`true`) or in ASCII (`false`)}
|
\cgalParamDescription{indicates whether data should be written in binary (`true`) or in \ascii (`false`)}
|
||||||
\cgalParamType{Boolean}
|
\cgalParamType{Boolean}
|
||||||
\cgalParamDefault{`true`}
|
\cgalParamDefault{`true`}
|
||||||
\cgalParamNEnd
|
\cgalParamNEnd
|
||||||
|
|
@ -521,7 +521,7 @@ bool write_PLY(std::ostream& os, const Graph& g,
|
||||||
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||||
\cgalParamType{int}
|
\cgalParamType{int}
|
||||||
\cgalParamDefault{`6`}
|
\cgalParamDefault{`6`}
|
||||||
\cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
|
\cgalParamExtra{This parameter is only meaningful while using \ascii encoding.}
|
||||||
\cgalParamNEnd
|
\cgalParamNEnd
|
||||||
\cgalNamedParamsEnd
|
\cgalNamedParamsEnd
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ bool read_STL(std::istream& is,
|
||||||
|
|
||||||
\cgalNamedParamsBegin
|
\cgalNamedParamsBegin
|
||||||
\cgalParamNBegin{use_binary_mode}
|
\cgalParamNBegin{use_binary_mode}
|
||||||
\cgalParamDescription{indicates whether data should be read in binary (`true`) or in ASCII (`false`)}
|
\cgalParamDescription{indicates whether data should be read in binary (`true`) or in \ascii (`false`)}
|
||||||
\cgalParamType{Boolean}
|
\cgalParamType{Boolean}
|
||||||
\cgalParamDefault{`true`}
|
\cgalParamDefault{`true`}
|
||||||
\cgalParamNEnd
|
\cgalParamNEnd
|
||||||
|
|
@ -230,8 +230,8 @@ bool read_STL(const std::string& fname, Graph& g) { return read_STL(fname, g, pa
|
||||||
\cgalParamNBegin{stream_precision}
|
\cgalParamNBegin{stream_precision}
|
||||||
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||||
\cgalParamType{int}
|
\cgalParamType{int}
|
||||||
\cgalParamDefault{`the precision of the stream `os``}
|
\cgalParamDefault{the precision of the stream `os`}
|
||||||
\cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
|
\cgalParamExtra{This parameter is only meaningful while using \ascii encoding.}
|
||||||
\cgalParamNEnd
|
\cgalParamNEnd
|
||||||
\cgalNamedParamsEnd
|
\cgalNamedParamsEnd
|
||||||
|
|
||||||
|
|
@ -328,7 +328,7 @@ bool write_STL(std::ostream& os,
|
||||||
|
|
||||||
\cgalNamedParamsBegin
|
\cgalNamedParamsBegin
|
||||||
\cgalParamNBegin{use_binary_mode}
|
\cgalParamNBegin{use_binary_mode}
|
||||||
\cgalParamDescription{indicates whether data should be written in binary (`true`) or in ASCII (`false`)}
|
\cgalParamDescription{indicates whether data should be written in binary (`true`) or in \ascii (`false`)}
|
||||||
\cgalParamType{Boolean}
|
\cgalParamType{Boolean}
|
||||||
\cgalParamDefault{`true`}
|
\cgalParamDefault{`true`}
|
||||||
\cgalParamNEnd
|
\cgalParamNEnd
|
||||||
|
|
@ -346,7 +346,7 @@ bool write_STL(std::ostream& os,
|
||||||
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||||
\cgalParamType{int}
|
\cgalParamType{int}
|
||||||
\cgalParamDefault{`6`}
|
\cgalParamDefault{`6`}
|
||||||
\cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
|
\cgalParamExtra{This parameter is only meaningful while using \ascii encoding.}
|
||||||
\cgalParamNEnd
|
\cgalParamNEnd
|
||||||
\cgalNamedParamsEnd
|
\cgalNamedParamsEnd
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -393,7 +393,7 @@ void write_polys_points(std::ostream& os,
|
||||||
*
|
*
|
||||||
* \cgalNamedParamsBegin
|
* \cgalNamedParamsBegin
|
||||||
* \cgalParamNBegin{use_binary_mode}
|
* \cgalParamNBegin{use_binary_mode}
|
||||||
* \cgalParamDescription{indicates whether data should be written in binary (`true`) or in ASCII (`false`)}
|
* \cgalParamDescription{indicates whether data should be written in binary (`true`) or in \ascii (`false`)}
|
||||||
* \cgalParamType{Boolean}
|
* \cgalParamType{Boolean}
|
||||||
* \cgalParamDefault{`true`}
|
* \cgalParamDefault{`true`}
|
||||||
* \cgalParamNEnd
|
* \cgalParamNEnd
|
||||||
|
|
@ -417,7 +417,7 @@ void write_polys_points(std::ostream& os,
|
||||||
* \cgalParamNBegin{stream_precision}
|
* \cgalParamNBegin{stream_precision}
|
||||||
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||||
* \cgalParamType{int}
|
* \cgalParamType{int}
|
||||||
* \cgalParamDefault{`the precision of the stream `os``}
|
* \cgalParamDefault{the precision of the stream `os`}
|
||||||
* \cgalParamNEnd
|
* \cgalParamNEnd
|
||||||
* \cgalNamedParamsEnd
|
* \cgalNamedParamsEnd
|
||||||
*
|
*
|
||||||
|
|
@ -492,7 +492,7 @@ bool write_VTP(std::ostream& os,
|
||||||
*
|
*
|
||||||
* \cgalNamedParamsBegin
|
* \cgalNamedParamsBegin
|
||||||
* \cgalParamNBegin{use_binary_mode}
|
* \cgalParamNBegin{use_binary_mode}
|
||||||
* \cgalParamDescription{indicates whether data should be written in binary (`true`) or in ASCII (`false`)}
|
* \cgalParamDescription{indicates whether data should be written in binary (`true`) or in \ascii (`false`)}
|
||||||
* \cgalParamType{Boolean}
|
* \cgalParamType{Boolean}
|
||||||
* \cgalParamDefault{`true`}
|
* \cgalParamDefault{`true`}
|
||||||
* \cgalParamNEnd
|
* \cgalParamNEnd
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ namespace IO {
|
||||||
\cgalParamNBegin{stream_precision}
|
\cgalParamNBegin{stream_precision}
|
||||||
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||||
\cgalParamType{int}
|
\cgalParamType{int}
|
||||||
\cgalParamDefault{`the precision of the stream `os``}
|
\cgalParamDefault{the precision of the stream `os`}
|
||||||
\cgalParamNEnd
|
\cgalParamNEnd
|
||||||
\cgalNamedParamsEnd
|
\cgalNamedParamsEnd
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ bool read_polygon_mesh(const std::string& fname, Graph& g)
|
||||||
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||||
* \cgalParamType{int}
|
* \cgalParamType{int}
|
||||||
* \cgalParamDefault{`6`}
|
* \cgalParamDefault{`6`}
|
||||||
* \cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
|
* \cgalParamExtra{This parameter is only meaningful while using \ascii encoding.}
|
||||||
* \cgalParamNEnd
|
* \cgalParamNEnd
|
||||||
*
|
*
|
||||||
* \cgalParamNBegin{verbose}
|
* \cgalParamNBegin{verbose}
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,7 @@
|
||||||
|
|
||||||
#include <boost/graph/adjacency_list.hpp>
|
#include <boost/graph/adjacency_list.hpp>
|
||||||
#include <boost/graph/compressed_sparse_row_graph.hpp>
|
#include <boost/graph/compressed_sparse_row_graph.hpp>
|
||||||
|
|
||||||
#if BOOST_VERSION >= 104400 // at this version kolmogorov_max_flow become depricated.
|
|
||||||
#include <boost/graph/boykov_kolmogorov_max_flow.hpp>
|
#include <boost/graph/boykov_kolmogorov_max_flow.hpp>
|
||||||
#else
|
|
||||||
# include <boost/graph/kolmogorov_max_flow.hpp>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
@ -242,12 +237,8 @@ public:
|
||||||
|
|
||||||
double max_flow()
|
double max_flow()
|
||||||
{
|
{
|
||||||
#if BOOST_VERSION >= 104400
|
|
||||||
return boost::boykov_kolmogorov_max_flow(graph, cluster_source,
|
return boost::boykov_kolmogorov_max_flow(graph, cluster_source,
|
||||||
cluster_sink);
|
cluster_sink);
|
||||||
#else
|
|
||||||
return boost::kolmogorov_max_flow(graph, cluster_source, cluster_sink);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename VertexLabelMap, typename InputVertexDescriptor>
|
template <typename VertexLabelMap, typename InputVertexDescriptor>
|
||||||
|
|
@ -352,13 +343,8 @@ public:
|
||||||
|
|
||||||
void init_vertices()
|
void init_vertices()
|
||||||
{
|
{
|
||||||
#if BOOST_VERSION >= 104000
|
|
||||||
graph = Graph(boost::edges_are_unsorted, edge_map.begin(), edge_map.end(),
|
graph = Graph(boost::edges_are_unsorted, edge_map.begin(), edge_map.end(),
|
||||||
edge_map_weights.begin(), nb_vertices);
|
edge_map_weights.begin(), nb_vertices);
|
||||||
#else
|
|
||||||
graph= Graph(edge_map.begin(), edge_map.end(),
|
|
||||||
edge_map_weights.begin(), nb_vertices);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// PERFORMANCE PROBLEM
|
// PERFORMANCE PROBLEM
|
||||||
// need to set reverse edge map, I guess there is no way to do that before creating the graph
|
// need to set reverse edge map, I guess there is no way to do that before creating the graph
|
||||||
|
|
@ -379,7 +365,6 @@ public:
|
||||||
|
|
||||||
double max_flow()
|
double max_flow()
|
||||||
{
|
{
|
||||||
#if BOOST_VERSION >= 104400
|
|
||||||
// since properties are bundled, defaults does not work need to specify them
|
// since properties are bundled, defaults does not work need to specify them
|
||||||
return boost::boykov_kolmogorov_max_flow
|
return boost::boykov_kolmogorov_max_flow
|
||||||
(graph,
|
(graph,
|
||||||
|
|
@ -392,19 +377,6 @@ public:
|
||||||
boost::get(boost::vertex_index,
|
boost::get(boost::vertex_index,
|
||||||
graph), // this is not bundled, get it from graph (CRS provides one)
|
graph), // this is not bundled, get it from graph (CRS provides one)
|
||||||
0, 1);
|
0, 1);
|
||||||
#else
|
|
||||||
return boost::kolmogorov_max_flow
|
|
||||||
(graph,
|
|
||||||
boost::get(&EdgeP::edge_capacity, graph),
|
|
||||||
boost::get(&EdgeP::edge_residual_capacity, graph),
|
|
||||||
boost::get(&EdgeP::edge_reverse, graph),
|
|
||||||
boost::get(&VertexP::vertex_predecessor, graph),
|
|
||||||
boost::get(&VertexP::vertex_color, graph),
|
|
||||||
boost::get(&VertexP::vertex_distance_t, graph),
|
|
||||||
boost::get(boost::vertex_index,
|
|
||||||
graph), // this is not bundled, get it from graph
|
|
||||||
0, 1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename VertexLabelMap, typename InputVertexDescriptor>
|
template <typename VertexLabelMap, typename InputVertexDescriptor>
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,9 @@ CGAL_add_named_parameter(use_angle_smoothing_t, use_angle_smoothing, use_angle_s
|
||||||
CGAL_add_named_parameter(use_area_smoothing_t, use_area_smoothing, use_area_smoothing)
|
CGAL_add_named_parameter(use_area_smoothing_t, use_area_smoothing, use_area_smoothing)
|
||||||
CGAL_add_named_parameter(use_Delaunay_flips_t, use_Delaunay_flips, use_Delaunay_flips)
|
CGAL_add_named_parameter(use_Delaunay_flips_t, use_Delaunay_flips, use_Delaunay_flips)
|
||||||
CGAL_add_named_parameter(do_project_t, do_project, do_project)
|
CGAL_add_named_parameter(do_project_t, do_project, do_project)
|
||||||
|
CGAL_add_named_parameter(do_split_t, do_split, do_split)
|
||||||
|
CGAL_add_named_parameter(do_collapse_t, do_collapse, do_collapse)
|
||||||
|
CGAL_add_named_parameter(do_flip_t, do_flip, do_flip)
|
||||||
CGAL_add_named_parameter(do_orientation_tests_t, do_orientation_tests, do_orientation_tests)
|
CGAL_add_named_parameter(do_orientation_tests_t, do_orientation_tests, do_orientation_tests)
|
||||||
CGAL_add_named_parameter(do_self_intersection_tests_t, do_self_intersection_tests, do_self_intersection_tests)
|
CGAL_add_named_parameter(do_self_intersection_tests_t, do_self_intersection_tests, do_self_intersection_tests)
|
||||||
CGAL_add_named_parameter(error_codes_t, error_codes, error_codes)
|
CGAL_add_named_parameter(error_codes_t, error_codes, error_codes)
|
||||||
|
|
@ -121,7 +124,10 @@ CGAL_add_named_parameter(do_not_modify_t, do_not_modify, do_not_modify)
|
||||||
CGAL_add_named_parameter(allow_self_intersections_t, allow_self_intersections, allow_self_intersections)
|
CGAL_add_named_parameter(allow_self_intersections_t, allow_self_intersections, allow_self_intersections)
|
||||||
CGAL_add_named_parameter(non_manifold_feature_map_t, non_manifold_feature_map, non_manifold_feature_map)
|
CGAL_add_named_parameter(non_manifold_feature_map_t, non_manifold_feature_map, non_manifold_feature_map)
|
||||||
CGAL_add_named_parameter(polyhedral_envelope_epsilon_t, polyhedral_envelope_epsilon, polyhedral_envelope_epsilon)
|
CGAL_add_named_parameter(polyhedral_envelope_epsilon_t, polyhedral_envelope_epsilon, polyhedral_envelope_epsilon)
|
||||||
|
CGAL_add_named_parameter(match_faces_t, match_faces, match_faces)
|
||||||
CGAL_add_named_parameter(face_epsilon_map_t, face_epsilon_map, face_epsilon_map)
|
CGAL_add_named_parameter(face_epsilon_map_t, face_epsilon_map, face_epsilon_map)
|
||||||
|
CGAL_add_named_parameter(maximum_number_t, maximum_number, maximum_number)
|
||||||
|
CGAL_add_named_parameter(use_one_sided_hausdorff_t, use_one_sided_hausdorff, use_one_sided_hausdorff)
|
||||||
|
|
||||||
// List of named parameters that we use in the package 'Surface Mesh Simplification'
|
// List of named parameters that we use in the package 'Surface Mesh Simplification'
|
||||||
CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost)
|
CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost)
|
||||||
|
|
@ -174,6 +180,7 @@ CGAL_add_named_parameter(pointmatcher_config_t, pointmatcher_config, pointmatche
|
||||||
CGAL_add_named_parameter(adjacencies_t, adjacencies, adjacencies)
|
CGAL_add_named_parameter(adjacencies_t, adjacencies, adjacencies)
|
||||||
CGAL_add_named_parameter(scan_angle_t, scan_angle_map, scan_angle_map)
|
CGAL_add_named_parameter(scan_angle_t, scan_angle_map, scan_angle_map)
|
||||||
CGAL_add_named_parameter(scanline_id_t, scanline_id_map, scanline_id_map)
|
CGAL_add_named_parameter(scanline_id_t, scanline_id_map, scanline_id_map)
|
||||||
|
CGAL_add_named_parameter(scalar_t, scalar_map, scalar_map)
|
||||||
|
|
||||||
// List of named parameters used in Surface_mesh_approximation package
|
// List of named parameters used in Surface_mesh_approximation package
|
||||||
CGAL_add_named_parameter(verbose_level_t, verbose_level, verbose_level)
|
CGAL_add_named_parameter(verbose_level_t, verbose_level, verbose_level)
|
||||||
|
|
@ -209,3 +216,16 @@ CGAL_add_named_parameter(accuracy_t, accuracy, accuracy)
|
||||||
CGAL_add_named_parameter(maximum_running_time_t, maximum_running_time, maximum_running_time)
|
CGAL_add_named_parameter(maximum_running_time_t, maximum_running_time, maximum_running_time)
|
||||||
CGAL_add_named_parameter(overlap_t, overlap, overlap)
|
CGAL_add_named_parameter(overlap_t, overlap, overlap)
|
||||||
CGAL_add_named_parameter(maximum_normal_deviation_t, maximum_normal_deviation, maximum_normal_deviation)
|
CGAL_add_named_parameter(maximum_normal_deviation_t, maximum_normal_deviation, maximum_normal_deviation)
|
||||||
|
|
||||||
|
// List of named parameters used in Shape_regularization package
|
||||||
|
CGAL_add_named_parameter(minimum_length_t, minimum_length, minimum_length)
|
||||||
|
CGAL_add_named_parameter(maximum_angle_t, maximum_angle, maximum_angle)
|
||||||
|
CGAL_add_named_parameter(maximum_offset_t, maximum_offset, maximum_offset)
|
||||||
|
CGAL_add_named_parameter(regularize_parallelism_t, regularize_parallelism, regularize_parallelism)
|
||||||
|
CGAL_add_named_parameter(regularize_orthogonality_t, regularize_orthogonality, regularize_orthogonality)
|
||||||
|
CGAL_add_named_parameter(regularize_coplanarity_t, regularize_coplanarity, regularize_coplanarity)
|
||||||
|
CGAL_add_named_parameter(regularize_axis_symmetry_t, regularize_axis_symmetry, regularize_axis_symmetry)
|
||||||
|
CGAL_add_named_parameter(symmetry_direction_t, symmetry_direction, symmetry_direction)
|
||||||
|
CGAL_add_named_parameter(preserve_order_t, preserve_order, preserve_order)
|
||||||
|
CGAL_add_named_parameter(adjust_directions_t, adjust_directions, adjust_directions)
|
||||||
|
CGAL_add_named_parameter(segment_t, segment_map, segment_map)
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include <boost/parameter/name.hpp>
|
#include <boost/parameter/name.hpp>
|
||||||
|
|
||||||
#if defined(__clang__) || (BOOST_GCC >= 40600)
|
#if defined(__clang__) || defined(BOOST_GCC)
|
||||||
# define CGAL_IGNORE_UNUSED_VARIABLES \
|
# define CGAL_IGNORE_UNUSED_VARIABLES \
|
||||||
_Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
|
_Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
|
||||||
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")
|
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ property uchar green
|
||||||
property uchar blue
|
property uchar blue
|
||||||
property int label
|
property int label
|
||||||
element edge 6
|
element edge 6
|
||||||
property int v0
|
property int vertex1
|
||||||
property int v1
|
property int vertex2
|
||||||
property float confidence
|
property float confidence
|
||||||
end_header
|
end_header
|
||||||
0 0 0 -0.5 -0.5 -0.5 255 255 0 0
|
0 0 0 -0.5 -0.5 -0.5 255 255 0 0
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ property uchar green
|
||||||
property uchar blue
|
property uchar blue
|
||||||
property int label
|
property int label
|
||||||
element edge 6
|
element edge 6
|
||||||
property int v0
|
property int vertex1
|
||||||
property int v1
|
property int vertex2
|
||||||
property float confidence
|
property float confidence
|
||||||
end_header
|
end_header
|
||||||
0 0 0 -0.5 -0.5 -0.5 255 255 0 0
|
0 0 0 -0.5 -0.5 -0.5 255 255 0 0
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ property uchar green
|
||||||
property uchar blue
|
property uchar blue
|
||||||
property int label
|
property int label
|
||||||
element edge 6
|
element edge 6
|
||||||
property int v0
|
property int vertex1
|
||||||
property int v1
|
property int vertex2
|
||||||
property float confidence
|
property float confidence
|
||||||
end_header
|
end_header
|
||||||
0 0 0 -0.5 -0.5 -0.5 0
|
0 0 0 -0.5 -0.5 -0.5 0
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,23 @@
|
||||||
#include <CGAL/boost/graph/Face_filtered_graph.h>
|
|
||||||
#include <CGAL/Polygon_mesh_processing/connected_components.h>
|
|
||||||
#include <CGAL/boost/graph/copy_face_graph.h>
|
#include <CGAL/boost/graph/copy_face_graph.h>
|
||||||
|
#include <CGAL/boost/graph/Face_filtered_graph.h>
|
||||||
|
#include <CGAL/boost/graph/named_params_helper.h>
|
||||||
|
#include <CGAL/Polygon_mesh_processing/connected_components.h>
|
||||||
|
#include <CGAL/use.h>
|
||||||
#include "test_Prefix.h"
|
#include "test_Prefix.h"
|
||||||
|
|
||||||
#include <boost/numeric/conversion/cast.hpp>
|
#include <boost/numeric/conversion/cast.hpp>
|
||||||
#include <boost/unordered_set.hpp>
|
#include <boost/unordered_set.hpp>
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
#include <CGAL/use.h>
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
typedef boost::unordered_set<std::size_t> id_map;
|
typedef boost::unordered_set<std::size_t> id_map;
|
||||||
|
|
||||||
|
namespace PMP = CGAL::Polygon_mesh_processing;
|
||||||
|
|
||||||
template <typename Graph>
|
template <typename Graph>
|
||||||
void test_halfedge_around_vertex_iterator(const Graph& g)
|
void test_halfedge_around_vertex_iterator(const Graph& g)
|
||||||
{
|
{
|
||||||
|
|
@ -17,8 +25,7 @@ void test_halfedge_around_vertex_iterator(const Graph& g)
|
||||||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||||
boost::unordered_map<g_face_descriptor, std::size_t> map(num_faces(g));
|
boost::unordered_map<g_face_descriptor, std::size_t> map(num_faces(g));
|
||||||
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
|
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||||
|
|
||||||
|
|
||||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||||
typename boost::graph_traits<Adapter >::vertex_iterator vit, vend;
|
typename boost::graph_traits<Adapter >::vertex_iterator vit, vend;
|
||||||
|
|
@ -45,8 +52,9 @@ void test_halfedge_around_face_iterator(const Graph& g)
|
||||||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||||
std::map<g_face_descriptor, std::size_t> map;
|
std::map<g_face_descriptor, std::size_t> map;
|
||||||
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
|
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||||
|
|
||||||
face_iterator fit, fend;
|
face_iterator fit, fend;
|
||||||
for(boost::tie(fit, fend) = faces(fg); fit != fend; ++fit) {
|
for(boost::tie(fit, fend) = faces(fg); fit != fend; ++fit) {
|
||||||
halfedge_around_face_iterator hafit, hafend;
|
halfedge_around_face_iterator hafit, hafend;
|
||||||
|
|
@ -65,7 +73,7 @@ void test_edge_iterators(const Graph& g)
|
||||||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||||
std::map<g_face_descriptor, std::size_t> map;
|
std::map<g_face_descriptor, std::size_t> map;
|
||||||
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
|
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||||
|
|
||||||
// do we iterate as many as that?
|
// do we iterate as many as that?
|
||||||
|
|
@ -91,7 +99,7 @@ void test_vertex_iterators(Graph& g)
|
||||||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||||
std::map<g_face_descriptor, std::size_t> map;
|
std::map<g_face_descriptor, std::size_t> map;
|
||||||
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
|
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||||
vertex_iterator vb, ve;
|
vertex_iterator vb, ve;
|
||||||
std::size_t count = 0;
|
std::size_t count = 0;
|
||||||
|
|
@ -121,7 +129,7 @@ void test_out_edges(const Graph& g)
|
||||||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||||
std::map<g_face_descriptor, std::size_t> map;
|
std::map<g_face_descriptor, std::size_t> map;
|
||||||
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
|
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||||
|
|
||||||
vertex_iterator vb, ve;
|
vertex_iterator vb, ve;
|
||||||
|
|
@ -150,7 +158,7 @@ void test_in_edges(const Graph& g)
|
||||||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||||
std::map<g_face_descriptor, std::size_t> map;
|
std::map<g_face_descriptor, std::size_t> map;
|
||||||
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
|
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||||
|
|
||||||
vertex_iterator vb, ve;
|
vertex_iterator vb, ve;
|
||||||
|
|
@ -177,7 +185,7 @@ void test_in_out_edges(const Graph& g)
|
||||||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||||
std::map<g_face_descriptor, std::size_t> map;
|
std::map<g_face_descriptor, std::size_t> map;
|
||||||
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
|
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||||
|
|
||||||
// check that the sets of in out edges are the same
|
// check that the sets of in out edges are the same
|
||||||
|
|
@ -219,7 +227,7 @@ void test_edge_find(const Graph& g)
|
||||||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||||
std::map<g_face_descriptor, std::size_t> map;
|
std::map<g_face_descriptor, std::size_t> map;
|
||||||
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
|
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||||
typedef std::pair<edge_descriptor, bool> ret;
|
typedef std::pair<edge_descriptor, bool> ret;
|
||||||
|
|
||||||
|
|
@ -243,7 +251,7 @@ void test_faces(const Graph& g)
|
||||||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||||
std::map<g_face_descriptor, std::size_t> map;
|
std::map<g_face_descriptor, std::size_t> map;
|
||||||
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
|
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||||
|
|
||||||
unsigned int count = 0;
|
unsigned int count = 0;
|
||||||
|
|
@ -262,6 +270,53 @@ void test_faces(const Graph& g)
|
||||||
assert(count == num_faces(fg));
|
assert(count == num_faces(fg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename Graph>
|
||||||
|
void test_index_property_maps(const Graph& g)
|
||||||
|
{
|
||||||
|
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||||
|
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||||
|
|
||||||
|
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
|
||||||
|
std::map<g_face_descriptor, std::size_t> map;
|
||||||
|
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||||
|
Adapter fg(g, -1, boost::make_assoc_property_map(map));
|
||||||
|
assert(is_empty(fg));
|
||||||
|
|
||||||
|
// Non const
|
||||||
|
typedef typename CGAL::GetInitializedVertexIndexMap<Adapter>::type VIMap;
|
||||||
|
VIMap vim = CGAL::get_initialized_vertex_index_map(fg);
|
||||||
|
assert(CGAL::BGL::internal::is_index_map_valid(vim, num_vertices(fg), vertices(fg)));
|
||||||
|
|
||||||
|
typedef typename CGAL::GetInitializedHalfedgeIndexMap<Adapter>::type HIMap;
|
||||||
|
HIMap him = CGAL::get_initialized_halfedge_index_map(fg);
|
||||||
|
assert(CGAL::BGL::internal::is_index_map_valid(him, num_halfedges(fg), halfedges(fg)));
|
||||||
|
|
||||||
|
typedef typename CGAL::GetInitializedFaceIndexMap<Adapter>::type FIMap;
|
||||||
|
FIMap fim = CGAL::get_initialized_face_index_map(fg);
|
||||||
|
assert(CGAL::BGL::internal::is_index_map_valid(fim, num_faces(fg), faces(fg)));
|
||||||
|
|
||||||
|
fg.set_selected_faces(0, boost::make_assoc_property_map(map));
|
||||||
|
assert(!is_empty(fg));
|
||||||
|
|
||||||
|
assert(CGAL::BGL::internal::is_index_map_valid(vim, num_vertices(fg), vertices(fg)));
|
||||||
|
assert(CGAL::BGL::internal::is_index_map_valid(him, num_halfedges(fg), halfedges(fg)));
|
||||||
|
assert(CGAL::BGL::internal::is_index_map_valid(fim, num_faces(fg), faces(fg)));
|
||||||
|
|
||||||
|
// Const
|
||||||
|
const Adapter cfg(g, 0, boost::make_assoc_property_map(map));
|
||||||
|
typedef typename CGAL::GetInitializedVertexIndexMap<Adapter>::const_type CVIMap;
|
||||||
|
CVIMap cvim = CGAL::get_initialized_vertex_index_map(cfg);
|
||||||
|
assert(CGAL::BGL::internal::is_index_map_valid(cvim, num_vertices(cfg), vertices(cfg)));
|
||||||
|
|
||||||
|
typedef typename CGAL::GetInitializedHalfedgeIndexMap<Adapter>::const_type CHIMap;
|
||||||
|
CHIMap chim = CGAL::get_initialized_halfedge_index_map(cfg);
|
||||||
|
assert(CGAL::BGL::internal::is_index_map_valid(chim, num_halfedges(cfg), halfedges(cfg)));
|
||||||
|
|
||||||
|
typedef typename CGAL::GetInitializedFaceIndexMap<Adapter>::const_type CFIMap;
|
||||||
|
CFIMap cfim = CGAL::get_initialized_face_index_map(cfg);
|
||||||
|
assert(CGAL::BGL::internal::is_index_map_valid(cfim, num_faces(cfg), faces(cfg)));
|
||||||
|
}
|
||||||
|
|
||||||
template<typename Graph>
|
template<typename Graph>
|
||||||
void test_read(const Graph& g)
|
void test_read(const Graph& g)
|
||||||
{
|
{
|
||||||
|
|
@ -270,7 +325,7 @@ void test_read(const Graph& g)
|
||||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||||
|
|
||||||
std::map<g_face_descriptor, std::size_t> map;
|
std::map<g_face_descriptor, std::size_t> map;
|
||||||
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
|
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||||
assert(fg.is_selection_valid());
|
assert(fg.is_selection_valid());
|
||||||
assert(CGAL::is_valid_polygon_mesh(fg));
|
assert(CGAL::is_valid_polygon_mesh(fg));
|
||||||
|
|
@ -292,6 +347,7 @@ test_graph_range(const std::vector<Graph>& graphs)
|
||||||
test_edge_iterators(p);
|
test_edge_iterators(p);
|
||||||
test_halfedge_around_face_iterator(p);
|
test_halfedge_around_face_iterator(p);
|
||||||
test_halfedge_around_vertex_iterator(p);
|
test_halfedge_around_vertex_iterator(p);
|
||||||
|
test_index_property_maps(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -356,7 +412,6 @@ struct Constraint : public boost::put_get_helper<bool,Constraint<Mesh, VertexPoi
|
||||||
template<class Mesh, class FCCMAP, class Adapter>
|
template<class Mesh, class FCCMAP, class Adapter>
|
||||||
void test_mesh(Adapter fga)
|
void test_mesh(Adapter fga)
|
||||||
{
|
{
|
||||||
|
|
||||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||||
//check that there is the right number of simplices in fga
|
//check that there is the right number of simplices in fga
|
||||||
CGAL_assertion(CGAL::is_valid_polygon_mesh(fga));
|
CGAL_assertion(CGAL::is_valid_polygon_mesh(fga));
|
||||||
|
|
@ -367,24 +422,16 @@ void test_mesh(Adapter fga)
|
||||||
halfedge_descriptor h = halfedge(*faces(fga).first, fga);
|
halfedge_descriptor h = halfedge(*faces(fga).first, fga);
|
||||||
CGAL_assertion_code( vertex_descriptor v = source(h, fga));
|
CGAL_assertion_code( vertex_descriptor v = source(h, fga));
|
||||||
//check that next() works inside the patch
|
//check that next() works inside the patch
|
||||||
CGAL_assertion(
|
CGAL_assertion(next(next(next(h, fga), fga), fga) == h);
|
||||||
next(next(next(h, fga), fga), fga) == h
|
|
||||||
);
|
|
||||||
//check that next() works on bordure of the patch
|
//check that next() works on bordure of the patch
|
||||||
h = opposite(h, fga);
|
h = opposite(h, fga);
|
||||||
CGAL_assertion(
|
CGAL_assertion(next(next(next(next(h, fga), fga), fga), fga) == h);
|
||||||
next(next(next(next(h, fga), fga), fga), fga) == h
|
|
||||||
);
|
|
||||||
//check that prev() works inside the patch
|
//check that prev() works inside the patch
|
||||||
h = halfedge(*faces(fga).first, fga);
|
h = halfedge(*faces(fga).first, fga);
|
||||||
CGAL_assertion(
|
CGAL_assertion(prev(prev(prev(h, fga), fga), fga) == h);
|
||||||
prev(prev(prev(h, fga), fga), fga) == h
|
|
||||||
);
|
|
||||||
//check that prev() works on bordure of the patch
|
//check that prev() works on bordure of the patch
|
||||||
h = opposite(h, fga);
|
h = opposite(h, fga);
|
||||||
CGAL_assertion(
|
CGAL_assertion(prev(prev(prev(prev(h, fga), fga), fga), fga) == h);
|
||||||
prev(prev(prev(prev(h, fga), fga), fga), fga) == h
|
|
||||||
);
|
|
||||||
//check degree
|
//check degree
|
||||||
CGAL_assertion(degree(v, fga) == 3);
|
CGAL_assertion(degree(v, fga) == 3);
|
||||||
//check in_edges and out_edges
|
//check in_edges and out_edges
|
||||||
|
|
@ -454,7 +501,7 @@ int main()
|
||||||
{
|
{
|
||||||
test_graph_range(poly_data());
|
test_graph_range(poly_data());
|
||||||
|
|
||||||
#if defined(CGAL_USE_SURFACE_MESH)
|
#ifdef CGAL_USE_SURFACE_MESH
|
||||||
test_graph_range(sm_data());
|
test_graph_range(sm_data());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -468,60 +515,43 @@ int main()
|
||||||
typedef CGAL::Face_filtered_graph<SM> SM_Adapter;
|
typedef CGAL::Face_filtered_graph<SM> SM_Adapter;
|
||||||
typedef SM::Property_map<boost::graph_traits<SM>::face_descriptor , std::size_t> SM_FCCMap;
|
typedef SM::Property_map<boost::graph_traits<SM>::face_descriptor , std::size_t> SM_FCCMap;
|
||||||
auto sm = std::make_unique<SM>();
|
auto sm = std::make_unique<SM>();
|
||||||
CGAL::make_tetrahedron(
|
CGAL::make_tetrahedron(Point_3(1,1,1), Point_3(0,0,0), Point_3(0,0,1), Point_3(1,0,1), *sm);
|
||||||
Point_3(1,1,1),
|
|
||||||
Point_3(0,0,0),
|
SM_FCCMap fccmap = sm->add_property_map<boost::graph_traits<SM>::face_descriptor, std::size_t>("f:CC").first;
|
||||||
Point_3(0,0,1),
|
SM::Property_map<boost::graph_traits<SM>::vertex_descriptor, SM::Point> positions = sm->points();
|
||||||
Point_3(1,0,1),
|
CGAL::Polygon_mesh_processing::connected_components(
|
||||||
*sm);
|
*sm, fccmap, CGAL::parameters::edge_is_constrained_map(Constraint<SM, SM::Property_map<boost::graph_traits<SM>::vertex_descriptor,
|
||||||
SM_FCCMap fccmap =
|
|
||||||
sm->add_property_map<boost::graph_traits<SM>::face_descriptor, std::size_t>("f:CC").first;
|
|
||||||
SM::Property_map<boost::graph_traits<SM>::vertex_descriptor, SM::Point> positions =
|
|
||||||
sm->points();
|
|
||||||
CGAL::Polygon_mesh_processing::connected_components(*sm, fccmap, CGAL::Polygon_mesh_processing::parameters::
|
|
||||||
edge_is_constrained_map(Constraint<SM, SM::Property_map<boost::graph_traits<SM>::vertex_descriptor,
|
|
||||||
SM::Point> >(*sm, positions)));
|
SM::Point> >(*sm, positions)));
|
||||||
|
|
||||||
boost::unordered_set<long unsigned int> pids;
|
boost::unordered_set<long unsigned int> pids;
|
||||||
pids.insert(0);
|
pids.insert(0);
|
||||||
pids.insert(2);
|
pids.insert(2);
|
||||||
SM_Adapter sm_adapter(*sm, pids, fccmap);
|
SM_Adapter sm_adapter(*sm, pids, fccmap);
|
||||||
test_mesh<SM,SM_FCCMap, SM_Adapter>(sm_adapter);
|
test_mesh<SM,SM_FCCMap, SM_Adapter>(sm_adapter);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef boost::graph_traits<Polyhedron> PolyTraits;
|
typedef boost::graph_traits<Polyhedron> PolyTraits;
|
||||||
typedef boost::property_map<Polyhedron, boost::vertex_point_t>::const_type VPMap;
|
typedef boost::property_map<Polyhedron, boost::vertex_point_t>::const_type VPMap;
|
||||||
typedef PolyTraits::face_descriptor poly_face_descriptor;
|
typedef PolyTraits::face_descriptor poly_face_descriptor;
|
||||||
typedef boost::associative_property_map< std::map<poly_face_descriptor,
|
typedef boost::associative_property_map<std::map<poly_face_descriptor, PolyTraits::faces_size_type> > FCMap;
|
||||||
PolyTraits::faces_size_type> > FCMap;
|
|
||||||
typedef boost::property_map<Polyhedron, CGAL::face_external_index_t>::const_type FIMap;
|
typedef boost::property_map<Polyhedron, CGAL::face_external_index_t>::const_type FIMap;
|
||||||
typedef boost::property_map<Polyhedron, CGAL::vertex_external_index_t>::const_type VIMap;
|
typedef boost::property_map<Polyhedron, CGAL::vertex_external_index_t>::const_type VIMap;
|
||||||
typedef boost::property_map<Polyhedron, CGAL::halfedge_external_index_t>::const_type HIMap;
|
typedef boost::property_map<Polyhedron, CGAL::halfedge_external_index_t>::const_type HIMap;
|
||||||
typedef CGAL::Face_filtered_graph<Polyhedron, FIMap, VIMap, HIMap> Poly_Adapter;
|
typedef CGAL::Face_filtered_graph<Polyhedron, FIMap, VIMap, HIMap> Poly_Adapter;
|
||||||
auto poly = std::make_unique<Polyhedron>();
|
|
||||||
CGAL::make_tetrahedron(
|
|
||||||
Point_3(1,1,1),
|
|
||||||
Point_3(0,0,0),
|
|
||||||
Point_3(0,0,1),
|
|
||||||
Point_3(1,0,1),
|
|
||||||
*poly);
|
|
||||||
|
|
||||||
|
auto poly = std::make_unique<Polyhedron>();
|
||||||
|
CGAL::make_tetrahedron(Point_3(1,1,1), Point_3(0,0,0), Point_3(0,0,1), Point_3(1,0,1), *poly);
|
||||||
|
|
||||||
FIMap poly_fimap = get(CGAL::face_external_index, *poly);
|
FIMap poly_fimap = get(CGAL::face_external_index, *poly);
|
||||||
VIMap poly_vimap = get(CGAL::vertex_external_index, *poly);
|
VIMap poly_vimap = get(CGAL::vertex_external_index, *poly);
|
||||||
HIMap poly_himap = get(CGAL::halfedge_external_index, *poly);
|
HIMap poly_himap = get(CGAL::halfedge_external_index, *poly);
|
||||||
std::map<poly_face_descriptor,
|
std::map<poly_face_descriptor, PolyTraits::faces_size_type> fc_map;
|
||||||
PolyTraits::faces_size_type> fc_map;
|
|
||||||
FCMap poly_fccmap(fc_map);
|
FCMap poly_fccmap(fc_map);
|
||||||
|
|
||||||
VPMap vpmap = get(boost::vertex_point, *poly);
|
VPMap vpmap = get(boost::vertex_point, *poly);
|
||||||
CGAL::Polygon_mesh_processing::connected_components(*poly, poly_fccmap,
|
PMP::connected_components(*poly, poly_fccmap,
|
||||||
CGAL::Polygon_mesh_processing::parameters::edge_is_constrained_map(Constraint<Polyhedron, VPMap >(*poly, vpmap))
|
CGAL::parameters::edge_is_constrained_map(Constraint<Polyhedron, VPMap >(*poly, vpmap))
|
||||||
.face_index_map(poly_fimap));
|
.face_index_map(poly_fimap));
|
||||||
Poly_Adapter poly_adapter(*poly,
|
Poly_Adapter poly_adapter(*poly, pids, poly_fccmap,
|
||||||
pids,
|
|
||||||
poly_fccmap,
|
|
||||||
CGAL::parameters::face_index_map(poly_fimap)
|
CGAL::parameters::face_index_map(poly_fimap)
|
||||||
.vertex_index_map(poly_vimap)
|
.vertex_index_map(poly_vimap)
|
||||||
.halfedge_index_map(poly_himap));
|
.halfedge_index_map(poly_himap));
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue