void SS5Player::setPartsParentage() { ToPointer ptr(m_currentRs->m_data); int numParts = getPartNum(); //親子関係を設定 for (int partIndex = 0; partIndex < numParts; partIndex++) { const PartData* partData = m_currentAnimeRef->getPartData(partIndex); CustomSprite* sprite = &m_parts[partIndex]; if (partIndex > 0){ sprite->m_parent = &m_parts[partData->parentIndex]; } else{ sprite->m_parent = nullptr; } //インスタンスパーツならChildPlayerの生成イベントを飛ばす if(partData->type == PARTTYPE_INSTANCE){ std::string refanimeName = ptr.toString(partData->refname); sprite->m_haveChildPlayer = m_eventListener->ChildPlayerLoad(partIndex, getPartName(partIndex), refanimeName); } } }
BVHNode* Animation::getNode(int jointNumber) { //#### // joint number 0 needs to return the hip position pseudonode if(jointNumber==0) return positionNode; // get the joint structure return bvh->bvhFindNode(frames,getPartName(jointNumber)); }
void Foam::vtkPV3Foam::convertMeshPatches ( vtkMultiBlockDataSet* output, int& blockNo ) { partInfo& selector = partInfoPatches_; selector.block(blockNo); // set output block label datasetNo = 0; // restart at dataset 0 const fvMesh& mesh = *meshPtr_; const polyBoundaryMesh& patches = mesh.boundaryMesh(); if (debug) { Info<< "<beg> Foam::vtkPV3Foam::convertMeshPatches" << endl; printMemory(); } for (int partId = selector.start(); partId < selector.end(); ++partId) { const word patchName = getPartName(partId); const label patchId = patches.findPatchID(patchName); if (!partStatus_[partId] || patchId < 0) { continue; } if (debug) { Info<< "Creating VTK mesh for patch[" << patchId <<"] " << patchName << endl; } vtkPolyData* vtkmesh = patchVTKMesh(patches[patchId]); if (vtkmesh) { AddToBlock(output, vtkmesh, selector, datasetNo, patchName); vtkmesh->Delete(); partDataset_[partId] = datasetNo++; } } // anything added? if (datasetNo) { ++blockNo; } if (debug) { Info<< "<end> Foam::vtkPV3Foam::convertMeshPatches" << endl; printMemory(); } }
void Foam::vtkPV3Foam::convertMeshPointSets ( vtkMultiBlockDataSet* output, int& blockNo ) { partInfo& selector = partInfoPointSets_; selector.block(blockNo); // set output block label datasetNo = 0; // restart at dataset 0 const fvMesh& mesh = *meshPtr_; if (debug) { Info<< "<beg> Foam::vtkPV3Foam::convertMeshPointSets" << endl; printMemory(); } for (int partId = selector.start(); partId < selector.end(); ++partId) { word partName = getPartName(partId); if (!partStatus_[partId]) { continue; } if (debug) { Info<< "Creating VTK mesh for pointSet=" << partName << endl; } const pointSet pSet(mesh, partName); vtkPolyData* vtkmesh = pointSetVTKMesh(mesh, pSet); if (vtkmesh) { AddToBlock(output, vtkmesh, selector, datasetNo, partName); vtkmesh->Delete(); partDataset_[partId] = datasetNo++; } } // anything added? if (datasetNo) { ++blockNo; } if (debug) { Info<< "<end> Foam::vtkPV3Foam::convertMeshPointSets" << endl; printMemory(); } }
void Foam::vtkPV3Foam::convertMeshFaceSets ( vtkMultiBlockDataSet* output, int& blockNo ) { arrayRange& range = arrayRangeFaceSets_; range.block(blockNo); // set output block label datasetNo = 0; // restart at dataset 0 const fvMesh& mesh = *meshPtr_; if (debug) { Info<< "<beg> Foam::vtkPV3Foam::convertMeshFaceSets" << endl; printMemory(); } for (int partId = range.start(); partId < range.end(); ++partId) { const word partName = getPartName(partId); if (!partStatus_[partId]) { continue; } if (debug) { Info<< "Creating VTK mesh for faceSet=" << partName << endl; } const faceSet fSet(mesh, partName); vtkPolyData* vtkmesh = faceSetVTKMesh(mesh, fSet); if (vtkmesh) { AddToBlock(output, vtkmesh, range, datasetNo, partName); vtkmesh->Delete(); partDataset_[partId] = datasetNo++; } } // anything added? if (datasetNo) { ++blockNo; } if (debug) { Info<< "<end> Foam::vtkPV3Foam::convertMeshFaceSets" << endl; printMemory(); } }
//パーツ名からindexを取得 int SS5Player::indexOfPart(const char* partName) const { for (int i = 0; i < m_currentAnimeRef->m_numParts; i++){ const char* name = getPartName(i); if (strcmp(partName, name) == 0){ return i; } } return -1; }
void Foam::vtkPV3Foam::convertMeshPointZones ( vtkMultiBlockDataSet* output, int& blockNo ) { partInfo& selector = partInfoPointZones_; selector.block(blockNo); // set output block label datasetNo = 0; // restart at dataset 0 const fvMesh& mesh = *meshPtr_; if (debug) { Info<< "<beg> Foam::vtkPV3Foam::convertMeshPointZones" << endl; printMemory(); } if (selector.size()) { const pointZoneMesh& zMesh = mesh.pointZones(); for (int partId = selector.start(); partId < selector.end(); ++partId) { word zoneName = getPartName(partId); label zoneId = zMesh.findZoneID(zoneName); if (!partStatus_[partId] || zoneId < 0) { continue; } vtkPolyData* vtkmesh = pointZoneVTKMesh(mesh, zMesh[zoneId]); if (vtkmesh) { AddToBlock(output, vtkmesh, selector, datasetNo, zoneName); vtkmesh->Delete(); partDataset_[partId] = datasetNo++; } } } // anything added? if (datasetNo) { ++blockNo; } if (debug) { Info<< "<end> Foam::vtkPV3Foam::convertMeshPointZones" << endl; printMemory(); } }
void Foam::vtkPV3Foam::convertMeshLagrangian ( vtkMultiBlockDataSet* output, int& blockNo ) { partInfo& selector = partInfoLagrangian_; selector.block(blockNo); // set output block label datasetNo = 0; // restart at dataset 0 const fvMesh& mesh = *meshPtr_; if (debug) { Info<< "<beg> Foam::vtkPV3Foam::convertMeshLagrangian" << endl; printMemory(); } for (int partId = selector.start(); partId < selector.end(); ++partId) { const word cloudName = getPartName(partId); if (!partStatus_[partId]) { continue; } vtkPolyData* vtkmesh = lagrangianVTKMesh(mesh, cloudName); if (vtkmesh) { AddToBlock(output, vtkmesh, selector, datasetNo, cloudName); vtkmesh->Delete(); partDataset_[partId] = datasetNo++; } } // anything added? if (datasetNo) { ++blockNo; } if (debug) { Info<< "<end> Foam::vtkPV3Foam::convertMeshLagrangian" << endl; printMemory(); } }
void SS5Player::releaseParts() { for(int partIndex = 0; partIndex < m_parts.size(); ++partIndex){ CustomSprite* sprite = &m_parts[partIndex]; //ChildPlayerがあるなら、spriteを破棄する前にリリースイベントを飛ばす if(sprite->m_haveChildPlayer){ m_eventListener->ChildPlayerRelease(partIndex, getPartName(partIndex)); } sprite->finalize(); } //m_parts.clear(); }
void Foam::vtkPV3Foam::convertMeshCellSets ( vtkMultiBlockDataSet* output, int& blockNo ) { partInfo& selector = partInfoCellSets_; selector.block(blockNo); // set output block label datasetNo = 0; // restart at dataset 0 const fvMesh& mesh = *meshPtr_; // resize for decomposed polyhedra csetPolyDecomp_.setSize(selector.size()); if (debug) { Info<< "<beg> Foam::vtkPV3Foam::convertMeshCellSets" << endl; printMemory(); } for (int partId = selector.start(); partId < selector.end(); ++partId) { const word partName = getPartName(partId); if (!partStatus_[partId]) { continue; } if (debug) { Info<< "Creating VTK mesh for cellSet=" << partName << endl; } const cellSet cSet(mesh, partName); fvMeshSubset subsetMesh ( IOobject ( "set", mesh.time().constant(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh ); subsetMesh.setLargeCellSubset(cSet); vtkUnstructuredGrid* vtkmesh = volumeVTKMesh ( subsetMesh.subMesh(), csetPolyDecomp_[datasetNo] ); if (vtkmesh) { // superCells + addPointCellLabels must contain global cell ids inplaceRenumber ( subsetMesh.cellMap(), csetPolyDecomp_[datasetNo].superCells() ); inplaceRenumber ( subsetMesh.cellMap(), csetPolyDecomp_[datasetNo].addPointCellLabels() ); // copy pointMap as well, otherwise pointFields fail csetPolyDecomp_[datasetNo].pointMap() = subsetMesh.pointMap(); AddToBlock(output, vtkmesh, selector, datasetNo, partName); vtkmesh->Delete(); partDataset_[partId] = datasetNo++; } } // anything added? if (datasetNo) { ++blockNo; } if (debug) { Info<< "<end> Foam::vtkPV3Foam::convertMeshCellSets" << endl; printMemory(); } }
int Animation::numKeyFrames(int jointNumber) { BVHNode* node=bvh->bvhFindNode(frames,getPartName(jointNumber)); // qDebug(QString("Animation::numKeyFrames(): joint number %1 has %2 keyframes").arg(jointNumber).arg(node->numKeyFrames)); return node->numKeyframes(); }
void Foam::vtkPVFoam::convertMeshPatches ( vtkMultiBlockDataSet* output, int& blockNo ) { arrayRange& range = arrayRangePatches_; range.block(blockNo); // set output block label datasetNo = 0; // restart at dataset 0 const fvMesh& mesh = *meshPtr_; const polyBoundaryMesh& patches = mesh.boundaryMesh(); if (debug) { Info<< "<beg> Foam::vtkPVFoam::convertMeshPatches" << endl; printMemory(); } for (int partId = range.start(); partId < range.end(); ++partId) { if (!partStatus_[partId]) { continue; } const word patchName = getPartName(partId); labelHashSet patchIds(patches.patchSet(List<wordRe>(1, wordRe(patchName)))); if (debug) { Info<< "Creating VTK mesh for patches [" << patchIds <<"] " << patchName << endl; } vtkPolyData* vtkmesh = nullptr; if (patchIds.size() == 1) { vtkmesh = patchVTKMesh(patchName, patches[patchIds.begin().key()]); } else { // Patch group. Collect patch faces. label sz = 0; forAllConstIter(labelHashSet, patchIds, iter) { sz += patches[iter.key()].size(); } labelList meshFaceLabels(sz); sz = 0; forAllConstIter(labelHashSet, patchIds, iter) { const polyPatch& pp = patches[iter.key()]; forAll(pp, i) { meshFaceLabels[sz++] = pp.start()+i; } } UIndirectList<face> fcs(mesh.faces(), meshFaceLabels); uindirectPrimitivePatch pp(fcs, mesh.points()); vtkmesh = patchVTKMesh(patchName, pp); } if (vtkmesh) { AddToBlock(output, vtkmesh, range, datasetNo, patchName); vtkmesh->Delete(); partDataset_[partId] = datasetNo++; } }
wxString formatItem(mysqlpp::Connection* conn, int num, int dishId, bool main) { wxArrayString parts; //getting parts from mysql-query wxString title; wxString comment; wxString qty; wxTimeSpan diff; bool ready = false; mysqlpp::Query query = conn->query(); query << "SELECT `orders_dishes`.`qty`,`orders_dishes`.`name`,`orders_dishes`.`comment` ,\ `orders_dishes`.`ready`,`orders`.`time` FROM `orders_dishes`,`orders` WHERE \ `orders_dishes`.`id` = "<< dishId <<" AND `orders_dishes`.`order_id`=`orders`.`id`"; mysqlpp::StoreQueryResult res = query.store(); if (res) { mysqlpp::Row row = res.at(0); title = std2wx(std::string(row["name"]), wxConvUI); comment = std2wx(std::string(row["comment"]), wxConvUI); qty = std2wx(std::string(row["qty"]), wxConvUI); ready = bool(row["ready"]); wxDateTime time; time.ParseDateTime(std2wx(std::string(row["time"]),wxConvUI)); diff = wxDateTime::Now() - time; } query << "SELECT * FROM `orders_dishes_parts` WHERE `orders_dishes_id`=" << dishId; res = query.store(); if (res) { mysqlpp::Row row; mysqlpp::StoreQueryResult::size_type i; for (i = 0; i < res.num_rows(); ++i) { row = res[i]; wxString partNameToAdd = getPartName(conn, int(row["parts_id"])); if(!bool(row["using"])) { partNameToAdd = _("<b>NO</b> ") + partNameToAdd; } parts.Add(partNameToAdd); } } wxString toRet; if(!main) { toRet << _T("<b><font size=4>") << title << _T(" X ")<< qty <<_T("</b></font>"); } else { toRet << _T("<br align = left>") << _("Time:") << _T(" <b>") << diff.Format(_T("%M")) << _(" min") <<_T("</b>") << _(" Qty:") << _T(" <b>") << qty <<_T("</b></br>"); } toRet << _T("<div align=right><table cellspacing=0 cellpadding=0 WIDTH=100%><tr><td>"); for(int i = 0; i < parts.GetCount(); ++i) { toRet << _T("<br> * ") << parts[i]; } wxString readyImage; if(ready) { readyImage = _T("done.png"); } else { readyImage = _T("todo.png"); } wxStandardPaths path; wxFileName imageName; imageName.Assign(path.GetDataDir(),readyImage); toRet << _T("</td><td width = 50><a href=") << num << _T(":") << dishId << _T("><img src=") << imageName.GetFullPath() << _T("></a></td></tr></table></div>"); if(comment != _T("")) { toRet << _T("<font size=2><br align=left>Comment: <i>") << comment << _T("</i></font>"); } return toRet; }
void Foam::vtkPV3Foam::convertMeshFaceZones ( vtkMultiBlockDataSet* output, int& blockNo ) { arrayRange& range = arrayRangeFaceZones_; range.block(blockNo); // set output block label datasetNo = 0; // restart at dataset 0 const fvMesh& mesh = *meshPtr_; if (range.empty()) { return; } if (debug) { Info<< "<beg> Foam::vtkPV3Foam::convertMeshFaceZones" << endl; printMemory(); } const faceZoneMesh& zMesh = mesh.faceZones(); for (int partId = range.start(); partId < range.end(); ++partId) { const word zoneName = getPartName(partId); const label zoneId = zMesh.findZoneID(zoneName); if (!partStatus_[partId] || zoneId < 0) { continue; } if (debug) { Info<< "Creating VTKmesh for faceZone[" << zoneId << "] " << zoneName << endl; } vtkPolyData* vtkmesh = faceZoneVTKMesh(mesh, zMesh[zoneId]); if (vtkmesh) { AddToBlock(output, vtkmesh, range, datasetNo, zoneName); vtkmesh->Delete(); partDataset_[partId] = datasetNo++; } } // anything added? if (datasetNo) { ++blockNo; } if (debug) { Info<< "<end> Foam::vtkPV3Foam::convertMeshFaceZones" << endl; printMemory(); } }
void Foam::vtkPV3Foam::convertMeshCellZones ( vtkMultiBlockDataSet* output, int& blockNo ) { arrayRange& range = arrayRangeCellZones_; range.block(blockNo); // set output block label datasetNo = 0; // restart at dataset 0 const fvMesh& mesh = *meshPtr_; // resize for decomposed polyhedra zonePolyDecomp_.setSize(range.size()); if (range.empty()) { return; } if (debug) { Info<< "<beg> Foam::vtkPV3Foam::convertMeshCellZones" << endl; printMemory(); } const cellZoneMesh& zMesh = mesh.cellZones(); for (int partId = range.start(); partId < range.end(); ++partId) { const word zoneName = getPartName(partId); const label zoneId = zMesh.findZoneID(zoneName); if (!partStatus_[partId] || zoneId < 0) { continue; } if (debug) { Info<< "Creating VTK mesh for cellZone[" << zoneId << "] " << zoneName << endl; } fvMeshSubset subsetter(mesh); subsetter.setLargeCellSubset(zMesh[zoneId]); vtkUnstructuredGrid* vtkmesh = volumeVTKMesh ( subsetter.subMesh(), zonePolyDecomp_[datasetNo] ); if (vtkmesh) { // superCells + addPointCellLabels must contain global cell ids inplaceRenumber ( subsetter.cellMap(), zonePolyDecomp_[datasetNo].superCells() ); inplaceRenumber ( subsetter.cellMap(), zonePolyDecomp_[datasetNo].addPointCellLabels() ); // copy pointMap as well, otherwise pointFields fail zonePolyDecomp_[datasetNo].pointMap() = subsetter.pointMap(); AddToBlock(output, vtkmesh, range, datasetNo, zoneName); vtkmesh->Delete(); partDataset_[partId] = datasetNo++; } } // anything added? if (datasetNo) { ++blockNo; } if (debug) { Info<< "<end> Foam::vtkPV3Foam::convertMeshCellZones" << endl; printMemory(); } }