| 
 | 1 | +/*  | 
 | 2 | + * Copyright (c) 2019 - 2022 Geode-solutions  | 
 | 3 | + *  | 
 | 4 | + * Permission is hereby granted, free of charge, to any person obtaining a copy  | 
 | 5 | + * of this software and associated documentation files (the "Software"), to deal  | 
 | 6 | + * in the Software without restriction, including without limitation the rights  | 
 | 7 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell  | 
 | 8 | + * copies of the Software, and to permit persons to whom the Software is  | 
 | 9 | + * furnished to do so, subject to the following conditions:  | 
 | 10 | + *  | 
 | 11 | + * The above copyright notice and this permission notice shall be included in  | 
 | 12 | + * all copies or substantial portions of the Software.  | 
 | 13 | + *  | 
 | 14 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  | 
 | 15 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  | 
 | 16 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE  | 
 | 17 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  | 
 | 18 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  | 
 | 19 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  | 
 | 20 | + * SOFTWARE.  | 
 | 21 | + *  | 
 | 22 | + */  | 
 | 23 | + | 
 | 24 | +#include <geode/model/representation/core/brep.h>  | 
 | 25 | +#include <geode/model/representation/core/section.h>  | 
 | 26 | + | 
 | 27 | +#include <geode/inspector/criterion/colocation/unique_vertices_colocation.h>  | 
 | 28 | + | 
 | 29 | +#define PYTHON_SECTION_UV_COLOCATION()                                         \  | 
 | 30 | +    pybind11::class_< SectionUniqueVerticesColocation >(                       \  | 
 | 31 | +        module, "SectionUniqueVerticesColocation" )                            \  | 
 | 32 | +        .def( pybind11::init< const Section& >() )                             \  | 
 | 33 | +        .def( pybind11::init< const Section&, bool >() )                       \  | 
 | 34 | +        .def( "model_has_unique_vertices_linked_to_different_points",          \  | 
 | 35 | +            &SectionUniqueVerticesColocation::                                 \  | 
 | 36 | +                model_has_unique_vertices_linked_to_different_points )         \  | 
 | 37 | +        .def( "model_has_colocated_unique_vertices",                           \  | 
 | 38 | +            &SectionUniqueVerticesColocation::                                 \  | 
 | 39 | +                model_has_colocated_unique_vertices )                          \  | 
 | 40 | +        .def( "nb_colocated_unique_vertices",                                  \  | 
 | 41 | +            &SectionUniqueVerticesColocation::nb_colocated_unique_vertices )   \  | 
 | 42 | +        .def( "nb_unique_vertices_linked_to_different_points",                 \  | 
 | 43 | +            &SectionUniqueVerticesColocation::                                 \  | 
 | 44 | +                nb_unique_vertices_linked_to_different_points )                \  | 
 | 45 | +        .def( "colocated_unique_vertices_groups",                              \  | 
 | 46 | +            &SectionUniqueVerticesColocation::                                 \  | 
 | 47 | +                colocated_unique_vertices_groups )                             \  | 
 | 48 | +        .def( "unique_vertices_linked_to_different_points",                    \  | 
 | 49 | +            &SectionUniqueVerticesColocation::                                 \  | 
 | 50 | +                unique_vertices_linked_to_different_points )  | 
 | 51 | + | 
 | 52 | +#define PYTHON_BREP_UV_COLOCATION()                                            \  | 
 | 53 | +    pybind11::class_< BRepUniqueVerticesColocation >(                          \  | 
 | 54 | +        module, "BRepUniqueVerticesColocation" )                               \  | 
 | 55 | +        .def( pybind11::init< const BRep& >() )                                \  | 
 | 56 | +        .def( pybind11::init< const BRep&, bool >() )                          \  | 
 | 57 | +        .def( "model_has_unique_vertices_linked_to_different_points",          \  | 
 | 58 | +            &BRepUniqueVerticesColocation::                                    \  | 
 | 59 | +                model_has_unique_vertices_linked_to_different_points )         \  | 
 | 60 | +        .def( "model_has_colocated_unique_vertices",                           \  | 
 | 61 | +            &BRepUniqueVerticesColocation::                                    \  | 
 | 62 | +                model_has_colocated_unique_vertices )                          \  | 
 | 63 | +        .def( "nb_colocated_unique_vertices",                                  \  | 
 | 64 | +            &BRepUniqueVerticesColocation::nb_colocated_unique_vertices )      \  | 
 | 65 | +        .def( "nb_unique_vertices_linked_to_different_points",                 \  | 
 | 66 | +            &BRepUniqueVerticesColocation::                                    \  | 
 | 67 | +                nb_unique_vertices_linked_to_different_points )                \  | 
 | 68 | +        .def( "colocated_unique_vertices_groups",                              \  | 
 | 69 | +            &BRepUniqueVerticesColocation::colocated_unique_vertices_groups )  \  | 
 | 70 | +        .def( "unique_vertices_linked_to_different_points",                    \  | 
 | 71 | +            &BRepUniqueVerticesColocation::                                    \  | 
 | 72 | +                unique_vertices_linked_to_different_points )  | 
 | 73 | + | 
 | 74 | +namespace geode  | 
 | 75 | +{  | 
 | 76 | +    void define_models_colocation( pybind11::module& module )  | 
 | 77 | +    {  | 
 | 78 | +        PYTHON_SECTION_UV_COLOCATION();  | 
 | 79 | +        PYTHON_BREP_UV_COLOCATION();  | 
 | 80 | +    }  | 
 | 81 | +} // namespace geode  | 
0 commit comments