Skip to content

Commit

Permalink
moved duct-cutting-logic including exclusion-list to CCPACSDucts
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonReiswich committed Apr 6, 2022
1 parent 0dc9e49 commit 6c8d046
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 96 deletions.
1 change: 1 addition & 0 deletions cpacs_gen_input/CustomTypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,4 @@ CPACSNacelleCenterCowl CCPACSNacelleCenterCowl
CPACSDuct CCPACSDuct
CPACSDuctStructure CCPACSDuctStructure
CPACSDuctAssembly CCPACSDuctAssembly
CPACSDucts CCPACSDucts
2 changes: 1 addition & 1 deletion cpacs_gen_input/cpacs_schema.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -33164,7 +33164,7 @@ The fuel tank volume type should also be used for the wing fuel tank</xsd:docume
</xsd:annotation>
</xsd:element>
<xsd:element name="transformation" minOccurs="0" type="transformationType"/>
<xsd:element name="excludeObjectUIs" minOccurs="0" type="uIDSequenceType"/>
<xsd:element name="excludeObjectUIDs" minOccurs="0" type="uIDSequenceType"/>
<xsd:element name="duct" maxOccurs="unbounded" type="ductType"/>
</xsd:sequence>
<xsd:attribute name="uID" type="xsd:ID" use="required"/>
Expand Down
22 changes: 0 additions & 22 deletions src/ducts/CCPACSDuctAssembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,26 +135,4 @@ PNamedShape CCPACSDuctAssembly::BuildLoft() const
#endif
}

PNamedShape CCPACSDuctAssembly::LoftWithDuctCutouts(PNamedShape const& cleanLoft) const
{
if (m_ducts.size() == 0) {
return cleanLoft;
}
auto loft = CCutShape(cleanLoft, GetLoft()).NamedShape();

// Mark the clean loft as parent, rather than the duct loft
for (int iFace = 0; iFace < static_cast<int>(loft->GetFaceCount()); ++iFace) {
CFaceTraits ft = loft->GetFaceTraits(iFace);
ft.SetOrigin(cleanLoft);
loft->SetFaceTraits(iFace, ft);
}

#ifdef DEBUG
dumpShape(GetLoft()->Shape(), "debugShapes", "ductTool");
dumpShape(loft->Shape(), "debugShapes", "loftWithoutDucts");
#endif

return loft;
}

} //namespace tigl
3 changes: 0 additions & 3 deletions src/ducts/CCPACSDuctAssembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ class CCPACSDuctAssembly : public generated::CPACSDuctAssembly, public CTiglRela

TIGL_EXPORT CCPACSDuctAssembly(CCPACSDucts* parent, CTiglUIDManager* uidMgr);

// Given an input loft, create a new loft where all ducts have been cut away.
TIGL_EXPORT PNamedShape LoftWithDuctCutouts(PNamedShape const&) const;

TIGL_EXPORT std::string GetDefaultedUID() const override;
TIGL_EXPORT TiglGeometricComponentType GetComponentType() const override;
TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent() const override;
Expand Down
9 changes: 2 additions & 7 deletions src/fuselage/CCPACSFuselage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,17 +261,12 @@ PNamedShape CCPACSFuselage::BuildLoft() const
return *cleanLoft;
}

auto& ducts = GetConfiguration().GetDucts();
auto const & ducts = GetConfiguration().GetDucts();
if (!ducts) {
return *cleanLoft;
}

PNamedShape result = *cleanLoft;
for (auto& ductAssembly: ducts->GetDuctAssemblys()) {
result = ductAssembly->LoftWithDuctCutouts(result);
}

return result;
return ducts->LoftWithDuctCutouts(*cleanLoft, GetUID());
}

void CCPACSFuselage::BuildCleanLoft(PNamedShape& cache) const
Expand Down
6 changes: 3 additions & 3 deletions src/generated/CPACSAircraftModel.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/generated/CPACSAircraftModel.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 27 additions & 27 deletions src/generated/CPACSDuctAssembly.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 10 additions & 14 deletions src/generated/CPACSDuctAssembly.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/generated/CPACSDucts.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/generated/CPACSDucts.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6c8d046

Please sign in to comment.