Skip to content
Snippets Groups Projects
Commit 4c7b2b39 authored by Tobias Schmidt's avatar Tobias Schmidt
Browse files

added SurfaceHandleList

parent 5c031c57
No related branches found
No related tags found
No related merge requests found
......@@ -20,12 +20,13 @@
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
using namespace boost::python;
#include <ost/mol/surface_handle.hh>
#include <ost/mol/surface_builder.hh>
#include <ost/mol/entity_handle.hh>
#include <ost/mol/impl/surface_impl.hh>
#include <ost/export_helper/vector.hh>
using namespace ost;
using namespace ost::mol;
......@@ -47,13 +48,13 @@ void export_Surface()
.def_readwrite("Position", &SurfaceVertex::position)
.def_readwrite("Normal", &SurfaceVertex::normal)
.def_readwrite("Atom", &SurfaceVertex::atom)
;
;
class_<SurfaceTriIDList>("SurfaceTriIDList", init<>())
.def(vector_indexing_suite<SurfaceTriIDList>())
;
class_<SurfaceVertexList>("SurfaceVertexList", init<>())
.def(vector_indexing_suite<SurfaceVertexList>())
;
;
class_<SurfaceHandle>("SurfaceHandle", no_init)
.def("Attach",attach1)
.def("Attach",attach2)
......@@ -65,6 +66,11 @@ void export_Surface()
.def("IsValid",&SurfaceHandle::IsValid)
;
class_<SurfaceHandleList>("SurfaceHandleList", init<>())
.def(vector_indexing_suite<SurfaceHandleList>())
.def(ost::VectorAdditions<SurfaceHandleList>())
;
def("CreateSurface",create1);
def("BuildSurface",BuildSurface);
......
......@@ -88,4 +88,14 @@ void SurfaceHandle::Invert()
impl_->Invert();
}
std::ostream& operator<<(std::ostream& os, const SurfaceHandle& surf)
{
if (surf.IsValid()) {
os << "valid surface";
} else {
os << "invalid surface";
}
return os;
}
}} // ns
......@@ -72,10 +72,20 @@ public:
bool IsValid() const {return impl_;}
bool operator==(const SurfaceHandle& ref) const { return impl_==ref.impl_; }
bool operator!=(const SurfaceHandle& ref) const { return !this->operator==(ref); }
private:
impl::SurfaceImplP impl_;
};
DLLEXPORT_OST_MOL std::ostream& operator<<(std::ostream& os,
const SurfaceHandle& surf);
typedef std::vector<SurfaceHandle> SurfaceHandleList;
}} // ns
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment