void PathPlanner::alignPathPlannerGridToColliderCloud() { // If the collider cloud's grid changed, copy the grid dimensions (not resolution) and repopulate if(!mParametersPathPlanner.grid.hasSameExtents(mPointCloudColliders->getGrid())) { qDebug() << __PRETTY_FUNCTION__ << "following collider cloud from current" << CudaHelper::convert(mParametersPathPlanner.grid.worldMin) << CudaHelper::convert(mParametersPathPlanner.grid.worldMin) << "to" << CudaHelper::convert(mPointCloudColliders->getGrid().worldMin) << CudaHelper::convert(mPointCloudColliders->getGrid().worldMax); mParametersPathPlanner.grid.worldMin = mPointCloudColliders->getGrid().worldMin; mParametersPathPlanner.grid.worldMax = mPointCloudColliders->getGrid().worldMax; mRepopulateOccupanccyGrid = true; emit vboInfoGridOccupancy( mVboGridOccupancy, Box3D( QVector3D(mParametersPathPlanner.grid.worldMin.x, mParametersPathPlanner.grid.worldMin.y, mParametersPathPlanner.grid.worldMin.z), QVector3D(mParametersPathPlanner.grid.worldMax.x, mParametersPathPlanner.grid.worldMax.y, mParametersPathPlanner.grid.worldMax.z) ), Vector3<quint16>(mParametersPathPlanner.grid.cells.x, mParametersPathPlanner.grid.cells.y, mParametersPathPlanner.grid.cells.z) ); emit vboInfoGridPathPlanner( mVboGridPathPlanner, Box3D( QVector3D(mParametersPathPlanner.grid.worldMin.x, mParametersPathPlanner.grid.worldMin.y, mParametersPathPlanner.grid.worldMin.z), QVector3D(mParametersPathPlanner.grid.worldMax.x, mParametersPathPlanner.grid.worldMax.y, mParametersPathPlanner.grid.worldMax.z) ), Vector3<quint16>(mParametersPathPlanner.grid.cells.x, mParametersPathPlanner.grid.cells.y, mParametersPathPlanner.grid.cells.z) ); } }
const char* AtomicBlockSerializer3D::getNextDataBuffer(pluint& bufferSize) const { PLB_PRECONDITION( !isEmpty() ); if (ordering==IndexOrdering::forward || ordering==IndexOrdering::memorySaving) { bufferSize = domain.getNz() * block.getDataTransfer().staticCellSize(); buffer.resize(bufferSize); block.getDataTransfer().send(Box3D(iX,iX,iY,iY, domain.z0, domain.z1), buffer, modif::staticVariables); ++iY; if (iY > domain.y1) { iY = domain.y0; ++iX; } } else { bufferSize = domain.getNx() * block.getDataTransfer().staticCellSize(); buffer.resize(bufferSize); block.getDataTransfer().send(Box3D(domain.x0, domain.x1, iY,iY,iZ,iZ), buffer, modif::staticVariables); ++iY; if (iY > domain.y1) { iY = domain.y0; ++iZ; } } return &buffer[0]; }
Box3D SurfaceDivision3D::cornerPP() const{ // plane XY if (direction == 2){ return Box3D(domain.x1-bw+1, domain.x1, domain.y1-bw+1, domain.y1, domain.z0, domain.z1); } // plane YZ if (direction == 0){ return Box3D(); } // plane XZ return Box3D(); }
Box3D SurfaceDivision3D::edge1N() const{ // plane XY if (direction == 2){ return Box3D(domain.x0+bw, domain.x1-bw, domain.y0, domain.y0+bw-1, domain.z0, domain.z1); } // plane YZ if (direction == 0){ return Box3D(); } // plane XZ return Box3D(); }
SparseBlockStructure3D createRegularDistribution3D ( Box3D const& domain, plint numBlocksX, plint numBlocksY, plint numBlocksZ ) { SparseBlockStructure3D dataGeometry(domain); plint posX = domain.x0; for (plint iBlockX=0; iBlockX<numBlocksX; ++iBlockX) { plint lx = domain.getNx() / numBlocksX; if (iBlockX < domain.getNx()%numBlocksX) ++lx; plint posY = domain.y0; for (plint iBlockY=0; iBlockY<numBlocksY; ++iBlockY) { plint ly = domain.getNy() / numBlocksY; if (iBlockY < domain.getNy()%numBlocksY) ++ly; plint posZ = domain.z0; for (plint iBlockZ=0; iBlockZ<numBlocksZ; ++iBlockZ) { plint lz = domain.getNz() / numBlocksZ; if (iBlockZ < domain.getNz()%numBlocksZ) ++lz; dataGeometry.addBlock ( Box3D(posX, posX+lx-1, posY, posY+ly-1, posZ, posZ+lz-1), dataGeometry.nextIncrementalId() ); posZ += lz; } posY += ly; } posX += lx; } return dataGeometry; }
Box3D GL_widget_3::draw_polygon(const QVector<Point3D>& polygon) { double xmin, xmax, ymin, ymax, zmin, zmax; // glNormal3f(0.0,1.0,0.0); glBegin(GL_POLYGON); //glVertex3d(0,0,0); //glVertex3d(0,0,1); //glVertex3d(0,0,1); //glVertex3d(0,1,1); //glVertex3d(2,1,0); //glEnd(); //return Box3D(0, 0, 0, 2, 1, 1); // std::cout << LOG_GREEN << "polygon start" << std::endl; QVector<Point3D>::const_iterator p_it, p_end = polygon.end(); /*int i = 0;*/ for (p_it = polygon.begin(); p_it!=p_end/* && i<3*/; p_it++/*, i++*/) { // std::cout << "p: " << p_it->x << ", " << p_it->y << ", " << p_it->z << std::endl; glVertex3d(p_it->x,p_it->y,p_it->z); if (p_it==polygon.begin()) { xmin = xmax = p_it->x; ymin = ymax = p_it->y; zmin = zmax = p_it->z; } else { if (p_it->x < xmin) xmin = p_it->x; if (p_it->x > xmax) xmax = p_it->x; if (p_it->y < ymin) ymin = p_it->y; if (p_it->y > ymax) ymax = p_it->y; if (p_it->z < zmin) zmin = p_it->z; if (p_it->z > zmax) zmax = p_it->z; } } glEnd(); return Box3D(xmin, ymin, zmin, xmax, ymax, zmax); }
Box3D GL_widget_3::draw_point(double x, double y, double z, bool with_begin_end) { makeCurrent(); if (with_begin_end) glBegin(GL_POINTS); glVertex3d(x,y,z); if (with_begin_end) glEnd(); return Box3D(x,y,z,x,y,z); }
SparseBlockStructure3D createRegularDistribution3D ( plint nx, plint ny, plint nz, plint numBlocksX, plint numBlocksY, plint numBlocksZ ) { return createRegularDistribution3D ( Box3D(0, nx-1, 0, ny-1, 0, nz-1), numBlocksX, numBlocksY, numBlocksZ); }
Box3D SurfaceDivision3D::bulk() const{ // plane XY if (direction == 2){ return Box3D(domain.x0+bw,domain.x1-bw, domain.y0+bw,domain.y1-bw, domain.z0,domain.z1); } // plane YZ if (direction == 0){ return Box3D(domain.x0,domain.x1, domain.y0+bw,domain.y1-bw, domain.z0+bw,domain.z1-bw); } // plane XZ return Box3D(domain.x0+bw,domain.x1-bw, domain.y0,domain.y1, domain.z0+bw,domain.z1-bw); }
Box3D GL_widget_3::draw_sphere(double orig_x, double orig_y, double orig_z, double radius) { glPushMatrix(); glTranslated(orig_x, orig_y, orig_z); glScaled(radius, radius, radius); glCallList(sphere_dl); glPopMatrix(); // std::cout << "sphere display list " << sphere_dl << std::endl; return Box3D(orig_x-radius, orig_y-radius, orig_z-radius, orig_x+radius, orig_y+radius, orig_z+radius); }
void AtomicBlockUnSerializer3D::commitData() { PLB_PRECONDITION( !isFull() ); if (ordering==IndexOrdering::forward || ordering==IndexOrdering::memorySaving) { block.getDataTransfer().receive(Box3D(iX,iX,iY,iY, domain.z0, domain.z1), buffer, modif::staticVariables); ++iY; if (iY > domain.y1) { iY = domain.y0; ++iX; } } else { block.getDataTransfer().receive(Box3D(domain.x0, domain.x1, iY,iY,iZ,iZ), buffer, modif::staticVariables); ++iY; if (iY > domain.y1) { iY = domain.y0; ++iZ; } } }
Box3D SmartBulk3D::computeNonPeriodicEnvelope() const { Box3D boundingBox = sparseBlock.getBoundingBox(); return Box3D ( std::max(bulk.x0-envelopeWidth, boundingBox.x0), std::min(bulk.x1+envelopeWidth, boundingBox.x1), std::max(bulk.y0-envelopeWidth, boundingBox.y0), std::min(bulk.y1+envelopeWidth, boundingBox.y1), std::max(bulk.z0-envelopeWidth, boundingBox.z0), std::min(bulk.z1+envelopeWidth, boundingBox.z1) ); }
MultiBlock3D::MultiBlock3D(plint nx, plint ny, plint nz, plint envelopeWidth) : multiBlockManagement(defaultMultiBlockPolicy3D().getMultiBlockManagement ( Box3D(0,nx-1,0,ny-1,0,nz-1), envelopeWidth) ), maxProcessorLevel(-1), blockCommunicator(defaultMultiBlockPolicy3D().getBlockCommunicator()), internalStatistics(), combinedStatistics(defaultMultiBlockPolicy3D().getCombinedStatistics()), statSubscriber(*this), statisticsOn(true), periodicitySwitch(*this), internalModifT(modif::staticVariables) { id = multiBlockRegistration3D().announce(*this); }
DistributionFactory::DistributionFactory() { /* Distribution registering */ registerDistribution(Box1D<xaxis>()); registerDistribution(Box1D<yaxis>()); registerDistribution(Box1D<zaxis>()); registerDistribution(Box2D<xaxis>()); registerDistribution(Box2D<yaxis>()); registerDistribution(Box2D<zaxis>()); registerDistribution(Box3D()); registerDistribution(Cyl2D<xaxis>()); registerDistribution(Cyl2D<yaxis>()); registerDistribution(Cyl2D<zaxis>()); registerDistribution(Isotropic()); registerDistribution(AceDistribution()); }
void ParticleSystem::slotEmitVboInfoAndParameters() { qDebug() << __PRETTY_FUNCTION__ << "emitting VBO info."; emit vboInfoParticles( mVboParticlePositions, mParametersSimulation->particleCount, mParametersSimulation->particleRadius, Box3D( CudaHelper::convert(mParametersSimulation->gridParticleSystem.worldMin), CudaHelper::convert(mParametersSimulation->gridParticleSystem.worldMax) ) ); qDebug() << __PRETTY_FUNCTION__ << "telling UI about changed parameters..."; emit parametersChanged(mParametersSimulation); qDebug() << __PRETTY_FUNCTION__ << "done."; }
Box3D GL_widget_3::draw_segment(double x1, double y1, double z1, double x2, double y2, double z2, bool with_begin_end) { double xmin, xmax, ymin, ymax, zmin, zmax; xmin = x1; xmax = x2; ymin = y1; ymax = y2; zmin = z1; zmax = z2; if (xmax<xmin) { double temp = xmin; xmin = xmax; xmax = temp; } if (ymax<ymin) { double temp = ymin; ymin = ymax; ymax = temp; } if (zmax<zmin) { double temp = zmin; zmin = zmax; zmax = temp; } makeCurrent(); // std::cout << "segment rendered with GL_LINES: " << with_begin_end << std::endl; if (with_begin_end) glBegin(GL_LINES); glVertex3d(x1,y1,z1); glVertex3d(x2,y2,z2); if (with_begin_end) glEnd(); return Box3D(xmin, ymin, zmin, xmax, ymax, zmax); }
Box3D GL_widget_3::draw_triangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double xn, double yn, double zn, bool with_begin_end) { double xmin, ymin, zmin, xmax, ymax, zmax; xmin = xmax = x1; ymin = ymax = y1; zmin = zmax = z1; if (x2<xmin) xmin = x2; if (x2>xmax) xmax = x2; if (y2<ymin) ymin = y2; if (y2>ymax) ymax = y2; if (z2<zmin) zmin = z2; if (z2>zmax) zmax = z2; if (x3<xmin) xmin = x3; if (x3>xmax) xmax = x3; if (y3<ymin) ymin = y3; if (y3>ymax) ymax = y3; if (z3<zmin) zmin = z3; if (z3>zmax) zmax = z3; makeCurrent(); glNormal3f(xn,yn,zn); if (with_begin_end) glBegin(GL_TRIANGLES); glVertex3d(x1,y1,z1); // glNormal3f(xn,yn,zn); glVertex3d(x2,y2,z2); // glNormal3f(xn,yn,zn); glVertex3d(x3,y3,z3); if (with_begin_end) glEnd(); return Box3D(xmin, ymin, zmin, xmax, ymax, zmax); }
cell AMX_NATIVE_CALL Natives::CreateDynamicCuboid(AMX *amx, cell *params) { CHECK_PARAMS(9, "CreateDynamicCuboid"); if (core->getData()->getGlobalMaxItems(STREAMER_TYPE_AREA) == core->getData()->areas.size()) { return 0; } int areaID = Item::Area::identifier.get(); Item::SharedArea area(new Item::Area); area->amx = amx; area->areaID = areaID; area->type = STREAMER_AREA_TYPE_CUBOID; area->position = Box3D(Eigen::Vector3f(amx_ctof(params[1]), amx_ctof(params[2]), amx_ctof(params[3])), Eigen::Vector3f(amx_ctof(params[4]), amx_ctof(params[5]), amx_ctof(params[6]))); boost::geometry::correct(boost::get<Box3D>(area->position)); area->size = static_cast<float>(boost::geometry::comparable_distance(Eigen::Vector2f(boost::get<Box3D>(area->position).min_corner()[0], boost::get<Box3D>(area->position).min_corner()[1]), Eigen::Vector2f(boost::get<Box3D>(area->position).max_corner()[0], boost::get<Box3D>(area->position).max_corner()[1]))); Utility::addToContainer(area->worlds, static_cast<int>(params[7])); Utility::addToContainer(area->interiors, static_cast<int>(params[8])); Utility::addToContainer(area->players, static_cast<int>(params[9])); core->getGrid()->addArea(area); core->getData()->areas.insert(std::make_pair(areaID, area)); return static_cast<cell>(areaID); }
int ReferenceFrame2D::AddNode(Node* n) { n->SetAuxNode(); double tol = 1e-8*GetMBS()->CharacteristicLength(); //standard: /* for (int i = 1; i <=nodes.Length(); i++) { if (Dist(n->Pos(),nodes(i)->Pos()) <= tol) return i; } Node* nc = n->GetCopy(); return nodes.Add(nc); */ //optimized: IVector items; Box3D box(n->Pos(),n->Pos()); box.Increase(tol); //disabled in example for witteven adams comparison Milano conference 2007 searchtree.GetItemsInBox(box,items); for (int i = 1; i <= items.Length(); i++) { //if (Dist(n->Pos(),nodes(items(i))->Pos()) <= tol) return items(i); if (Dist(n->Pos(),nodes(items(i))->Pos()) <= tol && (n->GetBodyInd() == nodes(items(i))->GetBodyInd()) ) return items(i); //$ AD FENodes have domain } Node* nc = n->GetCopy(); int index = nodes.Add(nc); nc->NodeNum() = index; //store node number in reference configuration (local == global) for const int& access of virtual function nodenum in referenceframe2D searchtree.AddItem(Box3D(n->Pos(),n->Pos()), index); return index; }
SparseBlockStructure3D createZSlicedDistribution3D ( CellTypeField3D const& cellTypeField, plint numBlocks ) { plint nX = cellTypeField.getNx(); plint nY = cellTypeField.getNy(); plint nZ = cellTypeField.getNz(); std::vector<plint> numActivePerSlice; plint numActiveTotal = 0; for(plint iZ=0; iZ<nZ; iZ++) { plint numActiveCurrentSlice = 0; for(plint iX=0; iX<nX; iX++) { for (plint iY=0; iY<nY; iY++) { if (cellTypeField.get(iX,iY,iZ) > 0) numActiveCurrentSlice++; } } numActivePerSlice.push_back(numActiveCurrentSlice); numActiveTotal += numActiveCurrentSlice; } plint numActivePerBlock = numActiveTotal / numBlocks; SparseBlockStructure3D dataGeometry(nX, nY, nZ); plint iZ=0; for (plint iBlock=0; iBlock<numBlocks; ++iBlock) { plint posZ = iZ; plint numActiveCurrentBlock = 0; while (numActiveCurrentBlock<numActivePerBlock && iZ<nZ) { numActiveCurrentBlock += numActivePerSlice[iZ]; iZ++; } dataGeometry.addBlock ( Box3D(0, nX-1, 0, nY-1, posZ, iZ-1), dataGeometry.nextIncrementalId() ); } return dataGeometry; }
SparseBlockStructure3D createRegularDistribution3D ( plint nx, plint ny, plint nz, int numProc) { return createRegularDistribution3D ( Box3D(0, nx-1, 0, ny-1, 0, nz-1), numProc ); }
Box3D BlockSurface3D::surface2N() const { return Box3D( domain.x0+bw, domain.x1-bw, domain.y0+bw, domain.y1-bw, domain.z0, domain.z0+bw-1 ); }
Box3D BlockSurface3D::surface2P() const { return Box3D( domain.x0+bw, domain.x1-bw, domain.y0+bw, domain.y1-bw, domain.z1-bw+1, domain.z1 ); }
Box3D BlockSurface3D::edge0NN() const { return Box3D( domain.x0+bw, domain.x1-bw, // Plane x; y: negative, z: negative domain.y0, domain.y0+bw-1, domain.z0, domain.z0+bw-1 ); }
Box3D BlockSurface3D::cornerPPP() const { return Box3D( domain.x1-bw+1, domain.x1, domain.y1-bw+1, domain.y1, domain.z1-bw+1, domain.z1 ); }
Box3D Visualization_layer::get_3d_bounding_box(bool *is_valid) { *is_valid = !default_bounding_box; return Box3D(bounding_xmin, bounding_ymin, bounding_zmin, bounding_xmax, bounding_ymax, bounding_zmax); }
Box3D BlockSurface3D::surface1N() const { return Box3D( domain.x0+bw, domain.x1-bw, domain.y0, domain.y0+bw-1, domain.z0+bw, domain.z1-bw ); }
void MemInfo(char forced) { #ifndef TEXTONLY char str[30]; unsigned long ldsp; int y=endvtoolbar(); int color; long value; if(forced && meminfovisible) { if(arachne.framescount) { p->activeframe=0; redrawHTML(REDRAW_NO_MESSAGE,REDRAW_CREATE_VIRTUAL); } else redrawHTML(REDRAW_WITH_MESSAGE,REDRAW_VIRTUAL); meminfovisible=0; return; } if((x_maxx()<640 || arachne.GUIstyle || fullscreen || customerscreen || fixedfont) /*fixedfont=printing hack*/ && !forced) return; if(arachne.GUIstyle) meminfovisible=1; mouseoff(); y+=2; Box3D(x_maxx()-150,y,x_maxx()-1,x_maxy()-17); y+=1; htmlfont(0,NORMAL); if(forced && lastinfo && endvtoolbar()>=x_maxy()-14*(fonty(0,NORMAL)-1)) goto moreinfo; #ifndef POSIX //DOS memory value=farcoreleft();//>>10; //!!glennmcc Oct 09, 2004 don't round off to KB sprintf(str,"%4lu",value); if(value<50000l || memory_model==0) { color=2; strcat(str,"[!!!]"); } else if(memory_model==2) { color=3; strcat(str,"[+]"); } else { color=0; strcat(str,"[?]"); } MemInfoLine("Dos mem",str,color,&y);//!!glennmcc Oct 09, 2004 don't round off to KB //XMS used sprintf(str,"%5lu",mem_all_xmem()); MemInfoLine("Used XMS (KB)",str,0,&y); #endif//posix //XSWAP free ldsp=ie_free()>>10; sprintf(str,"%4ld",ldsp); if(ldsp<500) { color=2; strcat(str,"[!!!]"); } else color=0; MemInfoLine("Free xSwap (KB)",str,color,&y); //XSWAP used sprintf(str,"%4ld",ie_used()>>10); MemInfoLine("Used xSwap (KB)",str,0,&y); #ifndef POSIX //disk space //!!glennmcc: Nov 25, 2005 -- check space on the cache drive //and the current drive .... display both when not the same drive //when cache is on local drive, display only one #ifndef NOKEY { ldsp=lastdiskspace(configvariable(&ARACHNEcfg,"CachePath",NULL))>>20; //local & cache /**/ if(ldsp==(localdiskspace()>>20)) sprintf(str,"%4lu",ldsp); else sprintf(str,"%4lu %4lu",localdiskspace()>>20,ldsp); /**/ //temp & cache /* if(ldsp==(lastdiskspace(getenv("TEMP"))>>20)) sprintf(str,"cache_%4lu",ldsp); else sprintf(str,"temp_%4lu cache_%4lu",lastdiskspace(getenv("TEMP"))>>20,ldsp); */ }
Box3D BlockSurface3D::edge0PP() const { return Box3D( domain.x0+bw, domain.x1-bw, // Plane x; y: positive, z: positive domain.y1-bw+1, domain.y1, domain.z1-bw+1, domain.z1 ); }
Box3D BlockSurface3D::bulk() const { return Box3D( domain.x0+bw, domain.x1-bw, domain.y0+bw, domain.y1-bw, domain.z0+bw, domain.z1-bw ); }