Skip to content

Commit 920d9fb

Browse files
committed
Added some debugging, update DomainType enum
1 parent 72d1eda commit 920d9fb

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

Libs/Groom/Groom.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,20 +1125,25 @@ Mesh Groom::get_mesh(int subject, int domain, bool transformed, MeshSource sourc
11251125

11261126
std::string path;
11271127

1128-
DomainType domain_type;
1128+
DomainType domain_type = DomainType::Mesh;
11291129

11301130
if (source == MeshSource::Original) {
11311131
if (domain >= subjects[subject]->get_original_filenames().size()) {
11321132
throw std::out_of_range("domain index out of range");
11331133
}
11341134
path = subjects[subject]->get_original_filenames()[domain];
11351135
domain_type = project_->get_original_domain_types()[domain];
1136+
SW_DEBUG("Getting original mesh for subject {}, domain {}: {}", subject, domain, path);
1137+
SW_DEBUG("Domain type: {}", static_cast<int>(domain_type));
11361138
} else {
11371139
if (domain >= subjects[subject]->get_groomed_filenames().size()) {
11381140
throw std::out_of_range("domain index out of range");
11391141
}
11401142
path = subjects[subject]->get_groomed_filenames()[domain];
1141-
domain_type = project_->get_groomed_domain_types()[domain];
1143+
1144+
domain_type = ProjectUtils::determine_domain_type(path);
1145+
SW_DEBUG("Getting groomed mesh for subject {}, domain {}: {}", subject, domain, path);
1146+
SW_DEBUG("Domain type: {}", static_cast<int>(domain_type));
11421147
}
11431148

11441149
auto constraint_filename = subjects[subject]->get_constraints_filenames();
@@ -1165,7 +1170,7 @@ Mesh Groom::get_mesh(int subject, int domain, bool transformed, MeshSource sourc
11651170
} else if (domain_type == DomainType::Contour) {
11661171
mesh = MeshUtils::threadSafeReadMesh(path);
11671172
} else {
1168-
throw std::invalid_argument("invalid domain type");
1173+
throw std::invalid_argument("invalid domain type: " + std::to_string(static_cast<int>(domain_type)));
11691174
}
11701175

11711176
if (transformed) {

Libs/Optimize/Domain/DomainType.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
#pragma once
22

3-
#define DIMENSION 3
4-
53
namespace shapeworks {
6-
enum class DomainType : char {
7-
Image = 'I',
8-
Mesh = 'M',
9-
Contour = 'C'
10-
};
11-
}
4+
enum class DomainType { Image, Mesh, Contour };
5+
} // namespace shapeworks

0 commit comments

Comments
 (0)