void Table::removeConstraint(unsigned idx) { try { removeObject(idx,OBJ_CONSTRAINT); } catch(Exception &e) { throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } }
void LogicObject:: removeState(State* state) { bool status = removeObject(state); if (!status) { return; } assert(state != 0); state->deleteLater(); Base::Utility::ignoreUnused(status); }
void View::removeObject(const QString &name, ObjectType obj_type) { try { removeObject(getObjectIndex(name, obj_type), obj_type); } catch(Exception &e) { throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } }
void Module::unloadPC() { if (!_pc) return; removeObject(*_pc); removePCTokens(); delete _pc; _pc = 0; }
void Storage::removeObject(GeometryObject* obj) { if (obj->isCompound()) { printf("Removing compound object.\n"); const list<GeometryObject*>& objects = ((Compound*)obj)->getObjects(); for(CompoundIter it = objects.begin(); it != objects.end(); it++) { removeObject(*it); } } else { objs.remove(obj); } }
bool CSVRender::Cell::removeObject (const std::string& id) { std::map<std::string, Object *>::iterator iter = mObjects.find (Misc::StringUtils::lowerCase (id)); if (iter==mObjects.end()) return false; removeObject (iter); return true; }
void View::removeRule(unsigned idx) { try { removeObject(idx, OBJ_RULE); } catch(Exception &e) { throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } }
void Table::removeObject(const QString &name, ObjectType obj_type) { int idx; //Gets the object index getObject(name,obj_type,idx); //Removes the object If it was found (idx >= 0) if(idx>=0) removeObject(static_cast<unsigned>(idx),obj_type); }
void Table::removeIndex(unsigned idx) { try { removeObject(idx,OBJ_INDEX); } catch(Exception &e) { throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } }
void Table::removeRule(const QString &name) { try { removeObject(name,OBJ_RULE); } catch(Exception &e) { throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } }
void View::removeObject(BaseObject *obj) { try { removeObject(getObjectIndex(obj), obj->getObjectType()); } catch(Exception &e) { throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } }
// // MetaTable::clearTable // // Removes all objects from a metatable. // void MetaTable::clearTable() { MetaObject *obj = NULL; // iterate on the source table while((obj = tableIterator(NULL))) { removeObject(obj); delete obj; } }
GLSLEditorPlugin::~GLSLEditorPlugin() { removeObject(m_editor); delete m_actionHandler; delete m_glsl_120_frag; delete m_glsl_120_vert; delete m_glsl_120_common; delete m_glsl_es_100_frag; delete m_glsl_es_100_vert; delete m_glsl_es_100_common; m_instance = 0; }
// // MetaTable::clearTable // // Removes all objects from a metatable. // void MetaTable::clearTable() { MetaObject *obj = NULL; // iterate on the source table while((obj = tableIterator(obj))) { removeObject(obj); delete obj; obj = NULL; // restart from the beginning } }
void Renderer::removeAllObjects() { for (auto &ol: m_objectList) { for (auto &ro: ol) { if (ro) { removeObject(ro); ro.reset(); } } ol.clear(); } m_objectList.clear(); }
void PhysicsSystem::scaleObject (const std::string& handle, float scale) { if(handleToMesh.find(handle) != handleToMesh.end()) { btTransform transform = mEngine->getRigidBody(handle)->getWorldTransform(); removeObject(handle); Ogre::Quaternion quat = Ogre::Quaternion(transform.getRotation().getW(), transform.getRotation().getX(), transform.getRotation().getY(), transform.getRotation().getZ()); Ogre::Vector3 vec = Ogre::Vector3(transform.getOrigin().getX(), transform.getOrigin().getY(), transform.getOrigin().getZ()); addObject(handle, handleToMesh[handle], quat, scale, vec); } }
void testNodeRemovalAlongCut() { addObject(ObjID(1), ObjID(0), true); addObject(ObjID(2), ObjID(1), true); addObject(ObjID(3), ObjID(1), true); addObject(ObjID(4), ObjID(1), true); refineToBottom(); verifyTreesMatch(); #ifdef LIBPROX_LIFT_CUTS removeObject(ObjID(4)); // When lifting, this'll force lifting up to the next node, in this case // the root TS_ASSERT_EQUALS(replicated_handler->numNodes(), 1); // Removing the other two children should leave us in the same place removeObject(ObjID(3)); TS_ASSERT_EQUALS(replicated_handler->numNodes(), 1); removeObject(ObjID(2)); TS_ASSERT_EQUALS(replicated_handler->numNodes(), 1); #else removeObject(ObjID(4)); // Removing one of the nodes, node 4, should leave the cut through the // other two nodes, 2 and 3, intact. TS_ASSERT_EQUALS(replicated_handler->numNodes(), 3); verifyTreesMatch(); // We should be able to do the same with node 3 removeObject(ObjID(3)); TS_ASSERT_EQUALS(replicated_handler->numNodes(), 2); verifyTreesMatch(); // And finally drop back to only the root removeObject(ObjID(2)); TS_ASSERT_EQUALS(replicated_handler->numNodes(), 1); verifyTreesMatch(); #endif }
static void initialize() { commentOnlyObjectName(); commentOnlyObjectText(); version(); header(); commentOnlyLine(); contentAndCommentLine(); group(); includeFile(); removeObject(); line(); memoProperty(); noteProperty(); objectNoFields(); objectAndFields(); uniqueProperty(); requiredObjectProperty(); obsoleteProperty(); hasurlProperty(); extensibleProperty(); formatProperty(); minFieldsProperty(); maxFieldsProperty(); field(); closingField(); lastField(); name(); nameProperty(); requiredFieldProperty(); autosizableProperty(); autocalculatableProperty(); retaincaseProperty(); unitsProperty(); ipUnitsProperty(); minExclusiveProperty(); minInclusiveProperty(); maxExclusiveProperty(); maxInclusiveProperty(); deprecatedProperty(); defaultProperty(); automaticDefault(); typeProperty(); keyProperty(); objectListProperty(); externalListProperty(); referenceProperty(); beginExtensible(); beginExtensibleProperty(); metaDataComment(); versionObjectName(); }
void PhysicsSystem::scaleObject (const Ptr& ptr) { Ogre::SceneNode* node = ptr.getRefData().getBaseNode(); std::string handle = node->getName(); if(handleToMesh.find(handle) != handleToMesh.end()) { removeObject(handle); addObject(ptr); } if (OEngine::Physic::PhysicActor* act = mEngine->getCharacter(handle)) act->setScale(node->getScale().x); }
void GenericDataCollection::appendObject(const int id, GenericDataObject* obj) { removeObject(id); if (obj != nullptr) { m_objects.insert(id, obj); m_sortedIDs.append(id); if (id > m_largestId) { m_largestId = id; } } }
// Same as above, but takes a Set instead of a Vector. Should only be called during teardown. void PhysicsEngine::deleteObjects(SetOfMotionStates& objects) { for (auto object : objects) { btRigidBody* body = object->getRigidBody(); removeObject(object); // NOTE: setRigidBody() modifies body->m_userPointer so we should clear the MotionState's body BEFORE deleting it. object->setRigidBody(nullptr); body->setMotionState(nullptr); delete body; object->releaseShape(); delete object; } }
void Simulator::tick_work(Time last_time, Duration elapsed) { SimulatorBase::tick_work(last_time, elapsed); if (mForceRebuild || (mForceInitialRebuild && last_time == Time::null())) { mHandler->rebuild(); // For the tests run in the simulator, we want to perform rebuilds // synchronously mHandler->waitForRebuild(); } else { // Object Churn... for(int i = 0; !mObjects.empty() && i < mChurn; i++) { Object* obj = mObjects.begin()->second; removeObject(obj); } for(int i = 0; !(mRemovedDynamicObjects.empty() && mRemovedStaticObjects.empty()) && i < mChurn; i++) { Object* obj = (!mRemovedDynamicObjects.empty() ? mRemovedDynamicObjects.begin()->second : mRemovedStaticObjects.begin()->second); addObject(obj); } } // Give all queries a chance to update for(QueryList::iterator it = mQueries.begin(); it != mQueries.end(); it++) (*it)->tick(mTime); // Tick the handler if (mForceRebuild || last_time == Time::null()) { // To simplify stats collection with rebuilds, we allow for // double-ticking. We use the same timestep and just. This just lets // us get valid "checks" counts when we're rebuilding every frame. // We also do this always on the first tick to avoid reporting the // initial cost of pushing down a cut. mHandler->tick(mTime, false); mHandler->tick(mTime, true); } else { // normal ticking mHandler->tick(mTime); } mItsSinceRateApprox++; if (mItsSinceRateApprox >= RATE_APPROX_ITERATIONS) { float its_per_sec = float(RATE_APPROX_ITERATIONS) * queriesSize() / (elapsed - mRateApproxStart).seconds(); if (mReportRate) printf("{ \"rate\" : %f }\n", its_per_sec); // Reset for next round mItsSinceRateApprox = 0; mRateApproxStart = elapsed; } }
void Renderer::removeAllSentBy(int sender, const std::string &senderPort) { for (auto &ol: m_objectList) { for (auto &ro: ol) { if (ro && ro->senderId == sender && ro->senderPort == senderPort) { removeObject(ro); ro.reset(); } } ol.erase(std::remove_if(ol.begin(), ol.end(), [](std::shared_ptr<vistle::RenderObject> ro) { return !ro; }), ol.end()); } while (!m_objectList.empty() && m_objectList.back().empty()) m_objectList.pop_back(); }
void Renderer::removeAllCreatedBy(int creatorId) { for (auto &ol: m_objectList) { for (auto &ro: ol) { if (ro && ro->container && ro->container->getCreator() == creatorId) { removeObject(ro); ro.reset(); } } ol.erase(std::remove_if(ol.begin(), ol.end(), [](std::shared_ptr<vistle::RenderObject> ro) { return !ro; }), ol.end()); } while (!m_objectList.empty() && m_objectList.back().empty()) m_objectList.pop_back(); }
void PhysicsSim::shootTestSphere() { removeObject(testSphere); testSphere = loadSceneObject("lemon.dae"); testSphere->setPosition(fpscam->getPosition()); testSphere->setScale(Vector3D(2,2,2)); PhysicalObject* phyObj = applyPhysics(testSphere, shSphere, 20); vector3df dir = fpscam->getTarget() - fpscam->getPosition(); dir = 250*dir.normalize(); phyObj->getRigidBody()->applyCentralImpulse(btVector3(dir.X, dir.Y, dir.Z)); }
bool PluginManager::unloadPlugin(PluginFile *plugin) { bool derivedPlugin = qobject_cast<Plugin*>(plugin->instance) != nullptr; if (plugin->loader->unload()) { if (!derivedPlugin) removeObject(plugin->instance); plugin->instance = nullptr; return true; } else { return false; } }
//----------------------------------------------------------------------------- // addObject() //----------------------------------------------------------------------------- BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) { object->extractAttachmentItemID(); if (isObjectAttached(object)) { llinfos << "(same object re-attached)" << llendl; removeObject(object); // Pass through anyway to let setupDrawable() // re-connect object to the joint correctly } // Two instances of the same inventory item attached -- // Request detach, and kill the object in the meantime. if (getAttachedObject(object->getAttachmentItemID())) { llinfos << "(same object re-attached)" << llendl; object->markDead(); // If this happens to be attached to self, then detach. LLVOAvatar::detachAttachmentIntoInventory(object->getAttachmentItemID()); return FALSE; } mAttachedObjects.push_back(object); setupDrawable(object); if (mIsHUDAttachment) { if (object->mText.notNull()) { object->mText->setOnHUDAttachment(TRUE); } LLViewerObject::const_child_list_t& child_list = object->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); iter != child_list.end(); ++iter) { LLViewerObject* childp = *iter; if (childp && childp->mText.notNull()) { childp->mText->setOnHUDAttachment(TRUE); } } } calcLOD(); mUpdateXform = TRUE; return TRUE; }
void gProjectCore::removeObjects(const QString &host, const QString &dbName, gObjectDBType objType) { QChar separator=QDir::separator(); QDir dir(path+separator+name+separator+host+separator+dbName); dir.cd(getDirNameByObjType(objType)); QStringList entryList=dir.entryList(QDir::Files,QDir::Name|QDir::Reversed); for (int i=0;i<entryList.count();i++){ QString objFileName=entryList.at(i); QString objName=objFileName.remove(objFileName.length()-4,4); removeObject(host,dbName,objName,objType); } }
void ObjectStore::deliverMessage_(Message message) { std::cout << "Delivering message to ObjectStore" << std::endl; //check if target entity is registered with this subsystem Parameters params = message.getParameters(); //read message! std::string mainCmd = params[1]; if (mainCmd=="destroy") { removeObject(message.getTargetId()); } }
void OcTree::updateObject(GameObject* go){ Node* n = goMap[go]; if (n == NULL) return; BoundingBox goBb = go->getCollider()->boundingBox; //find a node higher up that does fit this object (could be this one) removeObject(go, n); Node* current = n; while (Bounding::contains(&(current->bounds), &goBb) == false && current->isRoot == false){ current = current->parent; } insert(current, go); }