Skip to content

Commit

Permalink
Added XmWindow and xTypes. Commented out further unresolved externals
Browse files Browse the repository at this point in the history
  • Loading branch information
shrdluk committed Mar 25, 2018
1 parent 9c14cf5 commit f15d989
Show file tree
Hide file tree
Showing 15 changed files with 136 additions and 20 deletions.
41 changes: 41 additions & 0 deletions inc/xTypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
This file is part of pyOCCT which provides Python bindings to the OpenCASCADE
geometry kernel.
Copyright (C) 2018 Keith Preston
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

/*
Dummy definitions of _xcolor and __GLXFBConfigRec
The OCCT include files for Linux use these two X Windows related structs. Since pyOCCT doesn't need their internal details, it seems unnecessary to drag in X library files, which may not be present in all systems anyway.
*/

#ifndef __xTypes_h__
#define __xTypes_h__

struct _xcolor {

};

struct __GLXFBConfigRec {

};

#endif /* !__xTypes_h */
4 changes: 4 additions & 0 deletions src/Aspect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <pyOCCT_Common.hpp>

#ifndef _WIN32
#include <xTypes.h>
#endif

#include <Aspect_TypeOfDeflection.hxx>
#include <Aspect_TypeOfHighlightMethod.hxx>
#include <Standard_OutOfRange.hxx>
Expand Down
2 changes: 1 addition & 1 deletion src/BRepOffset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ PYBIND11_MODULE(BRepOffset, mod) {

// C:\Miniconda\envs\occt\Library\include\opencascade\BRepOffset_SimpleOffset.hxx
py::class_<BRepOffset_SimpleOffset, opencascade::handle<BRepOffset_SimpleOffset>, BRepTools_Modification> cls_BRepOffset_SimpleOffset(mod, "BRepOffset_SimpleOffset", "This class represents mechanism of simple offset algorithm i. e. topology-preserve offset construction without intersection.");
cls_BRepOffset_SimpleOffset.def(py::init<const TopoDS_Shape &, const Standard_Real, const Standard_Real>(), py::arg("theInputShape"), py::arg("theOffsetValue"), py::arg("theTolerance"));
// FIXME cls_BRepOffset_SimpleOffset.def(py::init<const TopoDS_Shape &, const Standard_Real, const Standard_Real>(), py::arg("theInputShape"), py::arg("theOffsetValue"), py::arg("theTolerance"));
cls_BRepOffset_SimpleOffset.def_static("get_type_name_", (const char * (*)()) &BRepOffset_SimpleOffset::get_type_name, "None");
cls_BRepOffset_SimpleOffset.def_static("get_type_descriptor_", (const opencascade::handle<Standard_Type> & (*)()) &BRepOffset_SimpleOffset::get_type_descriptor, "None");
cls_BRepOffset_SimpleOffset.def("DynamicType", (const opencascade::handle<Standard_Type> & (BRepOffset_SimpleOffset::*)() const ) &BRepOffset_SimpleOffset::DynamicType, "None");
Expand Down
4 changes: 2 additions & 2 deletions src/BinObjMgt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ PYBIND11_MODULE(BinObjMgt, mod) {
cls_BinObjMgt_Persistent.def("PutIntArray", (BinObjMgt_Persistent & (BinObjMgt_Persistent::*)(const BinObjMgt_PInteger, const Standard_Integer)) &BinObjMgt_Persistent::PutIntArray, "Put C array of int, theLength is the number of elements", py::arg("theArray"), py::arg("theLength"));
cls_BinObjMgt_Persistent.def("PutRealArray", (BinObjMgt_Persistent & (BinObjMgt_Persistent::*)(const BinObjMgt_PReal, const Standard_Integer)) &BinObjMgt_Persistent::PutRealArray, "Put C array of double, theLength is the number of elements", py::arg("theArray"), py::arg("theLength"));
cls_BinObjMgt_Persistent.def("PutShortRealArray", (BinObjMgt_Persistent & (BinObjMgt_Persistent::*)(const BinObjMgt_PShortReal, const Standard_Integer)) &BinObjMgt_Persistent::PutShortRealArray, "Put C array of float, theLength is the number of elements", py::arg("theArray"), py::arg("theLength"));
cls_BinObjMgt_Persistent.def("GetCharacter", (const BinObjMgt_Persistent & (BinObjMgt_Persistent::*)(Standard_Character &) const ) &BinObjMgt_Persistent::GetCharacter, "None", py::arg("theValue"));
// FIXME cls_BinObjMgt_Persistent.def("GetCharacter", (const BinObjMgt_Persistent & (BinObjMgt_Persistent::*)(Standard_Character &) const ) &BinObjMgt_Persistent::GetCharacter, "None", py::arg("theValue"));
// FIXME cls_BinObjMgt_Persistent.def("bits_right", (const BinObjMgt_Persistent & (BinObjMgt_Persistent::*)(Standard_Character &) const ) &BinObjMgt_Persistent::operator>>, py::is_operator(), "None", py::arg("theValue"));
cls_BinObjMgt_Persistent.def("GetByte", (const BinObjMgt_Persistent & (BinObjMgt_Persistent::*)(Standard_Byte &) const ) &BinObjMgt_Persistent::GetByte, "None", py::arg("theValue"));
// FIXME cls_BinObjMgt_Persistent.def("bits_right", (const BinObjMgt_Persistent & (BinObjMgt_Persistent::*)(Standard_Byte &) const ) &BinObjMgt_Persistent::operator>>, py::is_operator(), "None", py::arg("theValue"));
cls_BinObjMgt_Persistent.def("GetExtCharacter", (const BinObjMgt_Persistent & (BinObjMgt_Persistent::*)(Standard_ExtCharacter &) const ) &BinObjMgt_Persistent::GetExtCharacter, "None", py::arg("theValue"));
// FIXME cls_BinObjMgt_Persistent.def("GetExtCharacter", (const BinObjMgt_Persistent & (BinObjMgt_Persistent::*)(Standard_ExtCharacter &) const ) &BinObjMgt_Persistent::GetExtCharacter, "None", py::arg("theValue"));
// FIXME cls_BinObjMgt_Persistent.def("bits_right", (const BinObjMgt_Persistent & (BinObjMgt_Persistent::*)(Standard_ExtCharacter &) const ) &BinObjMgt_Persistent::operator>>, py::is_operator(), "None", py::arg("theValue"));
cls_BinObjMgt_Persistent.def("GetInteger", [](BinObjMgt_Persistent &self, Standard_Integer & theValue){ const BinObjMgt_Persistent & rv = self.GetInteger(theValue); return std::tuple<const BinObjMgt_Persistent &, Standard_Integer &>(rv, theValue); }, "None", py::arg("theValue"));
// FIXME cls_BinObjMgt_Persistent.def("bits_right", (const BinObjMgt_Persistent & (BinObjMgt_Persistent::*)(Standard_Integer &) const ) &BinObjMgt_Persistent::operator>>, py::is_operator(), "None", py::arg("theValue"));
Expand Down
2 changes: 1 addition & 1 deletion src/BinTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ PYBIND11_MODULE(BinTools, mod) {
cls_BinTools.def_static("GetReal_", [](Standard_IStream & IS, Standard_Real & theValue){ Standard_IStream & rv = BinTools::GetReal(IS, theValue); return std::tuple<Standard_IStream &, Standard_Real &>(rv, theValue); }, "None", py::arg("IS"), py::arg("theValue"));
cls_BinTools.def_static("GetInteger_", [](Standard_IStream & IS, Standard_Integer & theValue){ Standard_IStream & rv = BinTools::GetInteger(IS, theValue); return std::tuple<Standard_IStream &, Standard_Integer &>(rv, theValue); }, "None", py::arg("IS"), py::arg("theValue"));
cls_BinTools.def_static("GetBool_", [](Standard_IStream & IS, Standard_Boolean & theValue){ Standard_IStream & rv = BinTools::GetBool(IS, theValue); return std::tuple<Standard_IStream &, Standard_Boolean &>(rv, theValue); }, "None", py::arg("IS"), py::arg("theValue"));
cls_BinTools.def_static("GetExtChar_", (Standard_IStream & (*)(Standard_IStream &, Standard_ExtCharacter &)) &BinTools::GetExtChar, "None", py::arg("IS"), py::arg("theValue"));
// FIXME cls_BinTools.def_static("GetExtChar_", (Standard_IStream & (*)(Standard_IStream &, Standard_ExtCharacter &)) &BinTools::GetExtChar, "None", py::arg("IS"), py::arg("theValue"));
cls_BinTools.def_static("Write_", (void (*)(const TopoDS_Shape &, Standard_OStream &)) &BinTools::Write, "Writes <theShape> on <theStream> in binary format.", py::arg("theShape"), py::arg("theStream"));
cls_BinTools.def_static("Read_", (void (*)(TopoDS_Shape &, Standard_IStream &)) &BinTools::Read, "Reads a shape from <theStream> and returns it in <theShape>.", py::arg("theShape"), py::arg("theStream"));
cls_BinTools.def_static("Write_", (Standard_Boolean (*)(const TopoDS_Shape &, const Standard_CString)) &BinTools::Write, "Writes <theShape> in <theFile>.", py::arg("theShape"), py::arg("theFile"));
Expand Down
12 changes: 6 additions & 6 deletions src/FSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ PYBIND11_MODULE(FSD, mod) {
cls_FSD_BinaryFile.def("PutShortReal", (Storage_BaseDriver & (FSD_BinaryFile::*)(const Standard_ShortReal)) &FSD_BinaryFile::PutShortReal, "None", py::arg("aValue"));
// FIXME cls_FSD_BinaryFile.def("bits_left", (Storage_BaseDriver & (FSD_BinaryFile::*)(const Standard_ShortReal)) &FSD_BinaryFile::operator<<, py::is_operator(), "None", py::arg("aValue"));
cls_FSD_BinaryFile.def("GetReference", [](FSD_BinaryFile &self, Standard_Integer & aValue){ Storage_BaseDriver & rv = self.GetReference(aValue); return std::tuple<Storage_BaseDriver &, Standard_Integer &>(rv, aValue); }, "None", py::arg("aValue"));
cls_FSD_BinaryFile.def("GetCharacter", (Storage_BaseDriver & (FSD_BinaryFile::*)(Standard_Character &)) &FSD_BinaryFile::GetCharacter, "None", py::arg("aValue"));
// FIXME cls_FSD_BinaryFile.def("GetCharacter", (Storage_BaseDriver & (FSD_BinaryFile::*)(Standard_Character &)) &FSD_BinaryFile::GetCharacter, "None", py::arg("aValue"));
// FIXME cls_FSD_BinaryFile.def("bits_right", (Storage_BaseDriver & (FSD_BinaryFile::*)(Standard_Character &)) &FSD_BinaryFile::operator>>, py::is_operator(), "None", py::arg("aValue"));
cls_FSD_BinaryFile.def_static("GetReference_", [](Standard_IStream & theIStream, Standard_Integer & aValue){ FSD_BinaryFile::GetReference(theIStream, aValue); return aValue; }, "None", py::arg("theIStream"), py::arg("aValue"));
cls_FSD_BinaryFile.def("GetExtCharacter", (Storage_BaseDriver & (FSD_BinaryFile::*)(Standard_ExtCharacter &)) &FSD_BinaryFile::GetExtCharacter, "None", py::arg("aValue"));
// FIXME cls_FSD_BinaryFile.def("GetExtCharacter", (Storage_BaseDriver & (FSD_BinaryFile::*)(Standard_ExtCharacter &)) &FSD_BinaryFile::GetExtCharacter, "None", py::arg("aValue"));
// FIXME cls_FSD_BinaryFile.def("bits_right", (Storage_BaseDriver & (FSD_BinaryFile::*)(Standard_ExtCharacter &)) &FSD_BinaryFile::operator>>, py::is_operator(), "None", py::arg("aValue"));
cls_FSD_BinaryFile.def("GetInteger", [](FSD_BinaryFile &self, Standard_Integer & aValue){ Storage_BaseDriver & rv = self.GetInteger(aValue); return std::tuple<Storage_BaseDriver &, Standard_Integer &>(rv, aValue); }, "None", py::arg("aValue"));
// FIXME cls_FSD_BinaryFile.def("bits_right", (Storage_BaseDriver & (FSD_BinaryFile::*)(Standard_Integer &)) &FSD_BinaryFile::operator>>, py::is_operator(), "None", py::arg("aValue"));
Expand Down Expand Up @@ -254,9 +254,9 @@ PYBIND11_MODULE(FSD, mod) {
cls_FSD_CmpFile.def("PutShortReal", (Storage_BaseDriver & (FSD_CmpFile::*)(const Standard_ShortReal)) &FSD_CmpFile::PutShortReal, "None", py::arg("aValue"));
// FIXME cls_FSD_CmpFile.def("bits_left", (Storage_BaseDriver & (FSD_CmpFile::*)(const Standard_ShortReal)) &FSD_CmpFile::operator<<, py::is_operator(), "None", py::arg("aValue"));
cls_FSD_CmpFile.def("GetReference", [](FSD_CmpFile &self, Standard_Integer & aValue){ Storage_BaseDriver & rv = self.GetReference(aValue); return std::tuple<Storage_BaseDriver &, Standard_Integer &>(rv, aValue); }, "None", py::arg("aValue"));
cls_FSD_CmpFile.def("GetCharacter", (Storage_BaseDriver & (FSD_CmpFile::*)(Standard_Character &)) &FSD_CmpFile::GetCharacter, "None", py::arg("aValue"));
// FIXME cls_FSD_CmpFile.def("GetCharacter", (Storage_BaseDriver & (FSD_CmpFile::*)(Standard_Character &)) &FSD_CmpFile::GetCharacter, "None", py::arg("aValue"));
// FIXME cls_FSD_CmpFile.def("bits_right", (Storage_BaseDriver & (FSD_CmpFile::*)(Standard_Character &)) &FSD_CmpFile::operator>>, py::is_operator(), "None", py::arg("aValue"));
cls_FSD_CmpFile.def("GetExtCharacter", (Storage_BaseDriver & (FSD_CmpFile::*)(Standard_ExtCharacter &)) &FSD_CmpFile::GetExtCharacter, "None", py::arg("aValue"));
// FIXME cls_FSD_CmpFile.def("GetExtCharacter", (Storage_BaseDriver & (FSD_CmpFile::*)(Standard_ExtCharacter &)) &FSD_CmpFile::GetExtCharacter, "None", py::arg("aValue"));
// FIXME cls_FSD_CmpFile.def("bits_right", (Storage_BaseDriver & (FSD_CmpFile::*)(Standard_ExtCharacter &)) &FSD_CmpFile::operator>>, py::is_operator(), "None", py::arg("aValue"));
cls_FSD_CmpFile.def("GetInteger", [](FSD_CmpFile &self, Standard_Integer & aValue){ Storage_BaseDriver & rv = self.GetInteger(aValue); return std::tuple<Storage_BaseDriver &, Standard_Integer &>(rv, aValue); }, "None", py::arg("aValue"));
// FIXME cls_FSD_CmpFile.def("bits_right", (Storage_BaseDriver & (FSD_CmpFile::*)(Standard_Integer &)) &FSD_CmpFile::operator>>, py::is_operator(), "None", py::arg("aValue"));
Expand Down Expand Up @@ -343,9 +343,9 @@ PYBIND11_MODULE(FSD, mod) {
cls_FSD_File.def("PutShortReal", (Storage_BaseDriver & (FSD_File::*)(const Standard_ShortReal)) &FSD_File::PutShortReal, "None", py::arg("aValue"));
// FIXME cls_FSD_File.def("bits_left", (Storage_BaseDriver & (FSD_File::*)(const Standard_ShortReal)) &FSD_File::operator<<, py::is_operator(), "None", py::arg("aValue"));
cls_FSD_File.def("GetReference", [](FSD_File &self, Standard_Integer & aValue){ Storage_BaseDriver & rv = self.GetReference(aValue); return std::tuple<Storage_BaseDriver &, Standard_Integer &>(rv, aValue); }, "None", py::arg("aValue"));
cls_FSD_File.def("GetCharacter", (Storage_BaseDriver & (FSD_File::*)(Standard_Character &)) &FSD_File::GetCharacter, "None", py::arg("aValue"));
// FIXME cls_FSD_File.def("GetCharacter", (Storage_BaseDriver & (FSD_File::*)(Standard_Character &)) &FSD_File::GetCharacter, "None", py::arg("aValue"));
// FIXME cls_FSD_File.def("bits_right", (Storage_BaseDriver & (FSD_File::*)(Standard_Character &)) &FSD_File::operator>>, py::is_operator(), "None", py::arg("aValue"));
cls_FSD_File.def("GetExtCharacter", (Storage_BaseDriver & (FSD_File::*)(Standard_ExtCharacter &)) &FSD_File::GetExtCharacter, "None", py::arg("aValue"));
// FIXME cls_FSD_File.def("GetExtCharacter", (Storage_BaseDriver & (FSD_File::*)(Standard_ExtCharacter &)) &FSD_File::GetExtCharacter, "None", py::arg("aValue"));
// FIXME cls_FSD_File.def("bits_right", (Storage_BaseDriver & (FSD_File::*)(Standard_ExtCharacter &)) &FSD_File::operator>>, py::is_operator(), "None", py::arg("aValue"));
cls_FSD_File.def("GetInteger", [](FSD_File &self, Standard_Integer & aValue){ Storage_BaseDriver & rv = self.GetInteger(aValue); return std::tuple<Storage_BaseDriver &, Standard_Integer &>(rv, aValue); }, "None", py::arg("aValue"));
// FIXME cls_FSD_File.def("bits_right", (Storage_BaseDriver & (FSD_File::*)(Standard_Integer &)) &FSD_File::operator>>, py::is_operator(), "None", py::arg("aValue"));
Expand Down
2 changes: 1 addition & 1 deletion src/OSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ PYBIND11_MODULE(OSD, mod) {
cls_OSD_SharedLibrary.def("SetName", (void (OSD_SharedLibrary::*)(const Standard_CString)) &OSD_SharedLibrary::SetName, "Sets a name associated to the shared object.", py::arg("aName"));
cls_OSD_SharedLibrary.def("Name", (Standard_CString (OSD_SharedLibrary::*)() const ) &OSD_SharedLibrary::Name, "Returns the name associated to the shared object.");
cls_OSD_SharedLibrary.def("DlOpen", (Standard_Boolean (OSD_SharedLibrary::*)(const OSD_LoadMode)) &OSD_SharedLibrary::DlOpen, "The DlOpen method provides an interface to the dynamic library loader to allow shared libraries to be loaded and called at runtime. The DlOpen function attempts to load Filename, in the address space of the process, resolving symbols as appropriate. Any libraries that Filename depends upon are also loaded. If MODE is RTLD_LAZY, then the runtime loader does symbol resolution only as needed. Typically, this means that the first call to a function in the newly loaded library will cause the resolution of the address of that function to occur. If Mode is RTLD_NOW, then the runtime loader must do all symbol binding during the DlOpen call. The DlOpen method returns a handle that is used by DlSym or DlClose. If there is an error, Standard_False is returned, Standard_True otherwise. If a NULL Filename is specified, DlOpen returns a handle for the main executable, which allows access to dynamic symbols in the running program.", py::arg("Mode"));
cls_OSD_SharedLibrary.def("DlSymb", (OSD_Function (OSD_SharedLibrary::*)(const Standard_CString) const ) &OSD_SharedLibrary::DlSymb, "The dlsym function returns the address of the symbol name found in the shared library. If the symbol is not found, a NULL pointer is returned.", py::arg("Name"));
// FIXME cls_OSD_SharedLibrary.def("DlSymb", (OSD_Function (OSD_SharedLibrary::*)(const Standard_CString) const ) &OSD_SharedLibrary::DlSymb, "The dlsym function returns the address of the symbol name found in the shared library. If the symbol is not found, a NULL pointer is returned.", py::arg("Name"));
cls_OSD_SharedLibrary.def("DlClose", (void (OSD_SharedLibrary::*)() const ) &OSD_SharedLibrary::DlClose, "Deallocates the address space for the library corresponding to the shared object. If any user function continues to call a symbol resolved in the address space of a library that has been since been deallocated by DlClose, the results are undefined.");
cls_OSD_SharedLibrary.def("DlError", (Standard_CString (OSD_SharedLibrary::*)() const ) &OSD_SharedLibrary::DlError, "The dlerror function returns a string describing the last error that occurred from a call to DlOpen, DlClose or DlSym.");
cls_OSD_SharedLibrary.def("Destroy", (void (OSD_SharedLibrary::*)()) &OSD_SharedLibrary::Destroy, "Frees memory allocated.");
Expand Down
Loading

0 comments on commit f15d989

Please sign in to comment.