本文整理汇总了C++中voro::container类的典型用法代码示例。如果您正苦于以下问题:C++ container类的具体用法?C++ container怎么用?C++ container使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了container类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addCellSeed
void addCellSeed(voro::container &_con, ofPoint &_pnt, int _i, bool _checkInside){
if (_checkInside){
if ( insideContainer(_con, _pnt ))
_con.put(_i, _pnt.x, _pnt.y, _pnt.z);
} else {
_con.put(_i, _pnt.x, _pnt.y, _pnt.z);
}
}
示例2: getCellsFromContainer
void getCellsFromContainer(voro::container &_con, float _wallsThikness, vector<ofMesh>& cells){
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;
ofMesh cellMesh;
getCellMesh(c, ofPoint(pp[0],pp[1],pp[2])*(float)(1.0+_wallsThikness), cellMesh);
cells.push_back( cellMesh );
i++;
}
} while( vl.inc() );
}
return;
}
示例3: getCellsVertices
vector< vector<ofPoint> > getCellsVertices(voro::container &_con){
vector< vector<ofPoint> > cells;
ofPoint pos;
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 {
double *pp = _con.p[vl.ijk] + _con.ps * vl.q;
vector< ofPoint > cell = getCellVerteces(c, ofPoint(pp[0],pp[1],pp[2]) );
cells.push_back( cell );
i++;
}
} while( vl.inc() );
}
return cells;
}
示例4: getCellsPolylines
vector< ofPolyline > getCellsPolylines(voro::container &_con){
vector< ofPolyline > cells;
ofPoint pos;
voro::c_loop_all vl( _con );
if( vl.start() ){
do {
voro::voronoicell c;
int k = 0;
if( !_con.compute_cell(c, vl) ) {
return cells;
} else {
double *pp = _con.p[vl.ijk] + _con.ps * vl.q;
ofPoint pos = ofPoint(pp[0],pp[1],pp[2]);
ofPolyline cell;
double *ptsp= c.pts;
vector<ofPoint> points;
// Index
//
for(int i = 0; i < c.p; i++){
for(int j = 0; j < c.nu[i]; j++) {
int k = c.ed[i][0];
ofPoint newPoint;
newPoint.x = pos.x + c.pts[3*k]*0.5;
newPoint.y = pos.y + c.pts[3*k+1]*0.5;
newPoint.z = pos.z + c.pts[3*k+2]*0.5;
cell.addVertex(newPoint);
}
}
cells.push_back( cell );
}
} while( vl.inc() );
}
return cells;
}
示例5: getCellsCentroids
vector<ofPoint> getCellsCentroids(voro::container &_con){
vector<ofPoint> centroids;
voro::c_loop_all vl( _con );
int i = 0;
if( vl.start() ){
do {
voro::voronoicell c;
if( !_con.compute_cell(c, vl) ) {
return centroids;
} else {
double *pp = _con.p[vl.ijk] + _con.ps * vl.q;
centroids.push_back( getCellCentroid(c) + ofPoint(pp[0],pp[1],pp[2]) );
i++;
}
} while( vl.inc() );
}
return centroids;
}
示例6: getCellsFromContainer
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() );
}
}
示例7: getCellsRadius
vector<float> getCellsRadius(voro::container &_con){
vector<float> radius;
voro::c_loop_all vl( _con );
int i = 0;
if( vl.start() ){
do {
voro::voronoicell c;
if( !_con.compute_cell(c, vl) ) {
return radius;
} else {
double *pp = _con.p[vl.ijk] + _con.ps * vl.q;
float rad = getCellRadius(c);
radius.push_back( rad );
i++;
}
} while( vl.inc() );
}
return radius;
}
示例8: getCellsFromContainerParallel
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() );
}
}
示例9: insideContainer
bool insideContainer(voro::container &_con, ofPoint _pos){
return _con.point_inside(_pos.x, _pos.y, _pos.z);
}