| 1882 | } |
| 1883 | |
| 1884 | bool processMeshSF(const ccHObject::Container &selectedEntities, ccMesh::MESH_SCALAR_FIELD_PROCESS process, QWidget* parent/*=nullptr*/) |
| 1885 | { |
| 1886 | for (ccHObject* ent : selectedEntities) |
| 1887 | { |
| 1888 | if (ent->isKindOf(CC_TYPES::MESH) || ent->isKindOf(CC_TYPES::PRIMITIVE)) //TODO |
| 1889 | { |
| 1890 | ccMesh* mesh = ccHObjectCaster::ToMesh(ent); |
| 1891 | if (mesh == nullptr) |
| 1892 | continue; |
| 1893 | |
| 1894 | ccGenericPointCloud* cloud = mesh->getAssociatedCloud(); |
| 1895 | if (cloud == nullptr) |
| 1896 | continue; |
| 1897 | |
| 1898 | if (cloud->isA(CC_TYPES::POINT_CLOUD)) //TODO |
| 1899 | { |
| 1900 | ccPointCloud* pc = static_cast<ccPointCloud*>(cloud); |
| 1901 | |
| 1902 | //on active le champ scalaire actuellement affiche |
| 1903 | int sfIdx = pc->getCurrentDisplayedScalarFieldIndex(); |
| 1904 | if (sfIdx >= 0) |
| 1905 | { |
| 1906 | pc->setCurrentScalarField(sfIdx); |
| 1907 | mesh->processScalarField(process); |
| 1908 | pc->getCurrentInScalarField()->computeMinAndMax(); |
| 1909 | mesh->prepareDisplayForRefresh_recursive(); |
| 1910 | } |
| 1911 | else |
| 1912 | { |
| 1913 | ccConsole::Warning(QObject::tr("Mesh [%1] vertices have no activated scalar field!").arg(mesh->getName())); |
| 1914 | } |
| 1915 | } |
| 1916 | } |
| 1917 | } |
| 1918 | |
| 1919 | return true; |
| 1920 | } |
| 1921 | |
| 1922 | ////////// |
| 1923 | // Normals |
no test coverage detected