Blender V2.61 - r43446
|
#include <iostream>
#include <map>
#include "../extern/BOP_Interface.h"
#include "../../bsp/intern/BSP_CSGMesh_CFIterator.h"
#include "BOP_BSPTree.h"
#include "BOP_Mesh.h"
#include "BOP_Face2Face.h"
#include "BOP_Merge.h"
#include "BOP_Merge2.h"
#include "BOP_Chrono.h"
#include "../../../source/blender/blenkernel/BKE_global.h"
Go to the source code of this file.
Definition in file BOP_Interface.cpp.
void BOP_addMesh | ( | BOP_Mesh * | mesh, |
BOP_Faces * | meshFacesId, | ||
CSG_FaceIteratorDescriptor & | face_it, | ||
CSG_VertexIteratorDescriptor & | vertex_it, | ||
bool | invert | ||
) |
Adds mesh information into destination mesh.
mesh | input/output mesh, destination for the new mesh data |
meshFacesId | output mesh faces, contains an added faces list |
face_it | faces iterator |
vertex_it | vertices iterator |
inverted | if TRUE adding inverted faces, non-inverted otherwise |
Definition at line 364 of file BOP_Interface.cpp.
References BOP_Mesh::addFace(), BOP_Mesh::addVertex(), BOP_createFace3(), CSG_FaceIteratorDescriptor::Done, CSG_VertexIteratorDescriptor::Done, CSG_VertexIteratorDescriptor::Fill, CSG_FaceIteratorDescriptor::Fill, BOP_Mesh::getNumVertexs(), CSG_FaceIteratorDescriptor::it, CSG_VertexIteratorDescriptor::it, CSG_IFace::orig_face, CSG_IVertex::position, CSG_FaceIteratorDescriptor::Step, CSG_VertexIteratorDescriptor::Step, CSG_IFace::vertex_index, and CSG_IFace::vertex_number.
Referenced by BOP_performBooleanOperation().
BOP_Face3* BOP_createFace | ( | BOP_Mesh * | mesh, |
BOP_Index | vertex1, | ||
BOP_Index | vertex2, | ||
BOP_Index | vertex3, | ||
BOP_Index | origFace | ||
) |
BOP_Face3* BOP_createFace3 | ( | BOP_Mesh * | mesh, |
BOP_Index | vertex1, | ||
BOP_Index | vertex2, | ||
BOP_Index | vertex3, | ||
BOP_Index | origFace | ||
) |
Returns a new mesh triangle.
meshC | Input & Output mesh data |
vertex1 | first vertex of the new face |
vertex2 | second vertex of the new face |
vertex3 | third vertex of the new face |
origFace | identifier of the new face |
Definition at line 342 of file BOP_Interface.cpp.
References BOP_Vertex::getPoint(), and BOP_Mesh::getVertex().
Referenced by BOP_addMesh().
BSP_CSGMesh * BOP_exportMesh | ( | BOP_Mesh * | mesh, |
bool | invert | ||
) |
Exports a BOP_Mesh to a BSP_CSGMesh.
mesh | Input mesh |
invert | if TRUE export with inverted faces, no inverted otherwise |
Definition at line 476 of file BOP_Interface.cpp.
References BOP_newEmptyMesh(), BROKEN, BSP_CSGMesh::BuildEdges(), BSP_CSGMesh::FaceSet(), BOP_Mesh::getFaces(), BOP_Mesh::getVertex(), BOP_Mesh::getVertexs(), BSP_MVertex::m_edges, BSP_MFace::m_orig_face, BSP_MFace::m_plane, BSP_MFace::m_verts, NULL, and BSP_CSGMesh::VertexSet().
Referenced by BOP_performBooleanOperation().
BoolOpState BOP_intersectionBoolOp | ( | BOP_Mesh * | meshC, |
BOP_Faces * | facesA, | ||
BOP_Faces * | facesB, | ||
bool | invertMeshA, | ||
bool | invertMeshB | ||
) |
Computes the intersection boolean operation. Creates a new mesh resulting from an intersection of two meshes.
meshC | Input & Output mesh |
facesA | Mesh A faces list |
facesB | Mesh B faces list |
invertMeshA | determines if object A is inverted |
invertMeshB | determines if object B is inverted |
Definition at line 143 of file BOP_Interface.cpp.
References BOP_BSPTree::addMesh(), BOP_Face2Face(), BOP_meshClassify(), BOP_meshFilter(), BOP_OK, BOP_removeOverlappedFaces(), BOP_sew(), BOP_simplifiedMeshFilter(), G, BOP_BSPTree::getDeep(), BOP_Merge::getInstance(), BOP_Merge2::getInstance(), BOP_Mesh::getNumVertexs(), BOP_Chrono::stamp(), BOP_Chrono::start(), state, and BOP_Mesh::testMesh().
Referenced by BOP_performBooleanOperation().
void BOP_meshClassify | ( | BOP_Mesh * | meshC, |
BOP_Faces * | faces, | ||
BOP_BSPTree * | bsp | ||
) |
Process to classify the mesh faces using a bsp tree.
meshC | Input & Output mesh data |
faces | Faces list to classify |
bsp | BSP tree used to face classify |
Definition at line 319 of file BOP_Interface.cpp.
References BROKEN, BOP_Mesh::getVertex(), IN, BOP_Vertex::setTAG(), and BOP_BSPTree::simplifiedClassifyFace().
Referenced by BOP_intersectionBoolOp().
void BOP_meshFilter | ( | BOP_Mesh * | meshC, |
BOP_Faces * | faces, | ||
BOP_BSPTree * | bsp | ||
) |
Preprocess to filter no collisioned faces.
meshC | Input & Output mesh data |
faces | Faces list to test |
bsp | BSP tree used to filter |
Definition at line 263 of file BOP_Interface.cpp.
References BROKEN, BOP_BSPTree::classifyFace(), BOP_Face::getPlane(), BOP_Face::getVertex(), BOP_Mesh::getVertex(), IN, OUT, OUTON, and BOP_Face::setTAG().
Referenced by BOP_intersectionBoolOp().
BSP_CSGMesh * BOP_newEmptyMesh | ( | ) |
Returns an empty mesh with the specified properties.
Definition at line 458 of file BOP_Interface.cpp.
References BSP_CSGMesh::New(), NULL, and BSP_CSGMesh::SetVertices().
Referenced by BOP_exportMesh().
BoolOpState BOP_performBooleanOperation | ( | BoolOpType | opType, |
BSP_CSGMesh ** | outputMesh, | ||
CSG_FaceIteratorDescriptor | obAFaces, | ||
CSG_VertexIteratorDescriptor | obAVertices, | ||
CSG_FaceIteratorDescriptor | obBFaces, | ||
CSG_VertexIteratorDescriptor | obBVertices | ||
) |
Performs a generic booleam operation, the entry point for external modules.
opType | Boolean operation type BOP_INTERSECTION, BOP_UNION, BOP_DIFFERENCE |
outputMesh | Output mesh, the final result (the object C) |
obAFaces | Object A faces list |
obAVertices | Object A vertices list |
obBFaces | Object B faces list |
obBVertices | Object B vertices list |
interpFunc | Interpolating function |
Definition at line 81 of file BOP_Interface.cpp.
References BOP_addMesh(), BOP_exportMesh(), BOP_INTERSECTION, BOP_intersectionBoolOp(), BOP_NO_SOLID, BOP_UNION, and BOP_Mesh::isClosedMesh().
Referenced by CSG_PerformBooleanOperation().
void BOP_simplifiedMeshFilter | ( | BOP_Mesh * | meshC, |
BOP_Faces * | faces, | ||
BOP_BSPTree * | bsp, | ||
bool | inverted | ||
) |
Pre-process to filter no collisioned faces.
meshC | Input & Output mesh data |
faces | Faces list to test |
bsp | BSP tree used to filter |
inverted | determines if the object is inverted |
Definition at line 293 of file BOP_Interface.cpp.
References BROKEN, BOP_BSPTree::filterFace(), BOP_Face::getVertex(), BOP_Mesh::getVertex(), OUT, and BOP_Face::setTAG().
Referenced by BOP_intersectionBoolOp().