1 /************************************************************************* 2 * * 3 * Vega FEM Simulation Library Version 3.1 * 4 * * 5 * "distance field" library , Copyright (C) 2007 CMU, 2016 USC * 6 * All rights reserved. * 7 * * 8 * Code authors: Jernej Barbic, Hongyi Xu, Yijing Li * 9 * http://www.jernejbarbic.com/code * 10 * * 11 * Research: Jernej Barbic, Hongyi Xu, Doug L. James * 12 * * 13 * Funding: National Science Foundation, Link Foundation, * 14 * Zumberge Research and Innovation Fund at USC * 15 * * 16 * This library is free software; you can redistribute it and/or * 17 * modify it under the terms of the BSD-style license that is * 18 * included with this library in the file LICENSE.txt * 19 * * 20 * This library is distributed in the hope that it will be useful, * 21 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file * 23 * LICENSE.TXT for more details. * 24 * * 25 *************************************************************************/ 26 27 /* 28 Multithreaded computation of the distance field. 29 */ 30 31 #ifndef _DISTANCEFIELDMT_H_ 32 #define _DISTANCEFIELDMT_H_ 33 34 //#define USE_MULTICORE_LIBRARY 35 36 #include "distanceField.h" 37 38 class DistanceFieldMT : public DistanceField 39 { 40 public: 41 42 DistanceFieldMT(int numThreads); 43 virtual ~DistanceFieldMT(); 44 45 DistanceFieldMT(int resolutionX, int resolutionY, int resolutionZ, int numThreads); 46 47 // advanced function (tells what range of Z-slices is assigned to each thread) 48 int GetStartSlice(int rank); 49 int GetEndSlice(int rank); 50 51 protected: 52 virtual int ZigZagSigned(void * objMeshOctree, void * meshGraph); 53 virtual int ZigZagUnsigned(void * objMeshOctree, void * meshGraph); 54 virtual int ZigZagFloodFillSigned(void * objMeshOctree, void * meshGraph); 55 56 void Setup(); 57 58 int numThreads; 59 int * startSlice; 60 int * endSlice; 61 }; 62 63 #endif 64 65