fix meshtree params

This commit is contained in:
gabryon99 2021-09-16 18:58:41 +02:00
parent 3cd68269fd
commit b98261e29f
2 changed files with 16 additions and 8 deletions

View File

@ -472,7 +472,7 @@ namespace vcg {
AlignGlobal::LOG(elfp,"\nDormant Num: %i\n", DormantNum());
curr = ChooseDormantWithMostDormantLink();
if (curr == 0) {
if (curr == nullptr) {
AlignGlobal::LOG(elfp,"\nFailed ChooseDormantWithMostDormantLink, chosen id:%i\n" ,0);
break; // non ci sono piu' componenti connesse composte da piu' di una singola mesh.
}
@ -483,7 +483,7 @@ namespace vcg {
curr->Active = true;
cursid = curr->sid;
curr = ChooseDormantWithMostActiveLink ();
if (curr == 0) {
if (curr == nullptr) {
AlignGlobal::LOG(elfp, "\nFailed ChooseDormantWithMostActiveLink, chosen id:%i\n", 0);
}
else {
@ -545,7 +545,7 @@ namespace vcg {
AlignGlobal::Node* ChooseDormantWithMostDormantLink() {
int MaxAdjNum = 0;
AlignGlobal::Node *BestNode = 0;
AlignGlobal::Node *BestNode = nullptr;
for (auto li = std::begin(N); li != std::end(N); ++li) {
if (!(*li).Active) {
@ -557,6 +557,11 @@ namespace vcg {
}
}
if (!BestNode){
std::printf("Warning! Unable to find a Node with at least a dormant link!!\n");
return nullptr;
}
assert(BestNode);
assert(!BestNode->Queued);
assert(!BestNode->Active);
@ -567,7 +572,7 @@ namespace vcg {
AlignGlobal::Node* ChooseDormantWithMostActiveLink() {
int MaxAdjNum = 0;
AlignGlobal::Node* BestNode = 0;
AlignGlobal::Node* BestNode = nullptr;
for (auto li = std::begin(N); li != std::end(N); ++li) {
if (!(*li).Active) {
@ -582,7 +587,7 @@ namespace vcg {
if (!BestNode){
// Abbiamo finito di sistemare questa componente connessa.
std::printf("Warning! Unable to find a Node with at least an active link!!\n");
return 0;
return nullptr;
}
assert(BestNode);

View File

@ -39,7 +39,7 @@ namespace vcg {
class Param {
public:
int OGSize = 5000;
int OGSize = 50000;
float arcThreshold = 0.3f;
float recalcThreshold = 0.1f;
};
@ -50,12 +50,14 @@ namespace vcg {
vcg::OccupancyGrid<CMeshO, ScalarType> OG{};
vcg::CallBackPos* cb = vcg::DummyCallBackPos;
MeshTree() = default;
~MeshTree() { clear(); }
MeshType *MM(unsigned int i) {
return nodeMap[i]->m;
}
MeshTree() = default;
void clear() {
for (auto& ni : nodeMap) {
@ -381,6 +383,7 @@ namespace vcg {
}
};
}
#endif //VCGLIB_MESHTREE_H