Commit d5f7d2e9 authored by T.J. Corona's avatar T.J. Corona

Add generated (and manually tweaked) pybind11 bindings.

parent 5c53d3e0
Pipeline #38649 passed with stage
......@@ -92,7 +92,21 @@ install(
################################################################################
# Generate Python wrapping of the smtkCore library
if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
if (SMTK_USE_PYBIND11)
set(SMTK_PYTHON_MODULE_SRCS
simple
testing
)
foreach(pyfile ${SMTK_PYTHON_MODULE_SRCS})
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/smtk/${pyfile}.py"
"${SMTK_BINARY_DIR}/smtk/${pyfile}.py" @ONLY
)
list(APPEND SMTK_PYTHON_MODULEFILES "smtk/${pyfile}.py")
endforeach()
endif()
if(NOT SMTK_USE_PYBIND11 AND SMTK_ENABLE_PYTHON_WRAPPING)
sbk_wrap_library(smtkCore
PACKAGE smtk
GENERATOR_ARGS --avoid-protected-hack
......@@ -106,68 +120,68 @@ if(SMTK_ENABLE_PYTHON_WRAPPING AND Shiboken_FOUND)
${CMAKE_CURRENT_SOURCE_DIR}/io
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
TYPESYSTEM typesystem.xml
HEADERS ${smtk_headers}
)
set(SMTK_PYTHON_MODULE_SRCS
__init__
simple
testing
)
set(SMTK_PYTHON_MODULEFILES)
set(smtk_find_shiboken "build_tree")
foreach(pyfile ${SMTK_PYTHON_MODULE_SRCS})
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/smtk/${pyfile}.py"
"${SMTK_BINARY_DIR}/smtk/${pyfile}.py" @ONLY
)
list(APPEND SMTK_PYTHON_MODULEFILES "smtk/${pyfile}.py")
endforeach()
# TODO: We need to install this file in such a way that it can resolve
# the location of shiboken, which is going to mean running fixup
# bundle on the mac, and then fixing up the smtk/__init__.py
# package script
get_filename_component(SHIBOKEN_LIBRARY_NAME ${SHIBOKEN_LIBRARY} NAME)
# Store the location where we'll install SMTK's Python source
# in the SMTK_PYTHON_MODULEFILES variable and add an install rule.
# Note that SMTK_PYTHON_MODULEDIR may be provided if SMTK is being
# built as a submodule or as part of a superbuild.
if (NOT DEFINED SMTK_PYTHON_MODULEDIR)
if (SMTK_INSTALL_PYTHON_TO_SITE_PACKAGES)
execute_process(
COMMAND
TYPESYSTEM typesystem.xml
HEADERS ${smtk_headers}
)
set(SMTK_PYTHON_MODULE_SRCS
__init__
simple
testing
)
set(SMTK_PYTHON_MODULEFILES)
set(smtk_find_shiboken "build_tree")
foreach(pyfile ${SMTK_PYTHON_MODULE_SRCS})
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/smtk/${pyfile}.py"
"${SMTK_BINARY_DIR}/smtk/${pyfile}.py" @ONLY
)
list(APPEND SMTK_PYTHON_MODULEFILES "smtk/${pyfile}.py")
endforeach()
# TODO: We need to install this file in such a way that it can resolve
# the location of shiboken, which is going to mean running fixup
# bundle on the mac, and then fixing up the smtk/__init__.py
# package script
get_filename_component(SHIBOKEN_LIBRARY_NAME ${SHIBOKEN_LIBRARY} NAME)
# Store the location where we'll install SMTK's Python source
# in the SMTK_PYTHON_MODULEFILES variable and add an install rule.
# Note that SMTK_PYTHON_MODULEDIR may be provided if SMTK is being
# built as a submodule or as part of a superbuild.
if (NOT DEFINED SMTK_PYTHON_MODULEDIR)
if (SMTK_INSTALL_PYTHON_TO_SITE_PACKAGES)
execute_process(
COMMAND
${PYTHON_EXECUTABLE}
-c "import site; print(site.getsitepackages())[-1]"
RESULT_VARIABLE SMTK_PYTHON_MODULEDIR
)
elseif(WIN32)
set(SMTK_PYTHON_MODULEDIR
"bin/Lib/site-packages")
else()
set(SMTK_PYTHON_MODULEDIR
"${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages")
RESULT_VARIABLE SMTK_PYTHON_MODULEDIR
)
elseif(WIN32)
set(SMTK_PYTHON_MODULEDIR
"bin/Lib/site-packages")
else()
set(SMTK_PYTHON_MODULEDIR
"${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages")
endif()
endif()
endif()
install(
FILES ${SMTK_PYTHON_MODULEFILES}
DESTINATION "${SMTK_PYTHON_MODULEDIR}/smtk"
)
set(SMTK_FIND_SHIBOKEN "install_tree"
CACHE STRING "Set to empty if shiboken should be impicitly found in the install")
mark_as_advanced(SMTK_FIND_SHIBOKEN)
install(CODE
"set(LIBRARY_OUTPUT_PATH \"${CMAKE_INSTALL_PREFIX}/lib\")
set(SHIBOKEN_LIBRARY \"${CMAKE_INSTALL_PREFIX}/lib/${SHIBOKEN_LIBRARY_NAME}\")
set(smtk_find_shiboken \"${SMTK_FIND_SHIBOKEN}\")
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/smtk/__init__.py
${CMAKE_INSTALL_PREFIX}/${SMTK_PYTHON_MODULEDIR}/smtk/__init__.py )"
)
endif()
install(
FILES ${SMTK_PYTHON_MODULEFILES}
DESTINATION "${SMTK_PYTHON_MODULEDIR}/smtk"
)
set(SMTK_FIND_SHIBOKEN "install_tree"
CACHE STRING "Set to empty if shiboken should be impicitly found in the install")
mark_as_advanced(SMTK_FIND_SHIBOKEN)
install(CODE
"set(LIBRARY_OUTPUT_PATH \"${CMAKE_INSTALL_PREFIX}/lib\")
set(SHIBOKEN_LIBRARY \"${CMAKE_INSTALL_PREFIX}/lib/${SHIBOKEN_LIBRARY_NAME}\")
set(smtk_find_shiboken \"${SMTK_FIND_SHIBOKEN}\")
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/smtk/__init__.py
${CMAKE_INSTALL_PREFIX}/${SMTK_PYTHON_MODULEDIR}/smtk/__init__.py )"
)
endif()
################################################################################
# Build smtk extensions
......@@ -182,3 +196,7 @@ add_subdirectory(extension)
# any custom model bridge sessions that the user has enabled.
################################################################################
add_subdirectory(bridge)
if(SMTK_USE_PYBIND11)
add_subdirectory(pybind11)
endif()
project(SMTK_Attribute)
set(attributeHeaders
Attribute.h
Definition.h
......@@ -74,6 +72,9 @@ set(attributeSrcs
#install the headers
smtk_public_headers(${attributeHeaders})
if (SMTK_USE_PYBIND11)
add_subdirectory(pybind11)
endif()
if(SMTK_ENABLE_TESTING)
add_subdirectory(testing)
......
pybind11_add_module(smtkPybindAttribute PybindAttribute.cxx)
target_include_directories(smtkPybindAttribute PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
)
target_link_libraries(smtkPybindAttribute LINK_PUBLIC smtkCore)
set_target_properties(smtkPybindAttribute
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
)
install(TARGETS smtkPybindAttribute DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/__init__.py"
"${PROJECT_BINARY_DIR}/smtk/attribute/__init__.py" @ONLY
)
install(CODE
"set(LIBRARY_OUTPUT_PATH \"${CMAKE_INSTALL_PREFIX}/lib\")
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py
${CMAKE_INSTALL_PREFIX}/${SMTK_PYTHON_MODULEDIR}/smtk/attribute/__init__.py )"
)
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#include <utility>
#include <pybind11/pybind11.h>
namespace py = pybind11;
template <typename T, typename... Args>
using PySharedPtrClass = py::class_<T, std::shared_ptr<T>, Args...>;
#include "PybindAttribute.h"
#include "PybindDefinition.h"
#include "PybindDirectoryItem.h"
#include "PybindDirectoryItemDefinition.h"
#include "PybindDoubleItem.h"
#include "PybindDoubleItemDefinition.h"
#include "PybindFileItem.h"
#include "PybindFileItemDefinition.h"
#include "PybindFileSystemItem.h"
#include "PybindFileSystemItemDefinition.h"
#include "PybindGroupItem.h"
#include "PybindGroupItemDefinition.h"
#include "PybindIntItem.h"
#include "PybindIntItemDefinition.h"
#include "PybindItem.h"
#include "PybindItemDefinition.h"
#include "PybindMeshItem.h"
#include "PybindMeshItemDefinition.h"
#include "PybindMeshSelectionItem.h"
#include "PybindMeshSelectionItemDefinition.h"
#include "PybindModelEntityItem.h"
#include "PybindModelEntityItemDefinition.h"
#include "PybindRefItem.h"
#include "PybindRefItemDefinition.h"
#include "PybindSearchStyle.h"
#include "PybindStringItem.h"
#include "PybindStringItemDefinition.h"
#include "PybindSystem.h"
#include "PybindValueItem.h"
#include "PybindValueItemDefinition.h"
#include "PybindValueItemDefinitionTemplate.h"
#include "PybindValueItemTemplate.h"
#include "PybindVoidItem.h"
#include "PybindVoidItemDefinition.h"
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>);
PYBIND11_PLUGIN(smtkPybindAttribute)
{
py::module attribute("smtkPybindAttribute", "<description>");
// The order of these function calls is important! It was determined by
// comparing the dependencies of each of the wrapped objects.
pybind11_init_smtk_attribute_SearchStyle(attribute);
PySharedPtrClass< smtk::attribute::Attribute > smtk_attribute_Attribute = pybind11_init_smtk_attribute_Attribute(attribute);
PySharedPtrClass< smtk::attribute::Definition > smtk_attribute_Definition = pybind11_init_smtk_attribute_Definition(attribute);
PySharedPtrClass< smtk::attribute::Item > smtk_attribute_Item = pybind11_init_smtk_attribute_Item(attribute);
PySharedPtrClass< smtk::attribute::ItemDefinition > smtk_attribute_ItemDefinition = pybind11_init_smtk_attribute_ItemDefinition(attribute);
pybind11_init_smtk_attribute_MeshModifyMode(attribute);
PySharedPtrClass< smtk::attribute::FileSystemItem, smtk::attribute::Item > smtk_attribute_FileSystemItem = pybind11_init_smtk_attribute_FileSystemItem(attribute);
PySharedPtrClass< smtk::attribute::FileSystemItemDefinition, smtk::attribute::ItemDefinition > smtk_attribute_FileSystemItemDefinition = pybind11_init_smtk_attribute_FileSystemItemDefinition(attribute);
PySharedPtrClass< smtk::attribute::GroupItem, smtk::attribute::Item > smtk_attribute_GroupItem = pybind11_init_smtk_attribute_GroupItem(attribute);
PySharedPtrClass< smtk::attribute::GroupItemDefinition, smtk::attribute::ItemDefinition > smtk_attribute_GroupItemDefinition = pybind11_init_smtk_attribute_GroupItemDefinition(attribute);
PySharedPtrClass< smtk::attribute::MeshItem, smtk::attribute::Item > smtk_attribute_MeshItem = pybind11_init_smtk_attribute_MeshItem(attribute);
PySharedPtrClass< smtk::attribute::MeshItemDefinition, smtk::attribute::ItemDefinition > smtk_attribute_MeshItemDefinition = pybind11_init_smtk_attribute_MeshItemDefinition(attribute);
PySharedPtrClass< smtk::attribute::MeshSelectionItem, smtk::attribute::Item > smtk_attribute_MeshSelectionItem = pybind11_init_smtk_attribute_MeshSelectionItem(attribute);
PySharedPtrClass< smtk::attribute::MeshSelectionItemDefinition, smtk::attribute::ItemDefinition > smtk_attribute_MeshSelectionItemDefinition = pybind11_init_smtk_attribute_MeshSelectionItemDefinition(attribute);
PySharedPtrClass< smtk::attribute::ModelEntityItem, smtk::attribute::Item > smtk_attribute_ModelEntityItem = pybind11_init_smtk_attribute_ModelEntityItem(attribute);
PySharedPtrClass< smtk::attribute::ModelEntityItemDefinition, smtk::attribute::ItemDefinition > smtk_attribute_ModelEntityItemDefinition = pybind11_init_smtk_attribute_ModelEntityItemDefinition(attribute);
PySharedPtrClass< smtk::attribute::RefItem, smtk::attribute::Item > smtk_attribute_RefItem = pybind11_init_smtk_attribute_RefItem(attribute);
PySharedPtrClass< smtk::attribute::RefItemDefinition, smtk::attribute::ItemDefinition > smtk_attribute_RefItemDefinition = pybind11_init_smtk_attribute_RefItemDefinition(attribute);
PySharedPtrClass< smtk::attribute::System, smtk::common::Resource > smtk_attribute_System = pybind11_init_smtk_attribute_System(attribute);
PySharedPtrClass< smtk::attribute::ValueItem, smtk::attribute::Item > smtk_attribute_ValueItem = pybind11_init_smtk_attribute_ValueItem(attribute);
PySharedPtrClass< smtk::attribute::ValueItemDefinition, smtk::attribute::ItemDefinition > smtk_attribute_ValueItemDefinition = pybind11_init_smtk_attribute_ValueItemDefinition(attribute);
PySharedPtrClass< smtk::attribute::VoidItem, smtk::attribute::Item > smtk_attribute_VoidItem = pybind11_init_smtk_attribute_VoidItem(attribute);
PySharedPtrClass< smtk::attribute::VoidItemDefinition, smtk::attribute::ItemDefinition > smtk_attribute_VoidItemDefinition = pybind11_init_smtk_attribute_VoidItemDefinition(attribute);
PySharedPtrClass< smtk::attribute::DirectoryItem, smtk::attribute::FileSystemItem > smtk_attribute_DirectoryItem = pybind11_init_smtk_attribute_DirectoryItem(attribute);
PySharedPtrClass< smtk::attribute::DirectoryItemDefinition, smtk::attribute::FileSystemItemDefinition > smtk_attribute_DirectoryItemDefinition = pybind11_init_smtk_attribute_DirectoryItemDefinition(attribute);
PySharedPtrClass<smtk::attribute::ValueItemTemplate<double>, smtk::attribute::ValueItem > smtk_attribute_ValueItemTemplate_double_ = pybind11_init_smtk_attribute_ValueItemTemplate_double_(attribute);
PySharedPtrClass< smtk::attribute::DoubleItem, smtk::attribute::ValueItemTemplate<double> > smtk_attribute_DoubleItem = pybind11_init_smtk_attribute_DoubleItem(attribute);
PySharedPtrClass<smtk::attribute::ValueItemDefinitionTemplate<double>, smtk::attribute::ValueItemDefinition > smtk_attribute_ValueItemDefinitionTemplate_double_ = pybind11_init_smtk_attribute_ValueItemDefinitionTemplate_double_(attribute);
PySharedPtrClass< smtk::attribute::DoubleItemDefinition, smtk::attribute::ValueItemDefinitionTemplate<double> > smtk_attribute_DoubleItemDefinition = pybind11_init_smtk_attribute_DoubleItemDefinition(attribute);
PySharedPtrClass< smtk::attribute::FileItem, smtk::attribute::FileSystemItem > smtk_attribute_FileItem = pybind11_init_smtk_attribute_FileItem(attribute);
PySharedPtrClass< smtk::attribute::FileItemDefinition, smtk::attribute::FileSystemItemDefinition > smtk_attribute_FileItemDefinition = pybind11_init_smtk_attribute_FileItemDefinition(attribute);
PySharedPtrClass<smtk::attribute::ValueItemTemplate<int>, smtk::attribute::ValueItem > smtk_attribute_ValueItemTemplate_int_ = pybind11_init_smtk_attribute_ValueItemTemplate_int_(attribute);
PySharedPtrClass< smtk::attribute::IntItem, smtk::attribute::ValueItemTemplate<int> > smtk_attribute_IntItem = pybind11_init_smtk_attribute_IntItem(attribute);
PySharedPtrClass<smtk::attribute::ValueItemDefinitionTemplate<int>, smtk::attribute::ValueItemDefinition > smtk_attribute_ValueItemDefinitionTemplate_int_ = pybind11_init_smtk_attribute_ValueItemDefinitionTemplate_int_(attribute);
PySharedPtrClass< smtk::attribute::IntItemDefinition, smtk::attribute::ValueItemDefinitionTemplate<int> > smtk_attribute_IntItemDefinition = pybind11_init_smtk_attribute_IntItemDefinition(attribute);
PySharedPtrClass<smtk::attribute::ValueItemTemplate<std::basic_string<char> >, smtk::attribute::ValueItem > smtk_attribute_ValueItemTemplate_string_ = pybind11_init_smtk_attribute_ValueItemTemplate_string_(attribute);
PySharedPtrClass< smtk::attribute::StringItem, smtk::attribute::ValueItemTemplate<std::basic_string<char> > > smtk_attribute_StringItem = pybind11_init_smtk_attribute_StringItem(attribute);
PySharedPtrClass<smtk::attribute::ValueItemDefinitionTemplate<std::basic_string<char> >, smtk::attribute::ValueItemDefinition > smtk_attribute_ValueItemDefinitionTemplate_string_ = pybind11_init_smtk_attribute_ValueItemDefinitionTemplate_string_(attribute);
PySharedPtrClass< smtk::attribute::StringItemDefinition, smtk::attribute::ValueItemDefinitionTemplate<std::basic_string<char> > > smtk_attribute_StringItemDefinition = pybind11_init_smtk_attribute_StringItemDefinition(attribute);
return attribute.ptr();
}
This diff is collapsed.
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#ifndef pybind_smtk_attribute_Definition_h
#define pybind_smtk_attribute_Definition_h
#include <pybind11/pybind11.h>
#include "smtk/attribute/Definition.h"
#include "smtk/attribute/Attribute.h"
#include "smtk/attribute/ItemDefinition.h"
#include "smtk/attribute/ModelEntityItemDefinition.h"
#include "smtk/attribute/System.h"
#include "smtk/model/EntityRef.h"
namespace py = pybind11;
PySharedPtrClass< smtk::attribute::Definition > pybind11_init_smtk_attribute_Definition(py::module &m)
{
PySharedPtrClass< smtk::attribute::Definition > instance(m, "Definition");
instance
.def(py::init<::smtk::attribute::Definition const &>())
.def("deepcopy", (smtk::attribute::Definition & (smtk::attribute::Definition::*)(::smtk::attribute::Definition const &)) &smtk::attribute::Definition::operator=)
.def("classname", &smtk::attribute::Definition::classname)
.def("type", &smtk::attribute::Definition::type)
.def("system", &smtk::attribute::Definition::system)
.def("label", &smtk::attribute::Definition::label)
.def("setLabel", &smtk::attribute::Definition::setLabel, py::arg("newLabel"))
.def("baseDefinition", &smtk::attribute::Definition::baseDefinition)
.def("isA", &smtk::attribute::Definition::isA, py::arg("def"))
.def("version", &smtk::attribute::Definition::version)
.def("setVersion", &smtk::attribute::Definition::setVersion, py::arg("myVersion"))
.def("isAbstract", &smtk::attribute::Definition::isAbstract)
.def("setIsAbstract", &smtk::attribute::Definition::setIsAbstract, py::arg("isAbstractValue"))
.def("numberOfCategories", &smtk::attribute::Definition::numberOfCategories)
.def("isMemberOf", (bool (smtk::attribute::Definition::*)(::std::string const &) const) &smtk::attribute::Definition::isMemberOf, py::arg("category"))
.def("isMemberOf", (bool (smtk::attribute::Definition::*)(::std::vector<std::basic_string<char>, std::allocator<std::basic_string<char> > > const &) const) &smtk::attribute::Definition::isMemberOf, py::arg("categories"))
.def("categories", &smtk::attribute::Definition::categories)
.def("advanceLevel", &smtk::attribute::Definition::advanceLevel)
.def("setAdvanceLevel", &smtk::attribute::Definition::setAdvanceLevel, py::arg("level"))
.def("isUnique", &smtk::attribute::Definition::isUnique)
.def("setIsUnique", &smtk::attribute::Definition::setIsUnique, py::arg("isUniqueValue"))
.def("isNodal", &smtk::attribute::Definition::isNodal)
.def("setIsNodal", &smtk::attribute::Definition::setIsNodal, py::arg("isNodalValue"))
.def("notApplicableColor", &smtk::attribute::Definition::notApplicableColor)
.def("setNotApplicableColor", (void (smtk::attribute::Definition::*)(double, double, double, double)) &smtk::attribute::Definition::setNotApplicableColor, py::arg("r"), py::arg("g"), py::arg("b"), py::arg("alpha"))
.def("setNotApplicableColor", (void (smtk::attribute::Definition::*)(double const *)) &smtk::attribute::Definition::setNotApplicableColor, py::arg("color"))
.def("unsetNotApplicableColor", &smtk::attribute::Definition::unsetNotApplicableColor)
.def("isNotApplicableColorSet", &smtk::attribute::Definition::isNotApplicableColorSet)
.def("defaultColor", &smtk::attribute::Definition::defaultColor)
.def("setDefaultColor", (void (smtk::attribute::Definition::*)(double, double, double, double)) &smtk::attribute::Definition::setDefaultColor, py::arg("r"), py::arg("g"), py::arg("b"), py::arg("alpha"))
.def("setDefaultColor", (void (smtk::attribute::Definition::*)(double const *)) &smtk::attribute::Definition::setDefaultColor, py::arg("color"))
.def("unsetDefaultColor", &smtk::attribute::Definition::unsetDefaultColor)
.def("isDefaultColorSet", &smtk::attribute::Definition::isDefaultColorSet)
.def("associationRule", &smtk::attribute::Definition::associationRule)
.def("setAssociationRule", &smtk::attribute::Definition::setAssociationRule, py::arg("arg0"))
.def("associationMask", &smtk::attribute::Definition::associationMask)
.def("setAssociationMask", &smtk::attribute::Definition::setAssociationMask, py::arg("mask"))
.def("associatesWithVertex", &smtk::attribute::Definition::associatesWithVertex)
.def("associatesWithEdge", &smtk::attribute::Definition::associatesWithEdge)
.def("associatesWithFace", &smtk::attribute::Definition::associatesWithFace)
.def("associatesWithVolume", &smtk::attribute::Definition::associatesWithVolume)
.def("associatesWithModel", &smtk::attribute::Definition::associatesWithModel)
.def("associatesWithGroup", &smtk::attribute::Definition::associatesWithGroup)
.def("canBeAssociated", (bool (smtk::attribute::Definition::*)(::smtk::model::BitFlags) const) &smtk::attribute::Definition::canBeAssociated, py::arg("maskType"))
.def("canBeAssociated", (bool (smtk::attribute::Definition::*)(::smtk::model::EntityRef, ::std::vector<smtk::attribute::Attribute *, std::allocator<smtk::attribute::Attribute *> > *) const) &smtk::attribute::Definition::canBeAssociated, py::arg("entity"), py::arg("conflicts"))
.def("conflicts", &smtk::attribute::Definition::conflicts, py::arg("definition"))
.def("numberOfItemDefinitions", &smtk::attribute::Definition::numberOfItemDefinitions)
.def("itemDefinition", &smtk::attribute::Definition::itemDefinition, py::arg("ith"))
.def("addItemDefinition", (bool (smtk::attribute::Definition::*)(::smtk::attribute::ItemDefinitionPtr)) &smtk::attribute::Definition::addItemDefinition, py::arg("cdef"))
.def("findItemPosition", &smtk::attribute::Definition::findItemPosition, py::arg("name"))
.def("detailedDescription", &smtk::attribute::Definition::detailedDescription)
.def("setDetailedDescription", &smtk::attribute::Definition::setDetailedDescription, py::arg("text"))
.def("briefDescription", &smtk::attribute::Definition::briefDescription)
.def("setBriefDescription", &smtk::attribute::Definition::setBriefDescription, py::arg("text"))
.def("buildAttribute", &smtk::attribute::Definition::buildAttribute, py::arg("attribute"))
.def("setRootName", &smtk::attribute::Definition::setRootName, py::arg("val"))
.def("rootName", &smtk::attribute::Definition::rootName)
.def("resetItemOffset", &smtk::attribute::Definition::resetItemOffset)
.def("itemOffset", &smtk::attribute::Definition::itemOffset)
;
return instance;
}
#endif
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#ifndef pybind_smtk_attribute_DirectoryItem_h
#define pybind_smtk_attribute_DirectoryItem_h
#include <pybind11/pybind11.h>
#include "smtk/attribute/DirectoryItem.h"
#include "smtk/attribute/FileSystemItem.h"
namespace py = pybind11;
PySharedPtrClass< smtk::attribute::DirectoryItem, smtk::attribute::FileSystemItem > pybind11_init_smtk_attribute_DirectoryItem(py::module &m)
{
PySharedPtrClass< smtk::attribute::DirectoryItem, smtk::attribute::FileSystemItem > instance(m, "DirectoryItem");
instance
.def(py::init<::smtk::attribute::DirectoryItem const &>())
.def("deepcopy", (smtk::attribute::DirectoryItem & (smtk::attribute::DirectoryItem::*)(::smtk::attribute::DirectoryItem const &)) &smtk::attribute::DirectoryItem::operator=)
.def("classname", &smtk::attribute::DirectoryItem::classname)
.def("type", &smtk::attribute::DirectoryItem::type)
.def_static("CastTo", [](const std::shared_ptr<smtk::attribute::Item> i) {
return std::dynamic_pointer_cast<smtk::attribute::DirectoryItem>(i);
})
;
return instance;
}
#endif
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#ifndef pybind_smtk_attribute_DirectoryItemDefinition_h
#define pybind_smtk_attribute_DirectoryItemDefinition_h
#include <pybind11/pybind11.h>
#include "smtk/attribute/DirectoryItemDefinition.h"
#include "smtk/attribute/Attribute.h"
#include "smtk/attribute/FileSystemItemDefinition.h"
#include "smtk/attribute/Item.h"
#include "smtk/attribute/ItemDefinition.h"
namespace py = pybind11;
PySharedPtrClass< smtk::attribute::DirectoryItemDefinition, smtk::attribute::FileSystemItemDefinition > pybind11_init_smtk_attribute_DirectoryItemDefinition(py::module &m)
{
PySharedPtrClass< smtk::attribute::DirectoryItemDefinition, smtk::attribute::FileSystemItemDefinition > instance(m, "DirectoryItemDefinition");
instance
.def(py::init<::smtk::attribute::DirectoryItemDefinition const &>())
.def_static("New", &smtk::attribute::DirectoryItemDefinition::New, py::arg("myName"))
.def("buildItem", (smtk::attribute::ItemPtr (smtk::attribute::DirectoryItemDefinition::*)(::smtk::attribute::Attribute *, int) const) &smtk::attribute::DirectoryItemDefinition::buildItem, py::arg("owningAttribute"), py::arg("itemPosition"))
.def("buildItem", (smtk::attribute::ItemPtr (smtk::attribute::DirectoryItemDefinition::*)(::smtk::attribute::Item *, int, int) const) &smtk::attribute::DirectoryItemDefinition::buildItem, py::arg("owningItem"), py::arg("position"), py::arg("subGroupPosition"))
.def("classname", &smtk::attribute::DirectoryItemDefinition::classname)
.def("createCopy", &smtk::attribute::DirectoryItemDefinition::createCopy, py::arg("info"))
.def("type", &smtk::attribute::DirectoryItemDefinition::type)
.def_static("ToItemDefinition", [](const std::shared_ptr<smtk::attribute::DirectoryItemDefinition> d) {
return std::dynamic_pointer_cast<smtk::attribute::ItemDefinition>(d);
})
.def_static("CastTo", [](const std::shared_ptr<smtk::attribute::ItemDefinition> i) {
return std::dynamic_pointer_cast<smtk::attribute::DirectoryItemDefinition>(i);
})
;
return instance;
}
#endif
//=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
#ifndef pybind_smtk_attribute_DoubleItem_h
#define pybind_smtk_attribute_DoubleItem_h
#include <pybind11/pybind11.h>
#include "smtk/attribute/DoubleItem.h"
namespace py = pybind11;
PySharedPtrClass< smtk::attribute::DoubleItem, smtk::attribute::ValueItemTemplate<double> > pybind11_init_smtk_attribute_DoubleItem(py::module &m)
{
PySharedPtrClass< smtk::attribute::DoubleItem, smtk::attribute::ValueItemTemplate<double> > instance(m, "DoubleItem");
instance
.def(py::init<::smtk::attribute::DoubleItem const &>())
.def("assign", &smtk::attribute::DoubleItem::assign, py::arg("sourceItem"), py::arg("options") = 0)
.def("classname", &smtk::attribute::DoubleItem::classname)
.def("type", &smtk::attribute::DoubleItem::type)
.def_static("CastTo", [](const std::shared_ptr<smtk::attribute::Item> i) {
return std::dynamic_pointer_cast<smtk::attribute::DoubleItem>(i);
})