4 using namespace meshio;
7 %include "std_vector.i"
8 %include "../include/color.h"
9 %include "../include/la.h"
10 %include "../include/pmd.h"
12 %template(VertexVector) std::vector<meshio::pmd::Vertex>;
13 %template(MaterialVector) std::vector<meshio::pmd::Material*>;
14 %template(BoneVector) std::vector<meshio::pmd::Bone>;
15 %template(IKVector) std::vector<meshio::pmd::IK>;
16 %template(MorphVector) std::vector<meshio::pmd::Morph>;
17 %template(RigidBodyVector) std::vector<meshio::pmd::RigidBody>;
18 %template(ConstraintVector) std::vector<meshio::pmd::Constraint>;
19 %template(UintVector) std::vector<unsigned int>;
20 %template(UshortVector) std::vector<unsigned short>;
21 %template(Vector3Vector) std::vector<meshio::pmd::Vector3>;
22 %template(PBoneVector) std::vector<meshio::pmd::Bone*>;
24 ///////////////////////////////////////////////////////////////////////////////
26 ///////////////////////////////////////////////////////////////////////////////
28 //! Thin wrapper for ONLY the increment operator
29 void _vertices_incr(std::vector<meshio::pmd::Vertex>::const_iterator* iter)
31 // increment the iterator
36 %extend meshio::pmd::IO {
38 def each_vertex(self):
39 iter = self._beginVertices()
41 vertex = self._dereferenceVertex(iter)
49 //! get the first element in the vector
50 std::vector<meshio::pmd::Vertex>::const_iterator* _beginVertices()
52 return new std::vector<meshio::pmd::Vertex>::const_iterator(
53 ($self->vertices.begin()));
56 //! dereference the iterator; return NULL if at the end
57 const meshio::pmd::Vertex* _dereferenceVertex(
58 const std::vector<meshio::pmd::Vertex>::const_iterator* iter )
60 // if at the end, return NULL
61 if (*iter == ($self)->vertices.end() ) {
64 // otherwise, return the face to which this iterator points