Blender V2.61 - r43446
Functions

BOP_Interface.cpp File Reference

#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.

Functions

BoolOpState BOP_intersectionBoolOp (BOP_Mesh *meshC, BOP_Faces *facesA, BOP_Faces *facesB, bool invertMeshA, bool invertMeshB)
BOP_Face3BOP_createFace (BOP_Mesh *mesh, BOP_Index vertex1, BOP_Index vertex2, BOP_Index vertex3, BOP_Index origFace)
void BOP_addMesh (BOP_Mesh *mesh, BOP_Faces *meshFacesId, CSG_FaceIteratorDescriptor &face_it, CSG_VertexIteratorDescriptor &vertex_it, bool invert)
BSP_CSGMeshBOP_newEmptyMesh ()
BSP_CSGMeshBOP_exportMesh (BOP_Mesh *inputMesh, bool invert)
void BOP_meshFilter (BOP_Mesh *meshC, BOP_Faces *faces, BOP_BSPTree *bsp)
void BOP_simplifiedMeshFilter (BOP_Mesh *meshC, BOP_Faces *faces, BOP_BSPTree *bsp, bool inverted)
void BOP_meshClassify (BOP_Mesh *meshC, BOP_Faces *faces, BOP_BSPTree *bsp)
BoolOpState BOP_performBooleanOperation (BoolOpType opType, BSP_CSGMesh **outputMesh, CSG_FaceIteratorDescriptor obAFaces, CSG_VertexIteratorDescriptor obAVertices, CSG_FaceIteratorDescriptor obBFaces, CSG_VertexIteratorDescriptor obBVertices)
BOP_Face3BOP_createFace3 (BOP_Mesh *mesh, BOP_Index vertex1, BOP_Index vertex2, BOP_Index vertex3, BOP_Index origFace)

Detailed Description

Definition in file BOP_Interface.cpp.


Function Documentation

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.

Parameters:
meshinput/output mesh, destination for the new mesh data
meshFacesIdoutput mesh faces, contains an added faces list
face_itfaces iterator
vertex_itvertices iterator
invertedif 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.

Parameters:
meshCInput & Output mesh data
vertex1first vertex of the new face
vertex2second vertex of the new face
vertex3third vertex of the new face
origFaceidentifier of the new face
Returns:
new 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.

Parameters:
meshInput mesh
invertif TRUE export with inverted faces, no inverted otherwise
Returns:
the corresponding new BSP_CSGMesh

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.

Parameters:
meshCInput & Output mesh
facesAMesh A faces list
facesBMesh B faces list
invertMeshAdetermines if object A is inverted
invertMeshBdetermines if object B is inverted
Returns:
operation state: BOP_OK, BOP_NO_SOLID, BOP_ERROR

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.

Parameters:
meshCInput & Output mesh data
facesFaces list to classify
bspBSP 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.

Parameters:
meshCInput & Output mesh data
facesFaces list to test
bspBSP 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.

Returns:
a new empty mesh

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.

Parameters:
opTypeBoolean operation type BOP_INTERSECTION, BOP_UNION, BOP_DIFFERENCE
outputMeshOutput mesh, the final result (the object C)
obAFacesObject A faces list
obAVerticesObject A vertices list
obBFacesObject B faces list
obBVerticesObject B vertices list
interpFuncInterpolating function
Returns:
operation state: BOP_OK, BOP_NO_SOLID, BOP_ERROR

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.

Parameters:
meshCInput & Output mesh data
facesFaces list to test
bspBSP tree used to filter
inverteddetermines 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().