コード例 #1
0
ファイル: ofxVoro.cpp プロジェクト: arthurhunt7/ofxVoro
ofVboMesh getCellMesh(voro::voronoicell &_c, ofPoint _pos, bool bWireframe){
    if( _c.p ) {
        ofVboMesh mesh;
		getCellMesh(_c, _pos, mesh, bWireframe);
        return mesh;
    }
    return ofVboMesh();
}
コード例 #2
0
ファイル: ofxVoro.cpp プロジェクト: arthurhunt7/ofxVoro
void getCellsFromContainer(voro::container &_con, vector<ofVboMesh>& cells, bool bWireframe){
    cells.clear();
	
    voro::c_loop_all vl( _con );
    int i = 0;
	if( vl.start() ){
        
        do {
            voro::voronoicell c;
            if( !_con.compute_cell(c, vl) ) {
                return;
            } else {
                double *pp = _con.p[vl.ijk] + _con.ps * vl.q;
				ofVboMesh cellMesh;
                getCellMesh(c, cellMesh, bWireframe);
                cells.push_back( cellMesh );
                i++;
            }
            
        } while( vl.inc() );
    }
}
コード例 #3
0
ファイル: ofxVoro.cpp プロジェクト: arthurhunt7/ofxVoro
vector<ofVboMesh>  getCellsFromContainer(voro::container &_con, float _wallsThikness, float _maxRadius, bool bWireframe){
    vector<ofVboMesh> cells;
    
    voro::c_loop_all vl( _con );
    int i = 0;
	if( vl.start() ){
        do {
            voro::voronoicell c;
            if( !_con.compute_cell(c, vl) ) {
                return cells;
            } else {
                if(getCellRadius(c)<_maxRadius){
                    double *pp = _con.p[vl.ijk] + _con.ps * vl.q;
                    ofVboMesh cellMesh = getCellMesh(c, ofPoint(pp[0],pp[1],pp[2])*(float)(1.0+_wallsThikness), bWireframe);
                    cells.push_back( cellMesh );
                }
                i++;
            }
            
        } while( vl.inc() );
    }
    
    return cells;
}
コード例 #4
0
void VoroNode::getCellsFromContainerParallel(voro::container &_con, float _wallsThikness, vector<ofVboMesh>& cells, bool bWireframe){
    
    cells.clear();
    
    voro::c_loop_all vl( _con );
    if( vl.start() ){
        
        do {
            //                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
            voro::voronoicell c;
            if( !_con.compute_cell(c, vl) ) {
                return;
            } else {
                double *pp = _con.p[vl.ijk] + _con.ps * vl.q;
                ofVboMesh cellMesh;
                getCellMesh(c, ofPoint(pp[0],pp[1],pp[2])*(float)(1.0+_wallsThikness), cellMesh, bWireframe);
                cells.push_back( cellMesh );
            }
            
            //                });
            
        } while( vl.inc() );
    }
}
コード例 #5
0
ファイル: ofxVoro.cpp プロジェクト: arthurhunt7/ofxVoro
void getCellMesh(voro::voronoicell &_c, ofVboMesh& mesh, bool bWireframe){
    getCellMesh(_c, ofPoint(0,0), mesh, bWireframe);
}