File: component_inside_component.h

package info (click to toggle)
meshlab 2022.02%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 47,348 kB
  • sloc: cpp: 536,635; ansic: 27,783; sh: 539; makefile: 36
file content (75 lines) | stat: -rw-r--r-- 3,139 bytes parent folder | download | duplicates (4)
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
// This file is part of libigl, a simple c++ geometry processing library.
// 
// Copyright (C) 2015 Qingnan Zhou <qnzhou@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/.
#ifndef IGL_COPYLEFT_CGAL_COMONENT_INSIDE_COMPONENT
#define IGL_COPYLEFT_CGAL_COMONENT_INSIDE_COMPONENT

#include "../../igl_inline.h"
#include <Eigen/Core>
#include <vector>

namespace igl {
  namespace copyleft
  {
    namespace cgal {

        // Determine if connected facet component (V1, F1, I1) is inside of
        // connected facet component (V2, F2, I2).
        //
        // Precondition:
        // Both components must represent closed, self-intersection free,
        // non-degenerated surfaces that are the boundary of 3D volumes. In
        // addition, (V1, F1, I1) must not intersect with (V2, F2, I2).
        //
        // Inputs:
        //   V1  #V1 by 3 list of vertex position of mesh 1
        //   F1  #F1 by 3 list of triangles indices into V1
        //   I1  #I1 list of indices into F1, indicate the facets of component
        //   V2  #V2 by 3 list of vertex position of mesh 2
        //   F2  #F2 by 3 list of triangles indices into V2
        //   I2  #I2 list of indices into F2, indicate the facets of component
        //
        // Outputs:
        //   return true iff (V1, F1, I1) is entirely inside of (V2, F2, I2).
        template<typename DerivedV, typename DerivedF, typename DerivedI>
            IGL_INLINE bool component_inside_component(
                    const Eigen::PlainObjectBase<DerivedV>& V1,
                    const Eigen::PlainObjectBase<DerivedF>& F1,
                    const Eigen::PlainObjectBase<DerivedI>& I1,
                    const Eigen::PlainObjectBase<DerivedV>& V2,
                    const Eigen::PlainObjectBase<DerivedF>& F2,
                    const Eigen::PlainObjectBase<DerivedI>& I2);

        // Determine if mesh (V1, F1) is inside of mesh (V2, F2).
        //
        // Precondition:
        // Both meshes must be closed, self-intersection free, non-degenerated
        // surfaces that are the boundary of 3D volumes.  They should not
        // intersect each other.
        //
        // Inputs:
        //   V1  #V1 by 3 list of vertex position of mesh 1
        //   F1  #F1 by 3 list of triangles indices into V1
        //   V2  #V2 by 3 list of vertex position of mesh 2
        //   F2  #F2 by 3 list of triangles indices into V2
        //
        // Outputs:
        //   return true iff (V1, F1) is entirely inside of (V2, F2).
        template<typename DerivedV, typename DerivedF>
            IGL_INLINE bool component_inside_component(
                    const Eigen::PlainObjectBase<DerivedV>& V1,
                    const Eigen::PlainObjectBase<DerivedF>& F1,
                    const Eigen::PlainObjectBase<DerivedV>& V2,
                    const Eigen::PlainObjectBase<DerivedF>& F2);
    }
  }
}

#ifndef IGL_STATIC_LIBRARY
#include "component_inside_component.cpp"
#endif
#endif