mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-27 13:20:34 +05:00
print python solid
This commit is contained in:
parent
f840179103
commit
1c7db2c393
@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I m4
|
|||||||
|
|
||||||
METASOURCES = AUTO
|
METASOURCES = AUTO
|
||||||
|
|
||||||
SUBDIRS = libsrc ng tutorials doc windows nglib
|
SUBDIRS = libsrc ng tutorials python doc windows nglib
|
||||||
# nglib
|
# nglib
|
||||||
# TESTS = ng/netgen -batchmode
|
# TESTS = ng/netgen -batchmode
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Solid * GetSolid() { return solid; }
|
Solid * GetSolid() { return solid; }
|
||||||
|
const Solid * GetSolid() const { return solid; }
|
||||||
|
|
||||||
void GiveUpOwner()
|
void GiveUpOwner()
|
||||||
{
|
{
|
||||||
@ -99,6 +100,11 @@ private:
|
|||||||
optyp op;
|
optyp op;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline ostream & operator<< (ostream & ost, const SPSolid & sol)
|
||||||
|
{
|
||||||
|
ost << *sol.GetSolid();
|
||||||
|
return ost;
|
||||||
|
}
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
@ -152,11 +158,13 @@ void ExportCSG()
|
|||||||
|
|
||||||
|
|
||||||
bp::class_<SPSolid, shared_ptr<SPSolid>, boost::noncopyable> ("Solid", bp::no_init)
|
bp::class_<SPSolid, shared_ptr<SPSolid>, boost::noncopyable> ("Solid", bp::no_init)
|
||||||
|
.def ("__str__", &ToString<SPSolid>)
|
||||||
.def ("__add__", FunctionPointer( [] ( shared_ptr<SPSolid> self, shared_ptr<SPSolid> other ) { return make_shared<SPSolid> (SPSolid::UNION, self, other); } ) )
|
.def ("__add__", FunctionPointer( [] ( shared_ptr<SPSolid> self, shared_ptr<SPSolid> other ) { return make_shared<SPSolid> (SPSolid::UNION, self, other); } ) )
|
||||||
.def ("__mul__", FunctionPointer( [] ( shared_ptr<SPSolid> self, shared_ptr<SPSolid> other ) { return make_shared<SPSolid> (SPSolid::SECTION, self, other); } ) )
|
.def ("__mul__", FunctionPointer( [] ( shared_ptr<SPSolid> self, shared_ptr<SPSolid> other ) { return make_shared<SPSolid> (SPSolid::SECTION, self, other); } ) )
|
||||||
.def ("__sub__", FunctionPointer( [] ( shared_ptr<SPSolid> self, shared_ptr<SPSolid> other )
|
.def ("__sub__", FunctionPointer( [] ( shared_ptr<SPSolid> self, shared_ptr<SPSolid> other )
|
||||||
{ return make_shared<SPSolid> (SPSolid::SECTION, self, make_shared<SPSolid> (SPSolid::SUB, other, nullptr)); } ) )
|
{ return make_shared<SPSolid> (SPSolid::SECTION, self, make_shared<SPSolid> (SPSolid::SUB, other, nullptr)); } ) )
|
||||||
// .def ("__neg__", FunctionPointer( [] ( shared_ptr<SPSolid> self ) { return make_shared<SPSolid> (SPSolid::SUB, self); } ) ) COMPLEMENT?
|
// .def ("__neg__", FunctionPointer( [] ( shared_ptr<SPSolid> self ) { return make_shared<SPSolid> (SPSolid::SUB, self); } ) ) COMPLEMENT?
|
||||||
|
|
||||||
.def ("bc", FunctionPointer([](shared_ptr<SPSolid> & self, int nr) -> shared_ptr<SPSolid>
|
.def ("bc", FunctionPointer([](shared_ptr<SPSolid> & self, int nr) -> shared_ptr<SPSolid>
|
||||||
{ self->SetBC(nr); return self; }))
|
{ self->SetBC(nr); return self; }))
|
||||||
;
|
;
|
||||||
|
Loading…
Reference in New Issue
Block a user