Blender V2.61 - r43446
|
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_listbase.h"
#include "BLI_ghash.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_depsgraph.h"
#include "BKE_material.h"
#include "BKE_mesh.h"
#include "BKE_object.h"
#include "CSG_BooleanOps.h"
#include "MOD_boolean_util.h"
Go to the source code of this file.
Definition in file MOD_boolean_util.c.
Definition at line 261 of file MOD_boolean_util.c.
References add_mesh(), Scene::base, BLI_addhead(), copy_object(), Object::data, Base::flag, Mesh::id, MEM_mallocN(), OB_MESH, Base::object, SELECT, Object::type, and ID::us.
Referenced by NewBooleanMesh().
static void BuildMeshDescriptors | ( | struct DerivedMesh * | dm, |
struct Object * | ob, | ||
int | face_offset, | ||
struct CSG_FaceIteratorDescriptor * | face_it, | ||
struct CSG_VertexIteratorDescriptor * | vertex_it | ||
) | [static] |
Definition at line 441 of file MOD_boolean_util.c.
References FaceIt_Construct(), and VertexIt_Construct().
Referenced by NewBooleanDerivedMesh_intern().
static DerivedMesh* ConvertCSGDescriptorsToDerivedMesh | ( | CSG_FaceIteratorDescriptor * | face_it, |
CSG_VertexIteratorDescriptor * | vertex_it, | ||
float | parinv[][4], | ||
float | mapmat[][4], | ||
Material ** | mat, | ||
int * | totmat, | ||
DerivedMesh * | dm1, | ||
Object * | ob1, | ||
DerivedMesh * | dm2, | ||
Object * | ob2 | ||
) | [static] |
Definition at line 337 of file MOD_boolean_util.c.
References BLI_ghash_free(), BLI_ghash_haskey(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_new(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), CD_DEFAULT, CD_MASK_DERIVEDMESH, CDDM_calc_edges(), CDDM_calc_normals(), CDDM_get_face(), CDDM_get_vert(), CDDM_new(), MVert::co, CustomData_copy_data(), CustomData_merge(), Object::data, CSG_FaceIteratorDescriptor::Done, CSG_VertexIteratorDescriptor::Done, DerivedMesh::faceData, CSG_FaceIteratorDescriptor::Fill, CSG_VertexIteratorDescriptor::Fill, GET_INT_FROM_POINTER, DerivedMesh::getNumFaces, give_current_material(), i, InterpCSGFace(), CSG_FaceIteratorDescriptor::it, CSG_VertexIteratorDescriptor::it, MFace::mat_nr, mul_v3_m4v3(), NULL, CSG_FaceIteratorDescriptor::num_elements, CSG_VertexIteratorDescriptor::num_elements, CSG_IFace::orig_face, CSG_IVertex::position, SET_INT_IN_POINTER, CSG_FaceIteratorDescriptor::Step, CSG_VertexIteratorDescriptor::Step, test_index_face(), MFace::v1, MFace::v2, MFace::v3, MFace::v4, CSG_IFace::vertex_index, and CSG_IFace::vertex_number.
Referenced by NewBooleanDerivedMesh_intern().
static void FaceIt_Construct | ( | CSG_FaceIteratorDescriptor * | output, |
DerivedMesh * | dm, | ||
int | offset, | ||
Object * | ob | ||
) | [static] |
Definition at line 217 of file MOD_boolean_util.c.
References FaceIt::dm, CSG_FaceIteratorDescriptor::Done, FaceIt_Done(), FaceIt_Fill(), FaceIt_Reset(), FaceIt_Step(), CSG_FaceIteratorDescriptor::Fill, FaceIt::flip, DerivedMesh::getNumFaces, CSG_FaceIteratorDescriptor::it, MEM_mallocN(), CSG_FaceIteratorDescriptor::num_elements, FaceIt::offset, FaceIt::pos, CSG_FaceIteratorDescriptor::Reset, Object::size, and CSG_FaceIteratorDescriptor::Step.
Referenced by BuildMeshDescriptors().
static void FaceIt_Destruct | ( | CSG_FaceIteratorDescriptor * | iterator | ) | [static] |
Definition at line 162 of file MOD_boolean_util.c.
References CSG_FaceIteratorDescriptor::Done, CSG_FaceIteratorDescriptor::Fill, CSG_FaceIteratorDescriptor::it, MEM_freeN(), NULL, CSG_FaceIteratorDescriptor::num_elements, CSG_FaceIteratorDescriptor::Reset, and CSG_FaceIteratorDescriptor::Step.
Referenced by FreeMeshDescriptors().
static int FaceIt_Done | ( | CSG_IteratorPtr | it | ) | [static] |
Definition at line 172 of file MOD_boolean_util.c.
References FaceIt::dm, DerivedMesh::getNumFaces, and FaceIt::pos.
Referenced by FaceIt_Construct().
static void FaceIt_Fill | ( | CSG_IteratorPtr | it, |
CSG_IFace * | face | ||
) | [static] |
Definition at line 179 of file MOD_boolean_util.c.
References FaceIt::dm, FaceIt::flip, DerivedMesh::getFaceArray, FaceIt::offset, CSG_IFace::orig_face, FaceIt::pos, MFace::v1, MFace::v2, MFace::v3, MFace::v4, CSG_IFace::vertex_index, and CSG_IFace::vertex_number.
Referenced by FaceIt_Construct().
static void FaceIt_Reset | ( | CSG_IteratorPtr | it | ) | [static] |
Definition at line 211 of file MOD_boolean_util.c.
References FaceIt::pos.
Referenced by FaceIt_Construct().
static void FaceIt_Step | ( | CSG_IteratorPtr | it | ) | [static] |
Definition at line 205 of file MOD_boolean_util.c.
References FaceIt::pos.
Referenced by FaceIt_Construct().
static void FreeMeshDescriptors | ( | struct CSG_FaceIteratorDescriptor * | face_it, |
struct CSG_VertexIteratorDescriptor * | vertex_it | ||
) | [static] |
Definition at line 452 of file MOD_boolean_util.c.
References FaceIt_Destruct(), and VertexIt_Destruct().
Referenced by NewBooleanDerivedMesh_intern().
static void InterpCSGFace | ( | DerivedMesh * | dm, |
DerivedMesh * | orig_dm, | ||
int | index, | ||
int | orig_index, | ||
int | nr, | ||
float | mapmat[][4] | ||
) | [static] |
Definition at line 299 of file MOD_boolean_util.c.
References CDDM_get_face(), CDDM_get_vert(), MVert::co, co, copy_v3_v3(), CustomData_interp(), DerivedMesh::faceData, DerivedMesh::getFaceArray, DerivedMesh::getVertArray, interp_weights_face_v3(), mul_v3_m4v3(), NULL, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and simple_enum_gen::w.
Referenced by ConvertCSGDescriptorsToDerivedMesh().
DerivedMesh* NewBooleanDerivedMesh | ( | DerivedMesh * | dm, |
struct Object * | ob, | ||
DerivedMesh * | dm_select, | ||
struct Object * | ob_select, | ||
int | int_op_type | ||
) | [read] |
Definition at line 592 of file MOD_boolean_util.c.
References NewBooleanDerivedMesh_intern(), and NULL.
static DerivedMesh* NewBooleanDerivedMesh_intern | ( | DerivedMesh * | dm, |
struct Object * | ob, | ||
DerivedMesh * | dm_select, | ||
struct Object * | ob_select, | ||
int | int_op_type, | ||
Material ** | mat, | ||
int * | totmat | ||
) | [static] |
Definition at line 460 of file MOD_boolean_util.c.
References BuildMeshDescriptors(), ConvertCSGDescriptorsToDerivedMesh(), CSG_FreeBooleanOperation(), CSG_FreeFaceDescriptor(), CSG_FreeVertexDescriptor(), CSG_NewBooleanFunction(), CSG_OutputFaceDescriptor(), CSG_OutputVertexDescriptor(), CSG_PerformBooleanOperation(), e_csg_classify, e_csg_difference, e_csg_intersection, e_csg_union, FreeMeshDescriptors(), DerivedMesh::getNumFaces, invert_m4_m4(), mult_m4_m4m4(), NULL, and Object::obmat.
Referenced by NewBooleanDerivedMesh(), and NewBooleanMesh().
Definition at line 536 of file MOD_boolean_util.c.
References AddNewBlenderMesh(), assign_material(), CD_MASK_BAREMESH, DAG_id_tag_update(), Object::data, DM_to_mesh(), DerivedMesh::getNumFaces, Object::id, MEM_freeN(), MEM_mallocN(), mesh_create_derived_view(), mesh_get_derived_final(), NewBooleanDerivedMesh_intern(), NULL, OB_RECALC_DATA, Base::object, DerivedMesh::release, and Object::totcol.
static void VertexIt_Construct | ( | CSG_VertexIteratorDescriptor * | output, |
DerivedMesh * | dm, | ||
Object * | ob | ||
) | [static] |
Definition at line 125 of file MOD_boolean_util.c.
References VertexIt::dm, CSG_VertexIteratorDescriptor::Done, CSG_VertexIteratorDescriptor::Fill, DerivedMesh::getNumVerts, CSG_VertexIteratorDescriptor::it, MEM_mallocN(), CSG_VertexIteratorDescriptor::num_elements, VertexIt::ob, VertexIt::pos, CSG_VertexIteratorDescriptor::Reset, CSG_VertexIteratorDescriptor::Step, VertexIt_Done(), VertexIt_Fill(), VertexIt_Reset(), and VertexIt_Step().
Referenced by BuildMeshDescriptors().
static void VertexIt_Destruct | ( | CSG_VertexIteratorDescriptor * | iterator | ) | [static] |
Implementations of local vertex iterator functions. These describe a blender mesh to the CSG module.
Definition at line 73 of file MOD_boolean_util.c.
References CSG_VertexIteratorDescriptor::Done, CSG_VertexIteratorDescriptor::Fill, CSG_VertexIteratorDescriptor::it, MEM_freeN(), NULL, CSG_VertexIteratorDescriptor::num_elements, CSG_VertexIteratorDescriptor::Reset, and CSG_VertexIteratorDescriptor::Step.
Referenced by FreeMeshDescriptors().
static int VertexIt_Done | ( | CSG_IteratorPtr | it | ) | [static] |
Definition at line 88 of file MOD_boolean_util.c.
References VertexIt::dm, DerivedMesh::getNumVerts, and VertexIt::pos.
Referenced by VertexIt_Construct().
static void VertexIt_Fill | ( | CSG_IteratorPtr | it, |
CSG_IVertex * | vert | ||
) | [static] |
Definition at line 94 of file MOD_boolean_util.c.
References MVert::co, VertexIt::dm, DerivedMesh::getVertArray, mul_v3_m4v3(), VertexIt::ob, Object::obmat, VertexIt::pos, and CSG_IVertex::position.
Referenced by VertexIt_Construct().
static void VertexIt_Reset | ( | CSG_IteratorPtr | it | ) | [static] |
Definition at line 119 of file MOD_boolean_util.c.
References VertexIt::pos.
Referenced by VertexIt_Construct().
static void VertexIt_Step | ( | CSG_IteratorPtr | it | ) | [static] |
Definition at line 113 of file MOD_boolean_util.c.
References VertexIt::pos.
Referenced by VertexIt_Construct().