Welcome to mirror list, hosted at ThFree Co, Russian Federation.

infinite_cost_stopping_condition.cpp « igl « libigl « src - github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 033f2b6780211c9701a25f3d6c0fc7f7bc6a9e72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// This file is part of libigl, a simple c++ geometry processing library.
// 
// Copyright (C) 2016 Alec Jacobson <alecjacobson@gmail.com>
// 
// This Source Code Form is subject to the terms of the Mozilla Public License 
// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
// obtain one at http://mozilla.org/MPL/2.0/.
#include "infinite_cost_stopping_condition.h"

IGL_INLINE void igl::infinite_cost_stopping_condition(
  const std::function<void(
    const int,
    const Eigen::MatrixXd &,
    const Eigen::MatrixXi &,
    const Eigen::MatrixXi &,
    const Eigen::VectorXi &,
    const Eigen::MatrixXi &,
    const Eigen::MatrixXi &,
    double &,
    Eigen::RowVectorXd &)> & cost_and_placement,
  std::function<bool(
    const Eigen::MatrixXd &,
    const Eigen::MatrixXi &,
    const Eigen::MatrixXi &,
    const Eigen::VectorXi &,
    const Eigen::MatrixXi &,
    const Eigen::MatrixXi &,
    const std::set<std::pair<double,int> > &,
    const std::vector<std::set<std::pair<double,int> >::iterator > &,
    const Eigen::MatrixXd &,
    const int,
    const int,
    const int,
    const int,
    const int)> & stopping_condition)
{
  stopping_condition = 
    [&cost_and_placement]
    (
    const Eigen::MatrixXd & V,
    const Eigen::MatrixXi & F,
    const Eigen::MatrixXi & E,
    const Eigen::VectorXi & EMAP,
    const Eigen::MatrixXi & EF,
    const Eigen::MatrixXi & EI,
    const std::set<std::pair<double,int> > & Q,
    const std::vector<std::set<std::pair<double,int> >::iterator > & Qit,
    const Eigen::MatrixXd & C,
    const int e,
    const int /*e1*/,
    const int /*e2*/,
    const int /*f1*/,
    const int /*f2*/)->bool
    {
      Eigen::RowVectorXd p;
      double cost;
      cost_and_placement(e,V,F,E,EMAP,EF,EI,cost,p);
      return std::isinf(cost);
    };
}

IGL_INLINE 
  std::function<bool(
    const Eigen::MatrixXd &,
    const Eigen::MatrixXi &,
    const Eigen::MatrixXi &,
    const Eigen::VectorXi &,
    const Eigen::MatrixXi &,
    const Eigen::MatrixXi &,
    const std::set<std::pair<double,int> > &,
    const std::vector<std::set<std::pair<double,int> >::iterator > &,
    const Eigen::MatrixXd &,
    const int,
    const int,
    const int,
    const int,
    const int)> 
  igl::infinite_cost_stopping_condition(
    const std::function<void(
      const int,
      const Eigen::MatrixXd &,
      const Eigen::MatrixXi &,
      const Eigen::MatrixXi &,
      const Eigen::VectorXi &,
      const Eigen::MatrixXi &,
      const Eigen::MatrixXi &,
      double &,
      Eigen::RowVectorXd &)> & cost_and_placement)
{
  std::function<bool(
    const Eigen::MatrixXd &,
    const Eigen::MatrixXi &,
    const Eigen::MatrixXi &,
    const Eigen::VectorXi &,
    const Eigen::MatrixXi &,
    const Eigen::MatrixXi &,
    const std::set<std::pair<double,int> > &,
    const std::vector<std::set<std::pair<double,int> >::iterator > &,
    const Eigen::MatrixXd &,
    const int,
    const int,
    const int,
    const int,
    const int)> stopping_condition;
  infinite_cost_stopping_condition(cost_and_placement,stopping_condition);
  return stopping_condition;
}