MCPcopy Create free account
hub / github.com/CloudCompare/CloudCompare / processMeshSF

Function processMeshSF

qCC/ccEntityAction.cpp:1884–1920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

doActionSmoothMeshSFMethod · 0.85
doActionEnhanceMeshSFMethod · 0.85

Calls 5

processScalarFieldMethod · 0.80
computeMinAndMaxMethod · 0.80
getAssociatedCloudMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected