void Rectangles::finish() { ended = true; // calculate lines positions, sizes and nrLines for(unsigned i = 0; i < rectangles.size(); i++) { if (rectangles[i].getIsPinned()) { // create edges (0:left, 1:right, 2:bottom, 3:top) createLines(i, Edge::LEFT); createLines(i, Edge::RIGHT); createLines(i, Edge::BOTTOM); createLines(i, Edge::TOP); } } std::cout << "nr lines: " << nrLines << std::endl; animationStarted = new bool[nrLines]; animationStart = new double[nrLines]; for (unsigned i = 0; i < nrLines; i++) { animationStarted[i] = false; } }
void PMTorus::createViewStructure( ) { if( !m_pViewStructure ) { m_pViewStructure = new PMViewStructure( defaultViewStructure( ) ); m_pViewStructure->points( ).detach( ); } int uStep = (int)( ( (float)s_uStep / 2 ) * ( displayDetail( ) + 1 ) ); int vStep = (int)( ( (float)s_vStep / 2 ) * ( displayDetail( ) + 1 ) ); unsigned ptsSize = vStep * uStep; unsigned lineSize = vStep * uStep * 2; if( ptsSize != m_pViewStructure->points( ).size( ) ) m_pViewStructure->points( ).resize( ptsSize ); createPoints( m_pViewStructure->points( ), m_minorRadius, m_majorRadius, uStep, vStep ); if( lineSize != m_pViewStructure->lines( ).size( ) ) { m_pViewStructure->lines( ).detach( ); m_pViewStructure->lines( ).resize( lineSize ); createLines( m_pViewStructure->lines( ), uStep, vStep ); } }
void PMSuperquadricEllipsoid::createViewStructure( ) { if( !m_pViewStructure ) { m_pViewStructure = new PMViewStructure( defaultViewStructure( ) ); m_pViewStructure->points( ).detach( ); } int uStep = (int)( ( (float)s_uStep / 2 ) * ( displayDetail( ) + 1 ) ); int vStep = (int)( ( (float)s_vStep / 2 ) * ( displayDetail( ) + 1 ) ); int uStep2 = uStep * 4; int vStep2 = vStep * 8; unsigned ptsSize = vStep2 * ( uStep2 - 1 ) + 2; unsigned lineSize = vStep2 * ( uStep2 - 1 ) * 2 + vStep2; if( ptsSize != m_pViewStructure->points( ).size( ) ) m_pViewStructure->points( ).resize( ptsSize ); createPoints( m_pViewStructure->points( ), m_eastWestExponent, m_northSouthExponent, uStep, vStep ); if( lineSize != m_pViewStructure->lines( ).size( ) ) { m_pViewStructure->lines( ).detach( ); m_pViewStructure->lines( ).resize( lineSize ); createLines( m_pViewStructure->lines( ), uStep2, vStep2 ); } }
PMViewStructure* PMSuperquadricEllipsoid::defaultViewStructure( ) const { if( !s_pDefaultViewStructure || s_pDefaultViewStructure->parameterKey( ) != viewStructureParameterKey( ) ) { delete s_pDefaultViewStructure; s_pDefaultViewStructure = 0; int uStep = (int)( ( (float)s_uStep / 2 ) * ( globalDetailLevel( ) + 1 ) ); int vStep = (int)( ( (float)s_vStep / 2 ) * ( globalDetailLevel( ) + 1 ) ); // transform u and v steps to sphere u/v steps int uStep2 = uStep * 4; int vStep2 = vStep * 8; s_pDefaultViewStructure = new PMViewStructure( vStep2 * ( uStep2 - 1 ) + 2, vStep2 * ( uStep2 - 1 ) * 2 + vStep2 ); // points createPoints( s_pDefaultViewStructure->points( ), c_defaultEastWestExponent, c_defaultNorthSouthExponent, uStep, vStep ); createLines( s_pDefaultViewStructure->lines( ), uStep2, vStep2 ); } return s_pDefaultViewStructure; }
void DisassemblyData::recheck() { u32 newHash = computeHash(address,size); if (newHash != hash) { hash = newHash; createLines(); } }
DisassemblyData::DisassemblyData(u32 _address, u32 _size, DataType _type): address(_address), size(_size), type(_type) { auto memLock = Memory::Lock(); if (!PSP_IsInited()) return; hash = computeHash(address,size); createLines(); }
////! [0] TreeModel::TreeModel(QObject *parent) : QAbstractItemModel(parent) { QList<QVariant> rootData; rootData << "Сущности"; rootItem = new TreeItem(rootData); const QStringList lines = createLines(); setupModelData(lines, rootItem); }
//------------------------------------------------------------------ void ofxVoronoi::createLines(vector <ofPoint> points, int minX, int maxX, int minY, int maxY, int minDist) { vector <int> xPoints; vector <int> yPoints; for(int i=0; i<points.size(); i++) { xPoints.push_back(points[i].x); yPoints.push_back(points[i].y); } createLines(xPoints,yPoints,minX,maxX,minY,maxY,minDist); }
void TreeModel::update() { delete rootItem; QList<QVariant> rootData; rootData << "Сущности"; rootItem = new TreeItem(rootData); const QStringList lines = createLines(); setupModelData(lines, rootItem); }
void DisassemblyData::recheck() { auto memLock = Memory::Lock(); if (!PSP_IsInited()) return; u32 newHash = computeHash(address,size); if (newHash != hash) { hash = newHash; createLines(); } }
PMViewStructure* PMCone::defaultViewStructure( ) const { if( !s_pDefaultViewStructure || s_pDefaultViewStructure->parameterKey( ) != viewStructureParameterKey( ) ) { delete s_pDefaultViewStructure; s_pDefaultViewStructure = 0; int steps = (int)( ( (float)s_numSteps / 2 ) * ( globalDetailLevel( ) + 1 ) ); s_pDefaultViewStructure = new PMViewStructure( steps * 2, steps * 3 ); createPoints( s_pDefaultViewStructure->points( ), defaultEnd1, defaultEnd2,defaultConeRadius1,defaultConeRadius2, steps ); createLines( s_pDefaultViewStructure->lines( ), steps ); } return s_pDefaultViewStructure; }
void compile_Arc2D (struct X3D_Arc2D *node) { /* have to regen the shape*/ struct SFVec2f *tmpptr_a, *tmpptr_b; int tmpint; MARK_NODE_COMPILED tmpint = 0; tmpptr_a = createLines (node->startAngle, node->endAngle, node->radius, NONE, &tmpint, node->_extent); /* perform the switch - worry about threading here without locking */ node->__numPoints = 0; /* tell us that it has zero points */ tmpptr_b = node->__points.p; /* old set of points, for freeing later */ node->__points.p = tmpptr_a; /* new points */ node->__numPoints = tmpint; FREE_IF_NZ (tmpptr_b); /* switch completed */ }
PMViewStructure* PMTorus::defaultViewStructure( ) const { if( !s_pDefaultViewStructure || s_pDefaultViewStructure->parameterKey( ) != viewStructureParameterKey( ) ) { delete s_pDefaultViewStructure; s_pDefaultViewStructure = 0; int uStep = (int)( ( (float)s_uStep / 2 ) * ( globalDetailLevel( ) + 1 ) ); int vStep = (int)( ( (float)s_vStep / 2 ) * ( globalDetailLevel( ) + 1 ) ); s_pDefaultViewStructure = new PMViewStructure( vStep * uStep , vStep * uStep * 2 ); createPoints( s_pDefaultViewStructure->points( ), c_defaultminorRadius, c_defaultmajorRadius, uStep, vStep ); createLines( s_pDefaultViewStructure->lines( ), uStep, vStep ); } return s_pDefaultViewStructure; }
Game::Game() : m_circleId(0), start(0), bPeriodEnd(false), m_totalObjects(0), m_elasticity(0.2f), m_friction(0.02f), m_airjetForce(0.0f), massId(0), mAppliedAirJet(true), mAirjetMagnitude(0.0f), mPause(false) { bRope = false; setElasticity(0.8f); setFriction(0.02f); Primitive::setGame(this); // init rope int ropePoints = 8; m_rope.init(10.0f, ropePoints, Vector(-4,12), Vector(4,12), true, true); // Initial values for components' frequencies m_physicsFreq = 200; m_networkFreq = 50; m_graphicsFreq = 60; createLines(); m_circles.reserve(50); m_manifold = new ContactManifold(); }
void PMCone::createViewStructure( ) { if( !m_pViewStructure ) { m_pViewStructure = new PMViewStructure(defaultViewStructure ( ) ); m_pViewStructure->points( ).detach( ); } int steps = (int)( ( (float)s_numSteps / 2 ) * ( displayDetail( ) + 1 ) ); unsigned ptsSize = steps * 2; unsigned lineSize = steps * 3; if( ptsSize != m_pViewStructure->points( ).size( ) ) m_pViewStructure->points( ).resize( ptsSize ); createPoints( m_pViewStructure->points( ), m_end1, m_end2, m_radius1, m_radius2, steps ); if( lineSize != m_pViewStructure->lines( ).size( ) ) { m_pViewStructure->lines( ).detach( ); m_pViewStructure->lines( ).resize( lineSize ); createLines( m_pViewStructure->lines( ), steps ); } }
void LineDemo::initLine() { createLines(); }
DisassemblyData::DisassemblyData(DebugInterface* _cpu, u32 _address, u32 _size, DataType _type): address(_address), size(_size), type(_type) { cpu = _cpu; hash = computeHash(address,size); createLines(); }
DisassemblyData::DisassemblyData(u32 _address, u32 _size, DataType _type): address(_address), size(_size), type(_type) { hash = computeHash(address,size); createLines(); }