void Object::create() { clearObject(); scale_.x = bounding_box_lwh_.x; scale_.y = bounding_box_lwh_.y; scale_.z = bounding_box_lwh_.z; object_.header.frame_id = frame_id_; object_.name = name_; //object_.description = description_; object_.pose = pose_; object_.scale = maxScale(scale_); createMesh(); control_.name = "object_control"; control_.interaction_mode = InteractiveMarkerControl::BUTTON; control_.always_visible = true; control_.markers.push_back(mesh_); object_.controls.clear(); object_.controls.push_back(control_); if (scale_.x != 0.0f && scale_.y != 0.0f && scale_.z != 0.0f) BoundingBox::createBoundingBoxControl(0.0f, 0.0f, 0.0f); createMenu(); }
inline void initializeNewObject(size_t mark, void *vft, RexxBehaviour *b) { // we need to make this a function object of some type in case // a GC cycle gets triggered before this is complete. By default, // we make this a generic object setVirtualFunctions(vft); setBehaviour(b); // this has a clean set of flags, except for the live mark header.initHeader(mark); // make sure the object is cleared in case this gets marked out of any of // the constructors. clearObject(); }
void BoundingBox::create() { clearObject(); object_.header.frame_id = frame_id_; object_.header.stamp = ros::Time::now(); object_.name = name_; object_.description = description_; object_.pose = pose_; object_.scale = srs_interaction_primitives::maxScale(scale_); createBoundingBoxControl(); createMenu(); }
/** * Construct a ListContent item of the given size. * * @param size The total number of entries in the object. */ ListContents::ListContents(size_t size) { // clear the entire object for safety clearObject(); // this is the total size of the bucket totalSize = size; // no first or last items. firstItem = NoMore; lastItem = NoMore; // initialize the free chains initializeFreeChain(); }
void Plane::create() { clearObject(); object_.header.frame_id = frame_id_; object_.name = name_; object_.description = name_ + " plane"; object_.pose = pose_; mesh_.type = Marker::CUBE; mesh_.color = color_; mesh_.scale = scale_; mesh_.scale.z = 0.001; control_.always_visible = true; control_.interaction_mode = InteractiveMarkerControl::BUTTON; control_.markers.push_back(mesh_); object_.controls.push_back(control_); createMenu(); }
void Billboard::create() { clearObject(); object_.header.frame_id = frame_id_; object_.name = name_; // object_.description = name_ + " billboard"; object_.pose.position.x = pose_.position.x; object_.pose.position.y = pose_.position.y; object_.pose.position.z = pose_.position.z; createMesh(); control_.name = "billboard_control"; control_.always_visible = true; control_.orientation_mode = InteractiveMarkerControl::VIEW_FACING; control_.interaction_mode = InteractiveMarkerControl::BUTTON; control_.markers.push_back(mesh_); object_.controls.push_back(control_); createMenu(); }
void UnknownObject::create() { clearObject(); createUnknownBox(); control_.name = "box_control"; if( use_material_ ) { createBox(); control_.markers.push_back(box_); } else { createColorBox(); control_.markers.push_back(box_); control_.markers.push_back(wire_); } control_.interaction_mode = InteractiveMarkerControl::MENU; control_.always_visible = true; object_.controls.push_back(control_); createMenu(); }
VActorPhysicsController::~VActorPhysicsController( void ) { // Clear Object. clearObject(); }
void OnDlgCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) { bool load=false; if (id == IDC_BUTTON_REBUILD) { QString embeddedFile =MeshObject::meshObject->embeddedFile; int yy=0; if (embeddedFile!="" && MeshObject::meshObject->animaPath!="") { clearObject(); //MeshObject *obj = (MeshObject*)CreateInstance(GEOMOBJECT_CLASS_ID, MeshObject_CLASS_ID); //assert(obj); //INode *node = CreateRootNode(importInt,globalInt); //if (!node) return ; MeshObject::meshObject->Load(MeshObject::meshObject->animaPath,FindNodeRef(MeshObject::meshObject),false,true); } } else if (id == IDC_BUTTON_FILE_BROWSE) { load=true; } else if (id == IDC_BUTTON_RELOAD) { try { //MeshObject::meshObject->LoadFromGUI(MeshObject::meshObject->animaPath,FindNodeRef(MeshObject::meshObject)); Anima::_LogDebug(QString("Reload %1").arg(MeshObject::meshObject->animaPath),__FUNCTION__,__LINE__); if (QFile(MeshObject::meshObject->animaPath).exists()) { clearObject(); MeshObject::meshObject->Load(MeshObject::meshObject->animaPath,FindNodeRef(MeshObject::meshObject),true,true); } else { Anima::_LogDebug("File not found",__FUNCTION__,__LINE__); MessageBox(NULL, _T(QString("The path to the original .ani scene has changed (%1) .\r\n\ Please use the Browser window to navigate and locate the new file.").arg(MeshObject::meshObject->animaPath).toAscii().data()), _T("WARNING!"), MB_OK); load=true; } UpdateLabelInfo(); } catch(Anima::CoreException &e) { MessageBox(NULL, _T(QString("The path to the original .ani scene has changed (%1) .\r\n\ Please use the Browser window to navigate and locate the new file.").arg(MeshObject::meshObject->animaPath).toAscii().data()), _T("WARNING!"), MB_OK); Anima::_LogDebug(e.Message(),__FUNCTION__,__LINE__); load=true; } // Anima::CommandManager::Singleton.Load(fileName); } if (load) { OPENFILENAME ofn; char szFileName[MAX_PATH] = ""; ZeroMemory(&ofn, sizeof(ofn)); strcpy(szFileName,MeshObject::meshObject->animaPath.toAscii().data()); ofn.lStructSize = sizeof(ofn); // SEE NOTE BELOW ofn.hwndOwner = hwnd; ofn.lpstrFilter = "AXYZ Anima Files (*.ani)\0*.ani\0All Files (*.*)\0*.*\0"; ofn.lpstrFile = szFileName; ofn.nMaxFile = MAX_PATH; ofn.lpstrTitle = "Load a 'Anima' File"; ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY ;//|OFN_ALLOWMULTISELECT; ofn.lpstrDefExt = "ani"; if(GetOpenFileName(&ofn)) { // Do something usefull with the filename stored in szFileName clearObject(); //MeshObject::meshObject->LoadFromGUI(szFileName,FindNodeRef(MeshObject::meshObject)); MeshObject::meshObject->Load(szFileName,FindNodeRef(MeshObject::meshObject),true,true); UpdateFileNameInfo(); UpdateLabelInfo(); } //QString path = QFileDialog::getOpenFileName(NULL ,"Load a 'Anima' File","","Anima (*.ani)"); //if (path!="") { //MeshObject::meshObject->Clear(); // MeshObject::meshObject->Load(path,FindNodeRef(MeshObject::meshObject)); /* QString name = QFileInfo(path).fileName(); HWND hwndLbl = GetDlgItem(hwnd, IDC_FILE_NAME); LPARAM a = (LPARAM)name.toAscii().data(); SendMessage(hwndLbl, WM_SETTEXT, 0, (LPARAM) a);*/ } } }