/** * Method is used to group object components. * @param object is source object. * @param vertices is other object vertices. * @pram indices is other object indices. * @param faceStatus1 is face status. * @param faceStatus2 is face status. */ void GeoModifier::groupObjectComponents(Object3D& object, VertexSet& vertices, IntSet& indices, int faceStatus1, int faceStatus2) { //for each face.. for(int i = 0; i < object.getNumFaces(); ++i) { Face& face = *(object.getFace(i)); if(face.getStatus()==faceStatus1 || face.getStatus()==faceStatus2) { VertexPointerSet faceVerts; faceVerts.add(face.v1); faceVerts.add(face.v2); faceVerts.add(face.v3); for(int j=0;j<faceVerts.length();j++) { if(vertices.contains(faceVerts[j])) indices.push_back(vertices.indexOf(faceVerts[j])); else { indices.push_back(vertices.length()); vertices.AddVertex(*faceVerts[j]); } } } } }
/** * Accessor to indices. * @return pointer to indices collection. */ IntSet* getIndices() { IntSet * newIndices = new IntSet(); for(unsigned i = 0; i < indices.size(); i++) newIndices->push_back(indices[i]); return newIndices; }