-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
continue work on nacelle engine nacelles
make sure ITiglWingProfilePointList can deal with PCACSPointListXYVector (2d points also) addresses #529
- Loading branch information
1 parent
f92e623
commit 421069d
Showing
46 changed files
with
868 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,3 +92,4 @@ CPACSSkinSegments | |
CPACSEnginePylon | ||
CPACSEnginePylons | ||
|
||
CPACSNacelleCowl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,3 +121,6 @@ CPACSUncertaintyFunction | |
|
||
// in pylon | ||
CPACSPylonStructure | ||
|
||
// in nacelle | ||
CPACSNacelleCenterCowl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright (c) 2018 RISC Software GmbH | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "CCPACSPointListXYVector.h" | ||
|
||
#include "CTiglLogging.h" | ||
#include "CTiglError.h" | ||
|
||
namespace tigl | ||
{ | ||
|
||
void CCPACSPointListXYVector::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) | ||
{ | ||
generated::CPACSPointListXYVector::ReadCPACS(tixiHandle, xpath); | ||
|
||
// create cached representation from CPACS fields | ||
const std::vector<double>& xs = m_x.AsVector(); | ||
const std::vector<double>& ys = m_y.AsVector(); | ||
if (xs.size() != ys.size() ) { | ||
throw CTiglError("component vectors in CCPACSPointListXYZ must all have the same number of elements"); | ||
} | ||
m_vec.clear(); | ||
for (std::size_t i = 0; i < xs.size(); i++) { | ||
m_vec.push_back(CTiglPoint(xs[i], ys[i], 0.0)); | ||
} | ||
} | ||
|
||
void CCPACSPointListXYVector::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const | ||
{ | ||
// write back to CPACS fields | ||
CCPACSPointListXYVector* self = | ||
const_cast<CCPACSPointListXYVector*>(this); // TODO: ugly hack, but WriteCPACS() has to be const, fix this | ||
std::vector<double>& xs = self->m_x.AsVector(); | ||
std::vector<double>& ys = self->m_y.AsVector(); | ||
xs.clear(); | ||
ys.clear(); | ||
for (std::vector<CTiglPoint>::const_iterator it = m_vec.begin(); it != m_vec.end(); ++it) { | ||
xs.push_back(it->x); | ||
ys.push_back(it->y); | ||
} | ||
|
||
generated::CPACSPointListXYVector::WriteCPACS(tixiHandle, xpath); | ||
} | ||
|
||
const std::vector<CTiglPoint>& CCPACSPointListXYVector::AsVector() const | ||
{ | ||
return m_vec; | ||
} | ||
|
||
std::vector<CTiglPoint>& CCPACSPointListXYVector::AsVector() | ||
{ | ||
return m_vec; | ||
} | ||
|
||
} // namespace tigl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (c) 2018 RISC Software GmbH | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <vector> | ||
|
||
#include "generated/CPACSPointListXYVector.h" | ||
#include "CTiglPoint.h" | ||
|
||
namespace tigl | ||
{ | ||
|
||
class CCPACSPointListXYVector : public generated::CPACSPointListXYVector | ||
{ | ||
public: | ||
TIGL_EXPORT void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) OVERRIDE; | ||
TIGL_EXPORT void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const OVERRIDE; | ||
|
||
TIGL_EXPORT const std::vector<CTiglPoint>& AsVector() const; | ||
TIGL_EXPORT std::vector<CTiglPoint>& AsVector(); | ||
|
||
private: | ||
// cache | ||
std::vector<CTiglPoint> m_vec; | ||
}; | ||
|
||
} // namespace tigl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (C) 2018 German Aerospace Center (DLR/SC) | ||
* | ||
* Created: 2018-11-16 Jan Kleinert <jan.kleinert@dlr.de> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "CCPACSNacelleCowl.h" | ||
|
||
namespace tigl | ||
{ | ||
|
||
CCPACSNacelleCowl::CCPACSNacelleCowl(CCPACSEngineNacelle* parent, CTiglUIDManager* uidMgr) | ||
: generated::CPACSNacelleCowl(parent, uidMgr) | ||
, CTiglAbstractGeometricComponent() | ||
{} | ||
|
||
std::string CCPACSNacelleCowl::GetDefaultedUID() const | ||
{ | ||
return generated::CPACSNacelleCowl::GetUID(); | ||
} | ||
|
||
PNamedShape CCPACSNacelleCowl::BuildLoft() const | ||
{ | ||
//TODO | ||
return PNamedShape(); | ||
} | ||
|
||
} //namespace tigl |
Oops, something went wrong.