MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / validate

Method validate

src/Mod/Material/App/Model.cpp:111–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111void ModelProperty::validate(const ModelProperty& other) const
112{
113 if (_name != other._name) {
114 throw InvalidProperty("Model names don't match");
115 }
116 if (getDisplayName() != other.getDisplayName()) {
117 Base::Console().log("Local display name '%s'\n", getDisplayName().toStdString().c_str());
118 Base::Console().log("Remote display name '%s'\n",
119 other.getDisplayName().toStdString().c_str());
120 throw InvalidProperty("Model display names don't match");
121 }
122 if (_propertyType != other._propertyType) {
123 throw InvalidProperty("Model property types don't match");
124 }
125 if (_units != other._units) {
126 throw InvalidProperty("Model units don't match");
127 }
128 if (_url != other._url) {
129 throw InvalidProperty("Model URLs don't match");
130 }
131 if (_description != other._description) {
132 throw InvalidProperty("Model descriptions don't match");
133 }
134 if (_inheritance != other._inheritance) {
135 throw InvalidProperty("Model inheritance don't match");
136 }
137
138 if (_columns.size() != other._columns.size()) {
139 Base::Console().log("Local property column count %d\n", _columns.size());
140 Base::Console().log("Remote property column count %d\n", other._columns.size());
141 throw InvalidProperty("Model property column counts don't match");
142 }
143 for (size_t i = 0; i < _columns.size(); i++) {
144 _columns[i].validate(other._columns[i]);
145 }
146}
147
148TYPESYSTEM_SOURCE(Materials::Model, Base::BaseClass)
149

Callers 2

validateMigrationMethod · 0.45
validateMigrationMethod · 0.45

Calls 9

InvalidPropertyClass · 0.85
InvalidModelClass · 0.85
toStdStringMethod · 0.80
getDisplayNameMethod · 0.45
logMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45
whatMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected