diff --git a/cpacs_gen_input/CustomTypes.txt b/cpacs_gen_input/CustomTypes.txt index b6003e2a1..31f7ffd73 100644 --- a/cpacs_gen_input/CustomTypes.txt +++ b/cpacs_gen_input/CustomTypes.txt @@ -2,7 +2,7 @@ // maps generated types to actual tigl types // enums -CPACSSymmetry TiglSymmetryAxis +CPACSSymmetryXyXzYz TiglSymmetryAxis CPACSPointAbsRelType_refType ECPACSTranslationType CPACSFarField_type TiglFarFieldType CPACSRotorHub_type TiglRotorHubType diff --git a/cpacs_gen_input/cpacs_schema.xsd b/cpacs_gen_input/cpacs_schema.xsd index df2955fa3..3e9a792d3 100644 --- a/cpacs_gen_input/cpacs_schema.xsd +++ b/cpacs_gen_input/cpacs_schema.xsd @@ -43,11 +43,11 @@ marko.alder@dlr.de Version - V3.3 + V3.4 Date - 2020-06-03 + 2021-04-20 @@ -56,7 +56,7 @@ marko.alder@dlr.de The Common Parametric Aircraft Configuration Scheme (CPACS) is an XML-based data format for describing aircraft configurations and their corresponding data. This XML-Schema document (XSD) serves two purposes: (1) it defines the CPACS data structure used in the XML file (e.g., aircraft.xml) and - (2) it provides the corresponding documentation (see picture below). An XML processor (e.g., Tixi or + (2) it provides the corresponding documentation (see picture below). An XML processor (e.g., TiXIhttps://github.com/DLR-SC/tixi or XML tools in Eclipse) parses the XSD and XML files and validates whether the data set defined by the user (or tool) conforms to the given structure defined by the schema. @@ -67,31 +67,36 @@ marko.alder@dlr.de structure). In addition, the sequence of the elements and their occurrence is documented. To link the XML file to the XSD file, the header of the XML file should specify the path of the schema file. An example could look like this: - <cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> + + + ]]> + - CPACS is an open source project published by the German Aerospace Center (DLR e.V.). For further information please visit www.cpacs.de. + CPACS is an open source project published by the German Aerospace Center (DLR e.V.)https://www.dlr.de/. For further information please visit www.cpacs.dehttps://www.cpacs.de. - 2. Data hierarchy - - CPACS data is modeled in a hierarchical structure whose underlying concept follows a top-down description of a system-of-systems which decomposes a generic concept (e.g., an aircraft or rotorcraft) into a more detailed description of its components. This originates from the conceptual and preliminary design of aircraft, where the level of detail is initially low and continues to increase as the design process progresses. - For some concepts within CPACS, however, a bottom-up approach is applied where the components are first defined in detail (sometimes referred to as library) and then linked within an instantiated higher-level concept. This is advantageous when used multiple times within complex systems, such as engines, which only have to be defined once in order to be referenced several times on the aircraft. The combination of these two methodologies is known as middle-out approach and enables the goal to fully parametrize aeronautical systems. - + 2. Data structure + + CPACS data is modeled in a hierarchical structure whose underlying concept follows a top-down description of a system-of-systems which decomposes a generic concept (e.g., an aircraft or rotorcraft) into a more detailed description of its components. This originates from the conceptual and preliminary design of aircraft, where the level of detail is initially low and continues to increase as the design process progresses. + For some concepts within CPACS, however, a bottom-up approach is applied where the components are first defined in detail (sometimes referred to as library) and then linked within an instantiated higher-level concept. This is advantageous when used multiple times within complex systems, such as engines, which only have to be defined once in order to be referenced several times on the aircraft. The combination of these two methodologies is known as middle-out approach and enables the goal to fully parametrize aeronautical systems. + - + 3. Coordinate Systems - Coordinate systems are a regular cause for ambiguous interpretation of data. In CPACS, the reference coordinate system is the CPACS-coordinate system. This coordinate system is used for most of the data. A single exception is made in order to keep aerodynamic data in an aerodynamic coordinate system. The following paragraphs outline the determination to known coordinate systems. - The CPACS coordinate system is the coordinate system identified by TIGL, CPACS's geometric library. It is a right-handed coordinate system. If an aircraft is defined in the CPACS coordinate system it will usually follow the directions listed in the table below. - Therefore, the CPACS coordinate system can be confused with the body-fixed coordinate system. While often the CPACS coordinate system and the body-fixed coordinate system overlap, this must not always be true. Several definitions for body-fixed coordinate systems exist (x-axis through nose and tail, x-axis perpendicular to nose plane). For non-symmetric aircraft, body-fixed coordinate systems become even more complicated. Hence, analysis tools should stick to the CPACS-Coordinate system. It remains to the designer to model the geometry accordingly. - The CPACS coordinate system does not rotate with flow. Hence, aerodynamic calculations do rotate their flow relative to the CPACS-coordinate system. If not stated explicitly different, e.g. for target lift-coefficients, results are returned in the CPACS coordinate system, i.e. the cfx-coefficient is parallel to the CPACS x-Coordinate, regardless of the way the geometry is defined. - The following table gives a "best-practice" advice on how to locate a geometry within CPACS. Different approaches are, of course, valid as well. + 3.1. CPACS coordinate system + Coordinate systems are a regular cause for ambiguous interpretation of data. In CPACS, the reference coordinate system is the CPACS-coordinate system. This coordinate system is used for most of the data. A single exception is made in order to keep aerodynamic data in an aerodynamic coordinate system. The following paragraphs outline the determination to known coordinate systems. + The CPACS coordinate system is the coordinate system identified by TiGLhttps://dlr-sc.github.io/tigl, CPACS's geometric library. It is a right-handed coordinate system. If an aircraft is defined in the CPACS coordinate system it will usually follow the directions listed in the table below. + Therefore, the CPACS coordinate system can be confused with the body-fixed coordinate system. While often the CPACS coordinate system and the body-fixed coordinate system overlap, this must not always be true. Several definitions for body-fixed coordinate systems exist (x-axis through nose and tail, x-axis perpendicular to nose plane). For non-symmetric aircraft, body-fixed coordinate systems become even more complicated. Hence, analysis tools should stick to the CPACS-Coordinate system. It remains to the designer to model the geometry accordingly. + The CPACS coordinate system does not rotate with flow. Hence, aerodynamic calculations do rotate their flow relative to the CPACS-coordinate system. If not stated explicitly different, e.g. for target lift-coefficients, results are returned in the CPACS coordinate system, i.e. the cfx-coefficient is parallel to the CPACS x-Coordinate, regardless of the way the geometry is defined. + The following table gives a "best-practice" advice on how to locate a geometry within CPACS. Different approaches are, of course, valid as well. @@ -120,40 +125,97 @@ marko.alder@dlr.de from landing gear to tip of vertical tailplane - The following figures show an example of a geometry that is aligned with the CPACS coordinate system, i.e. the body-fixed coordinate system corresponds to the CPACS coordinate system. + The following figures show an example of a geometry that is aligned with the CPACS coordinate system, i.e. the body-fixed coordinate system corresponds to the CPACS coordinate system. - The aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. + The aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. - The following figures give an example of a geometry that is not defined in alignment with the CPACS coordinate system. It is a valid CPACS file, but only used in this example for demonstrative purposes. + The following figures give an example of a geometry that is not defined in alignment with the CPACS coordinate system. It is a valid CPACS file, but only used in this example for demonstrative purposes. - The body axes and the CPACS coordinate system do not align. That is, the origin of the geometry is not at CPACS (0,0,0) but at a point in positive x- and z-direction. + The body axes and the CPACS coordinate system do not align. That is, the origin of the geometry is not at CPACS (0,0,0) but at a point in positive x- and z-direction. - Again, the aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. + Again, the aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. + + 3.2. Local coordinate systems via parentUID and transformation + + Some elements in CPACS, in particular the geometric components, are described in local coordinates. + The hierarchical data structure allows to define a local coordinate system either with respect to the coordinate system of the parent element or with respect to the global CPACS coordinate system. + This is achieved by combining the two elements parentUID and transformation: + + + + parentUID: An individual data hierarchy can be set up using the optional parentUID element. + Here it is important that exactly one element does not contain the parentUID in order to identify the top element of this user-specific hierarchy. + As soon as the parentUID (which refers to the uID of the parent element) is set, a local coordinate system of the corresponding node is instantiated. + + + + + transformation: This allows the coordinate system to be transformed via translation, rotation and scaling. + As soon as the parentUID is set, this transformation refers to the local coordinate system (in the current CPACS version this only affects translation). + An attribute refType is used to either make this explicit (refType="absLocal") or to override this and reference the global CPACS coordinate system instead (refType="absGlobal"). + + + + The following table summarizes the possible combinations of parentUID and transformation and the resulting coordinate system (local or global): + + + + parentUID not set + parentUID set + + + transformation without refType + global + local + + + transformation with refType="absLocal" + global + local + + + transformation with refType="absGlobal" + global + global + + + Note: The combination of transformation with refType="absLocal" and no parentUID is global, because the local coordinate system to which the transformation is referring to via refType equals the global coordinate system (see fuselage in the following example). + + An exemplary use case further illustrates the concept of the coordinate system hierarchy. + The CPACS schema shall not specify in advance that a wing is always be part of the fuselage and engines must always be part of the wing. + In other cases the engine could be attached to the fuselage, which would not be possible via a predefined XML tree. + The following figure shows how components of the aircraft are related to each other via the parentUID. + The fairing is a child of the wing and is therefore automatically translated when the wing is translated. + Likewise, the horizontal tailplane is a part of the vertical tailplane and is therefore affected by translation of the latter: + + + + 4. Units - There are no explicit attributes describing units in CPACS. The general convention is that all values must be given in the following SI-units: + There are no explicit attributes describing units in CPACS. The general convention is that all values must be given in the following SI-units: [m] Position, Distance - [m^2] + [m2] Area - [m^3] + [m3] Volume @@ -188,7 +250,7 @@ marko.alder@dlr.de Energy - The only non SI unit used throughout CPACS is the angle in degrees [°]. + The only non SI unit used throughout CPACS is the angle in degrees [°]. For the sake of an intuitive use the angles are given in degrees rather than in radian [rad]. @@ -199,67 +261,80 @@ marko.alder@dlr.de - 5. Splitting up a CPACS dataset into several files + 5. Splitting up a CPACS dataset into several files - To provide a better overview, it is possible to split up a CPACS dataset into several files. This can be done by inserting an <externaldata> node at an arbitrary position into the datatset. This node contains a <path> node with a URI to the external file(s), followed by one or more <filename> nodes, containing each a name of a file to be included at that position. Below, an example of such external data is given: - <?xml version="1.0" encoding="utf-8"?> -<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> - <vehicles> - <profiles> - <wingAirfoils> - <externaldata> - <path>file:://airfoils</path> - <filename>NACA0010.xml</filename> - <filename>NACA2412.xml</filename> - </externaldata> - <airfoil uID="NACA0012"> - <name>NACA 0012 Airfoil</name> - <pointList>...</pointList> - </airfoil> - </wingAirfoils> - </profiles> - </vehicles> -<cpacs> + To provide a better overview, it is possible to split up a CPACS dataset into several files. This can be done by inserting an <externaldata> node at an arbitrary position into the datatset. This node contains a <path> node with a URI to the external file(s), followed by one or more <filename> nodes, containing each a name of a file to be included at that position. Below, an example of such external data is given: + + + + + + + + file:://airfoils + NACA0010.xml + NACA2412.xml + + + NACA 0012 Airfoil + ... + + + + + + ]]> + + Such an external file would look like: - <?xml version="1.0" encoding="utf-8"?> -<airfoil uID="NACA0010"> - <name>NACA 0010 Airfoil</name> - <pointList>...</pointList> -</airfoil> - The file would be included completely, except for its title line <?xml version="1.0" encoding="utf-8"?> . This concept can also be used recursively (external files of external files), then it is important to prevent circle connections (file "A" loading file "B" loading file "C" loading again file "A" ...). + + + + NACA 0010 Airfoil + ... + + ]]> + + The file would be included completely, except for its title line <?xml version="1.0" encoding="utf-8"?> . This concept can also be used recursively (external files of external files), but it is important to prevent circle connections (file "A" loading file "B" loading file "C" loading again file "A" ...). For path URI addresses, the trailing file separator "/" may be omitted. Below, some examples for path URIs are given: - Absolute local path: "file:///tmp" or "file:///c:/windows/tmp" - Relative local direcotry: "file://relativeDirectory" or "file://../anotherRelativeDirectory" - Remote net ressource: "http://www.someurl.de" + Absolute local path: file:///tmp or file:///c:/windows/tmp + Relative local direcotry: file://relativeDirectory or file://../anotherRelativeDirectory + Remote net ressource: http://www.someurl.de - A CPACS dataset with external files, being loaded by a special library like the TIVA XML Interface TIXI, shall collect all its external datafiles and build up a single tree from them. A validation against this schema is only possible for such a single tree file; the <externaldata>nodes are not recognized by it. To preserve the information, necessary to split the file up into external files again later, externaldata information is maintained within three attributes of the former external top node: + With the help of the TiXI XML Interface TiXIhttps://github.com/DLR-SC/tixi, a CPACS dataset that is split into multiple files can be reassembled into a single tree structure for subsequent validation against the CPACS schema. The following commands are used to link external data sets: - externalFileName - Name of the file where the external data shall be saved - externalDataDirectory - Directory of the external data file. Its content is analogous to the <externaldata>'s <path>node described above. - externalDataNodePath - XPATH of the node which is replaced with the content of the external file. In case that it is an external file of an external file, then it is the XPATH in the outer external file. If, e.g., in the example above the <pointList>node would have also been loaded from an external file, then the entry would just be: externalDataNodePath="/airfoil". This is used primarily for loop-detection. + <externalFileName>: Name of the external data file + <externalDataDirectory>: Directory of the external data file. Its content is analogous to the externaldata's path-element described above. + <externalDataNodePath>: XPathhttps://www.w3schools.com/xml/xpath_intro.asp of the node which is replaced with the content of the external file. In case that it is an external file of an external file, then it is the XPath in the outer external file. If, e.g., in the example above the pointList element would have also been loaded from an external file, then the entry would just be: externalDataNodePath="/airfoil". This is used primarily for loop-detection. - The single tree for the example above would look like: - <?xml version="1.0" encoding="utf-8"?> -<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> - <vehicles> - <profiles> - <wingAirfoils> - <airfoil uID="NACA0010" externalFileName="NACA0010.xml" externalDataDirectory="file://airfoils" externalDataNodePath="/cpacs/vehicles/profiles/wingAirfoils"> - <name>NACA 0010 Airfoil</name> - <pointList>...</pointList> - </airfoil> + The merged data tree for the example above would look like: + + + + + + + + NACA 0010 Airfoil + ... + ... - <airfoil uID="NACA0012"> - <name>NACA 0012 Airfoil</name> - <pointList>...</pointList> - </airfoil> - </wingAirfoils> - </profiles> - </vehicles> -<cpacs> + + NACA 0012 Airfoil + ... + + + + + + ]]> + @@ -269,87 +344,154 @@ marko.alder@dlr.de references define connections between elements which are located somewhere else in the hierarchical dataset (e.g. a wing is connected to a fuselage; a specific engine is connected to a pylon; etc.). These connections are defined by unique identifiers (uID) which are specified as attributes. Thus, there are elements which can be referenced via a uID attribute, e.g. a fuselage: - <fuselage uID="ATTAS_fuselage">... + + ... + ]]> + as well as elements which refer to the former, e.g. a wing pointing to its geometrical parent: - <wing uID="e382bf5j"> - <name>ATTAS main wing</name> - <parentUID isLink="True">ATTAS_fuselage</parentUID> - ... - Such referencing elements must carry the isLink="True" attribute. + + + ATTAS main wing + ATTAS_fuselage + ... + ]]> + - Since uIDs are only used to link nodes within the XML file, no naming convention is required. UIDs, however, must be unique! - Although a common practice for naming uIDs is their position in the data hierarchy (e.g. uID="mainWingSection3"), - uIDs as shown in the above example are absolutely valid as well. It is therefore recommended to use the name element + In previous CPACS versions, referencing elements were identified via the isLink="True" attribute. Since this is superfluous due to the explicit definition of the element properties via the CPACS schema, this attribute no longer needs to be listed. It is nevertheless a valid optional attribute to ensure compatibility with older datasets, but might be removed in future versions. + Since uIDs are only used to link nodes within the XML file, no naming convention is required. The characters only have to conform to the conventions of the xsd:IDhttp://books.xmlschemata.org/relaxng/ch19-77151.html type standardized by the W3Chttps://www.w3.org/. UIDs, however, must be unique! + Although a common practice for naming uIDs is their position in the data hierarchy (e.g. uID="mainWingSection3"), + uIDs as shown in the above example are absolutely valid as well. It is therefore recommended to use the name element to convey human-readable meanings. - 7. Symmetry + 7. Usage of name, description and uID - Sometimes it might be useful to specify a part of the aircraft as symmetric instead of holding all the data twice in nearly identical form in the dataset (e.g. left and right wing are usually identical, except for the sign of the y-coordinate). Hence, some parts offer the option to set a symmetry attribute for them, like: - <wing symmetry="x-z-plane">... - This attribute explains that the whole part with all its subnodes is symmetric to the given plane. Possible planes are: - x-y-plane - x-z-plane - y-z-plane - none - inherit - - By default, the symmetry of a component is inherited from its parent. If e.g. a wing is symmetrically defined, a pylon will also have a symmetry by default. - This symmetry inheritance can be broken, by explicitly deleting the symmetry with symmetry="none". - + CPACS is designed to serve as a central data exchange format in fully automated process chains. + A key requirement is therefore that tools can automatically read and process an incoming CPACS file. + A second requirement is that users can interpret the data set. + To address both requirements, the following usage of the name and description elements in combination with the uID attribute is proposed: + + + name: A specification of the name element is usually mandatory for sequences of elements (e.g., if max occurence is unbounded [1..*]). + Typical examples are wings/wing, aeroPerformance/aeroMap or missions/mission. + Such elements must be able to be listed by tools, especially for visualization and reporting purposes, where the name element serves as a concise and human-readable indicator of the actual meaning of the corresponding element in the list (e.g., which wing, which aeroMap, which mission). + This is usually a single word or a small number of words. + + + + + description: This element is usually optional and is used to add comprehensive and human-readable explanations. This is usually at least one explanatory sentence. + + + + + uID: As described in more detail in Section 6, the uID attribute is mainly used for internal referencing of CPACS elements. + Further processing software, e.g. TiXI and TiGL, also use the uIDs to improve the robustness of the data query. + Consequently, the uID attribute serves as a machine-readable indicator and does not claim to be interpretable by human users. + In some practical use cases, the same string is chosen for uID and name. + However, restrictions on the choice of characters for the uID attribute must be considered, for example that no spaces may be used and the uID must be unique. + + + + + + Main wing + This is the main wing which was designed by my awesome wing sizing design tool. Your tool should not try to read and interpret what I'm writing here as typos are not recognized by XML processors. + + ]]> + - UIDs, references and symmetry + 8. Symmetry - All nodes, e.g. parentUID, in CPACS that refer to a component that holds symmetry attribute, e.g. wing, have to carry the symmetry attribute as well. - The symmetry attribute may take three values: symm, def, full: + 8.1. Specification of symmetric elements + Sometimes it might be useful to specify a part of the aircraft as symmetric instead of holding all the data twice in nearly identical form in the dataset (e.g. left and right wing are usually identical, except for the sign of the y-coordinate). + Hence, some parts offer the option to set a symmetry attribute: + + + ]]> + + There are six possible attribute values: + + x-y-plane: Symmetry w.r.t. the x-y plane of the CPACS coordinate system + x-z-plane: Symmetry w.r.t. the x-z plane of the CPACS coordinate system + y-z-plane: Symmetry w.r.t. the y-z plane of the CPACS coordinate system + inherit: Symmetry inherited from parent element (default behavior, i.e. also applies if attribute not set) + + Note: It must be taken from the documentation of the respective element which of these attribute values may be set. + + One example of how to apply the symmetry attribute is shown in Sec. 3.2. Another simplified example shown below illustrates the combination of different symmetry properties of 4 wings: + + + + + Wing 1 is mirrored on the x-z plane. + Wing 2 has wing 1 as parent element, but suppresses its symmetry inheritance. + Wing 3 has wing 2 as parent element and sets a new symmetry at the x-y plane. + Wing 4 has wing 3 as parent element and no symmetry attribute specified. Thus, it inherits the symmetry at the x-y plane from wing 3. + + Note: The corresponding transformations are not shown here. + 8.2. Referencing symmetric elements + All nodes (e.g., parentUID) in CPACS that refer to a component holding the symmetry attribute (e.g., wing) might also have a symmetry attribute to specify how symmetry is propagated through the resulting element hierarchy. + The symmetry attribute of a referencing element may take three values: symm, def, full: - def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. + def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. - symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) + symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) - full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) + full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) - <wing uID="ATTAS_main_wing" symmetry="x-z-plane"> - ... - <segments> - <segment uID="ATTAS_main_wing_innersegment"> - ... - In the example above, to refer to the "other" side of the wing on must use the definition as such: - <loadcase> - ... - <segments> - <segment> - <segmentUID isLink="True" symmetry="symm">ATTAS_main_wing_inner_segment</segmentUID> - <strip>... + + + + For example, to refer to the "other" side of a mirrored wing the following the following syntax might be used: + + + + wing + ]]> + + Note: This feature is not implemented in TiGL. The upper figure is manually processed to illustrate the principle. In addition, there is an ongoing debate whether the approach is suitable for CPACS due to rapidly increasing complexity and unresolved implicit assumptions as to whether it is one or two components after mirroring. Therefore, it is advised to avoid using the symmetry attribute if possible. - 8. Vectors and arrays + 9. Vectors and arrays For large data sets (e.g. increments of aerodynamic coefficients due to control surface deflections) it is advantageous to map them via vectors and arrays instead of using a sequence of nodes for each data value. Therefore vectors and arrays are defined as semicolon-separated lists in CPACS. Via the documentation (derived from the XSD) of the corresponding nodes it has to be checked whether it is a vector or an array. Vector The vector is meant as a one-dimensional-array. In such a node, the values are given in a semicolon separated list: - <angleOfAttack>0.;1.5;3.;4.5;6;7.5;9.</angleOfAttack> + + 0.;1.5;3.;4.5;6;7.5;9. + ]]> + Array As for vectors, multi-dimensional arrays provide values in a semicolon separated list. An array is always preceded by a sequence of vectors, containing the dimensions and index values. Which vectors of an array are dimensioning is specified in the respective documentation of the array. - <altitude>1000.;2000.;3000.</altitude> <!-- vector element --> - <incrementMaps> - <incrementMap uID="incMap_b3ac2"> - <controlSurfaceUID>InnerWingFlap</controlSurfaceUID> - <controlParameters>-1;-0.5;0;1</controlParameters> <!-- vector element --> - <!-- array of dimension length(altitude) x length(controlParameters): --> - <dcl>11.;12.;13.;14.;21.;22.;23.;24.;31.;32.;33.;34.</dcl> + + 1000.;2000.;3000. + + + InnerWingFlap + -1;-0.5;0;1 + + 11.;12.;13.;14.;21.;22.;23.;24.;31.;32.;33.;34. + ]]> @@ -391,7 +533,7 @@ marko.alder@dlr.de - 9. Control Parameters + 10. Control Parameters Control parameters are abstract parameters, linking a generic floating point value to a certain status of a control device (e.g. control surface, landing gear, suction system, brake parachute, ...). For control surfaces, such a data pair (control parameter @@ -404,41 +546,44 @@ marko.alder@dlr.de mandatory to specify a <step> with a <controlParameter> of 0. Consequently, no <controlParameter> must be used twice within a single <path> definition. Deflection values between two specified steps are handled by linear interpolation. The following example shows the usage of control parameters within a control surface deflection path definition: - <controlSurfaces> - <trailingEdgeDevices> - <trailingEdgeDevice uID="InnerWingFlap"> + + + + ... - <path> + ... - <steps> - <step> - <controlParameter>-1</controlParameter> - <hingeLineRotation>-20.</hingeLineRotation> - </step> - <step> - <controlParameter>-0.5</controlParameter> - <hingeLineRotation>-10.</hingeLineRotation> - </step> - <step> - <controlParameter>0</controlParameter> - <hingeLineRotation>0.</hingeLineRotation> - </step> - <step> - <controlParameter>1</controlParameter> - <hingeLineRotation>5.</hingeLineRotation> - </step> - </steps> + + + -1 + -20. + + + -0.5 + -10. + + + 0 + 0. + + + 1 + 5. + + ... + ]]> - 10. Atmosphere + 11. Atmosphere - At some places in CPACS, an atmosphere has to be selected (e.g. for connecting an altitude with a certain pressure or density). - Currently, CPACS does only support a single atmospheric model: The ICAO Standard Atmosphere (ISA) from 1993 (see ICAO Doc 7488/3 'MANUAL OF THE ICAO STANDARD ATMOSPHERE', third edition, 1993) + At some places in CPACS, an atmosphere has to be selected (e.g. for connecting an altitude with a certain pressure or density). + Currently, CPACS does only support a single atmospheric model: The ICAO Standard Atmosphere (ISA) from 1993 (see ICAO Doc 7488/3 'MANUAL OF THE ICAO STANDARD ATMOSPHERE', third edition, 1993) It covers temperature, pressure, density, speed of sound, dynamic viscosity and kinematic viscosity with respect to altitude. - In CPACS, 'altitude' means what is called 'geopotential altitude' (H) in the ISA reference document and is given in [m]. + In CPACS, 'altitude' means what is called 'geopotential altitude' (H) in the ISA reference document and is given in [m]. For details, see ISA manual, section 2.3, page E-viii f. ISA covers a range from -5000 m to 80000 m. Temperature offsets are introduced on top of the definitions in the ISA manual (which does not cover such variations). The offset model @@ -446,6 +591,32 @@ marko.alder@dlr.de The temperature offset changes only the density (following rho = p / Gas Constant / T) (and viscosity, of course) + + CPACS 3.4 + + Release in April 2022 + + Revision of decks definition (compatibility break) + Mass breakdown: add mSparSkins and mSparCells to mSpar + Mass breakdown: fix hierarchical error in mMiscellaneous (compatibility break) + Mass breakdown: fix typo in mPylon (compatibility break) + Nacelle guide curves: set description optional + Mission definition: add uID to elements in geographicPointConstraintType + Mission definition: add powerFraction, powerRemaining and powerConsumed to missionSegmentEndConditionType + Mission definition: rename referenceEndCondition to referenceEndConditionUID in constraintSettingsType (compatibility break) + Mission definition: rename reqClassification to requirementClassification in flightPerformanceRequirementType (compatibility break) + Add contour coordinates for cell definition + Add vehicle independent node for external geometry + Remove paxFlow element from aircraftAnalysesType (compatibility break) + Docs: improve documentation of name, description and uID usage + Docs: add description of parentUID concept + Docs: add description of symmetry inheritance + Docs: add description of engine nacelles + Docs: add description of mission definition + General improvements of the documentation + + + CPACS 3.3 @@ -1610,9 +1781,8 @@ marko.alder@dlr.de Translation data default: 0,0,0. Translations can either be made absolute in the global coordinate system - (absGlobal), absolute in the local Coordinate system (absLocal) - or relative (relative), normalized with the maximum dimensions - of the parent. + (absGlobal) or absolute in the local Coordinate system (absLocal). + @@ -1953,8 +2123,16 @@ marko.alder@dlr.de - - + + + Absolute values in global coordinate system + + + + + Absolute values in local coordinate system (default) + + @@ -2032,7 +2210,7 @@ marko.alder@dlr.de Vector of rX coordinates. Relative - circumferential coordinate on wing / fuselage profile + circumferential coordinate on wing, fuselage or nacelle profile @@ -2386,6 +2564,23 @@ marko.alder@dlr.de + + + + + + Positive integer values larger than 0 + + + + + + + + + + + @@ -2950,7 +3145,6 @@ marko.alder@dlr.de - @@ -3887,103 +4081,12 @@ marko.alder@dlr.de - - - - - - cabGeometryType - - - cabGeometry provides the geometry of the cabin in terms - of constant height contour lines. The lines all share a common - x-vector. The vectors yZ[N] provide the lateral contour at - Z-coordinate provided in the vector z. The number of contour - lines can differ and is given by the length of the vector z - - - - - - - - - - - - - x-coordinates for all contour lines, relative - to cabin origin. - - - - - z-coordinate of contour lines. Contour lines - are constant z, so each entry in this vector belongs to a single - contour line. - - - - - - - - - - - - - - - cabinAisleType - - - aisles has as many entries as there are aisles in the - cabin. In a normal single aisle there are two aisles: the cabin - aisle and the aisle leading to the cockpit. - - - - - - - - - - - - Provides the longitudinal coordinates. The - number of coordinates can be chosen as appropriate, the minimum - number is two. The coordinates are relative to the cabin origin. - - - - - - Provides the center points of the aisle. The - y-vector has to have same length as the x-vector. The aisle - stretches equally left and right of the provided y-coordinate. - - - - - - the width of the aisle at floor level at each - y-coordinate. - - - - - - - - - cabinAislesType + Cabin aisles @@ -4000,306 +4103,12 @@ marko.alder@dlr.de - - - - - - cabinDoorType - - - doors describe all doors of the cabin. They are linked - to a structural door description. The cabin door is usually equal - in size to the door, but does not need to be. The structural door - might describe a wider cut-out, while the cabin door is primarily - intended for evacuation modeling and cabin layout. In order to - obtain a 3-dimensional door representation, the local cabin - geometry shall be used. - - - - - - - - - - - - - Number of passengers this door adds to the - overall exit capacity limit of the aircraft. - - - - - This is the forward x-coordinate of the door - relative to the cabin origin. - - - - - the door sill height relative to cabin origin. - - - - - - The width of the door in x-direction. - - - - - - the effective height of the door. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cabinDoorsType - - - - - - - - - - - - - - - - - - - - - - cabinFloorElementType - - - floorElement describes objects like monuments or other - installations inside the cabin. - - - - - - - - - - - - - - - - - - - - - - - forward center coordinate of object relative - to cabin origin. - - - - - center y-coordinate relative to cabin origin. - - - - - - length of the object - - - - - length of the object - - - - - length of the object - - - - - - - - - - - - - - - cabinFloorElementsType - - - - - - - - - - - - - - - - - - - - - - cabinSeatElementType - - - seats describe all seats inside the aircraft. They are - – strictly speaking – also objects mounted on the floor, hence - floor objects. But the specific characteristics of seats justify - a differentiation between seats and other objects on the floor. - Seats are seat group, for example a triple seat. Therefore they - have multiple seats. - - - - - - - - - - - - Number of seats - - - - - - - - - - - - - - - - x-coordinate relative to cabin origin. - - - - - - y-coordinate relative to cabin origin. - - - - - - delta-y-coordinate of the individual seat - center points from the y-coordinate of the seat object. This is - important to locate passengers. It is assumed that seats have no - angle. - - - - - length of the seat group. - - - - - width of the seat group. - - - - - height of the seat group. - - - - - - - - - - - - - - - - - cabinSeatElementsType - - - - - - - - - - - - - - - - - cabinSpaceType + Space spaces describe areas in the cabin that need to be @@ -4314,17 +4123,25 @@ marko.alder@dlr.de - - - + + + Name + + + - x-coordinates. These describe an area, so they + Description + + + + + Vector with x-coordinates. These describe an area, so they are not monotonous ascending. - + - y-coordinates at given x-coordinates. Warning: + Vector with y-coordinates at given x-coordinates. Warning: x-y do not represent a function as single x-positions can have multiple y-coordinates. Hence, no interpolation is possible. @@ -4332,8 +4149,8 @@ marko.alder@dlr.de - the height above the floor that is required to - be empty of any objects. + Height above the floor that is required to + be empty of any objects @@ -4347,7 +4164,7 @@ marko.alder@dlr.de - cabinSpacesType + Cabin spaces @@ -4477,9 +4294,9 @@ marko.alder@dlr.de Chordwise positioning of wing cells. - CellPositioningChordwise defines the chordwise direction of a wing cell either in two xsi - (xsi1 at innerBorder and xsi2 at outerBorder) coordinates, via referencing a spar-uID or via a - contour coordinate in chordwise direction. + CellPositioningChordwise defines the chordwise direction of a wing cell either in two xsi + (xsi1 at innerBorder and xsi2 at outerBorder) coordinates, via referencing a spar-uID or via a + contour coordinate in chordwise direction. @@ -4488,30 +4305,27 @@ marko.alder@dlr.de - + - Relative chordwise position of the inner - end. + Relative chordwise position of the inner end. - - - - Relative chordwise position of the outer - end. - - - - - - Reference to a spar as chordwise border. - - - - - - Chordwise contour coordinate as chordwise border. 0 equals LE, 1 equals TE. - - + + + + Relative chordwise position of the outer end. + + + + + + Reference to a spar as chordwise border. + + + + + Chordwise contour coordinate as chordwise border. 0 equals LE, 1 equals TE. + + @@ -4524,44 +4338,38 @@ marko.alder@dlr.de Spanwise positioning of wing cells. - - CellPositioningSpanwise defines the chordwise direction of a wing cell either in two eta - (eta1 at leadingEdge and eta2 at trailingEdge) coordinates, via referencing a rib-uID or via a contour - coordinate in chordwise direction. + + CellPositioningSpanwise defines the chordwise direction of a wing cell either in two eta + (eta1 at leadingEdge and eta2 at trailingEdge) coordinates, via referencing a rib-uID or via a contour + coordinate in chordwise direction. - - - - - Relative spanwise position of the forward - end. + + + + + Relative spanwise position of the forward end. - Relative spanwise position of the rear end. - + Relative spanwise position of the rear end. - RibNumber is the reference to the rib number - of the rib set which is referenced by 'ribDefinitionUID'. - + RibNumber is the reference to the rib number of the rib set which is referenced by 'ribDefinitionUID'. - Reference to a ribDefinition set. The single - rib of this ribDefinition set is defined by using 'ribNumber'. - + Reference to a ribDefinition set. The single rib of this ribDefinition set is defined by using 'ribNumber'. @@ -5713,10 +5521,10 @@ marko.alder@dlr.de - + - Reference to the uID of the segment end condition variable + Reference to the uID of the segment end condition variable to which a profile of constraintSettings is provided @@ -5745,8 +5553,7 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Calibrated airspeed within the - segment + Calibrated airspeed within the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5754,7 +5561,7 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Mach number within the segment + Mach number within the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5762,19 +5569,19 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Climb angle within the segment + Climb angle within the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. + type="doubleConstraintBaseType"> - Climb angle within the segment + Rate of climb within the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. - + Specific excess power within the segment @@ -5795,18 +5602,14 @@ marko.alder@dlr.de - Flight heading at the end of the - segment in compassAngle with - reference to true North [deg] + Flight heading at the end of the segment in compassAngle with reference to true North [deg]. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. - Total change of heading angle during - segment (a full turn is 360 degrees) - [deg] + Total change of heading angle during segment (a full turn is 360 degrees) [deg]. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5814,7 +5617,7 @@ marko.alder@dlr.de - Rate of turn within the segment + Rate of turn within the segment [deg/s]. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5822,10 +5625,7 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Thrust setting for derated engine as - fraction of max. Thrust (e.g.: for - powered descents, deceleration not at - IDLE, manoevres). + Thrust setting for derated engine as fraction of max. Thrust (e.g.: for powered descents, deceleration not at IDLE, manoevres). If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5833,7 +5633,7 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Rate of velocity within the segment + Rate of velocity within the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5841,7 +5641,7 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Load factor experienced during segment + Load factor experienced during segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5849,23 +5649,20 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Constant altitude for the segment. + Constant altitude of the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. - priority setting indicating which - constraint is preferred within the - segment + Priority setting indicating which constraint is preferred within the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. - - - + + @@ -5949,12 +5746,12 @@ marko.alder@dlr.de Within some analyses, it might occur that overlapping control element settings are specified. In this case, it is assumed that a cumulative setting is built by summing up the individual settings. As the behavior of these settings is not necessarily linear, a certain order of summation has to be followed: - - (1) The command inputs for each controlDistributor, coming from the configurationUID, as well as from separate settings have to be summed up to a total commandInput. - (2) With this total commandInput, each corresponding controlDistributor definition has to be evaluated, in order to get controlParameter settings for a number of controlDevices. - (3) All controlParameter settings for a controlDevice, coming from the configurationUID, from the controlDistributors and from separate controlDevice settings have to be summed up to get a total controlParameter for each controlDevice. - (4) With this total controlParameter, each corresponding controlDevice definition has to be evaluated, in order to find out what the control device finally is doing. - (5) During the summation process (depending on the order of processing within step 1 to 4), commandInputs or controlParameters might exceed the specified limits for that controlDistributor or controlDevices. As an intermediate result, this should be accepted – however, when it comes to evaluation in step 2 and 4, all commandInputs and controlParameters have to be within the specified limits. + + The command inputs for each controlDistributor, coming from the configurationUID, as well as from separate settings have to be summed up to a total commandInput. + With this total commandInput, each corresponding controlDistributor definition has to be evaluated, in order to get controlParameter settings for a number of controlDevices. + All controlParameter settings for a controlDevice, coming from the configurationUID, from the controlDistributors and from separate controlDevice settings have to be summed up to get a total controlParameter for each controlDevice. + With this total controlParameter, each corresponding controlDevice definition has to be evaluated, in order to find out what the control device finally is doing. + During the summation process (depending on the order of processing within step 1 to 4), commandInputs or controlParameters might exceed the specified limits for that controlDistributor or controlDevices. As an intermediate result, this should be accepted – however, when it comes to evaluation in step 2 and 4, all commandInputs and controlParameters have to be within the specified limits. @@ -8959,10 +8756,10 @@ marko.alder@dlr.de - deckType + Deck - Deck type, containing the data of a deck + Data of an aircraft or rotorcraft deck @@ -8972,51 +8769,109 @@ marko.alder@dlr.de - Name of the deck + Name - Description of the deck + Description - - + - The starting point of the deck/cabin. In a - conventional aircraft like the A320, it would be the rear wall - of the cockpit. The coordinate is relative to the parent object - defined by “parentUID”, which should be the fuselage. - + UID of the object used as parent coordinate system (typically the fuselage uID) + + + + + UID of the floor structure which supports this deck - + - The starting point of the deck/cabin. In a + The reference point of the deck/cabin. In a conventional aircraft like the A320, it would be the rear wall - of the cockpit. The coordinate is relative to the parent object + of the cockpit. The transformation is relative to the parent object defined by “parentUID”, which should be the fuselage. - + + + Deck type: passanger, VIP, cargo or livestock + - + - - - - - - + + + + Seat modules + + + + + Aisles + + + + + Spaces + + + + + Sidewall panels + + + + + Luggage compartments + + + + + Ceiling panels + + + + + Galleys + + + + + Generic floor modules + + + + + Lavatories + + + + + Class dividers + + + + + Cargo containers + + + + + Doors + + @@ -9028,10 +8883,10 @@ marko.alder@dlr.de - decksType + Decks - Decks type, containing the decks of the fuselage + List of decks @@ -9965,20 +9820,26 @@ marko.alder@dlr.de - Definition of the engine nacelle type. + Engine nacelle - The engine nacelle is currently located together with - the engine. It gives a simple description of the outer shell of - the engine. All values are defined according to the base area, - center point of the fan(i.e. negative values can occur in the - definition) In most cases there will be a bypass engine. For - non-bypass or mixed engines ignore the bypass nozzle. For further - information on the geometric setup, please refer to the picture - below. + The engine nacelle is part of an engine. + It allows to define the outer geometry of the following engine components: + + Fan cowl + Core cowl + Center cowl + + + All geometric values refer to the fan position. + + + The common use case for this definition includes bypass engines. + In the case of non-bypass engines, the core cowl should be omitted. + - + @@ -9988,13 +9849,17 @@ marko.alder@dlr.de - + + + Fan cowl + - + + + Core cowl + - + @@ -10224,17 +10089,7 @@ marko.alder@dlr.de - - - - - - - - - - - + @@ -10306,17 +10161,7 @@ marko.alder@dlr.de UID of the engine pylon. - - - - - - - - - - - + @@ -10867,7 +10712,7 @@ marko.alder@dlr.de - + @@ -12930,17 +12775,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - + @@ -13277,17 +13112,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - + @@ -13319,11 +13144,145 @@ The fuel tank volume type should also be used for the wing fuel tank - mass + Mass description - genericMassType, describing mass, inertia and CoG data. - + + + + + parentUID not set + parentUID set + + + location without refType + global + local + + + location with refType="absLocal" + global + local + + + location with refType="absGlobal" + global + global + + + Note: The combination of location with refType="absLocal" and no parentUID is global, because the local coordinate system to which the location is referring to via refType equals the global coordinate system. + + + + ... + + + ... + + + ... + + + ... + + + ]]> + + + + + ... + + + ... + + + ... + + + ... + + + ]]> + + + + + ... + + + ... + + + ... + + + ... + + + ]]> + + + + wingUID + + ... + + + ... + + + ... + + + ... + + + ]]> + + + + wingUID + + ... + + + ... + + + ... + + + ... + + + ]]> + + + + wingUID + + ... + + + ... + + + ... + + + ... + + + ]]> + + @@ -13333,36 +13292,45 @@ The fuel tank volume type should also be used for the wing fuel tank - name + Name - description + Description - parentUID + UID of the component which serves as parent element, i.e. whose coordinate system is to be used as a reference for the mass properties (CoG location, orientation and massInertia). Thus, two cases can occur: (1) + it is set: local coordinate system of the parent; (2) it is not set: global CPACS coordinate system. + - mass value + Mass [kg] - + - mass loaction values (x,y,z) + Mass location. + If the optional refType attribute is set, it explicitly specifies whether the location of the mass refers to the global CPACS coordinate system (absGobal) or the local coordinate system of the parent element (absLocal, given by the CPACS hierarchy OR by parentUID). + If it is not set, the global CPACS coordinate system is considered as default. + To ensure consistency, the same settings apply as well to orientation and massInertia. - mass orientation values + Orientation. The reference coordinate system (absGlobal or absLocal) is identical to location. + + + + + Mass intertia. The reference coordinate system (absGlobal or absLocal) is identical to location. - @@ -13405,7 +13373,7 @@ The fuel tank volume type should also be used for the wing fuel tankFor spheres the default diameter is 1m. Cubes have a length of 1m in all three dimensions. Cylinders have a length of 1m and a diameter of 1m for the circular cross section. The cone is a cylinder with the top face scaled down to zero. - + @@ -13442,17 +13410,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - + @@ -13473,20 +13431,41 @@ The fuel tank volume type should also be used for the wing fuel tank - - - Longitude coordinate 0-360 - + + + + Longitude coordinate 0-360 + + + + + + + - - - Latitude coordinate 0-360 - + + + + Latitude coordinate 0-360 + + + + + + + - - - Altitude in meters - + + + + Altitude in meters + + + + + + + @@ -13672,17 +13651,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - + @@ -13822,7 +13791,7 @@ The fuel tank volume type should also be used for the wing fuel tank The relative circumference position at which the guide curve shall end. Valid values - are in the interval -1.0...1.0. + are in the interval -1,...,1. @@ -14944,7 +14913,7 @@ The fuel tank volume type should also be used for the wing fuel tank - linkToFile + Link to file (Step, Iges or Stl) Please provide a link to the additional file that shall @@ -15725,6 +15694,29 @@ The fuel tank volume type should also be used for the wing fuel tank + + + + + + mSparCellsType + + + + + + + + + + + + + + + + + @@ -15794,7 +15786,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -16550,7 +16542,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -16589,7 +16581,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -17007,28 +16999,6 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - mMiscellaneousType - - - Miscellaneous masses must only specify componenent masses for which NO DEDICATED ELEMENT EXISTS in the mass breakdown list! - - - - - - - - - - - - - @@ -17387,7 +17357,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -17439,7 +17409,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -17608,6 +17578,29 @@ The fuel tank volume type should also be used for the wing fuel tank + + + + + + mSparSkinsType + + + + + + + + + + + + + + + + + @@ -17625,12 +17618,36 @@ The fuel tank volume type should also be used for the wing fuel tank - + + + + + + + mSparType + + + + + + + + + + + + + + + + + + @@ -17768,7 +17785,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -18304,7 +18321,7 @@ The fuel tank volume type should also be used for the wing fuel tank - massInertiaType + Mass intertia massInertiaType @@ -19712,10 +19729,272 @@ The fuel tank volume type should also be used for the wing fuel tank - Specifies missions for performance evaluation of aircraft. - As the topmost element of the hierarchical mission definition, individual missions are grouped together - in the missions node. Here, segmentBlocks - are referenced. These again link to a list of segments. + + General description + Specifies mission profiles required for the performance evaluation of air vehicles (aircraft, rotorcraft, etc.). The missionDefininitions node is constructed in such a way, that all civil aircraft missions and missions from MIL-STD-3013A can be specified.> + + + Hierarchical buildup of the mission definition + + The mission definition is built-up in a hierarchical way. As the topmost element of the hierarchical mission definition, missions are created within the missions node. Here, one or more segmentBlocks are referenced. These again link to a sequence of segments, making up parts of the missions: + + + + + + <missions> + containing the <startCondition> and a sequence of <segmentBlockUIDs> + + + <segmentBlocks> + + + grouping multiple <segments> and providing overall information concerning the block of segments: + + + + constraints in the form of an endCondition or given flightPath, + variableSegments and the corresponding variableConditions in case a segment should be adjusted such to meet the segmentBlock's endCondition, + fuelPlanningType (designFuel, reserveFuel, additionalFuel), + segmentDirection and numberOfRepetitions. + + + + + + <segments> + + + containing detailed information per segment: + + + EITHER + + + + segmentType, + endConditions, + constraints, + environmentalConditions + + + + OR massFraction + + + OR mass + + + + + + + + startConditions, constraints, endConditions and the relationalOperator attribute + + the startCondition is provided at the mission node. Each subsequent segmentBlock/segment ends by the provided endCondition. + + + <startCondition> + start condition of the mission (can be an airfield or mid-air condition) + + + <endCondition> + specific end condition for a segmentBlock or segment (e.g.: an altitude or velocity) + + + <constraint> + specific performance settings for a segmentBlock or segment (e.g.: a cruise Mach number) + + + attribute @relationalOperator + + Indicate how conditions should be interpreted: + + + enum: „lt“, „le“, „eq“, „ne“, „ge“, „gt“, + + Examples: + + + 0.78 +1800 + ]]> + + + + + + + + + + + + + Example implementation for a civil transport mission + + + + + + In the figure above, an example for a civil aircraft transport mission is provided. + + + The mission starts at a position of 0, 0, 0 with 0 velocity, as provided by the startCondition of the mission node. Furthermore, the environmental conditions are provided: ISA atmosphere with a deltaTemperature of 0 [K]. The mission consists of three segmentBlocks: a designMission, reserves and the taxiIn segmentBlock. + + + + example mission + this is an example mission + + 0.0 + + 0.0 + 0.0 + 0.0 + + + ISA + 0.0 + + + + designMission + reserves + endPhase + + + ]]> + + + The designMission segmentBlock is shown below. It provides a set of five segments, together making up a mission with a range of 1000 [nm] or 1852 [km]. The “cruise” segment is the variable segment, which thereby should have a range of: 1852000 – range(climb) – range(descent), provided the taxiOut and takeOff segments are not providing any range credit. The fuel burned during this segmentBlock should be added to the designFuel, the segmentDirection is provided for illustration purposes. + + + + + design mission + segment block for the design mission + + + 1852000 + + + + + cruise + range + + + designFuel + outbound + + taxiOut + takeOff + climb + cruise + descent + + + + + ]]> + + + The first and second segment are providing input for the part of the segmentBlock that doesn’t need simulation. During the taxiOut phase, 50 [kg] of fuel is burned. The takeOff phase has a duration of 30 [sec]. + + + + taxi out + taxi out segment + massFraction + 50 + + + take off + take off segment + takeOff + + 00:00:30 + + + ]]> + + The rest of the segments make-up the flying part of the designMission. The climb phase, ending at an altitude of FL330 or 10058.4 [m], provides a constraint-lapse having discrete steps, typical for transport aircraft (a 250 kt / 300 kt / M 0.78 climb profile). Through the referenceEndconditionUID “altClimb”, a link to the altitude endCondition of the segment at the basis of this climb profile is provided. + + + + Altitude from + Altitude to + calibratedAirspeed + machNumber + + + 0.0 [m] + 0.303 * 10058.4 = 3047.7 [m] + ≤ 128.61 [m/s] + ≤ 0.78 [-] + + + 0.303 * 10058.4 = 3047.7 [m] + 10058.4 [m] + ≤ 154.33 [m/s] + ≤ 0.78 [-] + + + + + The cruise phase is not fixed to a certain altitude and has no endCondition, since its range is determined by the segmentBlock information. The descent phase makes sure the vehicle lands at an altitude of 0 [m]. In this case, since the values are not explicitly provided, it is up to the mission simulation software to determine, when the cruise phase ends and the descent phase starts. + + + + climb + climb with: speed @ MFCS (set to machNumber le 0.78 [-]), altitude @ FL330 + climb + + + 10058.4 + + + + + altitude + 0.0;0.303 + discrete + 128.61;154.33 + 0.78;0.78 + velocity + + + + + cruise + cruise with: speed @ optimum cruise speed, altitude @ optimum cruise altitude + cruise + + + + descent to MSL + descent to MSL altitude + descent + + + 0 + + + + ]]> + + + Two more segmentBlocks make up the mission. The “reserves” segmentBlock provides information for the cruise to alternate airport and loitering phase and the corresponding burnt fuel is considered reserveFuel. The mission ends with a landing and taxiIn phase within the “endPhase” segmentBlock, of which the burnt fuel is considered additionalFuel. The following then holds: blockFuel = designFuel + additionalFuel. + + + @@ -19724,8 +20003,8 @@ The fuel tank volume type should also be used for the wing fuel tank - - + + @@ -19753,7 +20032,7 @@ The fuel tank volume type should also be used for the wing fuel tank - List of specific performance maps used on dedicated mission segments + List of specific performance maps used on dedicated mission segments or pointPerformance requirements @@ -19783,70 +20062,54 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - Calibrated airspeed [m/s] - - - - - - - - - - - - - - Mach number - - - - - - - - - - - - - Global coordinate in xyz coordinates + Calibrated airspeed at the end of the segment [m/s] - + - + - Global coordinate in geographic - coordinates (longitude, latitude, - altitude) + Mach number at the end of the segment - + + + + + + + Position at the end of the segment in xyz coordinates + + + + + + + Position at the end of the segment in geo coordinates + + + - Runway + Reference to the runway on which the segment ends @@ -19862,7 +20125,7 @@ The fuel tank volume type should also be used for the wing fuel tank - MassFraction ending the segment + massFraction ending the segment [-] @@ -19876,9 +20139,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Fuel mass fraction ending the - segment, as remaining fuel mass with - respect to initial segment fuel mass + massFraction of remaining fuel ending the segment [-] @@ -19892,8 +20153,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Remaining absolute fuel ending the - segment + Absolute mass of remaining fuel ending the segment [kg] @@ -19907,8 +20167,49 @@ The fuel tank volume type should also be used for the wing fuel tank - Consumed fuel mass ending the - segment + Consumed fuel ending the segment [kg] + + + + + + + + + + + + + + Power fraction of remaining at the end of the segment + + + + + + + + + + + + + + Absolute power left ending the segment [W] + + + + + + + + + + + + + + Consumed power ending the segment [W] @@ -19924,9 +20225,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Flight heading at the end of the - segment in compassAngle with - reference to true North [deg] + Flight heading at the end of the segment in compassAngle with reference to true North [deg] @@ -19940,9 +20239,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Total change of heading angle during - segment (a full turn is 360 degrees) - [deg] + Total change of heading angle during segment (a full turn is 360 degrees) [deg] @@ -19957,7 +20254,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Flown distance in the segment (x, y, z) + Flown distance ending the segment @@ -19986,7 +20283,7 @@ The fuel tank volume type should also be used for the wing fuel tank - UTC time at end of mission + UTC time at end of segment [hh:mm:ss] @@ -20001,8 +20298,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Specific excess power at the end of the - segment + Specific excess power at the end of the segment @@ -20016,7 +20312,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Rate of climb ending the segment + Rate of climb ending the segment [m/s] @@ -20030,7 +20326,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Achieved flightPathAngle ending the segment + Achieved flightPathAngle ending the segment [deg] @@ -20040,7 +20336,12 @@ The fuel tank volume type should also be used for the wing fuel tank - + + + List of stores released in the segment. The corresponding weightAndBalance vector for retrieving the new state as well as a potential change in aerodynamicPerformanceMap (if external stores are released) should be reflected within the configuration node at model level. + + + @@ -20051,11 +20352,8 @@ The fuel tank volume type should also be used for the wing fuel tank - Mission block constraints + Specific performance settings for the segmentBlock (e.g.: a cruise Mach number) - - Definition of constraints for the mission segment block - @@ -20110,7 +20408,12 @@ The fuel tank volume type should also be used for the wing fuel tank - + + + List of segment uID's making up the segmentBlock. These should be ordered, such that the segment connections are correct. + + + @@ -20453,21 +20756,126 @@ The fuel tank volume type should also be used for the wing fuel tank + + + + + Guide curve + + + + + The following figure shows the basic setup of the guide curves. + They always start at a given ζ-position (fromZeta) on the profile of the specified start section (startSectionUID) and end at the ζ-position (toZeta) on the profile of the subsequent section. + The relative coordinates of the guide curves are specified in cpacs/vehicles/profiles/guideCurves and referenced via its uID. + + + + + + Note: Guide curves and profiles must result in a valid curve network. + + + The guide curve points are interpreted as (Δr and Δx) offsets from a cubic polynomial. + This polynomial serves as a baseline for guide curves between segments located on different radial positions with smooth transitions: + + + + + + Note: Currently, the nacelles do not have an explicit guide curve type but employ the standard guide curve definition, which is used in wings and profiles. + Therefore, the parameters have a different meaning: + + + + Standard guide curve parameter + Nacelle guide curve equivalent + Description + + + rX + φ + Independent variable normalized to [0,1] + + + rY + Δx + Orthogonal offset (translation in x-direction) + + + rZ + Δr + Radial offset + + + + + + + - - - - - - + + + + Name + + + + + + + Description + + + + + + + UID of the guide curve profile + + + + + + + UID of the start section + + + + + + + Curve coordinate of the referenced section profile at which the guide curve shall start. + Valid values are in the interval -1,..,1. + + + + + + + Curve coordinate of the profile following the referenced section profile. + It defines where the guide curve ends. + Valid values are in the interval -1,..,1. + + + + + + + + Guide curves + + + + @@ -20505,10 +20913,122 @@ The fuel tank volume type should also be used for the wing fuel tank - nacelleSectionType + Section - + + + An engine nacelle is defined by sections, where at least one and up to an infinite number of sections can be specified. + Lofting of the nacelle surface along the sections is done in cylindrical coordinates. + The coordinate origin refers to the center of the fan, i.e. the sections and their profiles are typically shifted in negative x-direction. + + + Note: In the current CPACS release, transformations are still labeled as Cartesian coordinates. + It is current work in progress to explicitly introduce cylindrical coordinates. + Until this is implemented in a future CPACS release, the implicit conventions listed below apply: + + + + Translation component + Cylindrical coordinate equivalent + Description + + + x + ϑ + Rotation angle around x + + + y + h + Horizontal translation + + + z + r + Radial translation + + + + The following example illustrates the setup of a nacelle with 4 sections. + These are rotated by 0, 120, 180 and 240 degrees around the x-axis (given by translation/x). + To illustrate the possible transformations, the profile of the upper section is shifted slightly further in the negative x-direction (translation/y), while the lower section has a smaller radial distance from the rotation axis (translation/z). + In addition, the sections are scaled differently (transformation/scaling; not shown in the example figures) in order to create a straight trailing edge and to realize a flattened profile near the ground. + + + The following example also shows the profile cut-outs due to the radially symmetric inner region of the nacelle defined by the rotationCurve. For detailed information, please refer to the documentation of the rotationCurve element. + + + + + The first section is not rotated (x=ϑ=0), but shifted vertically in negative direction (y=h=-0.257). + The radial distance is given by z=r=0.365: + + + + Upper section + + + 1.055 + 1 + 1 + + + 0.0 + -0.257 + 0.365 + + + fanCowlUpperSectionProfile + + ]]> + + The second section is rotated around the x-axis (x=ϑ=120) as well as scaled by a factor of 1.1 in its profile height: + + + + Inboard section + + + 1 + 1 + 1.1 + + + 120.0 + -0.2 + 0.365 + + + fanCowlUpperSectionProfile + + ]]> + + The third section is rotated around the x-axis by 180° and scaled by a factor of 0.8 in its profile height: + + + + Lower section + + + 1 + 1 + 0.8 + + + 180.0 + -0.2 + 0.33 + + + fanCowlUpperSectionProfile + + ]]> + + @@ -20516,10 +21036,22 @@ The fuel tank volume type should also be used for the wing fuel tank - - + + + Name + + + + + Description + + - + + + UID of the profile + + @@ -20531,7 +21063,7 @@ The fuel tank volume type should also be used for the wing fuel tank - nacelleSectionsType + Sections @@ -20901,21 +21433,7 @@ The fuel tank volume type should also be used for the wing fuel tankDescription of the performance case - - - Requirement classification based on the MoSCoW method (must, should, could or wont) - - - - - - - - - - - - + Reference to the considered weightAndBalance case @@ -21659,18 +22177,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - - + @@ -23053,17 +23560,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - + @@ -23616,86 +24113,6 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - seatModuleType - - - SeatModule type, containing data of a seat module - - - - - - - - - - - Name of the seat module - - - - - Description of the seat module - - - - - - Number of seats in the seat module, e.g 1, 2 - or 3 - - - - - Total width of the seat module - - - - - - seat module mass (optional, use of data to be - clarified) - - - - - seat module mass CoG (optional, use of data to - be clarified) - - - - - - - - - - - - - - seatModulesType - - - SeatModules type, containing seat modules - - - - - - - - - - - - - @@ -24566,21 +24983,21 @@ The fuel tank volume type should also be used for the wing fuel tank - - List of all mission segment UIDs to which the performance map is to be applied - - - - - List of point performance UIDs to which the performance map is to be applied - - + + List of all mission segment UIDs to which the performance map is to be applied + + + + + List of point performance UIDs to which the performance map is to be applied + + - - - List of point performance UIDs to which the performance map is to be applied - - + + + List of point performance UIDs to which the performance map is to be applied + + @@ -24927,7 +25344,12 @@ The fuel tank volume type should also be used for the wing fuel tank - + + + Seat elements (Deprecation warning: This element will soon be removed from the official CPACS. Use the new seat modules located at cpacs/vehicles/deckElements!) + + + @@ -26394,6 +26816,7 @@ The fuel tank volume type should also be used for the wing fuel tank + @@ -28630,17 +29053,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - + @@ -29692,7 +30105,7 @@ The fuel tank volume type should also be used for the wing fuel tank - nacelleCowlType + Nacelle cowl @@ -29707,12 +30120,8 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - + + @@ -29721,17 +30130,95 @@ The fuel tank volume type should also be used for the wing fuel tank + + + + + Rotation curve + + + + + The figure below shows an example of a rotation curve. + Together with the corresponding XML code, the definition is explained in more detail. + + + + + + First, the reference system is defined via referenceSectionUID, for which in this example the section with uID="engine_nacelle_fanCowl_section1" is referenced. + This in turn contains a transformation (not shown here), for example a translation by z=0.4 and a scaling, where the x-direction is stretched by a factor of two. + + + The rotation curve is now described in this reference system. + It is predefined in the profile library and referenced via a its uID. + Note that the curve is defined in the range x=[0,..,1] in order to be reasonably transformed by the reference system. + + + Next, the blending from the rotated profile of the nacelle segment to the rotation curve is defined. + The corresponding start and end points are given in curve coordinates zeta of the corresponding profiles. + Note that the lower part of the segment profile counts from zeta=[-1,..,0] and the upper part counts from zeta=[0,..,1]. + In between, the blending is linear. + + + + engine_nacelle_fanCowl_section1 + fanCowl_upperSection + -0.6 + -0.5 + -0.2s + -0.1 + + ]]> + + + + Fan cowl rotation curve profile + + 0;0.5;1 + -0.1;-0.2;-0.05 + + + ]]> + + + + + + - + + + UID of the section which serves as reference + + + + + Start zeta [-1,..,1]; relative curve coordante along the rotation curve from which it will be inserted in the nacelle. + + + + + End zeta [-1,..,1]; relative curve coordante along the rotation curve up to which it will be inserted in the nacelle. + + + + + Start zeta for blending [-1..1]; relative curve coordinate along the nacelle profile at which blending from the nacelle profile to the rotation curve will begin. + + + + + End zeta for blending; relative curve coordinate along the nacelle profile at which blending from the rotation curve to the nacelle profile will end. + - - - + + + UID of the rotation curve profile; the profile should be defined in x=[0..1] to be transformed by the section which is referenced by referenceSectionUID. + - - @@ -29741,12 +30228,17 @@ The fuel tank volume type should also be used for the wing fuel tank - nacelleCenterCowlType + Center cowl - - Describes the curve for defining rotational center of the engine. - + + + The centerCowl is defined by the rotation of a given curve profile (referenced via curveUID) around the x-axis. + + + + + @@ -29754,8 +30246,16 @@ The fuel tank volume type should also be used for the wing fuel tank - - + + + Offset of the rotation curve in x-direction + + + + + UID of the curve profile (vehicles/profiles/curveProfiles/..) + + @@ -32320,17 +32820,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - + @@ -33199,8 +33689,8 @@ The fuel tank volume type should also be used for the wing fuel tank - Definition of missions and point performance events to evaluate the performance of a vehicle. - The definition of performance cases is independent from a specific vehicle. + Specification of performance cases required for the performance evaluation of air vehicles (aircraft, rotorcraft, etc.). + The information in this node is generally applicable to any kind of vehicle. Vehicle-specific information is provided through the performanceRequirements node found under: /cpacs/vehicles/../model/performanceCases. @@ -33209,8 +33699,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - + @@ -33231,7 +33720,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Offset from runway threshold in cartesian coordinates in the runway coordinate system + Offset from runway threshold in the runway coordinate system @@ -33647,7 +34136,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Delta temperature + Delta temperature with respect to the standard temperature of the selected atmosphere [K] @@ -33829,7 +34318,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Segments + List of segment uIDs to which the configuration is to be applied @@ -33866,11 +34355,17 @@ The fuel tank volume type should also be used for the wing fuel tank - + + + + UID of the segment for which the specific configuration holds. + + + - Vector with semicolon separated indices of the parameters within a segment. If not given then the complete segment is applied. + Vector with semicolon separated indices of the parts of the respective segment within the mission definition for which the specific configuration setting holds. Example: scheduling configurations for a climb or descent segment (different settings of moveables and gears) on altitudes/velocities @@ -33924,14 +34419,14 @@ The fuel tank volume type should also be used for the wing fuel tank - UID of the released store. + uID of the released store(s). - Quantity of the released store. + Quantity of released stores @@ -33940,7 +34435,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -33962,157 +34457,1534 @@ The fuel tank volume type should also be used for the wing fuel tank - - - X-position in cartesian coordinates in the runway coordinate system - - - + + + X-position in cartesian coordinates in the runway coordinate system + + + - - - Y-position in cartesian coordinates in the runway coordinate system - - - + + + Y-position in cartesian coordinates in the runway coordinate system + + + - - - Z-position in cartesian coordinates in the runway coordinate system - - - + + + Z-position in cartesian coordinates in the runway coordinate system + + + - - - Lengthwise distance along the runway centerline from the runway threshold - - - - - - - Lateral offset from the runway centerline. Positive values on the starboard side. - - - + + + Lengthwise distance along the runway centerline from the runway threshold + + + + + + + Lateral offset from the runway centerline. Positive values on the starboard side. + + + - - - - - - - Ducts - - - - - - - - - - - - - - - - - - - - Duct assembly - - - - - - - - - - - Name - - - - - - - Description - - - - - - - UID of part to which the duct is - mounted (if any) - - - - - - - - - - - - - - - - - - Duct - - - - - - - - - - - Name - - - - - - - Description - - - - - - - - - - - - - - - - - - - - - + + + + + + + Geometry + + + + [WARNING: This type is known to be susceptible to + inconsistencies and might therefore be removed in a future version of CPACS] + + + The geometry of the cabin roughly corresponds to the available design space in the cabin. + It is given in terms of constant height contour lines. + The lines all share a common x-vector. + The y vector provides the lateral + contour at Z-coordinate provided by the constant value z. + One or more contour lines can be given. + The cabin geometry is assumed to be symmetric. + + + + + + + + + + + + + + + Name + + + + + Description + + + + + + Vector of x coordinates + + + + + + + + + + + + + Cabin geometry contours + + + Cabin geometry contour line collection type. By providing more than one entry, + a 3D cabin space can be described. + + + + + + + + + + + + + + + + + + + + Cabin geometry contour + + + Type to define a lateral position value "y" at a given height "z" (in the parent deck coordinate system) + for each entry "x" in the parent cabin geometry definition. + + + + + + + + + + + Vector with y-coordinates + + + + + Height z + + + + + + + + + + + + + Aisle + + + Aisles has as many entries as there are aisles in the + cabin. In a normal single aisle there are two aisles: the cabin + aisle and the aisle leading to the cockpit. + + + + + + + + + + Name + + + + + Description + + + + + Longitudinal coordinates. The + number of coordinates can be chosen as appropriate, the minimum + number is two. The coordinates are relative to the cabin origin. + + + + + + Center points of the aisle. The + y-vector has to have same length as the x-vector. The aisle + stretches equally left and right of the provided y-coordinate. + + + + + + Width of the aisle at floor level at each + y-coordinate + + + + + + + + + + + + + + doorOpeningLegacyType + + + doors describe all doors of the cabin. They are linked + to a structural door description. The cabin door is usually equal + in size to the door, but does not need to be. The structural door + might describe a wider cut-out, while the cabin door is primarily + intended for evacuation modeling and cabin layout. In order to + obtain a 3-dimensional door representation, the local cabin + geometry shall be used. + + + + + + + + + + This is the forward x-coordinate of the door + relative to the cabin origin. + + + + + the door sill height relative to cabin origin. + + + + + + The width of the door in x-direction. + + + + + + the effective height of the door. + + + + + + + + + + + + + + + + + + + + + + + + "doorOpeningType" + + + Ceiling panel instance collection type. + + + + + + + + + + + + + + + + + + + + Deck door + + + doors describe all doors of the cabin. They are linked + to a structural door description. The cabin door is usually equal + in size to the door, but does not need to be. The structural door + might describe a wider cut-out, while the cabin door is primarily + intended for evacuation modeling and cabin layout. In order to + obtain a 3-dimensional door representation, the local cabin + geometry shall be used. + + + + + + + + + + Name + + + + + Description + + + + + Number of passengers this door adds to the + overall exit capacity limit of the aircraft. + + + + + Opening geometry of the door + + + + + Door type (boarding, cargo, evacuation or service) + + + + + + + + + + + + + + + + + + + + + + + + Deck doors + + + + + + + + + + + + + + + + + + + + + + Cargo containers + + + Cargo container instance collection type. + + + + + + + + + + + + + + + + + + + Cargo container + + + Cargo container type for placing an instance of a cargo container in the parent deck. + + + + + + + + + + Name + + + + + Description + + + + + UID of the cargo container element in the cpacs/vehicles/deckElements node + + + + + Position in x + + + + + Position in y + + + + + + + + + + + + + + Seat modules + + + Seat module instance collection type. + + + + + + + + + + Seat module + + + + + + + + + + + + + Galleys + + + Galley instance collection type. + + + + + + + + + + Galley + + + + + + + + + + + + + Generic floor modules + + + Generic floor module instance collection type. + + + + + + + + + + Generic floor module + + + + + + + + + + + + + Lavatories + + + Lavatory instance collection type. + + + + + + + + + + Lavatory + + + + + + + + + + + + + Class dividers + + + Class divider instance collection type. + + + + + + + + + + Class divider + + + + + + + + + + + + + + Sidewall panels + + + Sidewall panel instance collection type. + + + + + + + + + + Sidewall panel + + + + + + + + + + + + + + Luggage compartments + + + + + + + + + + Luggage compartment + + + + + + + + + + + + + + Ceiling panels + + + Ceiling panel instance collection type. + + + + + + + + + + Ceiling panel + + + + + + + + + + + + + + Structural mounts + + + Structural mount type containing the structural connections of cabin elements + + + + + + + + + + + + + + + + + + + Structural mount + + + Structural mount type containing the structural connections of cabin elements + + + + + + + + + + Name + + + + + Description + + + + + UID of the component to connect to + + + + + + + + + + + + + + Bounding Box + + + + + + + + + + Length in x + + + + + Length in y + + + + + Length in z + + + + + Origin + + + + + + + + + + + + + Geometry + + + Description of the deck element geometry. This might be either a bounding box definition or a link to a generic geometry component. + + + + + + + + + + + + + + + + + + + + Cargo container element for use in the decks + + + + + + + + + + + + + + + + + Description + + + + + + Contour: single or double + + + + + + + + + + + + + Delta x + + + + + + Delta y + + + + + + Delta y of the base + + + + + + Delta z + + + + + + Delta z kink + + + + + + + + + + + + + + + Cargo container elements + + + Cargo container element collection type + + + + + + + + + + + + + + + + + + + Ceiling panel + + + Ceiling panel element collection type + + + + + + + + + + Ceiling panel element for use in the decks + + + + + + + + + + + + + Class divider + + + Class divider element collection type + + + + + + + + + + Class divider element for use in the decks + + + + + + + + + + + + + Deck elements + + + A list of predefined elements which can be linked in the actual deck of the aircraft or rotorcraft model via referencing its uID. + + + + + + + + + + Ceiling panel elements for use in the decks + + + + + Class divider elements for use in the decks + + + + + Galley elements for use in the decks + + + + + Generic floor elements for use in the decks + + + + + Lavatory elements for use in the decks + + + + + Luggage compartment elements for use in the decks + + + + + Seat elements for use in the decks + + + + + Sidewall panel elements for use in the decks + + + + + Cargo container elements for use in the decks + + + + + + + + + + + + + Galley element + + + Galley element type, containing the base elements of the cabin + + + + + + + + + + Description + + + + + + + Number of trolleys + + + + + + + + + + + + + + Galley elements + + + Galley element collection type + + + + + + + + + + Galley element for use in the decks + + + + + + + + + + + + + Lavatory elements + + + Lavatory element collection type + + + + + + + + + + Lavatory element for use in the decks + + + + + + + + + + + + + Luggage compartment elements + + + Luggage compartment element collection type + + + + + + + + + + Luggage compartment element for use in the decks + + + + + + + + + + + + + Seat element + + + Seat element type, containing the base elements of the cabin + + + + + + + + + + Description + + + + + + + Number of seats + + + + + + + + + + + + + + Seat elements + + + Seat element collection type + + + + + + + + + + Seat element for use in the decks + + + + + + + + + + + + + Generic floor elements + + + Generic floor element collection type + + + + + + + + + + Generic floor element for use in the decks + + + + + + + + + + + + + Sidewall panel elements + + + Sidewall panel element collection type + + + + + + + + + + Sidewall panel element for use in the decks + + + + + + + + + + + + + Generic geometry component + + + + + + + + + + + + + + + + + + + + + + + Deck component + + + + + + + + + + Name + + + + + Description + + + + + UID of the corresponding element in the cpacs/vehicles/deckElemets node + + + + + + + + + + + + + + + + Deck component + + + + + + + + + + Name + + + + + Description + + + + + UID of the corresponding element in the cpacs/vehicles/deckElemets node + + + + + + + + + + + + + + + + Deck element + + + + + + + + + + Description + + + + + + + + + + + + + + + + Mass + + + Description of mass, center of gravity and inertia + + + + + + + + + + + Mass value + + + + + Center of gravity (x,y,z) + + + + + + + + + + + + + + + Symmetry (see CPACS root node documentation for details) + + + + + + + + Symmetry inheritance from parent element disabled + + + + + Symmetry inherited from parent element (default behavior, i.e. also applies if attribute not set) + + + + + Symmetry w.r.t. the x-y plane of the CPACS coordinate system + + + + + Symmetry w.r.t. the x-z plane of the CPACS coordinate system + + + + + Symmetry w.r.t. the y-z plane of the CPACS coordinate system + + + + + + + + + + + Requirement classification based on the MoSCoW method (must, should, could or wont) + + + + + + + + + + + + + + + + + + + + Ducts + + + + + + + + + + + + + + + + + + + + Duct assembly + + + + + + + + + + + Name + + + + + + + Description + + + + + + + UID of part to which the duct is + mounted (if any) + + + + + + + + + + + + + + + + + + Duct + + + + + + + + + + + Name + + + + + + + Description + + + + + + + + + + + diff --git a/cpacs_gen_input/cpacs_schema.xsd.orig b/cpacs_gen_input/cpacs_schema.xsd.orig old mode 100644 new mode 100755 index 1b52e072e..20aa85607 --- a/cpacs_gen_input/cpacs_schema.xsd.orig +++ b/cpacs_gen_input/cpacs_schema.xsd.orig @@ -43,11 +43,11 @@ marko.alder@dlr.de Version - V3.3 + V3.4 Date - 2020-11-27 + 2021-04-20 @@ -56,7 +56,7 @@ marko.alder@dlr.de The Common Parametric Aircraft Configuration Scheme (CPACS) is an XML-based data format for describing aircraft configurations and their corresponding data. This XML-Schema document (XSD) serves two purposes: (1) it defines the CPACS data structure used in the XML file (e.g., aircraft.xml) and - (2) it provides the corresponding documentation (see picture below). An XML processor (e.g., Tixi or + (2) it provides the corresponding documentation (see picture below). An XML processor (e.g., TiXIhttps://github.com/DLR-SC/tixi or XML tools in Eclipse) parses the XSD and XML files and validates whether the data set defined by the user (or tool) conforms to the given structure defined by the schema. @@ -67,31 +67,36 @@ marko.alder@dlr.de structure). In addition, the sequence of the elements and their occurrence is documented. To link the XML file to the XSD file, the header of the XML file should specify the path of the schema file. An example could look like this: - <cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> + + + ]]> + - CPACS is an open source project published by the German Aerospace Center (DLR e.V.). For further information please visit www.cpacs.de. + CPACS is an open source project published by the German Aerospace Center (DLR e.V.)https://www.dlr.de/. For further information please visit www.cpacs.dehttps://www.cpacs.de. - 2. Data hierarchy - - CPACS data is modeled in a hierarchical structure whose underlying concept follows a top-down description of a system-of-systems which decomposes a generic concept (e.g., an aircraft or rotorcraft) into a more detailed description of its components. This originates from the conceptual and preliminary design of aircraft, where the level of detail is initially low and continues to increase as the design process progresses. - For some concepts within CPACS, however, a bottom-up approach is applied where the components are first defined in detail (sometimes referred to as library) and then linked within an instantiated higher-level concept. This is advantageous when used multiple times within complex systems, such as engines, which only have to be defined once in order to be referenced several times on the aircraft. The combination of these two methodologies is known as middle-out approach and enables the goal to fully parametrize aeronautical systems. - + 2. Data structure + + CPACS data is modeled in a hierarchical structure whose underlying concept follows a top-down description of a system-of-systems which decomposes a generic concept (e.g., an aircraft or rotorcraft) into a more detailed description of its components. This originates from the conceptual and preliminary design of aircraft, where the level of detail is initially low and continues to increase as the design process progresses. + For some concepts within CPACS, however, a bottom-up approach is applied where the components are first defined in detail (sometimes referred to as library) and then linked within an instantiated higher-level concept. This is advantageous when used multiple times within complex systems, such as engines, which only have to be defined once in order to be referenced several times on the aircraft. The combination of these two methodologies is known as middle-out approach and enables the goal to fully parametrize aeronautical systems. + - + 3. Coordinate Systems - Coordinate systems are a regular cause for ambiguous interpretation of data. In CPACS, the reference coordinate system is the CPACS-coordinate system. This coordinate system is used for most of the data. A single exception is made in order to keep aerodynamic data in an aerodynamic coordinate system. The following paragraphs outline the determination to known coordinate systems. - The CPACS coordinate system is the coordinate system identified by TIGL, CPACS's geometric library. It is a right-handed coordinate system. If an aircraft is defined in the CPACS coordinate system it will usually follow the directions listed in the table below. - Therefore, the CPACS coordinate system can be confused with the body-fixed coordinate system. While often the CPACS coordinate system and the body-fixed coordinate system overlap, this must not always be true. Several definitions for body-fixed coordinate systems exist (x-axis through nose and tail, x-axis perpendicular to nose plane). For non-symmetric aircraft, body-fixed coordinate systems become even more complicated. Hence, analysis tools should stick to the CPACS-Coordinate system. It remains to the designer to model the geometry accordingly. - The CPACS coordinate system does not rotate with flow. Hence, aerodynamic calculations do rotate their flow relative to the CPACS-coordinate system. If not stated explicitly different, e.g. for target lift-coefficients, results are returned in the CPACS coordinate system, i.e. the cfx-coefficient is parallel to the CPACS x-Coordinate, regardless of the way the geometry is defined. - The following table gives a "best-practice" advice on how to locate a geometry within CPACS. Different approaches are, of course, valid as well. + 3.1. CPACS coordinate system + Coordinate systems are a regular cause for ambiguous interpretation of data. In CPACS, the reference coordinate system is the CPACS-coordinate system. This coordinate system is used for most of the data. A single exception is made in order to keep aerodynamic data in an aerodynamic coordinate system. The following paragraphs outline the determination to known coordinate systems. + The CPACS coordinate system is the coordinate system identified by TiGLhttps://dlr-sc.github.io/tigl, CPACS's geometric library. It is a right-handed coordinate system. If an aircraft is defined in the CPACS coordinate system it will usually follow the directions listed in the table below. + Therefore, the CPACS coordinate system can be confused with the body-fixed coordinate system. While often the CPACS coordinate system and the body-fixed coordinate system overlap, this must not always be true. Several definitions for body-fixed coordinate systems exist (x-axis through nose and tail, x-axis perpendicular to nose plane). For non-symmetric aircraft, body-fixed coordinate systems become even more complicated. Hence, analysis tools should stick to the CPACS-Coordinate system. It remains to the designer to model the geometry accordingly. + The CPACS coordinate system does not rotate with flow. Hence, aerodynamic calculations do rotate their flow relative to the CPACS-coordinate system. If not stated explicitly different, e.g. for target lift-coefficients, results are returned in the CPACS coordinate system, i.e. the cfx-coefficient is parallel to the CPACS x-Coordinate, regardless of the way the geometry is defined. + The following table gives a "best-practice" advice on how to locate a geometry within CPACS. Different approaches are, of course, valid as well. @@ -120,40 +125,97 @@ marko.alder@dlr.de from landing gear to tip of vertical tailplane - The following figures show an example of a geometry that is aligned with the CPACS coordinate system, i.e. the body-fixed coordinate system corresponds to the CPACS coordinate system. + The following figures show an example of a geometry that is aligned with the CPACS coordinate system, i.e. the body-fixed coordinate system corresponds to the CPACS coordinate system. - The aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. + The aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. - The following figures give an example of a geometry that is not defined in alignment with the CPACS coordinate system. It is a valid CPACS file, but only used in this example for demonstrative purposes. + The following figures give an example of a geometry that is not defined in alignment with the CPACS coordinate system. It is a valid CPACS file, but only used in this example for demonstrative purposes. - The body axes and the CPACS coordinate system do not align. That is, the origin of the geometry is not at CPACS (0,0,0) but at a point in positive x- and z-direction. + The body axes and the CPACS coordinate system do not align. That is, the origin of the geometry is not at CPACS (0,0,0) but at a point in positive x- and z-direction. - Again, the aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. + Again, the aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. + + 3.2. Local coordinate systems via parentUID and transformation + + Some elements in CPACS, in particular the geometric components, are described in local coordinates. + The hierarchical data structure allows to define a local coordinate system either with respect to the coordinate system of the parent element or with respect to the global CPACS coordinate system. + This is achieved by combining the two elements parentUID and transformation: + + + + parentUID: An individual data hierarchy can be set up using the optional parentUID element. + Here it is important that exactly one element does not contain the parentUID in order to identify the top element of this user-specific hierarchy. + As soon as the parentUID (which refers to the uID of the parent element) is set, a local coordinate system of the corresponding node is instantiated. + + + + + transformation: This allows the coordinate system to be transformed via translation, rotation and scaling. + As soon as the parentUID is set, this transformation refers to the local coordinate system (in the current CPACS version this only affects translation). + An attribute refType is used to either make this explicit (refType="absLocal") or to override this and reference the global CPACS coordinate system instead (refType="absGlobal"). + + + + The following table summarizes the possible combinations of parentUID and transformation and the resulting coordinate system (local or global): + + + + parentUID not set + parentUID set + + + transformation without refType + global + local + + + transformation with refType="absLocal" + global + local + + + transformation with refType="absGlobal" + global + global + + + Note: The combination of transformation with refType="absLocal" and no parentUID is global, because the local coordinate system to which the transformation is referring to via refType equals the global coordinate system (see fuselage in the following example). + + An exemplary use case further illustrates the concept of the coordinate system hierarchy. + The CPACS schema shall not specify in advance that a wing is always be part of the fuselage and engines must always be part of the wing. + In other cases the engine could be attached to the fuselage, which would not be possible via a predefined XML tree. + The following figure shows how components of the aircraft are related to each other via the parentUID. + The fairing is a child of the wing and is therefore automatically translated when the wing is translated. + Likewise, the horizontal tailplane is a part of the vertical tailplane and is therefore affected by translation of the latter: + + + + 4. Units - There are no explicit attributes describing units in CPACS. The general convention is that all values must be given in the following SI-units: + There are no explicit attributes describing units in CPACS. The general convention is that all values must be given in the following SI-units: [m] Position, Distance - [m^2] + [m2] Area - [m^3] + [m3] Volume @@ -188,7 +250,7 @@ marko.alder@dlr.de Energy - The only non SI unit used throughout CPACS is the angle in degrees [°]. + The only non SI unit used throughout CPACS is the angle in degrees [°]. For the sake of an intuitive use the angles are given in degrees rather than in radian [rad]. @@ -199,67 +261,80 @@ marko.alder@dlr.de - 5. Splitting up a CPACS dataset into several files + 5. Splitting up a CPACS dataset into several files - To provide a better overview, it is possible to split up a CPACS dataset into several files. This can be done by inserting an <externaldata> node at an arbitrary position into the datatset. This node contains a <path> node with a URI to the external file(s), followed by one or more <filename> nodes, containing each a name of a file to be included at that position. Below, an example of such external data is given: - <?xml version="1.0" encoding="utf-8"?> -<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> - <vehicles> - <profiles> - <wingAirfoils> - <externaldata> - <path>file:://airfoils</path> - <filename>NACA0010.xml</filename> - <filename>NACA2412.xml</filename> - </externaldata> - <airfoil uID="NACA0012"> - <name>NACA 0012 Airfoil</name> - <pointList>...</pointList> - </airfoil> - </wingAirfoils> - </profiles> - </vehicles> -<cpacs> + To provide a better overview, it is possible to split up a CPACS dataset into several files. This can be done by inserting an <externaldata> node at an arbitrary position into the datatset. This node contains a <path> node with a URI to the external file(s), followed by one or more <filename> nodes, containing each a name of a file to be included at that position. Below, an example of such external data is given: + + + + + + + + file:://airfoils + NACA0010.xml + NACA2412.xml + + + NACA 0012 Airfoil + ... + + + + + + ]]> + + Such an external file would look like: - <?xml version="1.0" encoding="utf-8"?> -<airfoil uID="NACA0010"> - <name>NACA 0010 Airfoil</name> - <pointList>...</pointList> -</airfoil> - The file would be included completely, except for its title line <?xml version="1.0" encoding="utf-8"?> . This concept can also be used recursively (external files of external files), then it is important to prevent circle connections (file "A" loading file "B" loading file "C" loading again file "A" ...). + + + + NACA 0010 Airfoil + ... + + ]]> + + The file would be included completely, except for its title line <?xml version="1.0" encoding="utf-8"?> . This concept can also be used recursively (external files of external files), but it is important to prevent circle connections (file "A" loading file "B" loading file "C" loading again file "A" ...). For path URI addresses, the trailing file separator "/" may be omitted. Below, some examples for path URIs are given: - Absolute local path: "file:///tmp" or "file:///c:/windows/tmp" - Relative local direcotry: "file://relativeDirectory" or "file://../anotherRelativeDirectory" - Remote net ressource: "http://www.someurl.de" + Absolute local path: file:///tmp or file:///c:/windows/tmp + Relative local direcotry: file://relativeDirectory or file://../anotherRelativeDirectory + Remote net ressource: http://www.someurl.de - A CPACS dataset with external files, being loaded by a special library like the TIVA XML Interface TIXI, shall collect all its external datafiles and build up a single tree from them. A validation against this schema is only possible for such a single tree file; the <externaldata>nodes are not recognized by it. To preserve the information, necessary to split the file up into external files again later, externaldata information is maintained within three attributes of the former external top node: + With the help of the TiXI XML Interface TiXIhttps://github.com/DLR-SC/tixi, a CPACS dataset that is split into multiple files can be reassembled into a single tree structure for subsequent validation against the CPACS schema. The following commands are used to link external data sets: - externalFileName - Name of the file where the external data shall be saved - externalDataDirectory - Directory of the external data file. Its content is analogous to the <externaldata>'s <path>node described above. - externalDataNodePath - XPATH of the node which is replaced with the content of the external file. In case that it is an external file of an external file, then it is the XPATH in the outer external file. If, e.g., in the example above the <pointList>node would have also been loaded from an external file, then the entry would just be: externalDataNodePath="/airfoil". This is used primarily for loop-detection. + <externalFileName>: Name of the external data file + <externalDataDirectory>: Directory of the external data file. Its content is analogous to the externaldata's path-element described above. + <externalDataNodePath>: XPathhttps://www.w3schools.com/xml/xpath_intro.asp of the node which is replaced with the content of the external file. In case that it is an external file of an external file, then it is the XPath in the outer external file. If, e.g., in the example above the pointList element would have also been loaded from an external file, then the entry would just be: externalDataNodePath="/airfoil". This is used primarily for loop-detection. - The single tree for the example above would look like: - <?xml version="1.0" encoding="utf-8"?> -<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> - <vehicles> - <profiles> - <wingAirfoils> - <airfoil uID="NACA0010" externalFileName="NACA0010.xml" externalDataDirectory="file://airfoils" externalDataNodePath="/cpacs/vehicles/profiles/wingAirfoils"> - <name>NACA 0010 Airfoil</name> - <pointList>...</pointList> - </airfoil> + The merged data tree for the example above would look like: + + + + + + + + NACA 0010 Airfoil + ... + ... - <airfoil uID="NACA0012"> - <name>NACA 0012 Airfoil</name> - <pointList>...</pointList> - </airfoil> - </wingAirfoils> - </profiles> - </vehicles> -<cpacs> + + NACA 0012 Airfoil + ... + + + + + + ]]> + @@ -269,83 +344,155 @@ marko.alder@dlr.de references define connections between elements which are located somewhere else in the hierarchical dataset (e.g. a wing is connected to a fuselage; a specific engine is connected to a pylon; etc.). These connections are defined by unique identifiers (uID) which are specified as attributes. Thus, there are elements which can be referenced via a uID attribute, e.g. a fuselage: - <fuselage uID="ATTAS_fuselage">... + + ... + ]]> + as well as elements which refer to the former, e.g. a wing pointing to its geometrical parent: - <wing uID="e382bf5j"> - <name>ATTAS main wing</name> - <parentUID isLink="True">ATTAS_fuselage</parentUID> - ... - Such referencing elements must carry the isLink="True" attribute. + + + ATTAS main wing + ATTAS_fuselage + ... + ]]> + - Since uIDs are only used to link nodes within the XML file, no naming convention is required. UIDs, however, must be unique! - Although a common practice for naming uIDs is their position in the data hierarchy (e.g. uID="mainWingSection3"), - uIDs as shown in the above example are absolutely valid as well. It is therefore recommended to use the name element + In previous CPACS versions, referencing elements were identified via the isLink="True" attribute. Since this is superfluous due to the explicit definition of the element properties via the CPACS schema, this attribute no longer needs to be listed. It is nevertheless a valid optional attribute to ensure compatibility with older datasets, but might be removed in future versions. + Since uIDs are only used to link nodes within the XML file, no naming convention is required. The characters only have to conform to the conventions of the xsd:IDhttp://books.xmlschemata.org/relaxng/ch19-77151.html type standardized by the W3Chttps://www.w3.org/. UIDs, however, must be unique! + Although a common practice for naming uIDs is their position in the data hierarchy (e.g. uID="mainWingSection3"), + uIDs as shown in the above example are absolutely valid as well. It is therefore recommended to use the name element to convey human-readable meanings. - 7. Symmetry + 7. Usage of name, description and uID - Sometimes it might be useful to specify a part of the aircraft as symmetric instead of holding all the data twice in nearly identical form in the dataset (e.g. left and right wing are usually identical, except for the sign of the y-coordinate). Hence, some parts offer the option to set a symmetry attribute for them, like: - <wing symmetry="x-z-plane">... - This attribute explains that the whole part with all its subnodes is symmetric to the given plane. Possible planes are: - x-y-plane - x-z-plane - y-z-plane - - + CPACS is designed to serve as a central data exchange format in fully automated process chains. + A key requirement is therefore that tools can automatically read and process an incoming CPACS file. + A second requirement is that users can interpret the data set. + To address both requirements, the following usage of the name and description elements in combination with the uID attribute is proposed: + + + name: A specification of the name element is usually mandatory for sequences of elements (e.g., if max occurence is unbounded [1..*]). + Typical examples are wings/wing, aeroPerformance/aeroMap or missions/mission. + Such elements must be able to be listed by tools, especially for visualization and reporting purposes, where the name element serves as a concise and human-readable indicator of the actual meaning of the corresponding element in the list (e.g., which wing, which aeroMap, which mission). + This is usually a single word or a small number of words. + + + + + description: This element is usually optional and is used to add comprehensive and human-readable explanations. This is usually at least one explanatory sentence. + + + + + uID: As described in more detail in Section 6, the uID attribute is mainly used for internal referencing of CPACS elements. + Further processing software, e.g. TiXI and TiGL, also use the uIDs to improve the robustness of the data query. + Consequently, the uID attribute serves as a machine-readable indicator and does not claim to be interpretable by human users. + In some practical use cases, the same string is chosen for uID and name. + However, restrictions on the choice of characters for the uID attribute must be considered, for example that no spaces may be used and the uID must be unique. + + + + + + Main wing + This is the main wing which was designed by my awesome wing sizing design tool. Your tool should not try to read and interpret what I'm writing here as typos are not recognized by XML processors. + + ]]> + - UIDs, references and symmetry + 8. Symmetry - All nodes, e.g. parentUID, in CPACS that refer to a component that holds symmetry attribute, e.g. wing, have to carry the symmetry attribute as well. - The symmetry attribute may take three values: symm, def, full: + 8.1. Specification of symmetric elements + Sometimes it might be useful to specify a part of the aircraft as symmetric instead of holding all the data twice in nearly identical form in the dataset (e.g. left and right wing are usually identical, except for the sign of the y-coordinate). + Hence, some parts offer the option to set a symmetry attribute: + + + ]]> + + There are six possible attribute values: + + x-y-plane: Symmetry w.r.t. the x-y plane of the CPACS coordinate system + x-z-plane: Symmetry w.r.t. the x-z plane of the CPACS coordinate system + y-z-plane: Symmetry w.r.t. the y-z plane of the CPACS coordinate system + inherit: Symmetry inherited from parent element (default behavior, i.e. also applies if attribute not set) + none: Symmetry inheritance from parent element disabled + + Note: It must be taken from the documentation of the respective element which of these attribute values may be set. + + One example of how to apply the symmetry attribute is shown in Sec. 3.2. Another simplified example shown below illustrates the combination of different symmetry properties of 4 wings: + + + + + Wing 1 is mirrored on the x-z plane. + Wing 2 has wing 1 as parent element, but suppresses its symmetry inheritance. + Wing 3 has wing 2 as parent element and sets a new symmetry at the x-y plane. + Wing 4 has wing 3 as parent element and no symmetry attribute specified. Thus, it inherits the symmetry at the x-y plane from wing 3. + + Note: The corresponding transformations are not shown here. + 8.2. Referencing symmetric elements + All nodes (e.g., parentUID) in CPACS that refer to a component holding the symmetry attribute (e.g., wing) might also have a symmetry attribute to specify how symmetry is propagated through the resulting element hierarchy. + The symmetry attribute of a referencing element may take three values: symm, def, full: - def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. + def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. - symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) + symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) - full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) + full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) - <wing uID="ATTAS_main_wing" symmetry="x-z-plane"> - ... - <segments> - <segment uID="ATTAS_main_wing_innersegment"> - ... - In the example above, to refer to the "other" side of the wing on must use the definition as such: - <loadcase> - ... - <segments> - <segment> - <segmentUID isLink="True" symmetry="symm">ATTAS_main_wing_inner_segment</segmentUID> - <strip>... + + + + For example, to refer to the "other" side of a mirrored wing the following the following syntax might be used: + + + + wing + ]]> + + Note: This feature is not implemented in TiGL. The upper figure is manually processed to illustrate the principle. In addition, there is an ongoing debate whether the approach is suitable for CPACS due to rapidly increasing complexity and unresolved implicit assumptions as to whether it is one or two components after mirroring. Therefore, it is advised to avoid using the symmetry attribute if possible. - 8. Vectors and arrays + 9. Vectors and arrays For large data sets (e.g. increments of aerodynamic coefficients due to control surface deflections) it is advantageous to map them via vectors and arrays instead of using a sequence of nodes for each data value. Therefore vectors and arrays are defined as semicolon-separated lists in CPACS. Via the documentation (derived from the XSD) of the corresponding nodes it has to be checked whether it is a vector or an array. Vector The vector is meant as a one-dimensional-array. In such a node, the values are given in a semicolon separated list: - <angleOfAttack>0.;1.5;3.;4.5;6;7.5;9.</angleOfAttack> + + 0.;1.5;3.;4.5;6;7.5;9. + ]]> + Array As for vectors, multi-dimensional arrays provide values in a semicolon separated list. An array is always preceded by a sequence of vectors, containing the dimensions and index values. Which vectors of an array are dimensioning is specified in the respective documentation of the array. - <altitude>1000.;2000.;3000.</altitude> <!-- vector element --> - <incrementMaps> - <incrementMap uID="incMap_b3ac2"> - <controlSurfaceUID>InnerWingFlap</controlSurfaceUID> - <controlParameters>-1;-0.5;0;1</controlParameters> <!-- vector element --> - <!-- array of dimension length(altitude) x length(controlParameters): --> - <dcl>11.;12.;13.;14.;21.;22.;23.;24.;31.;32.;33.;34.</dcl> + + 1000.;2000.;3000. + + + InnerWingFlap + -1;-0.5;0;1 + + 11.;12.;13.;14.;21.;22.;23.;24.;31.;32.;33.;34. + ]]> @@ -387,7 +534,7 @@ marko.alder@dlr.de - 9. Control Parameters + 10. Control Parameters Control parameters are abstract parameters, linking a generic floating point value to a certain status of a control device (e.g. control surface, landing gear, suction system, brake parachute, ...). For control surfaces, such a data pair (control parameter @@ -400,41 +547,44 @@ marko.alder@dlr.de mandatory to specify a <step> with a <controlParameter> of 0. Consequently, no <controlParameter> must be used twice within a single <path> definition. Deflection values between two specified steps are handled by linear interpolation. The following example shows the usage of control parameters within a control surface deflection path definition: - <controlSurfaces> - <trailingEdgeDevices> - <trailingEdgeDevice uID="InnerWingFlap"> + + + + ... - <path> + ... - <steps> - <step> - <controlParameter>-1</controlParameter> - <hingeLineRotation>-20.</hingeLineRotation> - </step> - <step> - <controlParameter>-0.5</controlParameter> - <hingeLineRotation>-10.</hingeLineRotation> - </step> - <step> - <controlParameter>0</controlParameter> - <hingeLineRotation>0.</hingeLineRotation> - </step> - <step> - <controlParameter>1</controlParameter> - <hingeLineRotation>5.</hingeLineRotation> - </step> - </steps> + + + -1 + -20. + + + -0.5 + -10. + + + 0 + 0. + + + 1 + 5. + + ... + ]]> - 10. Atmosphere + 11. Atmosphere - At some places in CPACS, an atmosphere has to be selected (e.g. for connecting an altitude with a certain pressure or density). - Currently, CPACS does only support a single atmospheric model: The ICAO Standard Atmosphere (ISA) from 1993 (see ICAO Doc 7488/3 'MANUAL OF THE ICAO STANDARD ATMOSPHERE', third edition, 1993) + At some places in CPACS, an atmosphere has to be selected (e.g. for connecting an altitude with a certain pressure or density). + Currently, CPACS does only support a single atmospheric model: The ICAO Standard Atmosphere (ISA) from 1993 (see ICAO Doc 7488/3 'MANUAL OF THE ICAO STANDARD ATMOSPHERE', third edition, 1993) It covers temperature, pressure, density, speed of sound, dynamic viscosity and kinematic viscosity with respect to altitude. - In CPACS, 'altitude' means what is called 'geopotential altitude' (H) in the ISA reference document and is given in [m]. + In CPACS, 'altitude' means what is called 'geopotential altitude' (H) in the ISA reference document and is given in [m]. For details, see ISA manual, section 2.3, page E-viii f. ISA covers a range from -5000 m to 80000 m. Temperature offsets are introduced on top of the definitions in the ISA manual (which does not cover such variations). The offset model @@ -442,6 +592,32 @@ marko.alder@dlr.de The temperature offset changes only the density (following rho = p / Gas Constant / T) (and viscosity, of course) + + CPACS 3.4 + + Release in April 2022 + + Revision of decks definition (compatibility break) + Mass breakdown: add mSparSkins and mSparCells to mSpar + Mass breakdown: fix hierarchical error in mMiscellaneous (compatibility break) + Mass breakdown: fix typo in mPylon (compatibility break) + Nacelle guide curves: set description optional + Mission definition: add uID to elements in geographicPointConstraintType + Mission definition: add powerFraction, powerRemaining and powerConsumed to missionSegmentEndConditionType + Mission definition: rename referenceEndCondition to referenceEndConditionUID in constraintSettingsType (compatibility break) + Mission definition: rename reqClassification to requirementClassification in flightPerformanceRequirementType (compatibility break) + Add contour coordinates for cell definition + Add vehicle independent node for external geometry + Remove paxFlow element from aircraftAnalysesType (compatibility break) + Docs: improve documentation of name, description and uID usage + Docs: add description of parentUID concept + Docs: add description of symmetry inheritance + Docs: add description of engine nacelles + Docs: add description of mission definition + General improvements of the documentation + + + CPACS 3.3 @@ -852,8 +1028,8 @@ marko.alder@dlr.de - - + + @@ -1625,9 +1801,8 @@ marko.alder@dlr.de Translation data default: 0,0,0. Translations can either be made absolute in the global coordinate system - (absGlobal), absolute in the local Coordinate system (absLocal) - or relative (relative), normalized with the maximum dimensions - of the parent. + (absGlobal) or absolute in the local Coordinate system (absLocal). + @@ -1968,8 +2143,16 @@ marko.alder@dlr.de - - + + + Absolute values in global coordinate system + + + + + Absolute values in local coordinate system (default) + + @@ -2047,7 +2230,7 @@ marko.alder@dlr.de Vector of rX coordinates. Relative - circumferential coordinate on wing / fuselage profile + circumferential coordinate on wing, fuselage or nacelle profile @@ -2401,6 +2584,23 @@ marko.alder@dlr.de + + + + + + Positive integer values larger than 0 + + + + + + + + + + + @@ -2965,7 +3165,6 @@ marko.alder@dlr.de - @@ -3901,103 +4100,12 @@ marko.alder@dlr.de - - - - - - cabGeometryType - - - cabGeometry provides the geometry of the cabin in terms - of constant height contour lines. The lines all share a common - x-vector. The vectors yZ[N] provide the lateral contour at - Z-coordinate provided in the vector z. The number of contour - lines can differ and is given by the length of the vector z - - - - - - - - - - - - - x-coordinates for all contour lines, relative - to cabin origin. - - - - - z-coordinate of contour lines. Contour lines - are constant z, so each entry in this vector belongs to a single - contour line. - - - - - - - - - - - - - - - cabinAisleType - - - aisles has as many entries as there are aisles in the - cabin. In a normal single aisle there are two aisles: the cabin - aisle and the aisle leading to the cockpit. - - - - - - - - - - - - Provides the longitudinal coordinates. The - number of coordinates can be chosen as appropriate, the minimum - number is two. The coordinates are relative to the cabin origin. - - - - - - Provides the center points of the aisle. The - y-vector has to have same length as the x-vector. The aisle - stretches equally left and right of the provided y-coordinate. - - - - - - the width of the aisle at floor level at each - y-coordinate. - - - - - - - - - cabinAislesType + Cabin aisles @@ -4014,306 +4122,12 @@ marko.alder@dlr.de - - - - - - cabinDoorType - - - doors describe all doors of the cabin. They are linked - to a structural door description. The cabin door is usually equal - in size to the door, but does not need to be. The structural door - might describe a wider cut-out, while the cabin door is primarily - intended for evacuation modeling and cabin layout. In order to - obtain a 3-dimensional door representation, the local cabin - geometry shall be used. - - - - - - - - - - - - - Number of passengers this door adds to the - overall exit capacity limit of the aircraft. - - - - - This is the forward x-coordinate of the door - relative to the cabin origin. - - - - - the door sill height relative to cabin origin. - - - - - - The width of the door in x-direction. - - - - - - the effective height of the door. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cabinDoorsType - - - - - - - - - - - - - - - - - - - - - - cabinFloorElementType - - - floorElement describes objects like monuments or other - installations inside the cabin. - - - - - - - - - - - - - - - - - - - - - - - forward center coordinate of object relative - to cabin origin. - - - - - center y-coordinate relative to cabin origin. - - - - - - length of the object - - - - - length of the object - - - - - length of the object - - - - - - - - - - - - - - - cabinFloorElementsType - - - - - - - - - - - - - - - - - - - - - - cabinSeatElementType - - - seats describe all seats inside the aircraft. They are - – strictly speaking – also objects mounted on the floor, hence - floor objects. But the specific characteristics of seats justify - a differentiation between seats and other objects on the floor. - Seats are seat group, for example a triple seat. Therefore they - have multiple seats. - - - - - - - - - - - - Number of seats - - - - - - - - - - - - - - - - x-coordinate relative to cabin origin. - - - - - - y-coordinate relative to cabin origin. - - - - - - delta-y-coordinate of the individual seat - center points from the y-coordinate of the seat object. This is - important to locate passengers. It is assumed that seats have no - angle. - - - - - length of the seat group. - - - - - width of the seat group. - - - - - height of the seat group. - - - - - - - - - - - - - - - - - cabinSeatElementsType - - - - - - - - - - - - - - - - - cabinSpaceType + Space spaces describe areas in the cabin that need to be @@ -4328,17 +4142,25 @@ marko.alder@dlr.de - - - + + + Name + + + + + Description + + + - x-coordinates. These describe an area, so they + Vector with x-coordinates. These describe an area, so they are not monotonous ascending. - + - y-coordinates at given x-coordinates. Warning: + Vector with y-coordinates at given x-coordinates. Warning: x-y do not represent a function as single x-positions can have multiple y-coordinates. Hence, no interpolation is possible. @@ -4346,8 +4168,8 @@ marko.alder@dlr.de - the height above the floor that is required to - be empty of any objects. + Height above the floor that is required to + be empty of any objects @@ -4361,7 +4183,7 @@ marko.alder@dlr.de - cabinSpacesType + Cabin spaces @@ -4491,40 +4313,39 @@ marko.alder@dlr.de Chordwise positioning of wing cells. - CellPositioningChordwise defines the chordwise - direction of a wing cell either in two xsi (xsi1 at innerBorder - and xsi2 at outerBorder) coordinates or via a sparUID. - + CellPositioningChordwise defines the chordwise direction of a wing cell either in two xsi + (xsi1 at innerBorder and xsi2 at outerBorder) coordinates, via referencing a spar-uID or via a + contour coordinate in chordwise direction. - - - - - - Relative chordwise position of the inner - end. - - - - - Relative chordwise position of the outer - end. - - - - + + + - Reference to a spar as chordwise border. - + Relative chordwise position of the inner end. - - + + + Relative chordwise position of the outer end. + + + + + + Reference to a spar as chordwise border. + + + + + Chordwise contour coordinate as chordwise border. 0 equals LE, 1 equals TE. + + + @@ -4537,50 +4358,46 @@ marko.alder@dlr.de Spanwise positioning of wing cells. - CellPositioningSpanwise defines the chordwise direction - of a wing cell either in two eta (eta1 at leadingEdge and eta2 at - trailingEdge) coordinates or via referencing to a rib. - + CellPositioningSpanwise defines the chordwise direction of a wing cell either in two eta + (eta1 at leadingEdge and eta2 at trailingEdge) coordinates, via referencing a rib-uID or via a contour + coordinate in chordwise direction. - - - - - - Relative spanwise position of the forward - end. - - - - - Relative spanwise position of the rear end. - - - - - - - - RibNumber is the reference to the rib number - of the rib set which is referenced by 'ribDefinitionUID'. - - - - - - Reference to a ribDefinition set. The single - rib of this ribDefinition set is defined by using 'ribNumber'. - - - - - - + + + + + Relative spanwise position of the forward end. + + + + + Relative spanwise position of the rear end. + + + + + + + RibNumber is the reference to the rib number of the rib set which is referenced by 'ribDefinitionUID'. + + + + + Reference to a ribDefinition set. The single rib of this ribDefinition set is defined by using 'ribNumber'. + + + + + + Spanwise contour coordinate as spanwise border. 0 equals root, 1 equals tip. + + + @@ -5723,10 +5540,10 @@ marko.alder@dlr.de - + - Reference to the uID of the segment end condition variable + Reference to the uID of the segment end condition variable to which a profile of constraintSettings is provided @@ -5755,8 +5572,7 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Calibrated airspeed within the - segment + Calibrated airspeed within the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5764,7 +5580,7 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Mach number within the segment + Mach number within the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5772,19 +5588,19 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Climb angle within the segment + Climb angle within the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. + type="doubleConstraintBaseType"> - Climb angle within the segment + Rate of climb within the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. - + Specific excess power within the segment @@ -5805,18 +5621,14 @@ marko.alder@dlr.de - Flight heading at the end of the - segment in compassAngle with - reference to true North [deg] + Flight heading at the end of the segment in compassAngle with reference to true North [deg]. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. - Total change of heading angle during - segment (a full turn is 360 degrees) - [deg] + Total change of heading angle during segment (a full turn is 360 degrees) [deg]. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5824,7 +5636,7 @@ marko.alder@dlr.de - Rate of turn within the segment + Rate of turn within the segment [deg/s]. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5832,10 +5644,7 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Thrust setting for derated engine as - fraction of max. Thrust (e.g.: for - powered descents, deceleration not at - IDLE, manoevres). + Thrust setting for derated engine as fraction of max. Thrust (e.g.: for powered descents, deceleration not at IDLE, manoevres). If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5843,7 +5652,7 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Rate of velocity within the segment + Rate of velocity within the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5851,7 +5660,7 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Load factor experienced during segment + Load factor experienced during segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. @@ -5859,23 +5668,20 @@ marko.alder@dlr.de type="doubleVectorConstraintBaseType"> - Constant altitude for the segment. + Constant altitude of the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. - priority setting indicating which - constraint is preferred within the - segment + Priority setting indicating which constraint is preferred within the segment. If a vector is provided, a constraint profile is defined with respect to the <referenceEndCondition> using the <endConditionRatio> vector. - - - + + @@ -5959,12 +5765,12 @@ marko.alder@dlr.de Within some analyses, it might occur that overlapping control element settings are specified. In this case, it is assumed that a cumulative setting is built by summing up the individual settings. As the behavior of these settings is not necessarily linear, a certain order of summation has to be followed: - - (1) The command inputs for each controlDistributor, coming from the configurationUID, as well as from separate settings have to be summed up to a total commandInput. - (2) With this total commandInput, each corresponding controlDistributor definition has to be evaluated, in order to get controlParameter settings for a number of controlDevices. - (3) All controlParameter settings for a controlDevice, coming from the configurationUID, from the controlDistributors and from separate controlDevice settings have to be summed up to get a total controlParameter for each controlDevice. - (4) With this total controlParameter, each corresponding controlDevice definition has to be evaluated, in order to find out what the control device finally is doing. - (5) During the summation process (depending on the order of processing within step 1 to 4), commandInputs or controlParameters might exceed the specified limits for that controlDistributor or controlDevices. As an intermediate result, this should be accepted – however, when it comes to evaluation in step 2 and 4, all commandInputs and controlParameters have to be within the specified limits. + + The command inputs for each controlDistributor, coming from the configurationUID, as well as from separate settings have to be summed up to a total commandInput. + With this total commandInput, each corresponding controlDistributor definition has to be evaluated, in order to get controlParameter settings for a number of controlDevices. + All controlParameter settings for a controlDevice, coming from the configurationUID, from the controlDistributors and from separate controlDevice settings have to be summed up to get a total controlParameter for each controlDevice. + With this total controlParameter, each corresponding controlDevice definition has to be evaluated, in order to find out what the control device finally is doing. + During the summation process (depending on the order of processing within step 1 to 4), commandInputs or controlParameters might exceed the specified limits for that controlDistributor or controlDevices. As an intermediate result, this should be accepted – however, when it comes to evaluation in step 2 and 4, all commandInputs and controlParameters have to be within the specified limits. @@ -8963,10 +8769,10 @@ marko.alder@dlr.de - deckType + Deck - Deck type, containing the data of a deck + Data of an aircraft or rotorcraft deck @@ -8976,51 +8782,109 @@ marko.alder@dlr.de - Name of the deck + Name - Description of the deck + Description - - + - The starting point of the deck/cabin. In a - conventional aircraft like the A320, it would be the rear wall - of the cockpit. The coordinate is relative to the parent object - defined by “parentUID”, which should be the fuselage. - + UID of the object used as parent coordinate system (typically the fuselage uID) + + + + + UID of the floor structure which supports this deck - + - The starting point of the deck/cabin. In a + The reference point of the deck/cabin. In a conventional aircraft like the A320, it would be the rear wall - of the cockpit. The coordinate is relative to the parent object + of the cockpit. The transformation is relative to the parent object defined by “parentUID”, which should be the fuselage. - + + + Deck type: passanger, VIP, cargo or livestock + - + - - - - - - + + + + Seat modules + + + + + Aisles + + + + + Spaces + + + + + Sidewall panels + + + + + Luggage compartments + + + + + Ceiling panels + + + + + Galleys + + + + + Generic floor modules + + + + + Lavatories + + + + + Class dividers + + + + + Cargo containers + + + + + Doors + + @@ -9032,10 +8896,10 @@ marko.alder@dlr.de - decksType + Decks - Decks type, containing the decks of the fuselage + List of decks @@ -9969,20 +9833,26 @@ marko.alder@dlr.de - Definition of the engine nacelle type. + Engine nacelle - The engine nacelle is currently located together with - the engine. It gives a simple description of the outer shell of - the engine. All values are defined according to the base area, - center point of the fan(i.e. negative values can occur in the - definition) In most cases there will be a bypass engine. For - non-bypass or mixed engines ignore the bypass nozzle. For further - information on the geometric setup, please refer to the picture - below. + The engine nacelle is part of an engine. + It allows to define the outer geometry of the following engine components: + + Fan cowl + Core cowl + Center cowl + + + All geometric values refer to the fan position. + + + The common use case for this definition includes bypass engines. + In the case of non-bypass engines, the core cowl should be omitted. + - + @@ -9992,13 +9862,17 @@ marko.alder@dlr.de - + + + Fan cowl + - + + + Core cowl + - + @@ -10228,17 +10102,7 @@ marko.alder@dlr.de - - - - - - - - - - - + @@ -10310,17 +10174,7 @@ marko.alder@dlr.de UID of the engine pylon. - - - - - - - - - - - + @@ -10871,7 +10725,7 @@ marko.alder@dlr.de - + @@ -12934,17 +12788,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - + @@ -13281,17 +13125,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - + @@ -13323,11 +13157,145 @@ The fuel tank volume type should also be used for the wing fuel tank - mass + Mass description - genericMassType, describing mass, inertia and CoG data. - + + + + + parentUID not set + parentUID set + + + location without refType + global + local + + + location with refType="absLocal" + global + local + + + location with refType="absGlobal" + global + global + + + Note: The combination of location with refType="absLocal" and no parentUID is global, because the local coordinate system to which the location is referring to via refType equals the global coordinate system. + + + + ... + + + ... + + + ... + + + ... + + + ]]> + + + + + ... + + + ... + + + ... + + + ... + + + ]]> + + + + + ... + + + ... + + + ... + + + ... + + + ]]> + + + + wingUID + + ... + + + ... + + + ... + + + ... + + + ]]> + + + + wingUID + + ... + + + ... + + + ... + + + ... + + + ]]> + + + + wingUID + + ... + + + ... + + + ... + + + ... + + + ]]> + + @@ -13337,36 +13305,45 @@ The fuel tank volume type should also be used for the wing fuel tank - name + Name - description + Description - parentUID + UID of the component which serves as parent element, i.e. whose coordinate system is to be used as a reference for the mass properties (CoG location, orientation and massInertia). Thus, two cases can occur: (1) + it is set: local coordinate system of the parent; (2) it is not set: global CPACS coordinate system. + - mass value + Mass [kg] - + - mass loaction values (x,y,z) + Mass location. + If the optional refType attribute is set, it explicitly specifies whether the location of the mass refers to the global CPACS coordinate system (absGobal) or the local coordinate system of the parent element (absLocal, given by the CPACS hierarchy OR by parentUID). + If it is not set, the global CPACS coordinate system is considered as default. + To ensure consistency, the same settings apply as well to orientation and massInertia. - mass orientation values + Orientation. The reference coordinate system (absGlobal or absLocal) is identical to location. + + + + + Mass intertia. The reference coordinate system (absGlobal or absLocal) is identical to location. - @@ -13409,7 +13386,7 @@ The fuel tank volume type should also be used for the wing fuel tankFor spheres the default diameter is 1m. Cubes have a length of 1m in all three dimensions. Cylinders have a length of 1m and a diameter of 1m for the circular cross section. The cone is a cylinder with the top face scaled down to zero. - + @@ -13446,17 +13423,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - + @@ -13477,20 +13444,41 @@ The fuel tank volume type should also be used for the wing fuel tank - - - Longitude coordinate 0-360 - + + + + Longitude coordinate 0-360 + + + + + + + - - - Latitude coordinate 0-360 - + + + + Latitude coordinate 0-360 + + + + + + + - - - Altitude in meters - + + + + Altitude in meters + + + + + + + @@ -13676,17 +13664,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - + @@ -13815,7 +13793,7 @@ The fuel tank volume type should also be used for the wing fuel tank The relative circumference position at which the guide curve shall end. Valid values - are in the interval -1.0...1.0. + are in the interval -1,..,1. @@ -14928,7 +14906,7 @@ The fuel tank volume type should also be used for the wing fuel tank - linkToFile + Link to file (Step, Iges or Stl) Please provide a link to the additional file that shall @@ -15709,6 +15687,29 @@ The fuel tank volume type should also be used for the wing fuel tank + + + + + + mSparCellsType + + + + + + + + + + + + + + + + + @@ -15778,7 +15779,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -16534,7 +16535,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -16573,7 +16574,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -16991,28 +16992,6 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - mMiscellaneousType - - - Miscellaneous masses must only specify componenent masses for which NO DEDICATED ELEMENT EXISTS in the mass breakdown list! - - - - - - - - - - - - - @@ -17371,7 +17350,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -17423,7 +17402,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -17592,6 +17571,29 @@ The fuel tank volume type should also be used for the wing fuel tank + + + + + + mSparSkinsType + + + + + + + + + + + + + + + + + @@ -17609,12 +17611,36 @@ The fuel tank volume type should also be used for the wing fuel tank - + + + + + + + mSparType + + + + + + + + + + + + + + + + + + @@ -17752,7 +17778,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -18288,7 +18314,7 @@ The fuel tank volume type should also be used for the wing fuel tank - massInertiaType + Mass intertia massInertiaType @@ -19696,10 +19722,272 @@ The fuel tank volume type should also be used for the wing fuel tank - Specifies missions for performance evaluation of aircraft. - As the topmost element of the hierarchical mission definition, individual missions are grouped together - in the missions node. Here, segmentBlocks - are referenced. These again link to a list of segments. + + General description + Specifies mission profiles required for the performance evaluation of air vehicles (aircraft, rotorcraft, etc.). The missionDefininitions node is constructed in such a way, that all civil aircraft missions and missions from MIL-STD-3013A can be specified.> + + + Hierarchical buildup of the mission definition + + The mission definition is built-up in a hierarchical way. As the topmost element of the hierarchical mission definition, missions are created within the missions node. Here, one or more segmentBlocks are referenced. These again link to a sequence of segments, making up parts of the missions: + + + + + + <missions> + containing the <startCondition> and a sequence of <segmentBlockUIDs> + + + <segmentBlocks> + + + grouping multiple <segments> and providing overall information concerning the block of segments: + + + + constraints in the form of an endCondition or given flightPath, + variableSegments and the corresponding variableConditions in case a segment should be adjusted such to meet the segmentBlock's endCondition, + fuelPlanningType (designFuel, reserveFuel, additionalFuel), + segmentDirection and numberOfRepetitions. + + + + + + <segments> + + + containing detailed information per segment: + + + EITHER + + + + segmentType, + endConditions, + constraints, + environmentalConditions + + + + OR massFraction + + + OR mass + + + + + + + + startConditions, constraints, endConditions and the relationalOperator attribute + + the startCondition is provided at the mission node. Each subsequent segmentBlock/segment ends by the provided endCondition. + + + <startCondition> + start condition of the mission (can be an airfield or mid-air condition) + + + <endCondition> + specific end condition for a segmentBlock or segment (e.g.: an altitude or velocity) + + + <constraint> + specific performance settings for a segmentBlock or segment (e.g.: a cruise Mach number) + + + attribute @relationalOperator + + Indicate how conditions should be interpreted: + + + enum: „lt“, „le“, „eq“, „ne“, „ge“, „gt“, + + Examples: + + + 0.78 +1800 + ]]> + + + + + + + + + + + + + Example implementation for a civil transport mission + + + + + + In the figure above, an example for a civil aircraft transport mission is provided. + + + The mission starts at a position of 0, 0, 0 with 0 velocity, as provided by the startCondition of the mission node. Furthermore, the environmental conditions are provided: ISA atmosphere with a deltaTemperature of 0 [K]. The mission consists of three segmentBlocks: a designMission, reserves and the taxiIn segmentBlock. + + + + example mission + this is an example mission + + 0.0 + + 0.0 + 0.0 + 0.0 + + + ISA + 0.0 + + + + designMission + reserves + endPhase + + + ]]> + + + The designMission segmentBlock is shown below. It provides a set of five segments, together making up a mission with a range of 1000 [nm] or 1852 [km]. The “cruise” segment is the variable segment, which thereby should have a range of: 1852000 – range(climb) – range(descent), provided the taxiOut and takeOff segments are not providing any range credit. The fuel burned during this segmentBlock should be added to the designFuel, the segmentDirection is provided for illustration purposes. + + + + + design mission + segment block for the design mission + + + 1852000 + + + + + cruise + range + + + designFuel + outbound + + taxiOut + takeOff + climb + cruise + descent + + + + + ]]> + + + The first and second segment are providing input for the part of the segmentBlock that doesn’t need simulation. During the taxiOut phase, 50 [kg] of fuel is burned. The takeOff phase has a duration of 30 [sec]. + + + + taxi out + taxi out segment + massFraction + 50 + + + take off + take off segment + takeOff + + 00:00:30 + + + ]]> + + The rest of the segments make-up the flying part of the designMission. The climb phase, ending at an altitude of FL330 or 10058.4 [m], provides a constraint-lapse having discrete steps, typical for transport aircraft (a 250 kt / 300 kt / M 0.78 climb profile). Through the referenceEndconditionUID “altClimb”, a link to the altitude endCondition of the segment at the basis of this climb profile is provided. + + + + Altitude from + Altitude to + calibratedAirspeed + machNumber + + + 0.0 [m] + 0.303 * 10058.4 = 3047.7 [m] + ≤ 128.61 [m/s] + ≤ 0.78 [-] + + + 0.303 * 10058.4 = 3047.7 [m] + 10058.4 [m] + ≤ 154.33 [m/s] + ≤ 0.78 [-] + + + + + The cruise phase is not fixed to a certain altitude and has no endCondition, since its range is determined by the segmentBlock information. The descent phase makes sure the vehicle lands at an altitude of 0 [m]. In this case, since the values are not explicitly provided, it is up to the mission simulation software to determine, when the cruise phase ends and the descent phase starts. + + + + climb + climb with: speed @ MFCS (set to machNumber le 0.78 [-]), altitude @ FL330 + climb + + + 10058.4 + + + + + altitude + 0.0;0.303 + discrete + 128.61;154.33 + 0.78;0.78 + velocity + + + + + cruise + cruise with: speed @ optimum cruise speed, altitude @ optimum cruise altitude + cruise + + + + descent to MSL + descent to MSL altitude + descent + + + 0 + + + + ]]> + + + Two more segmentBlocks make up the mission. The “reserves” segmentBlock provides information for the cruise to alternate airport and loitering phase and the corresponding burnt fuel is considered reserveFuel. The mission ends with a landing and taxiIn phase within the “endPhase” segmentBlock, of which the burnt fuel is considered additionalFuel. The following then holds: blockFuel = designFuel + additionalFuel. + + + @@ -19708,8 +19996,8 @@ The fuel tank volume type should also be used for the wing fuel tank - - + + @@ -19737,7 +20025,7 @@ The fuel tank volume type should also be used for the wing fuel tank - List of specific performance maps used on dedicated mission segments + List of specific performance maps used on dedicated mission segments or pointPerformance requirements @@ -19767,70 +20055,54 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - Calibrated airspeed [m/s] - - - - - - - - - - - - - - Mach number - - - - - - - - - - - - - Global coordinate in xyz coordinates + Calibrated airspeed at the end of the segment [m/s] - + - + - Global coordinate in geographic - coordinates (longitude, latitude, - altitude) + Mach number at the end of the segment - + + + + + + + Position at the end of the segment in xyz coordinates + + + + + + + Position at the end of the segment in geo coordinates + + + - Runway + Reference to the runway on which the segment ends @@ -19846,7 +20118,7 @@ The fuel tank volume type should also be used for the wing fuel tank - MassFraction ending the segment + massFraction ending the segment [-] @@ -19860,9 +20132,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Fuel mass fraction ending the - segment, as remaining fuel mass with - respect to initial segment fuel mass + massFraction of remaining fuel ending the segment [-] @@ -19876,8 +20146,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Remaining absolute fuel ending the - segment + Absolute mass of remaining fuel ending the segment [kg] @@ -19891,8 +20160,49 @@ The fuel tank volume type should also be used for the wing fuel tank - Consumed fuel mass ending the - segment + Consumed fuel ending the segment [kg] + + + + + + + + + + + + + + Power fraction of remaining at the end of the segment + + + + + + + + + + + + + + Absolute power left ending the segment [W] + + + + + + + + + + + + + + Consumed power ending the segment [W] @@ -19908,9 +20218,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Flight heading at the end of the - segment in compassAngle with - reference to true North [deg] + Flight heading at the end of the segment in compassAngle with reference to true North [deg] @@ -19924,9 +20232,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Total change of heading angle during - segment (a full turn is 360 degrees) - [deg] + Total change of heading angle during segment (a full turn is 360 degrees) [deg] @@ -19941,7 +20247,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Flown distance in the segment (x, y, z) + Flown distance ending the segment @@ -19970,7 +20276,7 @@ The fuel tank volume type should also be used for the wing fuel tank - UTC time at end of mission + UTC time at end of segment [hh:mm:ss] @@ -19985,8 +20291,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Specific excess power at the end of the - segment + Specific excess power at the end of the segment @@ -20000,7 +20305,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Rate of climb ending the segment + Rate of climb ending the segment [m/s] @@ -20014,7 +20319,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Achieved flightPathAngle ending the segment + Achieved flightPathAngle ending the segment [deg] @@ -20024,7 +20329,12 @@ The fuel tank volume type should also be used for the wing fuel tank - + + + List of stores released in the segment. The corresponding weightAndBalance vector for retrieving the new state as well as a potential change in aerodynamicPerformanceMap (if external stores are released) should be reflected within the configuration node at model level. + + + @@ -20035,11 +20345,8 @@ The fuel tank volume type should also be used for the wing fuel tank - Mission block constraints + Specific performance settings for the segmentBlock (e.g.: a cruise Mach number) - - Definition of constraints for the mission segment block - @@ -20094,7 +20401,12 @@ The fuel tank volume type should also be used for the wing fuel tank - + + + List of segment uID's making up the segmentBlock. These should be ordered, such that the segment connections are correct. + + + @@ -20437,21 +20749,126 @@ The fuel tank volume type should also be used for the wing fuel tank + + + + + Guide curve + + + + + The following figure shows the basic setup of the guide curves. + They always start at a given ζ-position (fromZeta) on the profile of the specified start section (startSectionUID) and end at the ζ-position (toZeta) on the profile of the subsequent section. + The relative coordinates of the guide curves are specified in cpacs/vehicles/profiles/guideCurves and referenced via its uID. + + + + + + Note: Guide curves and profiles must result in a valid curve network. + + + The guide curve points are interpreted as (Δr and Δx) offsets from a cubic polynomial. + This polynomial serves as a baseline for guide curves between segments located on different radial positions with smooth transitions: + + + + + + Note: Currently, the nacelles do not have an explicit guide curve type but employ the standard guide curve definition, which is used in wings and profiles. + Therefore, the parameters have a different meaning: + + + + Standard guide curve parameter + Nacelle guide curve equivalent + Description + + + rX + φ + Independent variable normalized to [0,1] + + + rY + Δx + Orthogonal offset (translation in x-direction) + + + rZ + Δr + Radial offset + + + + + + + - - - - - - + + + + Name + + + + + + + Description + + + + + + + UID of the guide curve profile + + + + + + + UID of the start section + + + + + + + Curve coordinate of the referenced section profile at which the guide curve shall start. + Valid values are in the interval -1,..,1. + + + + + + + Curve coordinate of the profile following the referenced section profile. + It defines where the guide curve ends. + Valid values are in the interval -1,..,1. + + + + + + + + Guide curves + + + + @@ -20489,10 +20906,122 @@ The fuel tank volume type should also be used for the wing fuel tank - nacelleSectionType + Section - + + + An engine nacelle is defined by sections, where at least one and up to an infinite number of sections can be specified. + Lofting of the nacelle surface along the sections is done in cylindrical coordinates. + The coordinate origin refers to the center of the fan, i.e. the sections and their profiles are typically shifted in negative x-direction. + + + Note: In the current CPACS release, transformations are still labeled as Cartesian coordinates. + It is current work in progress to explicitly introduce cylindrical coordinates. + Until this is implemented in a future CPACS release, the implicit conventions listed below apply: + + + + Translation component + Cylindrical coordinate equivalent + Description + + + x + ϑ + Rotation angle around x + + + y + h + Horizontal translation + + + z + r + Radial translation + + + + The following example illustrates the setup of a nacelle with 4 sections. + These are rotated by 0, 120, 180 and 240 degrees around the x-axis (given by translation/x). + To illustrate the possible transformations, the profile of the upper section is shifted slightly further in the negative x-direction (translation/y), while the lower section has a smaller radial distance from the rotation axis (translation/z). + In addition, the sections are scaled differently (transformation/scaling; not shown in the example figures) in order to create a straight trailing edge and to realize a flattened profile near the ground. + + + The following example also shows the profile cut-outs due to the radially symmetric inner region of the nacelle defined by the rotationCurve. For detailed information, please refer to the documentation of the rotationCurve element. + + + + + The first section is not rotated (x=ϑ=0), but shifted vertically in negative direction (y=h=-0.257). + The radial distance is given by z=r=0.365: + + + + Upper section + + + 1.055 + 1 + 1 + + + 0.0 + -0.257 + 0.365 + + + fanCowlUpperSectionProfile + + ]]> + + The second section is rotated around the x-axis (x=ϑ=120) as well as scaled by a factor of 1.1 in its profile height: + + + + Inboard section + + + 1 + 1 + 1.1 + + + 120.0 + -0.2 + 0.365 + + + fanCowlUpperSectionProfile + + ]]> + + The third section is rotated around the x-axis by 180° and scaled by a factor of 0.8 in its profile height: + + + + Lower section + + + 1 + 1 + 0.8 + + + 180.0 + -0.2 + 0.33 + + + fanCowlUpperSectionProfile + + ]]> + + @@ -20500,10 +21029,22 @@ The fuel tank volume type should also be used for the wing fuel tank - - + + + Name + + + + + Description + + - + + + UID of the profile + + @@ -20515,7 +21056,7 @@ The fuel tank volume type should also be used for the wing fuel tank - nacelleSectionsType + Sections @@ -20885,21 +21426,7 @@ The fuel tank volume type should also be used for the wing fuel tankDescription of the performance case - - - Requirement classification based on the MoSCoW method (must, should, could or wont) - - - - - - - - - - - - + Reference to the considered weightAndBalance case @@ -21643,18 +22170,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - - + @@ -23037,17 +23553,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - + @@ -23600,86 +24106,6 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - seatModuleType - - - SeatModule type, containing data of a seat module - - - - - - - - - - - Name of the seat module - - - - - Description of the seat module - - - - - - Number of seats in the seat module, e.g 1, 2 - or 3 - - - - - Total width of the seat module - - - - - - seat module mass (optional, use of data to be - clarified) - - - - - seat module mass CoG (optional, use of data to - be clarified) - - - - - - - - - - - - - - seatModulesType - - - SeatModules type, containing seat modules - - - - - - - - - - - - - @@ -24550,21 +24976,21 @@ The fuel tank volume type should also be used for the wing fuel tank - - List of all mission segment UIDs to which the performance map is to be applied - - - - - List of point performance UIDs to which the performance map is to be applied - - + + List of all mission segment UIDs to which the performance map is to be applied + + + + + List of point performance UIDs to which the performance map is to be applied + + - - - List of point performance UIDs to which the performance map is to be applied - - + + + List of point performance UIDs to which the performance map is to be applied + + @@ -24911,7 +25337,12 @@ The fuel tank volume type should also be used for the wing fuel tank - + + + Seat elements (Deprecation warning: This element will soon be removed from the official CPACS. Use the new seat modules located at cpacs/vehicles/deckElements!) + + + @@ -26378,6 +26809,7 @@ The fuel tank volume type should also be used for the wing fuel tank + @@ -28615,17 +29047,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - - - + @@ -29677,7 +30099,7 @@ The fuel tank volume type should also be used for the wing fuel tank - nacelleCowlType + Nacelle cowl @@ -29692,12 +30114,8 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - + + @@ -29706,17 +30124,95 @@ The fuel tank volume type should also be used for the wing fuel tank + + + + + Rotation curve + + + + + The figure below shows an example of a rotation curve. + Together with the corresponding XML code, the definition is explained in more detail. + + + + + + First, the reference system is defined via referenceSectionUID, for which in this example the section with uID="engine_nacelle_fanCowl_section1" is referenced. + This in turn contains a transformation (not shown here), for example a translation by z=0.4 and a scaling, where the x-direction is stretched by a factor of two. + + + The rotation curve is now described in this reference system. + It is predefined in the profile library and referenced via a its uID. + Note that the curve is defined in the range x=[0,..,1] in order to be reasonably transformed by the reference system. + + + Next, the blending from the rotated profile of the nacelle segment to the rotation curve is defined. + The corresponding start and end points are given in curve coordinates zeta of the corresponding profiles. + Note that the lower part of the segment profile counts from zeta=[-1,..,0] and the upper part counts from zeta=[0,..,1]. + In between, the blending is linear. + + + + engine_nacelle_fanCowl_section1 + fanCowl_upperSection + -0.6 + -0.5 + -0.2s + -0.1 + + ]]> + + + + Fan cowl rotation curve profile + + 0;0.5;1 + -0.1;-0.2;-0.05 + + + ]]> + + + + + + - + + + UID of the section which serves as reference + + + + + Start zeta [-1,..,1]; relative curve coordante along the rotation curve from which it will be inserted in the nacelle. + + + + + End zeta [-1,..,1]; relative curve coordante along the rotation curve up to which it will be inserted in the nacelle. + + + + + Start zeta for blending [-1..1]; relative curve coordinate along the nacelle profile at which blending from the nacelle profile to the rotation curve will begin. + + + + + End zeta for blending; relative curve coordinate along the nacelle profile at which blending from the rotation curve to the nacelle profile will end. + - - - + + + UID of the rotation curve profile; the profile should be defined in x=[0..1] to be transformed by the section which is referenced by referenceSectionUID. + - - @@ -29726,12 +30222,17 @@ The fuel tank volume type should also be used for the wing fuel tank - nacelleCenterCowlType + Center cowl - - Describes the curve for defining rotational center of the engine. - + + + The centerCowl is defined by the rotation of a given curve profile (referenced via curveUID) around the x-axis. + + + + + @@ -29739,8 +30240,16 @@ The fuel tank volume type should also be used for the wing fuel tank - - + + + Offset of the rotation curve in x-direction + + + + + UID of the curve profile (vehicles/profiles/curveProfiles/..) + + @@ -32122,7 +32631,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -32142,7 +32651,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -32305,15 +32814,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - - - - - - - - + @@ -33182,8 +33683,8 @@ The fuel tank volume type should also be used for the wing fuel tank - Definition of missions and point performance events to evaluate the performance of a vehicle. - The definition of performance cases is independent from a specific vehicle. + Specification of performance cases required for the performance evaluation of air vehicles (aircraft, rotorcraft, etc.). + The information in this node is generally applicable to any kind of vehicle. Vehicle-specific information is provided through the performanceRequirements node found under: /cpacs/vehicles/../model/performanceCases. @@ -33192,8 +33693,7 @@ The fuel tank volume type should also be used for the wing fuel tank - - + @@ -33214,7 +33714,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Offset from runway threshold in cartesian coordinates in the runway coordinate system + Offset from runway threshold in the runway coordinate system @@ -33630,7 +34130,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Delta temperature + Delta temperature with respect to the standard temperature of the selected atmosphere [K] @@ -33812,7 +34312,7 @@ The fuel tank volume type should also be used for the wing fuel tank - Segments + List of segment uIDs to which the configuration is to be applied @@ -33849,11 +34349,17 @@ The fuel tank volume type should also be used for the wing fuel tank - + + + + UID of the segment for which the specific configuration holds. + + + - Vector with semicolon separated indices of the parameters within a segment. If not given then the complete segment is applied. + Vector with semicolon separated indices of the parts of the respective segment within the mission definition for which the specific configuration setting holds. Example: scheduling configurations for a climb or descent segment (different settings of moveables and gears) on altitudes/velocities @@ -33907,14 +34413,14 @@ The fuel tank volume type should also be used for the wing fuel tank - UID of the released store. + uID of the released store(s). - Quantity of the released store. + Quantity of released stores @@ -33923,7 +34429,7 @@ The fuel tank volume type should also be used for the wing fuel tank - + @@ -33945,46 +34451,1433 @@ The fuel tank volume type should also be used for the wing fuel tank - - - X-position in cartesian coordinates in the runway coordinate system - - - + + + X-position in cartesian coordinates in the runway coordinate system + + + - - - Y-position in cartesian coordinates in the runway coordinate system - - - + + + Y-position in cartesian coordinates in the runway coordinate system + + + - - - Z-position in cartesian coordinates in the runway coordinate system - - - + + + Z-position in cartesian coordinates in the runway coordinate system + + + - - - Lengthwise distance along the runway centerline from the runway threshold - - - - - - - Lateral offset from the runway centerline. Positive values on the starboard side. - - - + + + Lengthwise distance along the runway centerline from the runway threshold + + + + + + + Lateral offset from the runway centerline. Positive values on the starboard side. + + + + + + + + + Geometry + + + + [WARNING: This type is known to be susceptible to + inconsistencies and might therefore be removed in a future version of CPACS] + + + The geometry of the cabin roughly corresponds to the available design space in the cabin. + It is given in terms of constant height contour lines. + The lines all share a common x-vector. + The y vector provides the lateral + contour at Z-coordinate provided by the constant value z. + One or more contour lines can be given. + The cabin geometry is assumed to be symmetric. + + + + + + + + + + + + + + + Name + + + + + Description + + + + + + Vector of x coordinates + + + + + + + + + + + + + Cabin geometry contours + + + Cabin geometry contour line collection type. By providing more than one entry, + a 3D cabin space can be described. + + + + + + + + + + + + + + + + + + + + Cabin geometry contour + + + Type to define a lateral position value "y" at a given height "z" (in the parent deck coordinate system) + for each entry "x" in the parent cabin geometry definition. + + + + + + + + + + + Vector with y-coordinates + + + + + Height z + + + + + + + + + + + + + Aisle + + + Aisles has as many entries as there are aisles in the + cabin. In a normal single aisle there are two aisles: the cabin + aisle and the aisle leading to the cockpit. + + + + + + + + + + Name + + + + + Description + + + + + Longitudinal coordinates. The + number of coordinates can be chosen as appropriate, the minimum + number is two. The coordinates are relative to the cabin origin. + + + + + + Center points of the aisle. The + y-vector has to have same length as the x-vector. The aisle + stretches equally left and right of the provided y-coordinate. + + + + + + Width of the aisle at floor level at each + y-coordinate + + + + + + + + + + + + + + doorOpeningLegacyType + + + doors describe all doors of the cabin. They are linked + to a structural door description. The cabin door is usually equal + in size to the door, but does not need to be. The structural door + might describe a wider cut-out, while the cabin door is primarily + intended for evacuation modeling and cabin layout. In order to + obtain a 3-dimensional door representation, the local cabin + geometry shall be used. + + + + + + + + + + This is the forward x-coordinate of the door + relative to the cabin origin. + + + + + the door sill height relative to cabin origin. + + + + + + The width of the door in x-direction. + + + + + + the effective height of the door. + + + + + + + + + + + + + + + + + + + + + + + + "doorOpeningType" + + + Ceiling panel instance collection type. + + + + + + + + + + + + + + + + + + + + Deck door + + + doors describe all doors of the cabin. They are linked + to a structural door description. The cabin door is usually equal + in size to the door, but does not need to be. The structural door + might describe a wider cut-out, while the cabin door is primarily + intended for evacuation modeling and cabin layout. In order to + obtain a 3-dimensional door representation, the local cabin + geometry shall be used. + + + + + + + + + + Name + + + + + Description + + + + + Number of passengers this door adds to the + overall exit capacity limit of the aircraft. + + + + + Opening geometry of the door + + + + + Door type (boarding, cargo, evacuation or service) + + + + + + + + + + + + + + + + + + + + + + + + Deck doors + + + + + + + + + + + + + + + + + + + + + + Cargo containers + + + Cargo container instance collection type. + + + + + + + + + + + + + + + + + + + Cargo container + + + Cargo container type for placing an instance of a cargo container in the parent deck. + + + + + + + + + + Name + + + + + Description + + + + + UID of the cargo container element in the cpacs/vehicles/deckElements node + + + + + Position in x + + + + + Position in y + + + + + + + + + + + + + + Seat modules + + + Seat module instance collection type. + + + + + + + + + + Seat module + + + + + + + + + + + + + Galleys + + + Galley instance collection type. + + + + + + + + + + Galley + + + + + + + + + + + + + Generic floor modules + + + Generic floor module instance collection type. + + + + + + + + + + Generic floor module + + + + + + + + + + + + + Lavatories + + + Lavatory instance collection type. + + + + + + + + + + Lavatory + + + + + + + + + + + + + Class dividers + + + Class divider instance collection type. + + + + + + + + + + Class divider + + + + + + + + + + + + + + Sidewall panels + + + Sidewall panel instance collection type. + + + + + + + + + + Sidewall panel + + + + + + + + + + + + + + Luggage compartments + + + + + + + + + + Luggage compartment + + + + + + + + + + + + + + Ceiling panels + + + Ceiling panel instance collection type. + + + + + + + + + + Ceiling panel + + + + + + + + + + + + + + Structural mounts + + + Structural mount type containing the structural connections of cabin elements + + + + + + + + + + + + + + + + + + + Structural mount + + + Structural mount type containing the structural connections of cabin elements + + + + + + + + + + Name + + + + + Description + + + + + UID of the component to connect to + + + + + + + + + + + + + + Bounding Box + + + + + + + + + + Length in x + + + + + Length in y + + + + + Length in z + + + + + Origin + + + + + + + + + + + + + Geometry + + + Description of the deck element geometry. This might be either a bounding box definition or a link to a generic geometry component. + + + + + + + + + + + + + + + + + + + + Cargo container element for use in the decks + + + + + + + + + + + + + + + + + Description + + + + + + Contour: single or double + + + + + + + + + + + + + Delta x + + + + + + Delta y + + + + + + Delta y of the base + + + + + + Delta z + + + + + + Delta z kink + + + + + + + + + + + + + + + Cargo container elements + + + Cargo container element collection type + + + + + + + + + + + + + + + + + + + Ceiling panel + + + Ceiling panel element collection type + + + + + + + + + + Ceiling panel element for use in the decks + + + + + + + + + + + + + Class divider + + + Class divider element collection type + + + + + + + + + + Class divider element for use in the decks + + + + + + + + + + + + + Deck elements + + + A list of predefined elements which can be linked in the actual deck of the aircraft or rotorcraft model via referencing its uID. + + + + + + + + + + Ceiling panel elements for use in the decks + + + + + Class divider elements for use in the decks + + + + + Galley elements for use in the decks + + + + + Generic floor elements for use in the decks + + + + + Lavatory elements for use in the decks + + + + + Luggage compartment elements for use in the decks + + + + + Seat elements for use in the decks + + + + + Sidewall panel elements for use in the decks + + + + + Cargo container elements for use in the decks + + + + + + + + + + + + + Galley element + + + Galley element type, containing the base elements of the cabin + + + + + + + + + + Description + + + + + + + Number of trolleys + + + + + + + + + + + + + + Galley elements + + + Galley element collection type + + + + + + + + + + Galley element for use in the decks + + + + + + + + + + + + + Lavatory elements + + + Lavatory element collection type + + + + + + + + + + Lavatory element for use in the decks + + + + + + + + + + + + + Luggage compartment elements + + + Luggage compartment element collection type + + + + + + + + + + Luggage compartment element for use in the decks + + + + + + + + + + + + + Seat element + + + Seat element type, containing the base elements of the cabin + + + + + + + + + + Description + + + + + + + Number of seats + + + + + + + + + + + + + + Seat elements + + + Seat element collection type + + + + + + + + + + Seat element for use in the decks + + + + + + + + + + + + + Generic floor elements + + + Generic floor element collection type + + + + + + + + + + Generic floor element for use in the decks + + + + + + + + + + + + + Sidewall panel elements + + + Sidewall panel element collection type + + + + + + + + + + Sidewall panel element for use in the decks + + + + + + + + + + + + + Generic geometry component + + + + + + + + + + + + + + + + + + + + + + + Deck component + + + + + + + + + + Name + + + + + Description + + + + + UID of the corresponding element in the cpacs/vehicles/deckElemets node + + + + + + + + + + + + + + + + Deck component + + + + + + + + + + Name + + + + + Description + + + + + UID of the corresponding element in the cpacs/vehicles/deckElemets node + + + + + + + + + + + + + + + + Deck element + + + + + + + + + + Description + + + + + + + + + + + + + + + + Mass + + + Description of mass, center of gravity and inertia + + + + + + + + + + + Mass value + + + + + Center of gravity (x,y,z) + + + + + + + + + + + + + + + Symmetry (see CPACS root node documentation for details) + + + + + + + + Symmetry inheritance from parent element disabled + + + + + Symmetry inherited from parent element (default behavior, i.e. also applies if attribute not set) + + + + + Symmetry w.r.t. the x-y plane of the CPACS coordinate system + + + + + Symmetry w.r.t. the x-z plane of the CPACS coordinate system + + + + + Symmetry w.r.t. the y-z plane of the CPACS coordinate system + + + + + + + + + + + Requirement classification based on the MoSCoW method (must, should, could or wont) + + + + + + + + + + + + + + diff --git a/src/CCPACSPoint.cpp b/src/CCPACSPoint.cpp index 88e0c7c88..20247ddd8 100644 --- a/src/CCPACSPoint.cpp +++ b/src/CCPACSPoint.cpp @@ -36,7 +36,12 @@ CCPACSPoint::CCPACSPoint(CCPACSPointList* parent, CTiglUIDManager* uidMgr) { } -CCPACSPoint::CCPACSPoint(CCPACSSeatModule* parent, CTiglUIDManager* uidMgr) +CCPACSPoint::CCPACSPoint(CCPACSBoundingBox* parent, CTiglUIDManager* uidMgr) + : generated::CPACSPoint(parent, uidMgr) +{ +} + +CCPACSPoint::CCPACSPoint(CCPACSDeckElementMass* parent, CTiglUIDManager* uidMgr) : generated::CPACSPoint(parent, uidMgr) { } diff --git a/src/CCPACSPoint.h b/src/CCPACSPoint.h index 8a1523ecf..e083c8239 100644 --- a/src/CCPACSPoint.h +++ b/src/CCPACSPoint.h @@ -27,7 +27,8 @@ class CCPACSPoint : public generated::CPACSPoint TIGL_EXPORT CCPACSPoint(CCPACSControlSurfaceStep* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSPoint(CCPACSControlSurfaceHingePoint* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSPoint(CCPACSPointList* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CCPACSPoint(CCPACSSeatModule* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSPoint(CCPACSBoundingBox* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSPoint(CCPACSDeckElementMass* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSPoint(CCPACSTransformation* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSPoint(const CCPACSPoint& p); diff --git a/src/generated/CPACSBoundingBox.cpp b/src/generated/CPACSBoundingBox.cpp new file mode 100644 index 000000000..76152b8f6 --- /dev/null +++ b/src/generated/CPACSBoundingBox.cpp @@ -0,0 +1,206 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSBoundingBox.h" +#include "CPACSDeckElementGeometry.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSBoundingBox::CPACSBoundingBox(CPACSDeckElementGeometry* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_deltaX(0) + , m_deltaY(0) + , m_deltaZ(0) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSBoundingBox::~CPACSBoundingBox() + { + } + + const CPACSDeckElementGeometry* CPACSBoundingBox::GetParent() const + { + return m_parent; + } + + CPACSDeckElementGeometry* CPACSBoundingBox::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSBoundingBox::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSBoundingBox::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSBoundingBox::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSBoundingBox::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSBoundingBox::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element deltaX + if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaX")) { + m_deltaX = tixi::TixiGetElement(tixiHandle, xpath + "/deltaX"); + } + else { + LOG(ERROR) << "Required element deltaX is missing at xpath " << xpath; + } + + // read element deltaY + if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaY")) { + m_deltaY = tixi::TixiGetElement(tixiHandle, xpath + "/deltaY"); + } + else { + LOG(ERROR) << "Required element deltaY is missing at xpath " << xpath; + } + + // read element deltaZ + if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaZ")) { + m_deltaZ = tixi::TixiGetElement(tixiHandle, xpath + "/deltaZ"); + } + else { + LOG(ERROR) << "Required element deltaZ is missing at xpath " << xpath; + } + + // read element origin + if (tixi::TixiCheckElement(tixiHandle, xpath + "/origin")) { + m_origin = boost::in_place(this, m_uidMgr); + try { + m_origin->ReadCPACS(tixiHandle, xpath + "/origin"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read origin at xpath " << xpath << ": " << e.what(); + m_origin = boost::none; + } + } + + } + + void CPACSBoundingBox::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element deltaX + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaX"); + tixi::TixiSaveElement(tixiHandle, xpath + "/deltaX", m_deltaX); + + // write element deltaY + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaY"); + tixi::TixiSaveElement(tixiHandle, xpath + "/deltaY", m_deltaY); + + // write element deltaZ + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaZ"); + tixi::TixiSaveElement(tixiHandle, xpath + "/deltaZ", m_deltaZ); + + // write element origin + if (m_origin) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/origin"); + m_origin->WriteCPACS(tixiHandle, xpath + "/origin"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/origin")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/origin"); + } + } + + } + + const double& CPACSBoundingBox::GetDeltaX() const + { + return m_deltaX; + } + + void CPACSBoundingBox::SetDeltaX(const double& value) + { + m_deltaX = value; + } + + const double& CPACSBoundingBox::GetDeltaY() const + { + return m_deltaY; + } + + void CPACSBoundingBox::SetDeltaY(const double& value) + { + m_deltaY = value; + } + + const double& CPACSBoundingBox::GetDeltaZ() const + { + return m_deltaZ; + } + + void CPACSBoundingBox::SetDeltaZ(const double& value) + { + m_deltaZ = value; + } + + const boost::optional& CPACSBoundingBox::GetOrigin() const + { + return m_origin; + } + + boost::optional& CPACSBoundingBox::GetOrigin() + { + return m_origin; + } + + CCPACSPoint& CPACSBoundingBox::GetOrigin(CreateIfNotExistsTag) + { + if (!m_origin) + m_origin = boost::in_place(this, m_uidMgr); + return *m_origin; + } + + void CPACSBoundingBox::RemoveOrigin() + { + m_origin = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSBoundingBox.h b/src/generated/CPACSBoundingBox.h new file mode 100644 index 000000000..a3c08b868 --- /dev/null +++ b/src/generated/CPACSBoundingBox.h @@ -0,0 +1,107 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include +#include +#include "CreateIfNotExists.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSDeckElementGeometry; + + // This class is used in: + // CPACSDeckElementGeometry + + /// @brief Bounding Box + /// + /// + class CPACSBoundingBox + { + public: + TIGL_EXPORT CPACSBoundingBox(CPACSDeckElementGeometry* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSBoundingBox(); + + TIGL_EXPORT CPACSDeckElementGeometry* GetParent(); + + TIGL_EXPORT const CPACSDeckElementGeometry* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const double& GetDeltaX() const; + TIGL_EXPORT virtual void SetDeltaX(const double& value); + + TIGL_EXPORT virtual const double& GetDeltaY() const; + TIGL_EXPORT virtual void SetDeltaY(const double& value); + + TIGL_EXPORT virtual const double& GetDeltaZ() const; + TIGL_EXPORT virtual void SetDeltaZ(const double& value); + + TIGL_EXPORT virtual const boost::optional& GetOrigin() const; + TIGL_EXPORT virtual boost::optional& GetOrigin(); + + TIGL_EXPORT virtual CCPACSPoint& GetOrigin(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveOrigin(); + + protected: + CPACSDeckElementGeometry* m_parent; + + CTiglUIDManager* m_uidMgr; + + /// Length in x + double m_deltaX; + + /// Length in y + double m_deltaY; + + /// Length in z + double m_deltaZ; + + /// Origin + boost::optional m_origin; + + private: + CPACSBoundingBox(const CPACSBoundingBox&) = delete; + CPACSBoundingBox& operator=(const CPACSBoundingBox&) = delete; + + CPACSBoundingBox(CPACSBoundingBox&&) = delete; + CPACSBoundingBox& operator=(CPACSBoundingBox&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSBoundingBox = generated::CPACSBoundingBox; +using CCPACSDeckElementGeometry = generated::CPACSDeckElementGeometry; +} // namespace tigl diff --git a/src/generated/CPACSCargoContainerElement.cpp b/src/generated/CPACSCargoContainerElement.cpp new file mode 100644 index 000000000..22005232a --- /dev/null +++ b/src/generated/CPACSCargoContainerElement.cpp @@ -0,0 +1,342 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSCargoContainerElement.h" +#include "CPACSCargoContainerElements.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSCargoContainerElement::CPACSCargoContainerElement(CPACSCargoContainerElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_deltaX(0) + , m_deltaY(0) + , m_deltaZ(0) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSCargoContainerElement::~CPACSCargoContainerElement() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + } + + const CPACSCargoContainerElements* CPACSCargoContainerElement::GetParent() const + { + return m_parent; + } + + CPACSCargoContainerElements* CPACSCargoContainerElement::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSCargoContainerElement::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSCargoContainerElement::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSCargoContainerElement::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSCargoContainerElement::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSCargoContainerElement::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element description + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; + } + } + + // read element mass + if (tixi::TixiCheckElement(tixiHandle, xpath + "/mass")) { + m_mass = boost::in_place(this, m_uidMgr); + try { + m_mass->ReadCPACS(tixiHandle, xpath + "/mass"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read mass at xpath " << xpath << ": " << e.what(); + m_mass = boost::none; + } + } + + // read element contour + if (tixi::TixiCheckElement(tixiHandle, xpath + "/contour")) { + m_contour = stringToCPACSCargoContainerElement_contour(tixi::TixiGetElement(tixiHandle, xpath + "/contour")); + } + else { + LOG(ERROR) << "Required element contour is missing at xpath " << xpath; + } + + // read element deltaX + if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaX")) { + m_deltaX = tixi::TixiGetElement(tixiHandle, xpath + "/deltaX"); + } + else { + LOG(ERROR) << "Required element deltaX is missing at xpath " << xpath; + } + + // read element deltaY + if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaY")) { + m_deltaY = tixi::TixiGetElement(tixiHandle, xpath + "/deltaY"); + } + else { + LOG(ERROR) << "Required element deltaY is missing at xpath " << xpath; + } + + // read element deltaYBase + if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaYBase")) { + m_deltaYBase = tixi::TixiGetElement(tixiHandle, xpath + "/deltaYBase"); + } + + // read element deltaZ + if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaZ")) { + m_deltaZ = tixi::TixiGetElement(tixiHandle, xpath + "/deltaZ"); + } + else { + LOG(ERROR) << "Required element deltaZ is missing at xpath " << xpath; + } + + // read element deltaZKink + if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaZKink")) { + m_deltaZKink = tixi::TixiGetElement(tixiHandle, xpath + "/deltaZKink"); + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + } + + void CPACSCargoContainerElement::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element description + if (m_description) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description"); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } + + // write element mass + if (m_mass) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/mass"); + m_mass->WriteCPACS(tixiHandle, xpath + "/mass"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/mass")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/mass"); + } + } + + // write element contour + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/contour"); + tixi::TixiSaveElement(tixiHandle, xpath + "/contour", CPACSCargoContainerElement_contourToString(m_contour)); + + // write element deltaX + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaX"); + tixi::TixiSaveElement(tixiHandle, xpath + "/deltaX", m_deltaX); + + // write element deltaY + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaY"); + tixi::TixiSaveElement(tixiHandle, xpath + "/deltaY", m_deltaY); + + // write element deltaYBase + if (m_deltaYBase) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaYBase"); + tixi::TixiSaveElement(tixiHandle, xpath + "/deltaYBase", *m_deltaYBase); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaYBase")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/deltaYBase"); + } + } + + // write element deltaZ + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaZ"); + tixi::TixiSaveElement(tixiHandle, xpath + "/deltaZ", m_deltaZ); + + // write element deltaZKink + if (m_deltaZKink) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deltaZKink"); + tixi::TixiSaveElement(tixiHandle, xpath + "/deltaZKink", *m_deltaZKink); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/deltaZKink")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/deltaZKink"); + } + } + + } + + const std::string& CPACSCargoContainerElement::GetUID() const + { + return m_uID; + } + + void CPACSCargoContainerElement::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const boost::optional& CPACSCargoContainerElement::GetDescription() const + { + return m_description; + } + + void CPACSCargoContainerElement::SetDescription(const boost::optional& value) + { + m_description = value; + } + + const boost::optional& CPACSCargoContainerElement::GetMass() const + { + return m_mass; + } + + boost::optional& CPACSCargoContainerElement::GetMass() + { + return m_mass; + } + + const CPACSCargoContainerElement_contour& CPACSCargoContainerElement::GetContour() const + { + return m_contour; + } + + void CPACSCargoContainerElement::SetContour(const CPACSCargoContainerElement_contour& value) + { + m_contour = value; + } + + const double& CPACSCargoContainerElement::GetDeltaX() const + { + return m_deltaX; + } + + void CPACSCargoContainerElement::SetDeltaX(const double& value) + { + m_deltaX = value; + } + + const double& CPACSCargoContainerElement::GetDeltaY() const + { + return m_deltaY; + } + + void CPACSCargoContainerElement::SetDeltaY(const double& value) + { + m_deltaY = value; + } + + const boost::optional& CPACSCargoContainerElement::GetDeltaYBase() const + { + return m_deltaYBase; + } + + void CPACSCargoContainerElement::SetDeltaYBase(const boost::optional& value) + { + m_deltaYBase = value; + } + + const double& CPACSCargoContainerElement::GetDeltaZ() const + { + return m_deltaZ; + } + + void CPACSCargoContainerElement::SetDeltaZ(const double& value) + { + m_deltaZ = value; + } + + const boost::optional& CPACSCargoContainerElement::GetDeltaZKink() const + { + return m_deltaZKink; + } + + void CPACSCargoContainerElement::SetDeltaZKink(const boost::optional& value) + { + m_deltaZKink = value; + } + + CPACSDeckElementMass& CPACSCargoContainerElement::GetMass(CreateIfNotExistsTag) + { + if (!m_mass) + m_mass = boost::in_place(this, m_uidMgr); + return *m_mass; + } + + void CPACSCargoContainerElement::RemoveMass() + { + m_mass = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSCargoContainerElement.h b/src/generated/CPACSCargoContainerElement.h new file mode 100644 index 000000000..221305f0e --- /dev/null +++ b/src/generated/CPACSCargoContainerElement.h @@ -0,0 +1,137 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include +#include "CPACSCargoContainerElement_contour.h" +#include "CPACSDeckElementMass.h" +#include "CreateIfNotExists.h" +#include "CTiglUIDObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; + +namespace generated +{ + class CPACSCargoContainerElements; + + // This class is used in: + // CPACSCargoContainerElements + + /// @brief Cargo container element for use in the decks + /// + /// @see cargoContainer + /// + class CPACSCargoContainerElement : public CTiglReqUIDObject + { + public: + TIGL_EXPORT CPACSCargoContainerElement(CPACSCargoContainerElements* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSCargoContainerElement(); + + TIGL_EXPORT CPACSCargoContainerElements* GetParent(); + + TIGL_EXPORT const CPACSCargoContainerElements* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetMass() const; + TIGL_EXPORT virtual boost::optional& GetMass(); + + TIGL_EXPORT virtual const CPACSCargoContainerElement_contour& GetContour() const; + TIGL_EXPORT virtual void SetContour(const CPACSCargoContainerElement_contour& value); + + TIGL_EXPORT virtual const double& GetDeltaX() const; + TIGL_EXPORT virtual void SetDeltaX(const double& value); + + TIGL_EXPORT virtual const double& GetDeltaY() const; + TIGL_EXPORT virtual void SetDeltaY(const double& value); + + TIGL_EXPORT virtual const boost::optional& GetDeltaYBase() const; + TIGL_EXPORT virtual void SetDeltaYBase(const boost::optional& value); + + TIGL_EXPORT virtual const double& GetDeltaZ() const; + TIGL_EXPORT virtual void SetDeltaZ(const double& value); + + TIGL_EXPORT virtual const boost::optional& GetDeltaZKink() const; + TIGL_EXPORT virtual void SetDeltaZKink(const boost::optional& value); + + TIGL_EXPORT virtual CPACSDeckElementMass& GetMass(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveMass(); + + protected: + CPACSCargoContainerElements* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + /// Description + boost::optional m_description; + + boost::optional m_mass; + + /// Contour: single or double + CPACSCargoContainerElement_contour m_contour; + + /// Delta x + double m_deltaX; + + /// Delta y + double m_deltaY; + + /// Delta y of the base + boost::optional m_deltaYBase; + + /// Delta z + double m_deltaZ; + + /// Delta z kink + boost::optional m_deltaZKink; + + private: + CPACSCargoContainerElement(const CPACSCargoContainerElement&) = delete; + CPACSCargoContainerElement& operator=(const CPACSCargoContainerElement&) = delete; + + CPACSCargoContainerElement(CPACSCargoContainerElement&&) = delete; + CPACSCargoContainerElement& operator=(CPACSCargoContainerElement&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSCargoContainerElement = generated::CPACSCargoContainerElement; +using CCPACSCargoContainerElements = generated::CPACSCargoContainerElements; +} // namespace tigl diff --git a/src/generated/CPACSCargoContainerElement_contour.h b/src/generated/CPACSCargoContainerElement_contour.h new file mode 100644 index 000000000..d0f7964a2 --- /dev/null +++ b/src/generated/CPACSCargoContainerElement_contour.h @@ -0,0 +1,58 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include + +#include "CTiglError.h" +#include "to_string.h" + +namespace tigl +{ +namespace generated +{ + // This enum is used in: + // CPACSCargoContainerElement + + enum CPACSCargoContainerElement_contour + { + single, + _double + }; + + inline std::string CPACSCargoContainerElement_contourToString(const CPACSCargoContainerElement_contour& value) + { + switch(value) { + case single: return "single"; + case _double: return "double"; + default: throw CTiglError("Invalid enum value \"" + std_to_string(static_cast(value)) + "\" for enum type CPACSCargoContainerElement_contour"); + } + } + inline CPACSCargoContainerElement_contour stringToCPACSCargoContainerElement_contour(const std::string& value) + { + auto toLower = [](std::string str) { for (char& c : str) { c = std::tolower(c); } return str; }; + if (toLower(value) == "single") { return single; } + if (toLower(value) == "double") { return _double; } + throw CTiglError("Invalid string value \"" + value + "\" for enum type CPACSCargoContainerElement_contour"); + } +} // namespace generated + +// Aliases in tigl namespace +using ECPACSCargoContainerElement_contour = generated::CPACSCargoContainerElement_contour; +} // namespace tigl diff --git a/src/generated/CPACSCargoContainerElements.cpp b/src/generated/CPACSCargoContainerElements.cpp new file mode 100644 index 000000000..390284e29 --- /dev/null +++ b/src/generated/CPACSCargoContainerElements.cpp @@ -0,0 +1,129 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSCargoContainerElement.h" +#include "CPACSCargoContainerElements.h" +#include "CPACSDeckElements.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSCargoContainerElements::CPACSCargoContainerElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSCargoContainerElements::~CPACSCargoContainerElements() + { + } + + const CPACSDeckElements* CPACSCargoContainerElements::GetParent() const + { + return m_parent; + } + + CPACSDeckElements* CPACSCargoContainerElements::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSCargoContainerElements::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSCargoContainerElements::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSCargoContainerElements::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSCargoContainerElements::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSCargoContainerElements::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element cargoContainerElement + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cargoContainerElement")) { + tixi::TixiReadElements(tixiHandle, xpath + "/cargoContainerElement", m_cargoContainerElements, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSCargoContainerElements::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element cargoContainerElement + tixi::TixiSaveElements(tixiHandle, xpath + "/cargoContainerElement", m_cargoContainerElements); + + } + + const std::vector>& CPACSCargoContainerElements::GetCargoContainerElements() const + { + return m_cargoContainerElements; + } + + std::vector>& CPACSCargoContainerElements::GetCargoContainerElements() + { + return m_cargoContainerElements; + } + + CPACSCargoContainerElement& CPACSCargoContainerElements::AddCargoContainerElement() + { + m_cargoContainerElements.push_back(make_unique(this, m_uidMgr)); + return *m_cargoContainerElements.back(); + } + + void CPACSCargoContainerElements::RemoveCargoContainerElement(CPACSCargoContainerElement& ref) + { + for (std::size_t i = 0; i < m_cargoContainerElements.size(); i++) { + if (m_cargoContainerElements[i].get() == &ref) { + m_cargoContainerElements.erase(m_cargoContainerElements.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSCargoContainerElements.h b/src/generated/CPACSCargoContainerElements.h new file mode 100644 index 000000000..974a5c3e1 --- /dev/null +++ b/src/generated/CPACSCargoContainerElements.h @@ -0,0 +1,89 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSCargoContainerElement; + class CPACSDeckElements; + + // This class is used in: + // CPACSDeckElements + + /// @brief Cargo container elements + /// + /// Cargo container element collection type + /// + class CPACSCargoContainerElements + { + public: + TIGL_EXPORT CPACSCargoContainerElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSCargoContainerElements(); + + TIGL_EXPORT CPACSDeckElements* GetParent(); + + TIGL_EXPORT const CPACSDeckElements* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetCargoContainerElements() const; + TIGL_EXPORT virtual std::vector>& GetCargoContainerElements(); + + TIGL_EXPORT virtual CPACSCargoContainerElement& AddCargoContainerElement(); + TIGL_EXPORT virtual void RemoveCargoContainerElement(CPACSCargoContainerElement& ref); + + protected: + CPACSDeckElements* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::vector> m_cargoContainerElements; + + private: + CPACSCargoContainerElements(const CPACSCargoContainerElements&) = delete; + CPACSCargoContainerElements& operator=(const CPACSCargoContainerElements&) = delete; + + CPACSCargoContainerElements(CPACSCargoContainerElements&&) = delete; + CPACSCargoContainerElements& operator=(CPACSCargoContainerElements&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSCargoContainerElements = generated::CPACSCargoContainerElements; +using CCPACSCargoContainerElement = generated::CPACSCargoContainerElement; +using CCPACSDeckElements = generated::CPACSDeckElements; +} // namespace tigl diff --git a/src/generated/CPACSCeilingPanelElements.cpp b/src/generated/CPACSCeilingPanelElements.cpp new file mode 100644 index 000000000..0fc9ff91f --- /dev/null +++ b/src/generated/CPACSCeilingPanelElements.cpp @@ -0,0 +1,129 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSCeilingPanelElements.h" +#include "CPACSDeckElementBase.h" +#include "CPACSDeckElements.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSCeilingPanelElements::CPACSCeilingPanelElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSCeilingPanelElements::~CPACSCeilingPanelElements() + { + } + + const CPACSDeckElements* CPACSCeilingPanelElements::GetParent() const + { + return m_parent; + } + + CPACSDeckElements* CPACSCeilingPanelElements::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSCeilingPanelElements::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSCeilingPanelElements::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSCeilingPanelElements::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSCeilingPanelElements::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSCeilingPanelElements::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element ceilingPanelElement + if (tixi::TixiCheckElement(tixiHandle, xpath + "/ceilingPanelElement")) { + tixi::TixiReadElements(tixiHandle, xpath + "/ceilingPanelElement", m_ceilingPanelElements, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSCeilingPanelElements::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element ceilingPanelElement + tixi::TixiSaveElements(tixiHandle, xpath + "/ceilingPanelElement", m_ceilingPanelElements); + + } + + const std::vector>& CPACSCeilingPanelElements::GetCeilingPanelElements() const + { + return m_ceilingPanelElements; + } + + std::vector>& CPACSCeilingPanelElements::GetCeilingPanelElements() + { + return m_ceilingPanelElements; + } + + CPACSDeckElementBase& CPACSCeilingPanelElements::AddCeilingPanelElement() + { + m_ceilingPanelElements.push_back(make_unique(this, m_uidMgr)); + return *m_ceilingPanelElements.back(); + } + + void CPACSCeilingPanelElements::RemoveCeilingPanelElement(CPACSDeckElementBase& ref) + { + for (std::size_t i = 0; i < m_ceilingPanelElements.size(); i++) { + if (m_ceilingPanelElements[i].get() == &ref) { + m_ceilingPanelElements.erase(m_ceilingPanelElements.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSCeilingPanelElements.h b/src/generated/CPACSCeilingPanelElements.h new file mode 100644 index 000000000..7cdab85a9 --- /dev/null +++ b/src/generated/CPACSCeilingPanelElements.h @@ -0,0 +1,90 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSDeckElementBase; + class CPACSDeckElements; + + // This class is used in: + // CPACSDeckElements + + /// @brief Ceiling panel + /// + /// Ceiling panel element collection type + /// + class CPACSCeilingPanelElements + { + public: + TIGL_EXPORT CPACSCeilingPanelElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSCeilingPanelElements(); + + TIGL_EXPORT CPACSDeckElements* GetParent(); + + TIGL_EXPORT const CPACSDeckElements* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetCeilingPanelElements() const; + TIGL_EXPORT virtual std::vector>& GetCeilingPanelElements(); + + TIGL_EXPORT virtual CPACSDeckElementBase& AddCeilingPanelElement(); + TIGL_EXPORT virtual void RemoveCeilingPanelElement(CPACSDeckElementBase& ref); + + protected: + CPACSDeckElements* m_parent; + + CTiglUIDManager* m_uidMgr; + + /// Ceiling panel element for use in the decks + std::vector> m_ceilingPanelElements; + + private: + CPACSCeilingPanelElements(const CPACSCeilingPanelElements&) = delete; + CPACSCeilingPanelElements& operator=(const CPACSCeilingPanelElements&) = delete; + + CPACSCeilingPanelElements(CPACSCeilingPanelElements&&) = delete; + CPACSCeilingPanelElements& operator=(CPACSCeilingPanelElements&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSCeilingPanelElements = generated::CPACSCeilingPanelElements; +using CCPACSDeckElementBase = generated::CPACSDeckElementBase; +using CCPACSDeckElements = generated::CPACSDeckElements; +} // namespace tigl diff --git a/src/generated/CPACSCellPositioningChordwise.h b/src/generated/CPACSCellPositioningChordwise.h index 860ce4c75..dca965d3e 100644 --- a/src/generated/CPACSCellPositioningChordwise.h +++ b/src/generated/CPACSCellPositioningChordwise.h @@ -86,12 +86,10 @@ namespace generated /// Chordwise contour coordinate as chordwise border. 0 equals LE, 1 equals TE. boost::optional m_contourCoordinate_choice2; - /// Relative chordwise position of the inner - /// end. + /// Relative chordwise position of the inner end. boost::optional m_xsi1_choice3; - /// Relative chordwise position of the outer - /// end. + /// Relative chordwise position of the outer end. boost::optional m_xsi2_choice3; private: diff --git a/src/generated/CPACSCellPositioningSpanwise.h b/src/generated/CPACSCellPositioningSpanwise.h index bd91272e7..8aa517718 100644 --- a/src/generated/CPACSCellPositioningSpanwise.h +++ b/src/generated/CPACSCellPositioningSpanwise.h @@ -94,19 +94,16 @@ namespace generated /// Spanwise contour coordinate as spanwise border. 0 equals root, 1 equals tip. boost::optional m_contourCoordinate_choice1; - /// Relative spanwise position of the forward - /// end. + /// Relative spanwise position of the forward end. boost::optional m_eta1_choice2; /// Relative spanwise position of the rear end. boost::optional m_eta2_choice2; - /// RibNumber is the reference to the rib number - /// of the rib set which is referenced by 'ribDefinitionUID'. + /// RibNumber is the reference to the rib number of the rib set which is referenced by 'ribDefinitionUID'. boost::optional m_ribNumber_choice3; - /// Reference to a ribDefinition set. The single - /// rib of this ribDefinition set is defined by using 'ribNumber'. + /// Reference to a ribDefinition set. The single rib of this ribDefinition set is defined by using 'ribNumber'. boost::optional m_ribDefinitionUID_choice3; private: diff --git a/src/generated/CPACSClassDividerElements.cpp b/src/generated/CPACSClassDividerElements.cpp new file mode 100644 index 000000000..7d51307ae --- /dev/null +++ b/src/generated/CPACSClassDividerElements.cpp @@ -0,0 +1,129 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSClassDividerElements.h" +#include "CPACSDeckElementBase.h" +#include "CPACSDeckElements.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSClassDividerElements::CPACSClassDividerElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSClassDividerElements::~CPACSClassDividerElements() + { + } + + const CPACSDeckElements* CPACSClassDividerElements::GetParent() const + { + return m_parent; + } + + CPACSDeckElements* CPACSClassDividerElements::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSClassDividerElements::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSClassDividerElements::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSClassDividerElements::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSClassDividerElements::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSClassDividerElements::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element classDividerElement + if (tixi::TixiCheckElement(tixiHandle, xpath + "/classDividerElement")) { + tixi::TixiReadElements(tixiHandle, xpath + "/classDividerElement", m_classDividerElements, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSClassDividerElements::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element classDividerElement + tixi::TixiSaveElements(tixiHandle, xpath + "/classDividerElement", m_classDividerElements); + + } + + const std::vector>& CPACSClassDividerElements::GetClassDividerElements() const + { + return m_classDividerElements; + } + + std::vector>& CPACSClassDividerElements::GetClassDividerElements() + { + return m_classDividerElements; + } + + CPACSDeckElementBase& CPACSClassDividerElements::AddClassDividerElement() + { + m_classDividerElements.push_back(make_unique(this, m_uidMgr)); + return *m_classDividerElements.back(); + } + + void CPACSClassDividerElements::RemoveClassDividerElement(CPACSDeckElementBase& ref) + { + for (std::size_t i = 0; i < m_classDividerElements.size(); i++) { + if (m_classDividerElements[i].get() == &ref) { + m_classDividerElements.erase(m_classDividerElements.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSClassDividerElements.h b/src/generated/CPACSClassDividerElements.h new file mode 100644 index 000000000..26486c241 --- /dev/null +++ b/src/generated/CPACSClassDividerElements.h @@ -0,0 +1,90 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSDeckElementBase; + class CPACSDeckElements; + + // This class is used in: + // CPACSDeckElements + + /// @brief Class divider + /// + /// Class divider element collection type + /// + class CPACSClassDividerElements + { + public: + TIGL_EXPORT CPACSClassDividerElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSClassDividerElements(); + + TIGL_EXPORT CPACSDeckElements* GetParent(); + + TIGL_EXPORT const CPACSDeckElements* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetClassDividerElements() const; + TIGL_EXPORT virtual std::vector>& GetClassDividerElements(); + + TIGL_EXPORT virtual CPACSDeckElementBase& AddClassDividerElement(); + TIGL_EXPORT virtual void RemoveClassDividerElement(CPACSDeckElementBase& ref); + + protected: + CPACSDeckElements* m_parent; + + CTiglUIDManager* m_uidMgr; + + /// Class divider element for use in the decks + std::vector> m_classDividerElements; + + private: + CPACSClassDividerElements(const CPACSClassDividerElements&) = delete; + CPACSClassDividerElements& operator=(const CPACSClassDividerElements&) = delete; + + CPACSClassDividerElements(CPACSClassDividerElements&&) = delete; + CPACSClassDividerElements& operator=(CPACSClassDividerElements&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSClassDividerElements = generated::CPACSClassDividerElements; +using CCPACSDeckElementBase = generated::CPACSDeckElementBase; +using CCPACSDeckElements = generated::CPACSDeckElements; +} // namespace tigl diff --git a/src/generated/CPACSCpacs.h b/src/generated/CPACSCpacs.h index 0f4a31050..1950cafcb 100644 --- a/src/generated/CPACSCpacs.h +++ b/src/generated/CPACSCpacs.h @@ -36,12 +36,12 @@ namespace generated // This class is used in: /// @brief CPACS root element /// - /// Version V3.3 - /// Date 2020-06-03 + /// Version V3.4 + /// Date 2021-04-20 /// 1. Overview /// The C ommon P arametric A ircraft C onfiguration S cheme (CPACS) is an XML-based data format for describing aircraft configurations and their corresponding data. /// This XML-Schema document ( XSD ) serves two purposes: (1) it defines the CPACS data structure used in the XML file (e.g., aircraft.xml) and - /// (2) it provides the corresponding documentation (see picture below). An XML processor (e.g., Tixi or + /// (2) it provides the corresponding documentation (see picture below). An XML processor (e.g., TiXI https://github.com/DLR-SC/tixi or /// XML tools in Eclipse) parses the XSD and XML files and validates whether the data set defined by the user (or tool) conforms to the given structure defined by the schema. /// @see basicPrinciple /// This documentation explains the elements defined in CPACS and its corresponding data types . @@ -49,20 +49,21 @@ namespace generated /// structure). In addition, the sequence of the elements and their occurrence is documented. /// To link the XML file to the XSD file, the header of the XML file should specify the path of the schema file. /// An example could look like this: - /// + /// <cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + /// xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> /// - /// CPACS is an open source project published by the German Aerospace Center (DLR e.V.). For further information please visit www.cpacs.de. - /// 2. Data hierarchy + /// CPACS is an open source project published by the German Aerospace Center (DLR e.V.) https://www.dlr.de/ . For further information please visit www.cpacs.de https://www.cpacs.de . + /// 2. Data structure /// CPACS data is modeled in a hierarchical structure whose underlying concept follows a top-down description of a system-of-systems which decomposes a generic concept (e.g., an aircraft or rotorcraft ) into a more detailed description of its components. This originates from the conceptual and preliminary design of aircraft, where the level of detail is initially low and continues to increase as the design process progresses. - /// For some concepts within CPACS, however, a bottom-up approach is applied where the components are first defined in detail (sometimes referred to as library ) and then linked within an instantiated higher-level concept. This is advantageous when used multiple times within complex systems, such as engines , which only have to be defined once in order to be referenced several times on the aircraft . The combination of these two methodologies is known as middle-out approach and enables the goal to fully parametrize aeronautical systems. + /// For some concepts within CPACS , however, a bottom-up approach is applied where the components are first defined in detail (sometimes referred to as library ) and then linked within an instantiated higher-level concept. This is advantageous when used multiple times within complex systems, such as engines , which only have to be defined once in order to be referenced several times on the aircraft . The combination of these two methodologies is known as middle-out approach and enables the goal to fully parametrize aeronautical systems. /// @see dataHierarchy /// 3. Coordinate Systems - /// Coordinate systems are a regular cause for ambiguous interpretation of data. In CPACS, the reference coordinate system is the CPACS-coordinate system. This coordinate system is used for most of the data. A single exception is made in order to keep aerodynamic data in an aerodynamic coordinate system. The following paragraphs outline the determination to known coordinate systems. - /// The CPACS coordinate system is the coordinate system identified by TIGL, CPACS's geometric library. It is a right-handed coordinate system. If an aircraft is defined in the CPACS coordinate system it will usually follow the directions listed in the table below. - /// Therefore, the CPACS coordinate system can be confused with the body-fixed coordinate system. While often the CPACS coordinate system and the body-fixed coordinate system overlap, this must not always be true. Several definitions for body-fixed coordinate systems exist (x-axis through nose and tail, x-axis perpendicular to nose plane). For non-symmetric aircraft, body-fixed coordinate systems become even more complicated. Hence, analysis tools should stick to the CPACS-Coordinate system. It remains to the designer to model the geometry accordingly. - /// The CPACS coordinate system does not rotate with flow. Hence, aerodynamic calculations do rotate their flow relative to the CPACS-coordinate system. If not stated explicitly different, e.g. for target lift-coefficients, results are returned in the CPACS coordinate system, i.e. the cfx-coefficient is parallel to the CPACS x-Coordinate, regardless of the way the geometry is defined. - /// The following table gives a "best-practice" advice on how to locate a geometry within CPACS. Different approaches are, of course, valid as well. + /// 3.1. CPACS coordinate system + /// Coordinate systems are a regular cause for ambiguous interpretation of data. In CPACS , the reference coordinate system is the CPACS -coordinate system. This coordinate system is used for most of the data. A single exception is made in order to keep aerodynamic data in an aerodynamic coordinate system. The following paragraphs outline the determination to known coordinate systems. + /// The CPACS coordinate system is the coordinate system identified by TiGL https://dlr-sc.github.io/tigl , CPACS 's geometric library. It is a right-handed coordinate system. If an aircraft is defined in the CPACS coordinate system it will usually follow the directions listed in the table below. + /// Therefore, the CPACS coordinate system can be confused with the body-fixed coordinate system. While often the CPACS coordinate system and the body-fixed coordinate system overlap, this must not always be true. Several definitions for body-fixed coordinate systems exist (x-axis through nose and tail, x-axis perpendicular to nose plane). For non-symmetric aircraft, body-fixed coordinate systems become even more complicated. Hence, analysis tools should stick to the CPACS -Coordinate system. It remains to the designer to model the geometry accordingly. + /// The CPACS coordinate system does not rotate with flow. Hence, aerodynamic calculations do rotate their flow relative to the CPACS -coordinate system. If not stated explicitly different, e.g. for target lift-coefficients, results are returned in the CPACS coordinate system, i.e. the cfx-coefficient is parallel to the CPACS x-Coordinate, regardless of the way the geometry is defined. + /// The following table gives a "best-practice" advice on how to locate a geometry within CPACS . Different approaches are, of course, valid as well. /// Axis Direction Description x tailwards from nose to tail y spanwise from symmetry plane to the right wingtip z upwards from landing gear to tip of vertical tailplane The following figures show an example of a geometry that is aligned with the CPACS coordinate system, i.e. the body-fixed coordinate system corresponds to the CPACS coordinate system. /// @see cosys01 /// The aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. @@ -72,119 +73,155 @@ namespace generated /// The body axes and the CPACS coordinate system do not align. That is, the origin of the geometry is not at CPACS (0,0,0) but at a point in positive x- and z-direction. /// @see cosys2 /// Again, the aerodynamic analysis is relative to the CPACS coordinate system. That is, the angle of attack is represented by the dashed orange line. Results of the aerodynamic calculation are given in the CPACS coordinate system. + /// 3.2. Local coordinate systems via parentUID and transformation + /// Some elements in CPACS , in particular the geometric components, are described in local coordinates. + /// The hierarchical data structure allows to define a local coordinate system either with respect to the coordinate system of the parent element or with respect to the global CPACS coordinate system. + /// This is achieved by combining the two elements parentUID and transformation : + /// parentUID : An individual data hierarchy can be set up using the optional parentUID element. + /// Here it is important that exactly one element does not contain the parentUID in order to identify the top element of this user-specific hierarchy. + /// As soon as the parentUID (which refers to the uID of the parent element) is set, a local coordinate system of the corresponding node is instantiated. + /// transformation : This allows the coordinate system to be transformed via translation , rotation and scaling . + /// As soon as the parentUID is set, this transformation refers to the local coordinate system (in the current CPACS version this only affects translation ). + /// An attribute refType is used to either make this explicit ( refType="absLocal" ) or to override this and reference the global CPACS coordinate system instead ( refType="absGlobal" ). + /// The following table summarizes the possible combinations of parentUID and transformation and the resulting coordinate system (local or global): + /// parentUID not set parentUID set transformation without refType global local transformation with refType="absLocal" global local transformation with refType="absGlobal" global global Note: The combination of transformation with refType="absLocal" and no parentUID is global, because the local coordinate system to which the transformation is referring to via refType equals the global coordinate system (see fuselage in the following example). + /// An exemplary use case further illustrates the concept of the coordinate system hierarchy. + /// The CPACS schema shall not specify in advance that a wing is always be part of the fuselage and engines must always be part of the wing. + /// In other cases the engine could be attached to the fuselage, which would not be possible via a predefined XML tree. + /// The following figure shows how components of the aircraft are related to each other via the parentUID . + /// The fairing is a child of the wing and is therefore automatically translated when the wing is translated. + /// Likewise, the horizontal tailplane is a part of the vertical tailplane and is therefore affected by translation of the latter: + /// @see parentUID_transformations /// 4. Units - /// There are no explicit attributes describing units in CPACS. The general convention is that all values must be given in the following SI-units: - /// [m] Position, Distance [m^2] Area [m^3] Volume [kg] Mass [s] Time [K] Temperature or in derived units, e.g.: + /// There are no explicit attributes describing units in CPACS . The general convention is that all values must be given in the following SI-units: + /// [m] Position, Distance [m 2 ] Area [m 3 ] Volume [kg] Mass [s] Time [K] Temperature or in derived units, e.g.: /// [N] Force [Nm] Moment [W] Power [J] Energy The only non SI unit used throughout CPACS is the angle in degrees [°]. /// For the sake of an intuitive use the angles are given in degrees rather than in radian [rad]. /// [°] Angle 5. Splitting up a CPACS dataset into several files /// To provide a better overview, it is possible to split up a CPACS dataset into several files. This can be done by inserting an node at an arbitrary position into the datatset. This node contains a node with a URI to the external file(s), followed by one or more nodes, containing each a name of a file to be included at that position. Below, an example of such external data is given: /// - /// - /// - /// - /// - /// - /// - /// file:://airfoils - /// NACA0010.xml - /// NACA2412.xml - /// - /// - /// NACA 0012 Airfoil - /// ... - /// - /// - /// - /// - /// + /// <?xml version="1.0" encoding="utf-8"?> + /// <cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + /// xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> + /// <vehicles> + /// <profiles> + /// <wingAirfoils> + /// <externaldata> + /// <path>file:://airfoils</path> + /// <filename>NACA0010.xml</filename> + /// <filename>NACA2412.xml</filename> + /// </externaldata> + /// <airfoil uID="NACA0012"> + /// <name>NACA 0012 Airfoil</name> + /// <pointList>...</pointList> + /// </airfoil> + /// </wingAirfoils> + /// </profiles> + /// </vehicles> + /// <cpacs> /// Such an external file would look like: /// - /// - /// - /// NACA 0010 Airfoil - /// ... - /// - /// The file would be included completely, except for its title line . This concept can also be used recursively (external files of external files), then it is important to prevent circle connections (file "A" loading file "B" loading file "C" loading again file "A" ...). + /// <?xml version="1.0" encoding="utf-8"?> + /// <airfoil uID="NACA0010"> + /// <name>NACA 0010 Airfoil</name> + /// <pointList>...</pointList> + /// </airfoil> + /// The file would be included completely, except for its title line . This concept can also be used recursively (external files of external files), but it is important to prevent circle connections (file "A" loading file "B" loading file "C" loading again file "A" ...). /// For path URI addresses, the trailing file separator "/" may be omitted. Below, some examples for path URIs are given: - /// Absolute local path: "file:///tmp" or "file:///c:/windows/tmp" Relative local direcotry: "file://relativeDirectory" or "file://../anotherRelativeDirectory" Remote net ressource: "http://www.someurl.de" A CPACS dataset with external files, being loaded by a special library like the TI VA X ML I nterface TIXI , shall collect all its external datafiles and build up a single tree from them. A validation against this schema is only possible for such a single tree file; the nodes are not recognized by it. To preserve the information, necessary to split the file up into external files again later, externaldata information is maintained within three attributes of the former external top node: - /// externalFileName - Name of the file where the external data shall be saved externalDataDirectory - Directory of the external data file. Its content is analogous to the 's node described above. externalDataNodePath - XPATH of the node which is replaced with the content of the external file. In case that it is an external file of an external file, then it is the XPATH in the outer external file. If, e.g., in the example above the node would have also been loaded from an external file, then the entry would just be: externalDataNodePath="/airfoil". This is used primarily for loop-detection. The single tree for the example above would look like: + /// Absolute local path: file:///tmp or file:///c:/windows/tmp Relative local direcotry: file://relativeDirectory or file://../anotherRelativeDirectory Remote net ressource: http://www.someurl.de With the help of the Ti XI X ML I nterface TiXI https://github.com/DLR-SC/tixi , a CPACS dataset that is split into multiple files can be reassembled into a single tree structure for subsequent validation against the CPACS schema. The following commands are used to link external data sets: + /// : Name of the external data file : Directory of the external data file. Its content is analogous to the externaldata 's path -element described above. : XPath https://www.w3schools.com/xml/xpath_intro.asp of the node which is replaced with the content of the external file. In case that it is an external file of an external file, then it is the XPath in the outer external file. If, e.g., in the example above the pointList element would have also been loaded from an external file, then the entry would just be: externalDataNodePath="/airfoil" . This is used primarily for loop-detection. The merged data tree for the example above would look like: /// - /// - /// - /// - /// - /// - /// - /// NACA 0010 Airfoil - /// ... - /// + /// <?xml version="1.0" encoding="utf-8"?> + /// <cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + /// xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd"> + /// <vehicles> + /// <profiles> + /// <wingAirfoils> + /// <airfoil uID="NACA0010" externalFileName="NACA0010.xml" externalDataDirectory="file://airfoils" externalDataNodePath="/cpacs/vehicles/profiles/wingAirfoils"> + /// <name>NACA 0010 Airfoil</name> + /// <pointList>...</pointList> + /// </airfoil> /// ... - /// - /// NACA 0012 Airfoil - /// ... - /// - /// - /// - /// - /// + /// <airfoil uID="NACA0012"> + /// <name>NACA 0012 Airfoil</name> + /// <pointList>...</pointList> + /// </airfoil> + /// </wingAirfoils> + /// </profiles> + /// </vehicles> + /// <cpacs> /// 6. UIDs and references /// The CPACS -dataset often uses references between nodes. Typically, these /// references define connections between elements which are located somewhere else in the hierarchical dataset (e.g. a wing is connected to a fuselage ; a specific engine is connected to a pylon ; etc.). These connections are defined by unique identifiers (uID) which are specified as attributes. Thus, there are elements which can be referenced via a uID attribute, e.g. a fuselage: - /// ... + /// <fuselage uID="ATTAS_fuselage">... /// /// as well as elements which refer to the former, e.g. a wing pointing to its geometrical parent: - /// - /// ATTAS main wing - /// ATTAS_fuselage + /// <wing uID="e382bf5j"> + /// <name>ATTAS main wing</name> + /// <parentUID isLink="True">ATTAS_fuselage</parentUID> /// ... - /// Such referencing elements must carry the isLink="True" attribute. - /// Since uIDs are only used to link nodes within the XML file, no naming convention is required. UIDs, however, must be unique! Although a common practice for naming uIDs is their position in the data hierarchy (e.g. uID="mainWingSection3" ), - /// uIDs as shown in the above example are absolutely valid as well. It is therefore recommended to use the name element + /// + /// In previous CPACS versions, referencing elements were identified via the isLink="True" attribute. Since this is superfluous due to the explicit definition of the element properties via the CPACS schema, this attribute no longer needs to be listed. It is nevertheless a valid optional attribute to ensure compatibility with older datasets, but might be removed in future versions. + /// Since uID s are only used to link nodes within the XML file, no naming convention is required. The characters only have to conform to the conventions of the xsd:ID http://books.xmlschemata.org/relaxng/ch19-77151.html type standardized by the W3C https://www.w3.org/ . UIDs, however, must be unique! Although a common practice for naming uID s is their position in the data hierarchy (e.g. uID="mainWingSection3" ), uID s as shown in the above example are absolutely valid as well. It is therefore recommended to use the name element /// to convey human-readable meanings. - /// 7. Symmetry - /// Sometimes it might be useful to specify a part of the aircraft as symmetric instead of holding all the data twice in nearly identical form in the dataset (e.g. left and right wing are usually identical, except for the sign of the y-coordinate). Hence, some parts offer the option to set a symmetry attribute for them, like: + /// 7. Usage of name , description and uID + /// CPACS is designed to serve as a central data exchange format in fully automated process chains. + /// A key requirement is therefore that tools can automatically read and process an incoming CPACS file. + /// A second requirement is that users can interpret the data set. + /// To address both requirements, the following usage of the name and description elements in combination with the uID attribute is proposed: + /// name : A specification of the name element is usually mandatory for sequences of elements (e.g., if max occurence is unbounded [1..*] ). + /// Typical examples are wings/wing , aeroPerformance/aeroMap or missions/mission . + /// Such elements must be able to be listed by tools, especially for visualization and reporting purposes, where the name element serves as a concise and human-readable indicator of the actual meaning of the corresponding element in the list (e.g., which wing , which aeroMap , which mission ). + /// This is usually a single word or a small number of words. + /// description : This element is usually optional and is used to add comprehensive and human-readable explanations. This is usually at least one explanatory sentence. + /// uID : As described in more detail in Section 6, the uID attribute is mainly used for internal referencing of CPACS elements. + /// Further processing software, e.g. TiXI and TiGL , also use the uID s to improve the robustness of the data query. + /// Consequently, the uID attribute serves as a machine-readable indicator and does not claim to be interpretable by human users. + /// In some practical use cases, the same string is chosen for uID and name . + /// However, restrictions on the choice of characters for the uID attribute must be considered, for example that no spaces may be used and the uID must be unique. /// - /// ... - /// This attribute explains that the whole part with all its subnodes is symmetric to the given plane. Possible planes are: x-y-plane x-z-plane y-z-plane none inherit By default, the symmetry of a component is inherited from its parent. If e.g. a wing is symmetrically defined, a pylon will also have a symmetry by default. - /// This symmetry inheritance can be broken, by explicitly deleting the symmetry with symmetry="none". - /// UIDs, references and symmetry - /// All nodes, e.g. parentUID, in CPACS that refer to a component that holds symmetry attribute, e.g. wing, have to carry the symmetry attribute as well. - /// The symmetry attribute may take three values: symm, def, full: def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) + /// <wing uID="main_wing"> + /// <name>Main wing</name> + /// <description>This is the main wing which was designed by my awesome wing sizing design tool. Your tool should not try to read and interpret what I'm writing here as typos are not recognized by XML processors.</description> + /// </wing> + /// 8. Symmetry + /// 8.1. Specification of symmetric elements + /// Sometimes it might be useful to specify a part of the aircraft as symmetric instead of holding all the data twice in nearly identical form in the dataset (e.g. left and right wing are usually identical, except for the sign of the y-coordinate). + /// Hence, some parts offer the option to set a symmetry attribute: /// - /// - /// ... - /// - /// - /// ... - /// In the example above, to refer to the "other" side of the wing on must use the definition as such: + /// <wing symmetry="x-z-plane"> + /// There are six possible attribute values: x-y-plane : Symmetry w.r.t. the x-y plane of the CPACS coordinate system x-z-plane : Symmetry w.r.t. the x-z plane of the CPACS coordinate system y-z-plane : Symmetry w.r.t. the y-z plane of the CPACS coordinate system inherit : Symmetry inherited from parent element (default behavior, i.e. also applies if attribute not set) Note : It must be taken from the documentation of the respective element which of these attribute values may be set. + /// One example of how to apply the symmetry attribute is shown in Sec. 3.2. Another simplified example shown below illustrates the combination of different symmetry properties of 4 wings: + /// @see symmetry1 + /// Wing 1 is mirrored on the x-z plane. Wing 2 has wing 1 as parent element, but suppresses its symmetry inheritance. Wing 3 has wing 2 as parent element and sets a new symmetry at the x-y plane. Wing 4 has wing 3 as parent element and no symmetry attribute specified. Thus, it inherits the symmetry at the x-y plane from wing 3. Note : The corresponding transformations are not shown here. + /// 8.2. Referencing symmetric elements + /// All nodes (e.g., parentUID ) in CPACS that refer to a component holding the symmetry attribute (e.g., wing) might also have a symmetry attribute to specify how symmetry is propagated through the resulting element hierarchy. + /// The symmetry attribute of a referencing element may take three values: symm , def , full : def: The element refers to the geometric component that has a symmetry attribute and refers only to the defined side of the geometric component. symm: The element refers to the geometric component that has a symmetry attribute and refers only to the symmetric side of the geometric component. (Similar to the previous _symm solution) full: The element refers to the geometric component that has a symmetry attribute and refers to the complete component. (This is the default behaviour) + /// @see symmetry2 + /// For example, to refer to the "other" side of a mirrored wing the following the following syntax might be used: /// - /// - /// ... - /// - /// - /// ATTAS_main_wing_inner_segment - /// ... - /// 8. Vectors and arrays + /// <enginePylons> + /// <enginePylon uID="pylon"> + /// <parentUID symmetry="symm">wing</parentUID> + /// Note: This feature is not implemented in TiGL. The upper figure is manually processed to illustrate the principle. In addition, there is an ongoing debate whether the approach is suitable for CPACS due to rapidly increasing complexity and unresolved implicit assumptions as to whether it is one or two components after mirroring. Therefore, it is advised to avoid using the symmetry attribute if possible. + /// 9. Vectors and arrays /// For large data sets (e.g. increments of aerodynamic coefficients due to control surface deflections) it is advantageous /// to map them via vectors and arrays instead of using a sequence of nodes for each data value. Therefore vectors and arrays are defined as semicolon-separated lists in CPACS . Via the documentation (derived from the XSD) of the corresponding nodes it has to be checked whether it is a vector or an array. Vector The vector is meant as a one-dimensional-array. In such a node, the values are given in a semicolon separated list: /// - /// 0.;1.5;3.;4.5;6;7.5;9. + /// <angleOfAttack>0.;1.5;3.;4.5;6;7.5;9.</angleOfAttack> /// Array As for vectors, multi-dimensional arrays provide values in a semicolon separated list. An array is always preceded by a sequence of vectors, containing the dimensions and index values. Which vectors of an array are dimensioning is specified in the respective documentation of the array. /// - /// 1000.;2000.;3000. - /// - /// - /// InnerWingFlap - /// -1;-0.5;0;1 - /// - /// 11.;12.;13.;14.;21.;22.;23.;24.;31.;32.;33.;34. + /// <altitude>1000.;2000.;3000.</altitude> <!-- vector element --> + /// <incrementMaps> + /// <incrementMap uID="incMap_b3ac2"> + /// <controlSurfaceUID>InnerWingFlap</controlSurfaceUID> + /// <controlParameters>-1;-0.5;0;1</controlParameters> <!-- vector element --> + /// <!-- array of dimension length(altitude) x length(controlParameters): --> + /// <dcl>11.;12.;13.;14.;21.;22.;23.;24.;31.;32.;33.;34.</dcl> /// Values for cl increments: /// Control parameter = -1 Control parameter = -0.5 Control parameter = 0 Control parameter = 1 Altitude = 1000m 11. 12. 13. 14. Altitude = 2000m 21. 22. 23. 24. Altitude = 3000m 31. 32. 33. 34. /// - /// 9. Control Parameters + /// 10. Control Parameters /// Control parameters are abstract parameters, linking a generic floating point value to a certain status of a control device /// (e.g. control surface, landing gear, suction system, brake parachute, ...). For control surfaces, such a data pair (control parameter /// and control surface deflection status) is called a and the ordered list of all steps for a control surface forms its deflection @@ -197,42 +234,44 @@ namespace generated /// a single definition. Deflection values between two specified steps are handled by linear interpolation. /// The following example shows the usage of control parameters within a control surface deflection path definition: /// - /// - /// - /// + /// <controlSurfaces> + /// <trailingEdgeDevices> + /// <trailingEdgeDevice uID="InnerWingFlap"> /// ... - /// + /// <path> /// ... - /// - /// - /// -1 - /// -20. - /// - /// - /// -0.5 - /// -10. - /// - /// - /// 0 - /// 0. - /// - /// - /// 1 - /// 5. - /// - /// + /// <steps> + /// <step> + /// <controlParameter>-1</controlParameter> + /// <hingeLineRotation>-20.</hingeLineRotation> + /// </step> + /// <step> + /// <controlParameter>-0.5</controlParameter> + /// <hingeLineRotation>-10.</hingeLineRotation> + /// </step> + /// <step> + /// <controlParameter>0</controlParameter> + /// <hingeLineRotation>0.</hingeLineRotation> + /// </step> + /// <step> + /// <controlParameter>1</controlParameter> + /// <hingeLineRotation>5.</hingeLineRotation> + /// </step> + /// </steps> /// ... - /// 10. Atmosphere - /// At some places in CPACS, an atmosphere has to be selected (e.g. for connecting an altitude with a certain pressure or density). + /// 11. Atmosphere + /// At some places in CPACS , an atmosphere has to be selected (e.g. for connecting an altitude with a certain pressure or density). /// Currently, CPACS does only support a single atmospheric model: The ICAO Standard Atmosphere (ISA) from 1993 (see ICAO Doc 7488/3 'MANUAL OF THE ICAO STANDARD ATMOSPHERE', third edition, 1993) /// It covers temperature, pressure, density, speed of sound, dynamic viscosity and kinematic viscosity with respect to altitude. - /// In CPACS, 'altitude' means what is called 'geopotential altitude' (H) in the ISA reference document and is given in [m]. + /// In CPACS , 'altitude' means what is called 'geopotential altitude' (H) in the ISA reference document and is given in [m]. /// For details, see ISA manual, section 2.3, page E-viii f. /// ISA covers a range from -5000 m to 80000 m. /// Temperature offsets are introduced on top of the definitions in the ISA manual (which does not cover such variations). The offset model /// is based upon the idea that the pressure at a fixed geopotential altitude is independent from temperature offset (pressure altitude). /// The temperature offset changes only the density (following rho = p / Gas Constant / T) (and viscosity, of course) - /// CPACS 3.3 + /// CPACS 3.4 + /// Release in April 2022 + /// Revision of decks definition ( compatibility break ) Mass breakdown: add mSparSkins and mSparCells to mSpar Mass breakdown: fix hierarchical error in mMiscellaneous ( compatibility break ) Mass breakdown: fix typo in mPylon ( compatibility break ) Nacelle guide curves: set description optional Mission definition: add uID to elements in geographicPointConstraintType Mission definition: add powerFraction , powerRemaining and powerConsumed to missionSegmentEndConditionType Mission definition: rename referenceEndCondition to referenceEndConditionUID in constraintSettingsType ( compatibility break ) Mission definition: rename reqClassification to requirementClassification in flightPerformanceRequirementType ( compatibility break ) Add contour coordinates for cell definition Add vehicle independent node for external geometry Remove paxFlow element from aircraftAnalysesType ( compatibility break ) Docs: improve documentation of name , description and uID usage Docs: add description of parentUID concept Docs: add description of symmetry inheritance Docs: add description of engine nacelles Docs: add description of mission definition General improvements of the documentation CPACS 3.3 /// Release in June 2021 /// Revision of the mission definition including parameter lapses within segments ( compatibility break ) Revision of the point performance definition ( compatibility break ) Revision of performance requirements ( compatibility break ) Revision of landing gears ( compatibility break ) Revision of control surface tracks definition ( compatibility break ) Load analysis: Revision of flightLoadCasesType ( compatibility break ) Load analysis: Revision of aeroCasesType ( compatibility break ) Load analysis: loadEnvelopesType relocated and envelope simplified to a single uID-Sequence ( compatibility break ) Load analysis: Replaced dynamicAircraftModel elements by loadApplicationPointSets ( compatibility break ) Flight dynamics: Group flightPerformance, flyingQualities and trim under flightDynamics parent node ( compatibility break ) Introduced a configuration node to describe aircraft and payload configurations Fuselage profiles: Introduced rectangle and super ellipse as standard profiles Fuselage profiles: Added vector to specify curve parameters for profiles with kinks Internal structure: Added standard profiles to profile based structural elements Internal structure: Added ribPosts element to wingRibCrossSectionType Internal structure: Upper and lowerCap now optional in sparCellType Internal structure: Stringers and frames can reference sections MassBreakdown: Set mass inertia Jxy, Jxz and Jyz optional MassBreakdown: Added mMiscellaneous element MassBreakdown: Added fuselage walls Added flight envelope to aircraft global element Added new base types: doubleVectorBaseType, posIntVectorBaseType, doubleArrayBaseType Added 'none' and 'inherit' to list of symmetry flags Set mapType attribute of vector and array elements to optional (requires TiXI>=3.1) AeroMaps: Defined angleOfSideslip as input and added distinction between minimum and maximum angleOfAttack in aeroLimitMaps ( compatibility break ) AeroMaps: Added missing singular incrementMap element to incrementMaps in aeroLimitsMap ( compatibility break ) AeroMaps: Adopted the camelCase style for damping derivatives ( compatibility break ) Introduced common nomenclature for speeds and altitudes ( compatibility break ) Control distributors are set to optional Added instructions for superposition of control surface deflections Further elaboration of development standards General improvements of the documentation CPACS 3.2 /// Release in February 2020 diff --git a/src/generated/CPACSDeckComponent2DBase.cpp b/src/generated/CPACSDeckComponent2DBase.cpp new file mode 100644 index 000000000..2d3715914 --- /dev/null +++ b/src/generated/CPACSDeckComponent2DBase.cpp @@ -0,0 +1,313 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSDeckComponent2DBase.h" +#include "CPACSSeatModules.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSDeckComponent2DBase::CPACSDeckComponent2DBase(CPACSSeatModules* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSDeckComponent2DBase::~CPACSDeckComponent2DBase() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + if (m_uidMgr) { + if (!m_deckElementUID.empty()) m_uidMgr->TryUnregisterReference(m_deckElementUID, *this); + } + } + + const CPACSSeatModules* CPACSDeckComponent2DBase::GetParent() const + { + return m_parent; + } + + CPACSSeatModules* CPACSDeckComponent2DBase::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSDeckComponent2DBase::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSDeckComponent2DBase::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSDeckComponent2DBase::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSDeckComponent2DBase::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSDeckComponent2DBase::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element name + if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { + m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); + if (m_name.empty()) { + LOG(WARNING) << "Required element name is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required element name is missing at xpath " << xpath; + } + + // read element description + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; + } + } + + // read element deckElementUID + if (tixi::TixiCheckElement(tixiHandle, xpath + "/deckElementUID")) { + m_deckElementUID = tixi::TixiGetElement(tixiHandle, xpath + "/deckElementUID"); + if (m_deckElementUID.empty()) { + LOG(WARNING) << "Required element deckElementUID is empty at xpath " << xpath; + } + if (m_uidMgr && !m_deckElementUID.empty()) m_uidMgr->RegisterReference(m_deckElementUID, *this); + } + else { + LOG(ERROR) << "Required element deckElementUID is missing at xpath " << xpath; + } + + // read element structuralMounts + if (tixi::TixiCheckElement(tixiHandle, xpath + "/structuralMounts")) { + m_structuralMounts = boost::in_place(this, m_uidMgr); + try { + m_structuralMounts->ReadCPACS(tixiHandle, xpath + "/structuralMounts"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read structuralMounts at xpath " << xpath << ": " << e.what(); + m_structuralMounts = boost::none; + } + } + + // read element transformation + if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { + m_transformation = boost::in_place(this, m_uidMgr); + try { + m_transformation->ReadCPACS(tixiHandle, xpath + "/transformation"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read transformation at xpath " << xpath << ": " << e.what(); + m_transformation = boost::none; + } + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + } + + void CPACSDeckComponent2DBase::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element name + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/name"); + tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); + + // write element description + if (m_description) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description"); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } + + // write element deckElementUID + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deckElementUID"); + tixi::TixiSaveElement(tixiHandle, xpath + "/deckElementUID", m_deckElementUID); + + // write element structuralMounts + if (m_structuralMounts) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/structuralMounts"); + m_structuralMounts->WriteCPACS(tixiHandle, xpath + "/structuralMounts"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/structuralMounts")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/structuralMounts"); + } + } + + // write element transformation + if (m_transformation) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/transformation"); + m_transformation->WriteCPACS(tixiHandle, xpath + "/transformation"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/transformation"); + } + } + + } + + const std::string& CPACSDeckComponent2DBase::GetUID() const + { + return m_uID; + } + + void CPACSDeckComponent2DBase::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const std::string& CPACSDeckComponent2DBase::GetName() const + { + return m_name; + } + + void CPACSDeckComponent2DBase::SetName(const std::string& value) + { + m_name = value; + } + + const boost::optional& CPACSDeckComponent2DBase::GetDescription() const + { + return m_description; + } + + void CPACSDeckComponent2DBase::SetDescription(const boost::optional& value) + { + m_description = value; + } + + const std::string& CPACSDeckComponent2DBase::GetDeckElementUID() const + { + return m_deckElementUID; + } + + void CPACSDeckComponent2DBase::SetDeckElementUID(const std::string& value) + { + if (m_uidMgr) { + if (!m_deckElementUID.empty()) m_uidMgr->TryUnregisterReference(m_deckElementUID, *this); + if (!value.empty()) m_uidMgr->RegisterReference(value, *this); + } + m_deckElementUID = value; + } + + const boost::optional& CPACSDeckComponent2DBase::GetStructuralMounts() const + { + return m_structuralMounts; + } + + boost::optional& CPACSDeckComponent2DBase::GetStructuralMounts() + { + return m_structuralMounts; + } + + const boost::optional& CPACSDeckComponent2DBase::GetTransformation() const + { + return m_transformation; + } + + boost::optional& CPACSDeckComponent2DBase::GetTransformation() + { + return m_transformation; + } + + CPACSDeckStructuralMounts& CPACSDeckComponent2DBase::GetStructuralMounts(CreateIfNotExistsTag) + { + if (!m_structuralMounts) + m_structuralMounts = boost::in_place(this, m_uidMgr); + return *m_structuralMounts; + } + + void CPACSDeckComponent2DBase::RemoveStructuralMounts() + { + m_structuralMounts = boost::none; + } + + CPACSTransformation2D& CPACSDeckComponent2DBase::GetTransformation(CreateIfNotExistsTag) + { + if (!m_transformation) + m_transformation = boost::in_place(this, m_uidMgr); + return *m_transformation; + } + + void CPACSDeckComponent2DBase::RemoveTransformation() + { + m_transformation = boost::none; + } + + const CTiglUIDObject* CPACSDeckComponent2DBase::GetNextUIDObject() const + { + return this; + } + + void CPACSDeckComponent2DBase::NotifyUIDChange(const std::string& oldUid, const std::string& newUid) + { + if (m_deckElementUID == oldUid) { + m_deckElementUID = newUid; + } + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSDeckComponent2DBase.h b/src/generated/CPACSDeckComponent2DBase.h new file mode 100644 index 000000000..c6b7ea9b6 --- /dev/null +++ b/src/generated/CPACSDeckComponent2DBase.h @@ -0,0 +1,124 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include +#include "CPACSDeckStructuralMounts.h" +#include "CPACSTransformation2D.h" +#include "CreateIfNotExists.h" +#include "CTiglUIDObject.h" +#include "ITiglUIDRefObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; + +namespace generated +{ + class CPACSSeatModules; + + // This class is used in: + // CPACSSeatModules + + /// @brief Deck component + /// + /// + class CPACSDeckComponent2DBase : public CTiglReqUIDObject, public ITiglUIDRefObject + { + public: + TIGL_EXPORT CPACSDeckComponent2DBase(CPACSSeatModules* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSDeckComponent2DBase(); + + TIGL_EXPORT CPACSSeatModules* GetParent(); + + TIGL_EXPORT const CPACSSeatModules* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const std::string& GetName() const; + TIGL_EXPORT virtual void SetName(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + + TIGL_EXPORT virtual const std::string& GetDeckElementUID() const; + TIGL_EXPORT virtual void SetDeckElementUID(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetStructuralMounts() const; + TIGL_EXPORT virtual boost::optional& GetStructuralMounts(); + + TIGL_EXPORT virtual const boost::optional& GetTransformation() const; + TIGL_EXPORT virtual boost::optional& GetTransformation(); + + TIGL_EXPORT virtual CPACSDeckStructuralMounts& GetStructuralMounts(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveStructuralMounts(); + + TIGL_EXPORT virtual CPACSTransformation2D& GetTransformation(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveTransformation(); + + protected: + CPACSSeatModules* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + /// Name + std::string m_name; + + /// Description + boost::optional m_description; + + /// UID of the corresponding element in the cpacs/vehicles/deckElemets node + std::string m_deckElementUID; + + boost::optional m_structuralMounts; + + boost::optional m_transformation; + + private: + TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; + TIGL_EXPORT void NotifyUIDChange(const std::string& oldUid, const std::string& newUid) final; + + CPACSDeckComponent2DBase(const CPACSDeckComponent2DBase&) = delete; + CPACSDeckComponent2DBase& operator=(const CPACSDeckComponent2DBase&) = delete; + + CPACSDeckComponent2DBase(CPACSDeckComponent2DBase&&) = delete; + CPACSDeckComponent2DBase& operator=(CPACSDeckComponent2DBase&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSDeckComponent2DBase = generated::CPACSDeckComponent2DBase; +using CCPACSSeatModules = generated::CPACSSeatModules; +} // namespace tigl diff --git a/src/generated/CPACSDeckElementBase.cpp b/src/generated/CPACSDeckElementBase.cpp new file mode 100644 index 000000000..bb331bb80 --- /dev/null +++ b/src/generated/CPACSDeckElementBase.cpp @@ -0,0 +1,297 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSCeilingPanelElements.h" +#include "CPACSClassDividerElements.h" +#include "CPACSDeckElementBase.h" +#include "CPACSGenericFloorElements.h" +#include "CPACSLavatoryElements.h" +#include "CPACSLuggageCompartmentElements.h" +#include "CPACSSidewallPanelElements.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSDeckElementBase::CPACSDeckElementBase(CPACSCeilingPanelElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_geometry(this, m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSCeilingPanelElements); + } + + CPACSDeckElementBase::CPACSDeckElementBase(CPACSClassDividerElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_geometry(this, m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSClassDividerElements); + } + + CPACSDeckElementBase::CPACSDeckElementBase(CPACSGenericFloorElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_geometry(this, m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSGenericFloorElements); + } + + CPACSDeckElementBase::CPACSDeckElementBase(CPACSLavatoryElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_geometry(this, m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSLavatoryElements); + } + + CPACSDeckElementBase::CPACSDeckElementBase(CPACSLuggageCompartmentElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_geometry(this, m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSLuggageCompartmentElements); + } + + CPACSDeckElementBase::CPACSDeckElementBase(CPACSSidewallPanelElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_geometry(this, m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSSidewallPanelElements); + } + + CPACSDeckElementBase::~CPACSDeckElementBase() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + } + + const CTiglUIDObject* CPACSDeckElementBase::GetNextUIDParent() const + { + if (m_parent) { + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + } + return nullptr; + } + + CTiglUIDObject* CPACSDeckElementBase::GetNextUIDParent() + { + if (m_parent) { + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + } + return nullptr; + } + + CTiglUIDManager& CPACSDeckElementBase::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSDeckElementBase::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSDeckElementBase::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element description + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; + } + } + + // read element geometry + if (tixi::TixiCheckElement(tixiHandle, xpath + "/geometry")) { + m_geometry.ReadCPACS(tixiHandle, xpath + "/geometry"); + } + else { + LOG(ERROR) << "Required element geometry is missing at xpath " << xpath; + } + + // read element mass + if (tixi::TixiCheckElement(tixiHandle, xpath + "/mass")) { + m_mass = boost::in_place(this, m_uidMgr); + try { + m_mass->ReadCPACS(tixiHandle, xpath + "/mass"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read mass at xpath " << xpath << ": " << e.what(); + m_mass = boost::none; + } + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + } + + void CPACSDeckElementBase::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element description + if (m_description) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description"); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } + + // write element geometry + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/geometry"); + m_geometry.WriteCPACS(tixiHandle, xpath + "/geometry"); + + // write element mass + if (m_mass) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/mass"); + m_mass->WriteCPACS(tixiHandle, xpath + "/mass"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/mass")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/mass"); + } + } + + } + + const std::string& CPACSDeckElementBase::GetUID() const + { + return m_uID; + } + + void CPACSDeckElementBase::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const boost::optional& CPACSDeckElementBase::GetDescription() const + { + return m_description; + } + + void CPACSDeckElementBase::SetDescription(const boost::optional& value) + { + m_description = value; + } + + const CPACSDeckElementGeometry& CPACSDeckElementBase::GetGeometry() const + { + return m_geometry; + } + + CPACSDeckElementGeometry& CPACSDeckElementBase::GetGeometry() + { + return m_geometry; + } + + const boost::optional& CPACSDeckElementBase::GetMass() const + { + return m_mass; + } + + boost::optional& CPACSDeckElementBase::GetMass() + { + return m_mass; + } + + CPACSDeckElementMass& CPACSDeckElementBase::GetMass(CreateIfNotExistsTag) + { + if (!m_mass) + m_mass = boost::in_place(this, m_uidMgr); + return *m_mass; + } + + void CPACSDeckElementBase::RemoveMass() + { + m_mass = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSDeckElementBase.h b/src/generated/CPACSDeckElementBase.h new file mode 100644 index 000000000..858f8d94f --- /dev/null +++ b/src/generated/CPACSDeckElementBase.h @@ -0,0 +1,150 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include +#include +#include "CPACSDeckElementGeometry.h" +#include "CPACSDeckElementMass.h" +#include "CreateIfNotExists.h" +#include "CTiglError.h" +#include "CTiglUIDObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; + +namespace generated +{ + class CPACSCeilingPanelElements; + class CPACSClassDividerElements; + class CPACSGenericFloorElements; + class CPACSLavatoryElements; + class CPACSLuggageCompartmentElements; + class CPACSSidewallPanelElements; + + // This class is used in: + // CPACSCeilingPanelElements + // CPACSClassDividerElements + // CPACSGenericFloorElements + // CPACSLavatoryElements + // CPACSLuggageCompartmentElements + // CPACSSidewallPanelElements + + /// @brief Deck element + /// + /// + class CPACSDeckElementBase : public CTiglReqUIDObject + { + public: + TIGL_EXPORT CPACSDeckElementBase(CPACSCeilingPanelElements* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSDeckElementBase(CPACSClassDividerElements* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSDeckElementBase(CPACSGenericFloorElements* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSDeckElementBase(CPACSLavatoryElements* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSDeckElementBase(CPACSLuggageCompartmentElements* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSDeckElementBase(CPACSSidewallPanelElements* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSDeckElementBase(); + + template + bool IsParent() const + { + return m_parentType != NULL && *m_parentType == typeid(P); + } + + template + P* GetParent() + { + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSDeckElementBase"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + template + const P* GetParent() const + { + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSDeckElementBase"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + + TIGL_EXPORT virtual const CPACSDeckElementGeometry& GetGeometry() const; + TIGL_EXPORT virtual CPACSDeckElementGeometry& GetGeometry(); + + TIGL_EXPORT virtual const boost::optional& GetMass() const; + TIGL_EXPORT virtual boost::optional& GetMass(); + + TIGL_EXPORT virtual CPACSDeckElementMass& GetMass(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveMass(); + + protected: + void* m_parent; + const std::type_info* m_parentType; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + /// Description + boost::optional m_description; + + CPACSDeckElementGeometry m_geometry; + + boost::optional m_mass; + + private: + CPACSDeckElementBase(const CPACSDeckElementBase&) = delete; + CPACSDeckElementBase& operator=(const CPACSDeckElementBase&) = delete; + + CPACSDeckElementBase(CPACSDeckElementBase&&) = delete; + CPACSDeckElementBase& operator=(CPACSDeckElementBase&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSDeckElementBase = generated::CPACSDeckElementBase; +using CCPACSCeilingPanelElements = generated::CPACSCeilingPanelElements; +using CCPACSClassDividerElements = generated::CPACSClassDividerElements; +using CCPACSGenericFloorElements = generated::CPACSGenericFloorElements; +using CCPACSLavatoryElements = generated::CPACSLavatoryElements; +using CCPACSLuggageCompartmentElements = generated::CPACSLuggageCompartmentElements; +using CCPACSSidewallPanelElements = generated::CPACSSidewallPanelElements; +} // namespace tigl diff --git a/src/generated/CPACSDeckElementGeometry.cpp b/src/generated/CPACSDeckElementGeometry.cpp new file mode 100644 index 000000000..beb1223ab --- /dev/null +++ b/src/generated/CPACSDeckElementGeometry.cpp @@ -0,0 +1,239 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSDeckElementBase.h" +#include "CPACSDeckElementGeometry.h" +#include "CPACSGalleyElement.h" +#include "CPACSSeatElement.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSDeckElementGeometry::CPACSDeckElementGeometry(CPACSDeckElementBase* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSDeckElementBase); + } + + CPACSDeckElementGeometry::CPACSDeckElementGeometry(CPACSGalleyElement* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSGalleyElement); + } + + CPACSDeckElementGeometry::CPACSDeckElementGeometry(CPACSSeatElement* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSSeatElement); + } + + CPACSDeckElementGeometry::~CPACSDeckElementGeometry() + { + } + + const CTiglUIDObject* CPACSDeckElementGeometry::GetNextUIDParent() const + { + if (m_parent) { + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + } + return nullptr; + } + + CTiglUIDObject* CPACSDeckElementGeometry::GetNextUIDParent() + { + if (m_parent) { + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + } + return nullptr; + } + + CTiglUIDManager& CPACSDeckElementGeometry::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSDeckElementGeometry::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSDeckElementGeometry::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element genericGeometryComponent + if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericGeometryComponent")) { + m_genericGeometryComponent_choice1 = boost::in_place(this, m_uidMgr); + try { + m_genericGeometryComponent_choice1->ReadCPACS(tixiHandle, xpath + "/genericGeometryComponent"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read genericGeometryComponent at xpath " << xpath << ": " << e.what(); + m_genericGeometryComponent_choice1 = boost::none; + } + } + + // read element boundingBox + if (tixi::TixiCheckElement(tixiHandle, xpath + "/boundingBox")) { + m_boundingBox_choice2 = boost::in_place(this, m_uidMgr); + try { + m_boundingBox_choice2->ReadCPACS(tixiHandle, xpath + "/boundingBox"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read boundingBox at xpath " << xpath << ": " << e.what(); + m_boundingBox_choice2 = boost::none; + } + } + + if (!ValidateChoices()) { + LOG(ERROR) << "Invalid choice configuration at xpath " << xpath; + } + } + + void CPACSDeckElementGeometry::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element genericGeometryComponent + if (m_genericGeometryComponent_choice1) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/genericGeometryComponent"); + m_genericGeometryComponent_choice1->WriteCPACS(tixiHandle, xpath + "/genericGeometryComponent"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericGeometryComponent")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/genericGeometryComponent"); + } + } + + // write element boundingBox + if (m_boundingBox_choice2) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/boundingBox"); + m_boundingBox_choice2->WriteCPACS(tixiHandle, xpath + "/boundingBox"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/boundingBox")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/boundingBox"); + } + } + + } + + bool CPACSDeckElementGeometry::ValidateChoices() const + { + return + ( + ( + ( + // mandatory elements of this choice must be there + m_genericGeometryComponent_choice1.is_initialized() + && + // elements of other choices must not be there + !( + m_boundingBox_choice2.is_initialized() + ) + ) + + + ( + // mandatory elements of this choice must be there + m_boundingBox_choice2.is_initialized() + && + // elements of other choices must not be there + !( + m_genericGeometryComponent_choice1.is_initialized() + ) + ) + == 1 + ) + ) + ; + } + + const boost::optional& CPACSDeckElementGeometry::GetGenericGeometryComponent_choice1() const + { + return m_genericGeometryComponent_choice1; + } + + boost::optional& CPACSDeckElementGeometry::GetGenericGeometryComponent_choice1() + { + return m_genericGeometryComponent_choice1; + } + + const boost::optional& CPACSDeckElementGeometry::GetBoundingBox_choice2() const + { + return m_boundingBox_choice2; + } + + boost::optional& CPACSDeckElementGeometry::GetBoundingBox_choice2() + { + return m_boundingBox_choice2; + } + + CPACSGenericGeometryComponent& CPACSDeckElementGeometry::GetGenericGeometryComponent_choice1(CreateIfNotExistsTag) + { + if (!m_genericGeometryComponent_choice1) + m_genericGeometryComponent_choice1 = boost::in_place(this, m_uidMgr); + return *m_genericGeometryComponent_choice1; + } + + void CPACSDeckElementGeometry::RemoveGenericGeometryComponent_choice1() + { + m_genericGeometryComponent_choice1 = boost::none; + } + + CPACSBoundingBox& CPACSDeckElementGeometry::GetBoundingBox_choice2(CreateIfNotExistsTag) + { + if (!m_boundingBox_choice2) + m_boundingBox_choice2 = boost::in_place(this, m_uidMgr); + return *m_boundingBox_choice2; + } + + void CPACSDeckElementGeometry::RemoveBoundingBox_choice2() + { + m_boundingBox_choice2 = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSDeckElementGeometry.h b/src/generated/CPACSDeckElementGeometry.h new file mode 100644 index 000000000..f9fdf9256 --- /dev/null +++ b/src/generated/CPACSDeckElementGeometry.h @@ -0,0 +1,132 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include +#include +#include "CPACSBoundingBox.h" +#include "CPACSGenericGeometryComponent.h" +#include "CreateIfNotExists.h" +#include "CTiglError.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSDeckElementBase; + class CPACSGalleyElement; + class CPACSSeatElement; + + // This class is used in: + // CPACSDeckElementBase + // CPACSGalleyElement + // CPACSSeatElement + + /// @brief Geometry + /// + /// Description of the deck element geometry. This might be either a bounding box definition or a link to a generic geometry component. + /// + class CPACSDeckElementGeometry + { + public: + TIGL_EXPORT CPACSDeckElementGeometry(CPACSDeckElementBase* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSDeckElementGeometry(CPACSGalleyElement* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSDeckElementGeometry(CPACSSeatElement* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSDeckElementGeometry(); + + template + bool IsParent() const + { + return m_parentType != NULL && *m_parentType == typeid(P); + } + + template + P* GetParent() + { + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSDeckElementGeometry"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + template + const P* GetParent() const + { + static_assert(std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSDeckElementGeometry"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT bool ValidateChoices() const; + + TIGL_EXPORT virtual const boost::optional& GetGenericGeometryComponent_choice1() const; + TIGL_EXPORT virtual boost::optional& GetGenericGeometryComponent_choice1(); + + TIGL_EXPORT virtual const boost::optional& GetBoundingBox_choice2() const; + TIGL_EXPORT virtual boost::optional& GetBoundingBox_choice2(); + + TIGL_EXPORT virtual CPACSGenericGeometryComponent& GetGenericGeometryComponent_choice1(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveGenericGeometryComponent_choice1(); + + TIGL_EXPORT virtual CPACSBoundingBox& GetBoundingBox_choice2(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveBoundingBox_choice2(); + + protected: + void* m_parent; + const std::type_info* m_parentType; + + CTiglUIDManager* m_uidMgr; + + boost::optional m_genericGeometryComponent_choice1; + boost::optional m_boundingBox_choice2; + + private: + CPACSDeckElementGeometry(const CPACSDeckElementGeometry&) = delete; + CPACSDeckElementGeometry& operator=(const CPACSDeckElementGeometry&) = delete; + + CPACSDeckElementGeometry(CPACSDeckElementGeometry&&) = delete; + CPACSDeckElementGeometry& operator=(CPACSDeckElementGeometry&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSDeckElementGeometry = generated::CPACSDeckElementGeometry; +using CCPACSDeckElementBase = generated::CPACSDeckElementBase; +using CCPACSGalleyElement = generated::CPACSGalleyElement; +using CCPACSSeatElement = generated::CPACSSeatElement; +} // namespace tigl diff --git a/src/generated/CPACSDeckElementMass.cpp b/src/generated/CPACSDeckElementMass.cpp new file mode 100644 index 000000000..332a91ebb --- /dev/null +++ b/src/generated/CPACSDeckElementMass.cpp @@ -0,0 +1,280 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSCargoContainerElement.h" +#include "CPACSDeckElementBase.h" +#include "CPACSDeckElementMass.h" +#include "CPACSGalleyElement.h" +#include "CPACSSeatElement.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSDeckElementMass::CPACSDeckElementMass(CPACSCargoContainerElement* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_mass(0) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSCargoContainerElement); + } + + CPACSDeckElementMass::CPACSDeckElementMass(CPACSDeckElementBase* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_mass(0) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSDeckElementBase); + } + + CPACSDeckElementMass::CPACSDeckElementMass(CPACSGalleyElement* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_mass(0) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSGalleyElement); + } + + CPACSDeckElementMass::CPACSDeckElementMass(CPACSSeatElement* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_mass(0) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSSeatElement); + } + + CPACSDeckElementMass::~CPACSDeckElementMass() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + } + + const CTiglUIDObject* CPACSDeckElementMass::GetNextUIDParent() const + { + if (m_parent) { + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + } + return nullptr; + } + + CTiglUIDObject* CPACSDeckElementMass::GetNextUIDParent() + { + if (m_parent) { + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + } + return nullptr; + } + + CTiglUIDManager& CPACSDeckElementMass::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSDeckElementMass::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSDeckElementMass::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element mass + if (tixi::TixiCheckElement(tixiHandle, xpath + "/mass")) { + m_mass = tixi::TixiGetElement(tixiHandle, xpath + "/mass"); + } + else { + LOG(ERROR) << "Required element mass is missing at xpath " << xpath; + } + + // read element location + if (tixi::TixiCheckElement(tixiHandle, xpath + "/location")) { + m_location = boost::in_place(this, m_uidMgr); + try { + m_location->ReadCPACS(tixiHandle, xpath + "/location"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read location at xpath " << xpath << ": " << e.what(); + m_location = boost::none; + } + } + + // read element massInertia + if (tixi::TixiCheckElement(tixiHandle, xpath + "/massInertia")) { + m_massInertia = boost::in_place(this); + try { + m_massInertia->ReadCPACS(tixiHandle, xpath + "/massInertia"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read massInertia at xpath " << xpath << ": " << e.what(); + m_massInertia = boost::none; + } + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + } + + void CPACSDeckElementMass::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element mass + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/mass"); + tixi::TixiSaveElement(tixiHandle, xpath + "/mass", m_mass); + + // write element location + if (m_location) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/location"); + m_location->WriteCPACS(tixiHandle, xpath + "/location"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/location")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/location"); + } + } + + // write element massInertia + if (m_massInertia) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/massInertia"); + m_massInertia->WriteCPACS(tixiHandle, xpath + "/massInertia"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/massInertia")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/massInertia"); + } + } + + } + + const std::string& CPACSDeckElementMass::GetUID() const + { + return m_uID; + } + + void CPACSDeckElementMass::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const double& CPACSDeckElementMass::GetMass() const + { + return m_mass; + } + + void CPACSDeckElementMass::SetMass(const double& value) + { + m_mass = value; + } + + const boost::optional& CPACSDeckElementMass::GetLocation() const + { + return m_location; + } + + boost::optional& CPACSDeckElementMass::GetLocation() + { + return m_location; + } + + const boost::optional& CPACSDeckElementMass::GetMassInertia() const + { + return m_massInertia; + } + + boost::optional& CPACSDeckElementMass::GetMassInertia() + { + return m_massInertia; + } + + CCPACSPoint& CPACSDeckElementMass::GetLocation(CreateIfNotExistsTag) + { + if (!m_location) + m_location = boost::in_place(this, m_uidMgr); + return *m_location; + } + + void CPACSDeckElementMass::RemoveLocation() + { + m_location = boost::none; + } + + CPACSMassInertia& CPACSDeckElementMass::GetMassInertia(CreateIfNotExistsTag) + { + if (!m_massInertia) + m_massInertia = boost::in_place(this); + return *m_massInertia; + } + + void CPACSDeckElementMass::RemoveMassInertia() + { + m_massInertia = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSDeckElementMass.h b/src/generated/CPACSDeckElementMass.h new file mode 100644 index 000000000..c8c5da903 --- /dev/null +++ b/src/generated/CPACSDeckElementMass.h @@ -0,0 +1,147 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include +#include +#include +#include "CPACSMassInertia.h" +#include "CreateIfNotExists.h" +#include "CTiglError.h" +#include "CTiglUIDObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; + +namespace generated +{ + class CPACSCargoContainerElement; + class CPACSDeckElementBase; + class CPACSGalleyElement; + class CPACSSeatElement; + + // This class is used in: + // CPACSCargoContainerElement + // CPACSDeckElementBase + // CPACSGalleyElement + // CPACSSeatElement + + /// @brief Mass + /// + /// Description of mass, center of gravity and inertia + /// + class CPACSDeckElementMass : public CTiglReqUIDObject + { + public: + TIGL_EXPORT CPACSDeckElementMass(CPACSCargoContainerElement* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSDeckElementMass(CPACSDeckElementBase* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSDeckElementMass(CPACSGalleyElement* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSDeckElementMass(CPACSSeatElement* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSDeckElementMass(); + + template + bool IsParent() const + { + return m_parentType != NULL && *m_parentType == typeid(P); + } + + template + P* GetParent() + { + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSDeckElementMass"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + template + const P* GetParent() const + { + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSDeckElementMass"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const double& GetMass() const; + TIGL_EXPORT virtual void SetMass(const double& value); + + TIGL_EXPORT virtual const boost::optional& GetLocation() const; + TIGL_EXPORT virtual boost::optional& GetLocation(); + + TIGL_EXPORT virtual const boost::optional& GetMassInertia() const; + TIGL_EXPORT virtual boost::optional& GetMassInertia(); + + TIGL_EXPORT virtual CCPACSPoint& GetLocation(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveLocation(); + + TIGL_EXPORT virtual CPACSMassInertia& GetMassInertia(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveMassInertia(); + + protected: + void* m_parent; + const std::type_info* m_parentType; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + /// Mass value + double m_mass; + + /// Center of gravity (x,y,z) + boost::optional m_location; + + boost::optional m_massInertia; + + private: + CPACSDeckElementMass(const CPACSDeckElementMass&) = delete; + CPACSDeckElementMass& operator=(const CPACSDeckElementMass&) = delete; + + CPACSDeckElementMass(CPACSDeckElementMass&&) = delete; + CPACSDeckElementMass& operator=(CPACSDeckElementMass&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSDeckElementMass = generated::CPACSDeckElementMass; +using CCPACSCargoContainerElement = generated::CPACSCargoContainerElement; +using CCPACSDeckElementBase = generated::CPACSDeckElementBase; +using CCPACSGalleyElement = generated::CPACSGalleyElement; +using CCPACSSeatElement = generated::CPACSSeatElement; +} // namespace tigl diff --git a/src/generated/CPACSDeckElements.cpp b/src/generated/CPACSDeckElements.cpp new file mode 100644 index 000000000..5dd669612 --- /dev/null +++ b/src/generated/CPACSDeckElements.cpp @@ -0,0 +1,489 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSDeckElements.h" +#include "CPACSVehicles.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSDeckElements::CPACSDeckElements(CPACSVehicles* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSDeckElements::~CPACSDeckElements() + { + } + + const CPACSVehicles* CPACSDeckElements::GetParent() const + { + return m_parent; + } + + CPACSVehicles* CPACSDeckElements::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSDeckElements::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSDeckElements::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSDeckElements::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSDeckElements::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSDeckElements::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element ceilingPanelElements + if (tixi::TixiCheckElement(tixiHandle, xpath + "/ceilingPanelElements")) { + m_ceilingPanelElements = boost::in_place(this, m_uidMgr); + try { + m_ceilingPanelElements->ReadCPACS(tixiHandle, xpath + "/ceilingPanelElements"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read ceilingPanelElements at xpath " << xpath << ": " << e.what(); + m_ceilingPanelElements = boost::none; + } + } + + // read element classDividerElements + if (tixi::TixiCheckElement(tixiHandle, xpath + "/classDividerElements")) { + m_classDividerElements = boost::in_place(this, m_uidMgr); + try { + m_classDividerElements->ReadCPACS(tixiHandle, xpath + "/classDividerElements"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read classDividerElements at xpath " << xpath << ": " << e.what(); + m_classDividerElements = boost::none; + } + } + + // read element galleyElements + if (tixi::TixiCheckElement(tixiHandle, xpath + "/galleyElements")) { + m_galleyElements = boost::in_place(this, m_uidMgr); + try { + m_galleyElements->ReadCPACS(tixiHandle, xpath + "/galleyElements"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read galleyElements at xpath " << xpath << ": " << e.what(); + m_galleyElements = boost::none; + } + } + + // read element genericFloorElements + if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericFloorElements")) { + m_genericFloorElements = boost::in_place(this, m_uidMgr); + try { + m_genericFloorElements->ReadCPACS(tixiHandle, xpath + "/genericFloorElements"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read genericFloorElements at xpath " << xpath << ": " << e.what(); + m_genericFloorElements = boost::none; + } + } + + // read element lavatoryElements + if (tixi::TixiCheckElement(tixiHandle, xpath + "/lavatoryElements")) { + m_lavatoryElements = boost::in_place(this, m_uidMgr); + try { + m_lavatoryElements->ReadCPACS(tixiHandle, xpath + "/lavatoryElements"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read lavatoryElements at xpath " << xpath << ": " << e.what(); + m_lavatoryElements = boost::none; + } + } + + // read element luggageCompartmentElements + if (tixi::TixiCheckElement(tixiHandle, xpath + "/luggageCompartmentElements")) { + m_luggageCompartmentElements = boost::in_place(this, m_uidMgr); + try { + m_luggageCompartmentElements->ReadCPACS(tixiHandle, xpath + "/luggageCompartmentElements"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read luggageCompartmentElements at xpath " << xpath << ": " << e.what(); + m_luggageCompartmentElements = boost::none; + } + } + + // read element seatElements + if (tixi::TixiCheckElement(tixiHandle, xpath + "/seatElements")) { + m_seatElements = boost::in_place(this, m_uidMgr); + try { + m_seatElements->ReadCPACS(tixiHandle, xpath + "/seatElements"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read seatElements at xpath " << xpath << ": " << e.what(); + m_seatElements = boost::none; + } + } + + // read element sidewallPanelElements + if (tixi::TixiCheckElement(tixiHandle, xpath + "/sidewallPanelElements")) { + m_sidewallPanelElements = boost::in_place(this, m_uidMgr); + try { + m_sidewallPanelElements->ReadCPACS(tixiHandle, xpath + "/sidewallPanelElements"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read sidewallPanelElements at xpath " << xpath << ": " << e.what(); + m_sidewallPanelElements = boost::none; + } + } + + // read element cargoContainerElements + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cargoContainerElements")) { + m_cargoContainerElements = boost::in_place(this, m_uidMgr); + try { + m_cargoContainerElements->ReadCPACS(tixiHandle, xpath + "/cargoContainerElements"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read cargoContainerElements at xpath " << xpath << ": " << e.what(); + m_cargoContainerElements = boost::none; + } + } + + } + + void CPACSDeckElements::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element ceilingPanelElements + if (m_ceilingPanelElements) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/ceilingPanelElements"); + m_ceilingPanelElements->WriteCPACS(tixiHandle, xpath + "/ceilingPanelElements"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/ceilingPanelElements")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/ceilingPanelElements"); + } + } + + // write element classDividerElements + if (m_classDividerElements) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/classDividerElements"); + m_classDividerElements->WriteCPACS(tixiHandle, xpath + "/classDividerElements"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/classDividerElements")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/classDividerElements"); + } + } + + // write element galleyElements + if (m_galleyElements) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/galleyElements"); + m_galleyElements->WriteCPACS(tixiHandle, xpath + "/galleyElements"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/galleyElements")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/galleyElements"); + } + } + + // write element genericFloorElements + if (m_genericFloorElements) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/genericFloorElements"); + m_genericFloorElements->WriteCPACS(tixiHandle, xpath + "/genericFloorElements"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericFloorElements")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/genericFloorElements"); + } + } + + // write element lavatoryElements + if (m_lavatoryElements) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/lavatoryElements"); + m_lavatoryElements->WriteCPACS(tixiHandle, xpath + "/lavatoryElements"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/lavatoryElements")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/lavatoryElements"); + } + } + + // write element luggageCompartmentElements + if (m_luggageCompartmentElements) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/luggageCompartmentElements"); + m_luggageCompartmentElements->WriteCPACS(tixiHandle, xpath + "/luggageCompartmentElements"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/luggageCompartmentElements")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/luggageCompartmentElements"); + } + } + + // write element seatElements + if (m_seatElements) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/seatElements"); + m_seatElements->WriteCPACS(tixiHandle, xpath + "/seatElements"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/seatElements")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/seatElements"); + } + } + + // write element sidewallPanelElements + if (m_sidewallPanelElements) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/sidewallPanelElements"); + m_sidewallPanelElements->WriteCPACS(tixiHandle, xpath + "/sidewallPanelElements"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/sidewallPanelElements")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/sidewallPanelElements"); + } + } + + // write element cargoContainerElements + if (m_cargoContainerElements) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/cargoContainerElements"); + m_cargoContainerElements->WriteCPACS(tixiHandle, xpath + "/cargoContainerElements"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/cargoContainerElements")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/cargoContainerElements"); + } + } + + } + + const boost::optional& CPACSDeckElements::GetCeilingPanelElements() const + { + return m_ceilingPanelElements; + } + + boost::optional& CPACSDeckElements::GetCeilingPanelElements() + { + return m_ceilingPanelElements; + } + + const boost::optional& CPACSDeckElements::GetClassDividerElements() const + { + return m_classDividerElements; + } + + boost::optional& CPACSDeckElements::GetClassDividerElements() + { + return m_classDividerElements; + } + + const boost::optional& CPACSDeckElements::GetGalleyElements() const + { + return m_galleyElements; + } + + boost::optional& CPACSDeckElements::GetGalleyElements() + { + return m_galleyElements; + } + + const boost::optional& CPACSDeckElements::GetGenericFloorElements() const + { + return m_genericFloorElements; + } + + boost::optional& CPACSDeckElements::GetGenericFloorElements() + { + return m_genericFloorElements; + } + + const boost::optional& CPACSDeckElements::GetLavatoryElements() const + { + return m_lavatoryElements; + } + + boost::optional& CPACSDeckElements::GetLavatoryElements() + { + return m_lavatoryElements; + } + + const boost::optional& CPACSDeckElements::GetLuggageCompartmentElements() const + { + return m_luggageCompartmentElements; + } + + boost::optional& CPACSDeckElements::GetLuggageCompartmentElements() + { + return m_luggageCompartmentElements; + } + + const boost::optional& CPACSDeckElements::GetSeatElements() const + { + return m_seatElements; + } + + boost::optional& CPACSDeckElements::GetSeatElements() + { + return m_seatElements; + } + + const boost::optional& CPACSDeckElements::GetSidewallPanelElements() const + { + return m_sidewallPanelElements; + } + + boost::optional& CPACSDeckElements::GetSidewallPanelElements() + { + return m_sidewallPanelElements; + } + + const boost::optional& CPACSDeckElements::GetCargoContainerElements() const + { + return m_cargoContainerElements; + } + + boost::optional& CPACSDeckElements::GetCargoContainerElements() + { + return m_cargoContainerElements; + } + + CPACSCeilingPanelElements& CPACSDeckElements::GetCeilingPanelElements(CreateIfNotExistsTag) + { + if (!m_ceilingPanelElements) + m_ceilingPanelElements = boost::in_place(this, m_uidMgr); + return *m_ceilingPanelElements; + } + + void CPACSDeckElements::RemoveCeilingPanelElements() + { + m_ceilingPanelElements = boost::none; + } + + CPACSClassDividerElements& CPACSDeckElements::GetClassDividerElements(CreateIfNotExistsTag) + { + if (!m_classDividerElements) + m_classDividerElements = boost::in_place(this, m_uidMgr); + return *m_classDividerElements; + } + + void CPACSDeckElements::RemoveClassDividerElements() + { + m_classDividerElements = boost::none; + } + + CPACSGalleyElements& CPACSDeckElements::GetGalleyElements(CreateIfNotExistsTag) + { + if (!m_galleyElements) + m_galleyElements = boost::in_place(this, m_uidMgr); + return *m_galleyElements; + } + + void CPACSDeckElements::RemoveGalleyElements() + { + m_galleyElements = boost::none; + } + + CPACSGenericFloorElements& CPACSDeckElements::GetGenericFloorElements(CreateIfNotExistsTag) + { + if (!m_genericFloorElements) + m_genericFloorElements = boost::in_place(this, m_uidMgr); + return *m_genericFloorElements; + } + + void CPACSDeckElements::RemoveGenericFloorElements() + { + m_genericFloorElements = boost::none; + } + + CPACSLavatoryElements& CPACSDeckElements::GetLavatoryElements(CreateIfNotExistsTag) + { + if (!m_lavatoryElements) + m_lavatoryElements = boost::in_place(this, m_uidMgr); + return *m_lavatoryElements; + } + + void CPACSDeckElements::RemoveLavatoryElements() + { + m_lavatoryElements = boost::none; + } + + CPACSLuggageCompartmentElements& CPACSDeckElements::GetLuggageCompartmentElements(CreateIfNotExistsTag) + { + if (!m_luggageCompartmentElements) + m_luggageCompartmentElements = boost::in_place(this, m_uidMgr); + return *m_luggageCompartmentElements; + } + + void CPACSDeckElements::RemoveLuggageCompartmentElements() + { + m_luggageCompartmentElements = boost::none; + } + + CPACSSeatElements& CPACSDeckElements::GetSeatElements(CreateIfNotExistsTag) + { + if (!m_seatElements) + m_seatElements = boost::in_place(this, m_uidMgr); + return *m_seatElements; + } + + void CPACSDeckElements::RemoveSeatElements() + { + m_seatElements = boost::none; + } + + CPACSSidewallPanelElements& CPACSDeckElements::GetSidewallPanelElements(CreateIfNotExistsTag) + { + if (!m_sidewallPanelElements) + m_sidewallPanelElements = boost::in_place(this, m_uidMgr); + return *m_sidewallPanelElements; + } + + void CPACSDeckElements::RemoveSidewallPanelElements() + { + m_sidewallPanelElements = boost::none; + } + + CPACSCargoContainerElements& CPACSDeckElements::GetCargoContainerElements(CreateIfNotExistsTag) + { + if (!m_cargoContainerElements) + m_cargoContainerElements = boost::in_place(this, m_uidMgr); + return *m_cargoContainerElements; + } + + void CPACSDeckElements::RemoveCargoContainerElements() + { + m_cargoContainerElements = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSDeckElements.h b/src/generated/CPACSDeckElements.h new file mode 100644 index 000000000..765c9b20f --- /dev/null +++ b/src/generated/CPACSDeckElements.h @@ -0,0 +1,170 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include +#include "CPACSCargoContainerElements.h" +#include "CPACSCeilingPanelElements.h" +#include "CPACSClassDividerElements.h" +#include "CPACSGalleyElements.h" +#include "CPACSGenericFloorElements.h" +#include "CPACSLavatoryElements.h" +#include "CPACSLuggageCompartmentElements.h" +#include "CPACSSeatElements.h" +#include "CPACSSidewallPanelElements.h" +#include "CreateIfNotExists.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSVehicles; + + // This class is used in: + // CPACSVehicles + + /// @brief Deck elements + /// + /// A list of predefined elements which can be linked in the actual deck of the aircraft or rotorcraft model via referencing its uID. + /// + class CPACSDeckElements + { + public: + TIGL_EXPORT CPACSDeckElements(CPACSVehicles* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSDeckElements(); + + TIGL_EXPORT CPACSVehicles* GetParent(); + + TIGL_EXPORT const CPACSVehicles* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const boost::optional& GetCeilingPanelElements() const; + TIGL_EXPORT virtual boost::optional& GetCeilingPanelElements(); + + TIGL_EXPORT virtual const boost::optional& GetClassDividerElements() const; + TIGL_EXPORT virtual boost::optional& GetClassDividerElements(); + + TIGL_EXPORT virtual const boost::optional& GetGalleyElements() const; + TIGL_EXPORT virtual boost::optional& GetGalleyElements(); + + TIGL_EXPORT virtual const boost::optional& GetGenericFloorElements() const; + TIGL_EXPORT virtual boost::optional& GetGenericFloorElements(); + + TIGL_EXPORT virtual const boost::optional& GetLavatoryElements() const; + TIGL_EXPORT virtual boost::optional& GetLavatoryElements(); + + TIGL_EXPORT virtual const boost::optional& GetLuggageCompartmentElements() const; + TIGL_EXPORT virtual boost::optional& GetLuggageCompartmentElements(); + + TIGL_EXPORT virtual const boost::optional& GetSeatElements() const; + TIGL_EXPORT virtual boost::optional& GetSeatElements(); + + TIGL_EXPORT virtual const boost::optional& GetSidewallPanelElements() const; + TIGL_EXPORT virtual boost::optional& GetSidewallPanelElements(); + + TIGL_EXPORT virtual const boost::optional& GetCargoContainerElements() const; + TIGL_EXPORT virtual boost::optional& GetCargoContainerElements(); + + TIGL_EXPORT virtual CPACSCeilingPanelElements& GetCeilingPanelElements(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveCeilingPanelElements(); + + TIGL_EXPORT virtual CPACSClassDividerElements& GetClassDividerElements(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveClassDividerElements(); + + TIGL_EXPORT virtual CPACSGalleyElements& GetGalleyElements(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveGalleyElements(); + + TIGL_EXPORT virtual CPACSGenericFloorElements& GetGenericFloorElements(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveGenericFloorElements(); + + TIGL_EXPORT virtual CPACSLavatoryElements& GetLavatoryElements(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveLavatoryElements(); + + TIGL_EXPORT virtual CPACSLuggageCompartmentElements& GetLuggageCompartmentElements(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveLuggageCompartmentElements(); + + TIGL_EXPORT virtual CPACSSeatElements& GetSeatElements(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveSeatElements(); + + TIGL_EXPORT virtual CPACSSidewallPanelElements& GetSidewallPanelElements(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveSidewallPanelElements(); + + TIGL_EXPORT virtual CPACSCargoContainerElements& GetCargoContainerElements(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveCargoContainerElements(); + + protected: + CPACSVehicles* m_parent; + + CTiglUIDManager* m_uidMgr; + + /// Ceiling panel elements for use in the decks + boost::optional m_ceilingPanelElements; + + /// Class divider elements for use in the decks + boost::optional m_classDividerElements; + + /// Galley elements for use in the decks + boost::optional m_galleyElements; + + /// Generic floor elements for use in the decks + boost::optional m_genericFloorElements; + + /// Lavatory elements for use in the decks + boost::optional m_lavatoryElements; + + /// Luggage compartment elements for use in the decks + boost::optional m_luggageCompartmentElements; + + /// Seat elements for use in the decks + boost::optional m_seatElements; + + /// Sidewall panel elements for use in the decks + boost::optional m_sidewallPanelElements; + + /// Cargo container elements for use in the decks + boost::optional m_cargoContainerElements; + + private: + CPACSDeckElements(const CPACSDeckElements&) = delete; + CPACSDeckElements& operator=(const CPACSDeckElements&) = delete; + + CPACSDeckElements(CPACSDeckElements&&) = delete; + CPACSDeckElements& operator=(CPACSDeckElements&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSDeckElements = generated::CPACSDeckElements; +using CCPACSVehicles = generated::CPACSVehicles; +} // namespace tigl diff --git a/src/generated/CPACSDeckStructuralMount.cpp b/src/generated/CPACSDeckStructuralMount.cpp new file mode 100644 index 000000000..07bb41308 --- /dev/null +++ b/src/generated/CPACSDeckStructuralMount.cpp @@ -0,0 +1,225 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSDeckStructuralMount.h" +#include "CPACSDeckStructuralMounts.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSDeckStructuralMount::CPACSDeckStructuralMount(CPACSDeckStructuralMounts* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSDeckStructuralMount::~CPACSDeckStructuralMount() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + if (m_uidMgr) { + if (!m_componentUID.empty()) m_uidMgr->TryUnregisterReference(m_componentUID, *this); + } + } + + const CPACSDeckStructuralMounts* CPACSDeckStructuralMount::GetParent() const + { + return m_parent; + } + + CPACSDeckStructuralMounts* CPACSDeckStructuralMount::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSDeckStructuralMount::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSDeckStructuralMount::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSDeckStructuralMount::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSDeckStructuralMount::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSDeckStructuralMount::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element name + if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { + m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); + if (m_name.empty()) { + LOG(WARNING) << "Required element name is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required element name is missing at xpath " << xpath; + } + + // read element description + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; + } + } + + // read element componentUID + if (tixi::TixiCheckElement(tixiHandle, xpath + "/componentUID")) { + m_componentUID = tixi::TixiGetElement(tixiHandle, xpath + "/componentUID"); + if (m_componentUID.empty()) { + LOG(WARNING) << "Required element componentUID is empty at xpath " << xpath; + } + if (m_uidMgr && !m_componentUID.empty()) m_uidMgr->RegisterReference(m_componentUID, *this); + } + else { + LOG(ERROR) << "Required element componentUID is missing at xpath " << xpath; + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + } + + void CPACSDeckStructuralMount::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element name + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/name"); + tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); + + // write element description + if (m_description) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description"); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } + + // write element componentUID + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/componentUID"); + tixi::TixiSaveElement(tixiHandle, xpath + "/componentUID", m_componentUID); + + } + + const std::string& CPACSDeckStructuralMount::GetUID() const + { + return m_uID; + } + + void CPACSDeckStructuralMount::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const std::string& CPACSDeckStructuralMount::GetName() const + { + return m_name; + } + + void CPACSDeckStructuralMount::SetName(const std::string& value) + { + m_name = value; + } + + const boost::optional& CPACSDeckStructuralMount::GetDescription() const + { + return m_description; + } + + void CPACSDeckStructuralMount::SetDescription(const boost::optional& value) + { + m_description = value; + } + + const std::string& CPACSDeckStructuralMount::GetComponentUID() const + { + return m_componentUID; + } + + void CPACSDeckStructuralMount::SetComponentUID(const std::string& value) + { + if (m_uidMgr) { + if (!m_componentUID.empty()) m_uidMgr->TryUnregisterReference(m_componentUID, *this); + if (!value.empty()) m_uidMgr->RegisterReference(value, *this); + } + m_componentUID = value; + } + + const CTiglUIDObject* CPACSDeckStructuralMount::GetNextUIDObject() const + { + return this; + } + + void CPACSDeckStructuralMount::NotifyUIDChange(const std::string& oldUid, const std::string& newUid) + { + if (m_componentUID == oldUid) { + m_componentUID = newUid; + } + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSDeckStructuralMount.h b/src/generated/CPACSDeckStructuralMount.h new file mode 100644 index 000000000..dffb21187 --- /dev/null +++ b/src/generated/CPACSDeckStructuralMount.h @@ -0,0 +1,106 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include +#include "CTiglUIDObject.h" +#include "ITiglUIDRefObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; + +namespace generated +{ + class CPACSDeckStructuralMounts; + + // This class is used in: + // CPACSDeckStructuralMounts + + /// @brief Structural mount + /// + /// Structural mount type containing the structural connections of cabin elements + /// + class CPACSDeckStructuralMount : public CTiglReqUIDObject, public ITiglUIDRefObject + { + public: + TIGL_EXPORT CPACSDeckStructuralMount(CPACSDeckStructuralMounts* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSDeckStructuralMount(); + + TIGL_EXPORT CPACSDeckStructuralMounts* GetParent(); + + TIGL_EXPORT const CPACSDeckStructuralMounts* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const std::string& GetName() const; + TIGL_EXPORT virtual void SetName(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + + TIGL_EXPORT virtual const std::string& GetComponentUID() const; + TIGL_EXPORT virtual void SetComponentUID(const std::string& value); + + protected: + CPACSDeckStructuralMounts* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + /// Name + std::string m_name; + + /// Description + boost::optional m_description; + + /// UID of the component to connect to + std::string m_componentUID; + + private: + TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; + TIGL_EXPORT void NotifyUIDChange(const std::string& oldUid, const std::string& newUid) final; + + CPACSDeckStructuralMount(const CPACSDeckStructuralMount&) = delete; + CPACSDeckStructuralMount& operator=(const CPACSDeckStructuralMount&) = delete; + + CPACSDeckStructuralMount(CPACSDeckStructuralMount&&) = delete; + CPACSDeckStructuralMount& operator=(CPACSDeckStructuralMount&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSDeckStructuralMount = generated::CPACSDeckStructuralMount; +using CCPACSDeckStructuralMounts = generated::CPACSDeckStructuralMounts; +} // namespace tigl diff --git a/src/generated/CPACSDeckStructuralMounts.cpp b/src/generated/CPACSDeckStructuralMounts.cpp new file mode 100644 index 000000000..82735659b --- /dev/null +++ b/src/generated/CPACSDeckStructuralMounts.cpp @@ -0,0 +1,123 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSDeckComponent2DBase.h" +#include "CPACSDeckStructuralMount.h" +#include "CPACSDeckStructuralMounts.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSDeckStructuralMounts::CPACSDeckStructuralMounts(CPACSDeckComponent2DBase* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSDeckStructuralMounts::~CPACSDeckStructuralMounts() + { + } + + const CPACSDeckComponent2DBase* CPACSDeckStructuralMounts::GetParent() const + { + return m_parent; + } + + CPACSDeckComponent2DBase* CPACSDeckStructuralMounts::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSDeckStructuralMounts::GetNextUIDParent() const + { + return m_parent; + } + + CTiglUIDObject* CPACSDeckStructuralMounts::GetNextUIDParent() + { + return m_parent; + } + + CTiglUIDManager& CPACSDeckStructuralMounts::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSDeckStructuralMounts::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSDeckStructuralMounts::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element structuralMount + if (tixi::TixiCheckElement(tixiHandle, xpath + "/structuralMount")) { + tixi::TixiReadElements(tixiHandle, xpath + "/structuralMount", m_structuralMounts, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSDeckStructuralMounts::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element structuralMount + tixi::TixiSaveElements(tixiHandle, xpath + "/structuralMount", m_structuralMounts); + + } + + const std::vector>& CPACSDeckStructuralMounts::GetStructuralMounts() const + { + return m_structuralMounts; + } + + std::vector>& CPACSDeckStructuralMounts::GetStructuralMounts() + { + return m_structuralMounts; + } + + CPACSDeckStructuralMount& CPACSDeckStructuralMounts::AddStructuralMount() + { + m_structuralMounts.push_back(make_unique(this, m_uidMgr)); + return *m_structuralMounts.back(); + } + + void CPACSDeckStructuralMounts::RemoveStructuralMount(CPACSDeckStructuralMount& ref) + { + for (std::size_t i = 0; i < m_structuralMounts.size(); i++) { + if (m_structuralMounts[i].get() == &ref) { + m_structuralMounts.erase(m_structuralMounts.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSDeckStructuralMounts.h b/src/generated/CPACSDeckStructuralMounts.h new file mode 100644 index 000000000..6a3692d45 --- /dev/null +++ b/src/generated/CPACSDeckStructuralMounts.h @@ -0,0 +1,89 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSDeckStructuralMount; + class CPACSDeckComponent2DBase; + + // This class is used in: + // CPACSDeckComponent2DBase + + /// @brief Structural mounts + /// + /// Structural mount type containing the structural connections of cabin elements + /// + class CPACSDeckStructuralMounts + { + public: + TIGL_EXPORT CPACSDeckStructuralMounts(CPACSDeckComponent2DBase* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSDeckStructuralMounts(); + + TIGL_EXPORT CPACSDeckComponent2DBase* GetParent(); + + TIGL_EXPORT const CPACSDeckComponent2DBase* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetStructuralMounts() const; + TIGL_EXPORT virtual std::vector>& GetStructuralMounts(); + + TIGL_EXPORT virtual CPACSDeckStructuralMount& AddStructuralMount(); + TIGL_EXPORT virtual void RemoveStructuralMount(CPACSDeckStructuralMount& ref); + + protected: + CPACSDeckComponent2DBase* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::vector> m_structuralMounts; + + private: + CPACSDeckStructuralMounts(const CPACSDeckStructuralMounts&) = delete; + CPACSDeckStructuralMounts& operator=(const CPACSDeckStructuralMounts&) = delete; + + CPACSDeckStructuralMounts(CPACSDeckStructuralMounts&&) = delete; + CPACSDeckStructuralMounts& operator=(CPACSDeckStructuralMounts&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSDeckStructuralMounts = generated::CPACSDeckStructuralMounts; +using CCPACSDeckStructuralMount = generated::CPACSDeckStructuralMount; +using CCPACSDeckComponent2DBase = generated::CPACSDeckComponent2DBase; +} // namespace tigl diff --git a/src/generated/CPACSEngineNacelle.h b/src/generated/CPACSEngineNacelle.h index e1c455be5..9d0be7fba 100644 --- a/src/generated/CPACSEngineNacelle.h +++ b/src/generated/CPACSEngineNacelle.h @@ -38,17 +38,14 @@ namespace generated // This class is used in: // CPACSEngine - /// @brief Definition of the engine nacelle type. + /// @brief Engine nacelle /// - /// The engine nacelle is currently located together with - /// the engine. It gives a simple description of the outer shell of - /// the engine. All values are defined according to the base area, - /// center point of the fan(i.e. negative values can occur in the - /// definition) In most cases there will be a bypass engine. For - /// non-bypass or mixed engines ignore the bypass nozzle. For further - /// information on the geometric setup, please refer to the picture - /// below. - /// @see engineNacelle + /// The engine nacelle is part of an engine. + /// It allows to define the outer geometry of the following engine components: + /// Fan cowl Core cowl Center cowl All geometric values refer to the fan position. + /// The common use case for this definition includes bypass engines. + /// In the case of non-bypass engines, the core cowl should be omitted. + /// @see nacelle /// class CPACSEngineNacelle : public CTiglReqUIDObject { @@ -94,8 +91,13 @@ namespace generated CTiglUIDManager* m_uidMgr; std::string m_uID; + + /// Fan cowl CCPACSNacelleCowl m_fanCowl; + + /// Core cowl boost::optional m_coreCowl; + boost::optional m_centerCowl; private: diff --git a/src/generated/CPACSEnvironment.h b/src/generated/CPACSEnvironment.h index 589f41bef..4e3a7c15b 100644 --- a/src/generated/CPACSEnvironment.h +++ b/src/generated/CPACSEnvironment.h @@ -95,7 +95,7 @@ namespace generated CPACSAtmosphericModel m_atmosphericModel; - /// Delta temperature + /// Delta temperature with respect to the standard temperature of the selected atmosphere [K] boost::optional m_deltaTemperature; private: diff --git a/src/generated/CPACSGalleyElement.cpp b/src/generated/CPACSGalleyElement.cpp new file mode 100644 index 000000000..7942e3a77 --- /dev/null +++ b/src/generated/CPACSGalleyElement.cpp @@ -0,0 +1,266 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSGalleyElement.h" +#include "CPACSGalleyElements.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSGalleyElement::CPACSGalleyElement(CPACSGalleyElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_geometry(this, m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSGalleyElement::~CPACSGalleyElement() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + } + + const CPACSGalleyElements* CPACSGalleyElement::GetParent() const + { + return m_parent; + } + + CPACSGalleyElements* CPACSGalleyElement::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSGalleyElement::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSGalleyElement::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSGalleyElement::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSGalleyElement::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSGalleyElement::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element description + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; + } + } + + // read element geometry + if (tixi::TixiCheckElement(tixiHandle, xpath + "/geometry")) { + m_geometry.ReadCPACS(tixiHandle, xpath + "/geometry"); + } + else { + LOG(ERROR) << "Required element geometry is missing at xpath " << xpath; + } + + // read element mass + if (tixi::TixiCheckElement(tixiHandle, xpath + "/mass")) { + m_mass = boost::in_place(this, m_uidMgr); + try { + m_mass->ReadCPACS(tixiHandle, xpath + "/mass"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read mass at xpath " << xpath << ": " << e.what(); + m_mass = boost::none; + } + } + + // read element numberOfTrolleys + if (tixi::TixiCheckElement(tixiHandle, xpath + "/numberOfTrolleys")) { + m_numberOfTrolleys = boost::in_place(this); + try { + m_numberOfTrolleys->ReadCPACS(tixiHandle, xpath + "/numberOfTrolleys"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read numberOfTrolleys at xpath " << xpath << ": " << e.what(); + m_numberOfTrolleys = boost::none; + } + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + } + + void CPACSGalleyElement::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element description + if (m_description) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description"); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } + + // write element geometry + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/geometry"); + m_geometry.WriteCPACS(tixiHandle, xpath + "/geometry"); + + // write element mass + if (m_mass) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/mass"); + m_mass->WriteCPACS(tixiHandle, xpath + "/mass"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/mass")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/mass"); + } + } + + // write element numberOfTrolleys + if (m_numberOfTrolleys) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/numberOfTrolleys"); + m_numberOfTrolleys->WriteCPACS(tixiHandle, xpath + "/numberOfTrolleys"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/numberOfTrolleys")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/numberOfTrolleys"); + } + } + + } + + const std::string& CPACSGalleyElement::GetUID() const + { + return m_uID; + } + + void CPACSGalleyElement::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const boost::optional& CPACSGalleyElement::GetDescription() const + { + return m_description; + } + + void CPACSGalleyElement::SetDescription(const boost::optional& value) + { + m_description = value; + } + + const CPACSDeckElementGeometry& CPACSGalleyElement::GetGeometry() const + { + return m_geometry; + } + + CPACSDeckElementGeometry& CPACSGalleyElement::GetGeometry() + { + return m_geometry; + } + + const boost::optional& CPACSGalleyElement::GetMass() const + { + return m_mass; + } + + boost::optional& CPACSGalleyElement::GetMass() + { + return m_mass; + } + + const boost::optional& CPACSGalleyElement::GetNumberOfTrolleys() const + { + return m_numberOfTrolleys; + } + + boost::optional& CPACSGalleyElement::GetNumberOfTrolleys() + { + return m_numberOfTrolleys; + } + + CPACSDeckElementMass& CPACSGalleyElement::GetMass(CreateIfNotExistsTag) + { + if (!m_mass) + m_mass = boost::in_place(this, m_uidMgr); + return *m_mass; + } + + void CPACSGalleyElement::RemoveMass() + { + m_mass = boost::none; + } + + CPACSPosExcl0IntBase& CPACSGalleyElement::GetNumberOfTrolleys(CreateIfNotExistsTag) + { + if (!m_numberOfTrolleys) + m_numberOfTrolleys = boost::in_place(this); + return *m_numberOfTrolleys; + } + + void CPACSGalleyElement::RemoveNumberOfTrolleys() + { + m_numberOfTrolleys = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSGalleyElement.h b/src/generated/CPACSGalleyElement.h new file mode 100644 index 000000000..1c121e59e --- /dev/null +++ b/src/generated/CPACSGalleyElement.h @@ -0,0 +1,116 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include +#include "CPACSDeckElementGeometry.h" +#include "CPACSDeckElementMass.h" +#include "CPACSPosExcl0IntBase.h" +#include "CreateIfNotExists.h" +#include "CTiglUIDObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; + +namespace generated +{ + class CPACSGalleyElements; + + // This class is used in: + // CPACSGalleyElements + + /// @brief Galley element + /// + /// Galley element type, containing the base elements of the cabin + /// + class CPACSGalleyElement : public CTiglReqUIDObject + { + public: + TIGL_EXPORT CPACSGalleyElement(CPACSGalleyElements* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSGalleyElement(); + + TIGL_EXPORT CPACSGalleyElements* GetParent(); + + TIGL_EXPORT const CPACSGalleyElements* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + + TIGL_EXPORT virtual const CPACSDeckElementGeometry& GetGeometry() const; + TIGL_EXPORT virtual CPACSDeckElementGeometry& GetGeometry(); + + TIGL_EXPORT virtual const boost::optional& GetMass() const; + TIGL_EXPORT virtual boost::optional& GetMass(); + + TIGL_EXPORT virtual const boost::optional& GetNumberOfTrolleys() const; + TIGL_EXPORT virtual boost::optional& GetNumberOfTrolleys(); + + TIGL_EXPORT virtual CPACSDeckElementMass& GetMass(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveMass(); + + TIGL_EXPORT virtual CPACSPosExcl0IntBase& GetNumberOfTrolleys(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveNumberOfTrolleys(); + + protected: + CPACSGalleyElements* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + /// Description + boost::optional m_description; + + CPACSDeckElementGeometry m_geometry; + + boost::optional m_mass; + + /// Number of trolleys + boost::optional m_numberOfTrolleys; + + private: + CPACSGalleyElement(const CPACSGalleyElement&) = delete; + CPACSGalleyElement& operator=(const CPACSGalleyElement&) = delete; + + CPACSGalleyElement(CPACSGalleyElement&&) = delete; + CPACSGalleyElement& operator=(CPACSGalleyElement&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSGalleyElement = generated::CPACSGalleyElement; +using CCPACSGalleyElements = generated::CPACSGalleyElements; +} // namespace tigl diff --git a/src/generated/CPACSGalleyElements.cpp b/src/generated/CPACSGalleyElements.cpp new file mode 100644 index 000000000..3f5621037 --- /dev/null +++ b/src/generated/CPACSGalleyElements.cpp @@ -0,0 +1,129 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSDeckElements.h" +#include "CPACSGalleyElement.h" +#include "CPACSGalleyElements.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSGalleyElements::CPACSGalleyElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSGalleyElements::~CPACSGalleyElements() + { + } + + const CPACSDeckElements* CPACSGalleyElements::GetParent() const + { + return m_parent; + } + + CPACSDeckElements* CPACSGalleyElements::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSGalleyElements::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSGalleyElements::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSGalleyElements::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSGalleyElements::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSGalleyElements::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element galleyElement + if (tixi::TixiCheckElement(tixiHandle, xpath + "/galleyElement")) { + tixi::TixiReadElements(tixiHandle, xpath + "/galleyElement", m_galleyElements, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSGalleyElements::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element galleyElement + tixi::TixiSaveElements(tixiHandle, xpath + "/galleyElement", m_galleyElements); + + } + + const std::vector>& CPACSGalleyElements::GetGalleyElements() const + { + return m_galleyElements; + } + + std::vector>& CPACSGalleyElements::GetGalleyElements() + { + return m_galleyElements; + } + + CPACSGalleyElement& CPACSGalleyElements::AddGalleyElement() + { + m_galleyElements.push_back(make_unique(this, m_uidMgr)); + return *m_galleyElements.back(); + } + + void CPACSGalleyElements::RemoveGalleyElement(CPACSGalleyElement& ref) + { + for (std::size_t i = 0; i < m_galleyElements.size(); i++) { + if (m_galleyElements[i].get() == &ref) { + m_galleyElements.erase(m_galleyElements.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSGalleyElements.h b/src/generated/CPACSGalleyElements.h new file mode 100644 index 000000000..bbae08071 --- /dev/null +++ b/src/generated/CPACSGalleyElements.h @@ -0,0 +1,90 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSGalleyElement; + class CPACSDeckElements; + + // This class is used in: + // CPACSDeckElements + + /// @brief Galley elements + /// + /// Galley element collection type + /// + class CPACSGalleyElements + { + public: + TIGL_EXPORT CPACSGalleyElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSGalleyElements(); + + TIGL_EXPORT CPACSDeckElements* GetParent(); + + TIGL_EXPORT const CPACSDeckElements* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetGalleyElements() const; + TIGL_EXPORT virtual std::vector>& GetGalleyElements(); + + TIGL_EXPORT virtual CPACSGalleyElement& AddGalleyElement(); + TIGL_EXPORT virtual void RemoveGalleyElement(CPACSGalleyElement& ref); + + protected: + CPACSDeckElements* m_parent; + + CTiglUIDManager* m_uidMgr; + + /// Galley element for use in the decks + std::vector> m_galleyElements; + + private: + CPACSGalleyElements(const CPACSGalleyElements&) = delete; + CPACSGalleyElements& operator=(const CPACSGalleyElements&) = delete; + + CPACSGalleyElements(CPACSGalleyElements&&) = delete; + CPACSGalleyElements& operator=(CPACSGalleyElements&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSGalleyElements = generated::CPACSGalleyElements; +using CCPACSGalleyElement = generated::CPACSGalleyElement; +using CCPACSDeckElements = generated::CPACSDeckElements; +} // namespace tigl diff --git a/src/generated/CPACSGenericFloorElements.cpp b/src/generated/CPACSGenericFloorElements.cpp new file mode 100644 index 000000000..614fec564 --- /dev/null +++ b/src/generated/CPACSGenericFloorElements.cpp @@ -0,0 +1,129 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSDeckElementBase.h" +#include "CPACSDeckElements.h" +#include "CPACSGenericFloorElements.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSGenericFloorElements::CPACSGenericFloorElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSGenericFloorElements::~CPACSGenericFloorElements() + { + } + + const CPACSDeckElements* CPACSGenericFloorElements::GetParent() const + { + return m_parent; + } + + CPACSDeckElements* CPACSGenericFloorElements::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSGenericFloorElements::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSGenericFloorElements::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSGenericFloorElements::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSGenericFloorElements::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSGenericFloorElements::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element genericFloorElement + if (tixi::TixiCheckElement(tixiHandle, xpath + "/genericFloorElement")) { + tixi::TixiReadElements(tixiHandle, xpath + "/genericFloorElement", m_genericFloorElements, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSGenericFloorElements::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element genericFloorElement + tixi::TixiSaveElements(tixiHandle, xpath + "/genericFloorElement", m_genericFloorElements); + + } + + const std::vector>& CPACSGenericFloorElements::GetGenericFloorElements() const + { + return m_genericFloorElements; + } + + std::vector>& CPACSGenericFloorElements::GetGenericFloorElements() + { + return m_genericFloorElements; + } + + CPACSDeckElementBase& CPACSGenericFloorElements::AddGenericFloorElement() + { + m_genericFloorElements.push_back(make_unique(this, m_uidMgr)); + return *m_genericFloorElements.back(); + } + + void CPACSGenericFloorElements::RemoveGenericFloorElement(CPACSDeckElementBase& ref) + { + for (std::size_t i = 0; i < m_genericFloorElements.size(); i++) { + if (m_genericFloorElements[i].get() == &ref) { + m_genericFloorElements.erase(m_genericFloorElements.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSGenericFloorElements.h b/src/generated/CPACSGenericFloorElements.h new file mode 100644 index 000000000..192e3d820 --- /dev/null +++ b/src/generated/CPACSGenericFloorElements.h @@ -0,0 +1,90 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSDeckElementBase; + class CPACSDeckElements; + + // This class is used in: + // CPACSDeckElements + + /// @brief Generic floor elements + /// + /// Generic floor element collection type + /// + class CPACSGenericFloorElements + { + public: + TIGL_EXPORT CPACSGenericFloorElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSGenericFloorElements(); + + TIGL_EXPORT CPACSDeckElements* GetParent(); + + TIGL_EXPORT const CPACSDeckElements* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetGenericFloorElements() const; + TIGL_EXPORT virtual std::vector>& GetGenericFloorElements(); + + TIGL_EXPORT virtual CPACSDeckElementBase& AddGenericFloorElement(); + TIGL_EXPORT virtual void RemoveGenericFloorElement(CPACSDeckElementBase& ref); + + protected: + CPACSDeckElements* m_parent; + + CTiglUIDManager* m_uidMgr; + + /// Generic floor element for use in the decks + std::vector> m_genericFloorElements; + + private: + CPACSGenericFloorElements(const CPACSGenericFloorElements&) = delete; + CPACSGenericFloorElements& operator=(const CPACSGenericFloorElements&) = delete; + + CPACSGenericFloorElements(CPACSGenericFloorElements&&) = delete; + CPACSGenericFloorElements& operator=(CPACSGenericFloorElements&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSGenericFloorElements = generated::CPACSGenericFloorElements; +using CCPACSDeckElementBase = generated::CPACSDeckElementBase; +using CCPACSDeckElements = generated::CPACSDeckElements; +} // namespace tigl diff --git a/src/generated/CPACSGenericGeometryComponent.cpp b/src/generated/CPACSGenericGeometryComponent.cpp new file mode 100644 index 000000000..811e3ffbb --- /dev/null +++ b/src/generated/CPACSGenericGeometryComponent.cpp @@ -0,0 +1,139 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSDeckElementGeometry.h" +#include "CPACSGenericGeometryComponent.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSGenericGeometryComponent::CPACSGenericGeometryComponent(CPACSDeckElementGeometry* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_linkToFile(this) + , m_transformation(this, m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSGenericGeometryComponent::~CPACSGenericGeometryComponent() + { + } + + const CPACSDeckElementGeometry* CPACSGenericGeometryComponent::GetParent() const + { + return m_parent; + } + + CPACSDeckElementGeometry* CPACSGenericGeometryComponent::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSGenericGeometryComponent::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSGenericGeometryComponent::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSGenericGeometryComponent::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSGenericGeometryComponent::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSGenericGeometryComponent::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element linkToFile + if (tixi::TixiCheckElement(tixiHandle, xpath + "/linkToFile")) { + m_linkToFile.ReadCPACS(tixiHandle, xpath + "/linkToFile"); + } + else { + LOG(ERROR) << "Required element linkToFile is missing at xpath " << xpath; + } + + // read element transformation + if (tixi::TixiCheckElement(tixiHandle, xpath + "/transformation")) { + m_transformation.ReadCPACS(tixiHandle, xpath + "/transformation"); + } + else { + LOG(ERROR) << "Required element transformation is missing at xpath " << xpath; + } + + } + + void CPACSGenericGeometryComponent::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element linkToFile + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/linkToFile"); + m_linkToFile.WriteCPACS(tixiHandle, xpath + "/linkToFile"); + + // write element transformation + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/transformation"); + m_transformation.WriteCPACS(tixiHandle, xpath + "/transformation"); + + } + + const CPACSLinkToFile& CPACSGenericGeometryComponent::GetLinkToFile() const + { + return m_linkToFile; + } + + CPACSLinkToFile& CPACSGenericGeometryComponent::GetLinkToFile() + { + return m_linkToFile; + } + + const CCPACSTransformation& CPACSGenericGeometryComponent::GetTransformation() const + { + return m_transformation; + } + + CCPACSTransformation& CPACSGenericGeometryComponent::GetTransformation() + { + return m_transformation; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSGenericGeometryComponent.h b/src/generated/CPACSGenericGeometryComponent.h new file mode 100644 index 000000000..4a2b7903b --- /dev/null +++ b/src/generated/CPACSGenericGeometryComponent.h @@ -0,0 +1,88 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include "CPACSLinkToFile.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSDeckElementGeometry; + + // This class is used in: + // CPACSDeckElementGeometry + + /// @brief Generic geometry component + /// + /// + /// + class CPACSGenericGeometryComponent + { + public: + TIGL_EXPORT CPACSGenericGeometryComponent(CPACSDeckElementGeometry* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSGenericGeometryComponent(); + + TIGL_EXPORT CPACSDeckElementGeometry* GetParent(); + + TIGL_EXPORT const CPACSDeckElementGeometry* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const CPACSLinkToFile& GetLinkToFile() const; + TIGL_EXPORT virtual CPACSLinkToFile& GetLinkToFile(); + + TIGL_EXPORT virtual const CCPACSTransformation& GetTransformation() const; + TIGL_EXPORT virtual CCPACSTransformation& GetTransformation(); + + protected: + CPACSDeckElementGeometry* m_parent; + + CTiglUIDManager* m_uidMgr; + + CPACSLinkToFile m_linkToFile; + CCPACSTransformation m_transformation; + + private: + CPACSGenericGeometryComponent(const CPACSGenericGeometryComponent&) = delete; + CPACSGenericGeometryComponent& operator=(const CPACSGenericGeometryComponent&) = delete; + + CPACSGenericGeometryComponent(CPACSGenericGeometryComponent&&) = delete; + CPACSGenericGeometryComponent& operator=(CPACSGenericGeometryComponent&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSGenericGeometryComponent = generated::CPACSGenericGeometryComponent; +using CCPACSDeckElementGeometry = generated::CPACSDeckElementGeometry; +} // namespace tigl diff --git a/src/generated/CPACSGenericSystem.h b/src/generated/CPACSGenericSystem.h index ee146489f..b0463cf4a 100644 --- a/src/generated/CPACSGenericSystem.h +++ b/src/generated/CPACSGenericSystem.h @@ -41,7 +41,7 @@ namespace generated /// /// The generic base types must be one of the following cone|sphere|cube|cylinder. The origin of the shapes is at the center of volume for cube, sphere and cylinder. Since the cone is constructued from a cylindric shape, its origin is at the same location as the origin of the basic cylinder, although not any longer the center of volume due to scaling of one side. While cube and sphere are symmetrical in all three axis, cylinder and cone are standing upright in the direction of cpacs z-axis. The tip of the cone is located in direction of the positive z-axis. The figure below illustrates the default position and orientation of the different shapes. Note that the cube, cylinder and sphere were moved along the x-axis for demonstration by 2, 4 and 6 meters respectively. /// For spheres the default diameter is 1m. Cubes have a length of 1m in all three dimensions. Cylinders have a length of 1m and a diameter of 1m for the circular cross section. The cone is a cylinder with the top face scaled down to zero. - /// @see geometricBaseTypes + /// @see geometricBaseType /// class CPACSGenericSystem : public CTiglReqUIDObject { diff --git a/src/generated/CPACSGlobalPerformanceCases.h b/src/generated/CPACSGlobalPerformanceCases.h index 40470c56a..b47739aa1 100644 --- a/src/generated/CPACSGlobalPerformanceCases.h +++ b/src/generated/CPACSGlobalPerformanceCases.h @@ -39,8 +39,8 @@ namespace generated /// @brief Performance Cases /// - /// Definition of missions and point performance events to evaluate the performance of a vehicle. - /// The definition of performance cases is independent from a specific vehicle. + /// Specification of performance cases required for the performance evaluation of air vehicles (aircraft, rotorcraft, etc.). + /// The information in this node is generally applicable to any kind of vehicle. Vehicle-specific information is provided through the performanceRequirements node found under: /cpacs/vehicles/../model/performanceCases . /// class CPACSGlobalPerformanceCases { diff --git a/src/generated/CPACSGuideCurve.h b/src/generated/CPACSGuideCurve.h index 595c10b8d..5f8af22bb 100644 --- a/src/generated/CPACSGuideCurve.h +++ b/src/generated/CPACSGuideCurve.h @@ -156,7 +156,7 @@ namespace generated /// The relative circumference /// position at which the guide curve shall end. Valid values - /// are in the interval -1.0...1.0. + /// are in the interval -1,...,1. boost::optional m_toRelativeCircumference_choice1; /// The parameter diff --git a/src/generated/CPACSLavatoryElements.cpp b/src/generated/CPACSLavatoryElements.cpp new file mode 100644 index 000000000..c49c19660 --- /dev/null +++ b/src/generated/CPACSLavatoryElements.cpp @@ -0,0 +1,129 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSDeckElementBase.h" +#include "CPACSDeckElements.h" +#include "CPACSLavatoryElements.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSLavatoryElements::CPACSLavatoryElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSLavatoryElements::~CPACSLavatoryElements() + { + } + + const CPACSDeckElements* CPACSLavatoryElements::GetParent() const + { + return m_parent; + } + + CPACSDeckElements* CPACSLavatoryElements::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSLavatoryElements::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSLavatoryElements::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSLavatoryElements::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSLavatoryElements::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSLavatoryElements::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element lavatoryElement + if (tixi::TixiCheckElement(tixiHandle, xpath + "/lavatoryElement")) { + tixi::TixiReadElements(tixiHandle, xpath + "/lavatoryElement", m_lavatoryElements, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSLavatoryElements::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element lavatoryElement + tixi::TixiSaveElements(tixiHandle, xpath + "/lavatoryElement", m_lavatoryElements); + + } + + const std::vector>& CPACSLavatoryElements::GetLavatoryElements() const + { + return m_lavatoryElements; + } + + std::vector>& CPACSLavatoryElements::GetLavatoryElements() + { + return m_lavatoryElements; + } + + CPACSDeckElementBase& CPACSLavatoryElements::AddLavatoryElement() + { + m_lavatoryElements.push_back(make_unique(this, m_uidMgr)); + return *m_lavatoryElements.back(); + } + + void CPACSLavatoryElements::RemoveLavatoryElement(CPACSDeckElementBase& ref) + { + for (std::size_t i = 0; i < m_lavatoryElements.size(); i++) { + if (m_lavatoryElements[i].get() == &ref) { + m_lavatoryElements.erase(m_lavatoryElements.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSLavatoryElements.h b/src/generated/CPACSLavatoryElements.h new file mode 100644 index 000000000..0aab0c3a9 --- /dev/null +++ b/src/generated/CPACSLavatoryElements.h @@ -0,0 +1,90 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSDeckElementBase; + class CPACSDeckElements; + + // This class is used in: + // CPACSDeckElements + + /// @brief Lavatory elements + /// + /// Lavatory element collection type + /// + class CPACSLavatoryElements + { + public: + TIGL_EXPORT CPACSLavatoryElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSLavatoryElements(); + + TIGL_EXPORT CPACSDeckElements* GetParent(); + + TIGL_EXPORT const CPACSDeckElements* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetLavatoryElements() const; + TIGL_EXPORT virtual std::vector>& GetLavatoryElements(); + + TIGL_EXPORT virtual CPACSDeckElementBase& AddLavatoryElement(); + TIGL_EXPORT virtual void RemoveLavatoryElement(CPACSDeckElementBase& ref); + + protected: + CPACSDeckElements* m_parent; + + CTiglUIDManager* m_uidMgr; + + /// Lavatory element for use in the decks + std::vector> m_lavatoryElements; + + private: + CPACSLavatoryElements(const CPACSLavatoryElements&) = delete; + CPACSLavatoryElements& operator=(const CPACSLavatoryElements&) = delete; + + CPACSLavatoryElements(CPACSLavatoryElements&&) = delete; + CPACSLavatoryElements& operator=(CPACSLavatoryElements&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSLavatoryElements = generated::CPACSLavatoryElements; +using CCPACSDeckElementBase = generated::CPACSDeckElementBase; +using CCPACSDeckElements = generated::CPACSDeckElements; +} // namespace tigl diff --git a/src/generated/CPACSLinkToFile.cpp b/src/generated/CPACSLinkToFile.cpp index 3fa30141b..9183c6b95 100644 --- a/src/generated/CPACSLinkToFile.cpp +++ b/src/generated/CPACSLinkToFile.cpp @@ -17,6 +17,7 @@ #include #include "CCPACSExternalObject.h" +#include "CPACSGenericGeometryComponent.h" #include "CPACSLinkToFile.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -31,30 +32,44 @@ namespace generated { //assert(parent != NULL); m_parent = parent; + m_parentType = &typeid(CCPACSExternalObject); } - CPACSLinkToFile::~CPACSLinkToFile() - { - } - - const CCPACSExternalObject* CPACSLinkToFile::GetParent() const + CPACSLinkToFile::CPACSLinkToFile(CPACSGenericGeometryComponent* parent) { - return m_parent; + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSGenericGeometryComponent); } - CCPACSExternalObject* CPACSLinkToFile::GetParent() + CPACSLinkToFile::~CPACSLinkToFile() { - return m_parent; } const CTiglUIDObject* CPACSLinkToFile::GetNextUIDParent() const { - return m_parent; + if (m_parent) { + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + } + return nullptr; } CTiglUIDObject* CPACSLinkToFile::GetNextUIDParent() { - return m_parent; + if (m_parent) { + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } + } + return nullptr; } void CPACSLinkToFile::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) diff --git a/src/generated/CPACSLinkToFile.h b/src/generated/CPACSLinkToFile.h index 6f580837d..88da27d72 100644 --- a/src/generated/CPACSLinkToFile.h +++ b/src/generated/CPACSLinkToFile.h @@ -21,7 +21,9 @@ #include #include #include +#include #include "CPACSLinkToFileType_format.h" +#include "CTiglError.h" #include "tigl_internal.h" namespace tigl @@ -31,10 +33,13 @@ class CCPACSExternalObject; namespace generated { + class CPACSGenericGeometryComponent; + // This class is used in: // CPACSGenericGeometricComponent + // CPACSGenericGeometryComponent - /// @brief linkToFile + /// @brief Link to file (Step, Iges or Stl) /// /// Please provide a link to the additional file that shall /// be loaded by the TIGL library. Furthermore it is necessary to @@ -46,12 +51,35 @@ namespace generated { public: TIGL_EXPORT CPACSLinkToFile(CCPACSExternalObject* parent); + TIGL_EXPORT CPACSLinkToFile(CPACSGenericGeometryComponent* parent); TIGL_EXPORT virtual ~CPACSLinkToFile(); - TIGL_EXPORT CCPACSExternalObject* GetParent(); - - TIGL_EXPORT const CCPACSExternalObject* GetParent() const; + template + bool IsParent() const + { + return m_parentType != NULL && *m_parentType == typeid(P); + } + + template + P* GetParent() + { + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSLinkToFile"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + template + const P* GetParent() const + { + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSLinkToFile"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -66,7 +94,8 @@ namespace generated TIGL_EXPORT virtual void SetValue(const std::string& value); protected: - CCPACSExternalObject* m_parent; + void* m_parent; + const std::type_info* m_parentType; boost::optional m_format; std::string m_value; @@ -82,4 +111,5 @@ namespace generated // Aliases in tigl namespace using CCPACSLinkToFile = generated::CPACSLinkToFile; +using CCPACSGenericGeometryComponent = generated::CPACSGenericGeometryComponent; } // namespace tigl diff --git a/src/generated/CPACSLuggageCompartmentElements.cpp b/src/generated/CPACSLuggageCompartmentElements.cpp new file mode 100644 index 000000000..82acf973c --- /dev/null +++ b/src/generated/CPACSLuggageCompartmentElements.cpp @@ -0,0 +1,129 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSDeckElementBase.h" +#include "CPACSDeckElements.h" +#include "CPACSLuggageCompartmentElements.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSLuggageCompartmentElements::CPACSLuggageCompartmentElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSLuggageCompartmentElements::~CPACSLuggageCompartmentElements() + { + } + + const CPACSDeckElements* CPACSLuggageCompartmentElements::GetParent() const + { + return m_parent; + } + + CPACSDeckElements* CPACSLuggageCompartmentElements::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSLuggageCompartmentElements::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSLuggageCompartmentElements::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSLuggageCompartmentElements::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSLuggageCompartmentElements::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSLuggageCompartmentElements::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element luggageCompartmentElement + if (tixi::TixiCheckElement(tixiHandle, xpath + "/luggageCompartmentElement")) { + tixi::TixiReadElements(tixiHandle, xpath + "/luggageCompartmentElement", m_luggageCompartmentElements, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSLuggageCompartmentElements::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element luggageCompartmentElement + tixi::TixiSaveElements(tixiHandle, xpath + "/luggageCompartmentElement", m_luggageCompartmentElements); + + } + + const std::vector>& CPACSLuggageCompartmentElements::GetLuggageCompartmentElements() const + { + return m_luggageCompartmentElements; + } + + std::vector>& CPACSLuggageCompartmentElements::GetLuggageCompartmentElements() + { + return m_luggageCompartmentElements; + } + + CPACSDeckElementBase& CPACSLuggageCompartmentElements::AddLuggageCompartmentElement() + { + m_luggageCompartmentElements.push_back(make_unique(this, m_uidMgr)); + return *m_luggageCompartmentElements.back(); + } + + void CPACSLuggageCompartmentElements::RemoveLuggageCompartmentElement(CPACSDeckElementBase& ref) + { + for (std::size_t i = 0; i < m_luggageCompartmentElements.size(); i++) { + if (m_luggageCompartmentElements[i].get() == &ref) { + m_luggageCompartmentElements.erase(m_luggageCompartmentElements.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSLuggageCompartmentElements.h b/src/generated/CPACSLuggageCompartmentElements.h new file mode 100644 index 000000000..cac516e6b --- /dev/null +++ b/src/generated/CPACSLuggageCompartmentElements.h @@ -0,0 +1,90 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSDeckElementBase; + class CPACSDeckElements; + + // This class is used in: + // CPACSDeckElements + + /// @brief Luggage compartment elements + /// + /// Luggage compartment element collection type + /// + class CPACSLuggageCompartmentElements + { + public: + TIGL_EXPORT CPACSLuggageCompartmentElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSLuggageCompartmentElements(); + + TIGL_EXPORT CPACSDeckElements* GetParent(); + + TIGL_EXPORT const CPACSDeckElements* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetLuggageCompartmentElements() const; + TIGL_EXPORT virtual std::vector>& GetLuggageCompartmentElements(); + + TIGL_EXPORT virtual CPACSDeckElementBase& AddLuggageCompartmentElement(); + TIGL_EXPORT virtual void RemoveLuggageCompartmentElement(CPACSDeckElementBase& ref); + + protected: + CPACSDeckElements* m_parent; + + CTiglUIDManager* m_uidMgr; + + /// Luggage compartment element for use in the decks + std::vector> m_luggageCompartmentElements; + + private: + CPACSLuggageCompartmentElements(const CPACSLuggageCompartmentElements&) = delete; + CPACSLuggageCompartmentElements& operator=(const CPACSLuggageCompartmentElements&) = delete; + + CPACSLuggageCompartmentElements(CPACSLuggageCompartmentElements&&) = delete; + CPACSLuggageCompartmentElements& operator=(CPACSLuggageCompartmentElements&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSLuggageCompartmentElements = generated::CPACSLuggageCompartmentElements; +using CCPACSDeckElementBase = generated::CPACSDeckElementBase; +using CCPACSDeckElements = generated::CPACSDeckElements; +} // namespace tigl diff --git a/src/generated/CPACSMassInertia.cpp b/src/generated/CPACSMassInertia.cpp new file mode 100644 index 000000000..67cb5348a --- /dev/null +++ b/src/generated/CPACSMassInertia.cpp @@ -0,0 +1,216 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSDeckElementMass.h" +#include "CPACSMassInertia.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSMassInertia::CPACSMassInertia(CPACSDeckElementMass* parent) + : m_Jxx(0) + , m_Jyy(0) + , m_Jzz(0) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSMassInertia::~CPACSMassInertia() + { + } + + const CPACSDeckElementMass* CPACSMassInertia::GetParent() const + { + return m_parent; + } + + CPACSDeckElementMass* CPACSMassInertia::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSMassInertia::GetNextUIDParent() const + { + return m_parent; + } + + CTiglUIDObject* CPACSMassInertia::GetNextUIDParent() + { + return m_parent; + } + + void CPACSMassInertia::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element Jxx + if (tixi::TixiCheckElement(tixiHandle, xpath + "/Jxx")) { + m_Jxx = tixi::TixiGetElement(tixiHandle, xpath + "/Jxx"); + } + else { + LOG(ERROR) << "Required element Jxx is missing at xpath " << xpath; + } + + // read element Jyy + if (tixi::TixiCheckElement(tixiHandle, xpath + "/Jyy")) { + m_Jyy = tixi::TixiGetElement(tixiHandle, xpath + "/Jyy"); + } + else { + LOG(ERROR) << "Required element Jyy is missing at xpath " << xpath; + } + + // read element Jzz + if (tixi::TixiCheckElement(tixiHandle, xpath + "/Jzz")) { + m_Jzz = tixi::TixiGetElement(tixiHandle, xpath + "/Jzz"); + } + else { + LOG(ERROR) << "Required element Jzz is missing at xpath " << xpath; + } + + // read element Jxy + if (tixi::TixiCheckElement(tixiHandle, xpath + "/Jxy")) { + m_Jxy = tixi::TixiGetElement(tixiHandle, xpath + "/Jxy"); + } + + // read element Jxz + if (tixi::TixiCheckElement(tixiHandle, xpath + "/Jxz")) { + m_Jxz = tixi::TixiGetElement(tixiHandle, xpath + "/Jxz"); + } + + // read element Jyz + if (tixi::TixiCheckElement(tixiHandle, xpath + "/Jyz")) { + m_Jyz = tixi::TixiGetElement(tixiHandle, xpath + "/Jyz"); + } + + } + + void CPACSMassInertia::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element Jxx + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/Jxx"); + tixi::TixiSaveElement(tixiHandle, xpath + "/Jxx", m_Jxx); + + // write element Jyy + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/Jyy"); + tixi::TixiSaveElement(tixiHandle, xpath + "/Jyy", m_Jyy); + + // write element Jzz + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/Jzz"); + tixi::TixiSaveElement(tixiHandle, xpath + "/Jzz", m_Jzz); + + // write element Jxy + if (m_Jxy) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/Jxy"); + tixi::TixiSaveElement(tixiHandle, xpath + "/Jxy", *m_Jxy); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/Jxy")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/Jxy"); + } + } + + // write element Jxz + if (m_Jxz) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/Jxz"); + tixi::TixiSaveElement(tixiHandle, xpath + "/Jxz", *m_Jxz); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/Jxz")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/Jxz"); + } + } + + // write element Jyz + if (m_Jyz) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/Jyz"); + tixi::TixiSaveElement(tixiHandle, xpath + "/Jyz", *m_Jyz); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/Jyz")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/Jyz"); + } + } + + } + + const double& CPACSMassInertia::GetJxx() const + { + return m_Jxx; + } + + void CPACSMassInertia::SetJxx(const double& value) + { + m_Jxx = value; + } + + const double& CPACSMassInertia::GetJyy() const + { + return m_Jyy; + } + + void CPACSMassInertia::SetJyy(const double& value) + { + m_Jyy = value; + } + + const double& CPACSMassInertia::GetJzz() const + { + return m_Jzz; + } + + void CPACSMassInertia::SetJzz(const double& value) + { + m_Jzz = value; + } + + const boost::optional& CPACSMassInertia::GetJxy() const + { + return m_Jxy; + } + + void CPACSMassInertia::SetJxy(const boost::optional& value) + { + m_Jxy = value; + } + + const boost::optional& CPACSMassInertia::GetJxz() const + { + return m_Jxz; + } + + void CPACSMassInertia::SetJxz(const boost::optional& value) + { + m_Jxz = value; + } + + const boost::optional& CPACSMassInertia::GetJyz() const + { + return m_Jyz; + } + + void CPACSMassInertia::SetJyz(const boost::optional& value) + { + m_Jyz = value; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSMassInertia.h b/src/generated/CPACSMassInertia.h new file mode 100644 index 000000000..f0b1994ff --- /dev/null +++ b/src/generated/CPACSMassInertia.h @@ -0,0 +1,98 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDObject; + +namespace generated +{ + class CPACSDeckElementMass; + + // This class is used in: + // CPACSDeckElementMass + + /// @brief Mass intertia + /// + /// massInertiaType + /// + class CPACSMassInertia + { + public: + TIGL_EXPORT CPACSMassInertia(CPACSDeckElementMass* parent); + + TIGL_EXPORT virtual ~CPACSMassInertia(); + + TIGL_EXPORT CPACSDeckElementMass* GetParent(); + + TIGL_EXPORT const CPACSDeckElementMass* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const double& GetJxx() const; + TIGL_EXPORT virtual void SetJxx(const double& value); + + TIGL_EXPORT virtual const double& GetJyy() const; + TIGL_EXPORT virtual void SetJyy(const double& value); + + TIGL_EXPORT virtual const double& GetJzz() const; + TIGL_EXPORT virtual void SetJzz(const double& value); + + TIGL_EXPORT virtual const boost::optional& GetJxy() const; + TIGL_EXPORT virtual void SetJxy(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetJxz() const; + TIGL_EXPORT virtual void SetJxz(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetJyz() const; + TIGL_EXPORT virtual void SetJyz(const boost::optional& value); + + protected: + CPACSDeckElementMass* m_parent; + + double m_Jxx; + double m_Jyy; + double m_Jzz; + boost::optional m_Jxy; + boost::optional m_Jxz; + boost::optional m_Jyz; + + private: + CPACSMassInertia(const CPACSMassInertia&) = delete; + CPACSMassInertia& operator=(const CPACSMassInertia&) = delete; + + CPACSMassInertia(CPACSMassInertia&&) = delete; + CPACSMassInertia& operator=(CPACSMassInertia&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSMassInertia = generated::CPACSMassInertia; +using CCPACSDeckElementMass = generated::CPACSDeckElementMass; +} // namespace tigl diff --git a/src/generated/CPACSNacelleCenterCowl.h b/src/generated/CPACSNacelleCenterCowl.h index 843ee8a0b..3bcc12e28 100644 --- a/src/generated/CPACSNacelleCenterCowl.h +++ b/src/generated/CPACSNacelleCenterCowl.h @@ -34,9 +34,10 @@ namespace generated // This class is used in: // CPACSEngineNacelle - /// @brief nacelleCenterCowlType + /// @brief Center cowl /// - /// Describes the curve for defining rotational center of the engine. + /// The centerCowl is defined by the rotation of a given curve profile (referenced via curveUID ) around the x -axis. + /// @see nacelle_centerCowl /// class CPACSNacelleCenterCowl : public CTiglReqUIDObject, public ITiglUIDRefObject { @@ -73,7 +74,11 @@ namespace generated CTiglUIDManager* m_uidMgr; std::string m_uID; + + /// Offset of the rotation curve in x-direction double m_xOffset; + + /// UID of the curve profile (vehicles/profiles/curveProfiles/..) std::string m_curveUID; private: diff --git a/src/generated/CPACSNacelleCowl.h b/src/generated/CPACSNacelleCowl.h index 40c2b9c13..27179b64c 100644 --- a/src/generated/CPACSNacelleCowl.h +++ b/src/generated/CPACSNacelleCowl.h @@ -39,7 +39,7 @@ namespace generated // This class is used in: // CPACSEngineNacelle - /// @brief nacelleCowlType + /// @brief Nacelle cowl /// /// Describes the cowl geometry for nacelles /// using sections positioned around the diff --git a/src/generated/CPACSNacelleGuideCurve.cpp b/src/generated/CPACSNacelleGuideCurve.cpp index 8c92d3320..8fd9a78d7 100644 --- a/src/generated/CPACSNacelleGuideCurve.cpp +++ b/src/generated/CPACSNacelleGuideCurve.cpp @@ -103,13 +103,10 @@ namespace generated // read element description if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); - if (m_description.empty()) { - LOG(WARNING) << "Required element description is empty at xpath " << xpath; + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; } } - else { - LOG(ERROR) << "Required element description is missing at xpath " << xpath; - } // read element guideCurveProfileUID if (tixi::TixiCheckElement(tixiHandle, xpath + "/guideCurveProfileUID")) { @@ -160,8 +157,15 @@ namespace generated tixi::TixiSaveElement(tixiHandle, xpath + "/name", m_name); // write element description - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description"); - tixi::TixiSaveElement(tixiHandle, xpath + "/description", m_description); + if (m_description) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description"); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } // write element guideCurveProfileUID tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/guideCurveProfileUID"); @@ -191,12 +195,12 @@ namespace generated m_name = value; } - const std::string& CPACSNacelleGuideCurve::GetDescription() const + const boost::optional& CPACSNacelleGuideCurve::GetDescription() const { return m_description; } - void CPACSNacelleGuideCurve::SetDescription(const std::string& value) + void CPACSNacelleGuideCurve::SetDescription(const boost::optional& value) { m_description = value; } diff --git a/src/generated/CPACSNacelleGuideCurve.h b/src/generated/CPACSNacelleGuideCurve.h index 262bfa82b..483981b5e 100644 --- a/src/generated/CPACSNacelleGuideCurve.h +++ b/src/generated/CPACSNacelleGuideCurve.h @@ -17,6 +17,8 @@ #pragma once +#include +#include #include #include #include "ITiglUIDRefObject.h" @@ -33,6 +35,19 @@ namespace generated // This class is used in: // CPACSNacelleGuideCurves + /// @brief Guide curve + /// + /// The following figure shows the basic setup of the guide curves. + /// They always start at a given ζ-position ( fromZeta ) on the profile of the specified start section ( startSectionUID ) and end at the ζ-position ( toZeta ) on the profile of the subsequent section. + /// The relative coordinates of the guide curves are specified in cpacs/vehicles/profiles/guideCurves and referenced via its uID . + /// @see nacelle_guideCurves + /// Note : Guide curves and profiles must result in a valid curve network. + /// The guide curve points are interpreted as ( Δr and Δx ) offsets from a cubic polynomial. + /// This polynomial serves as a baseline for guide curves between segments located on different radial positions with smooth transitions: + /// @see nacelle_guideCurve + /// Note : Currently, the nacelles do not have an explicit guide curve type but employ the standard guide curve definition, which is used in wings and profiles. + /// Therefore, the parameters have a different meaning: + /// Standard guide curve parameter Nacelle guide curve equivalent Description rX φ Independent variable normalized to [0,1] rY Δx Orthogonal offset (translation in x -direction) rZ Δr Radial offset class CPACSNacelleGuideCurve : public ITiglUIDRefObject { public: @@ -56,8 +71,8 @@ namespace generated TIGL_EXPORT virtual const std::string& GetName() const; TIGL_EXPORT virtual void SetName(const std::string& value); - TIGL_EXPORT virtual const std::string& GetDescription() const; - TIGL_EXPORT virtual void SetDescription(const std::string& value); + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); TIGL_EXPORT virtual const std::string& GetGuideCurveProfileUID() const; TIGL_EXPORT virtual void SetGuideCurveProfileUID(const std::string& value); @@ -76,12 +91,26 @@ namespace generated CTiglUIDManager* m_uidMgr; - std::string m_name; - std::string m_description; - std::string m_guideCurveProfileUID; - std::string m_startSectionUID; - double m_fromZeta; - double m_toZeta; + /// Name + std::string m_name; + + /// Description + boost::optional m_description; + + /// UID of the guide curve profile + std::string m_guideCurveProfileUID; + + /// UID of the start section + std::string m_startSectionUID; + + /// Curve coordinate of the referenced section profile at which the guide curve shall start. + /// Valid values are in the interval -1,..,1. + double m_fromZeta; + + /// Curve coordinate of the profile following the referenced section profile. + /// It defines where the guide curve ends. + /// Valid values are in the interval -1,..,1. + double m_toZeta; private: TIGL_EXPORT const CTiglUIDObject* GetNextUIDObject() const final; diff --git a/src/generated/CPACSNacelleGuideCurves.h b/src/generated/CPACSNacelleGuideCurves.h index 7c90c2acf..a147bf703 100644 --- a/src/generated/CPACSNacelleGuideCurves.h +++ b/src/generated/CPACSNacelleGuideCurves.h @@ -36,6 +36,9 @@ namespace generated // This class is used in: // CPACSNacelleCowl + /// @brief Guide curves + /// + /// class CPACSNacelleGuideCurves { public: diff --git a/src/generated/CPACSNacelleSection.h b/src/generated/CPACSNacelleSection.h index 894173692..eb2de046b 100644 --- a/src/generated/CPACSNacelleSection.h +++ b/src/generated/CPACSNacelleSection.h @@ -36,9 +36,75 @@ namespace generated // This class is used in: // CPACSNacelleSections - /// @brief nacelleSectionType + /// @brief Section /// + /// An engine nacelle is defined by sections, where at least one and up to an infinite number of sections can be specified. + /// Lofting of the nacelle surface along the sections is done in cylindrical coordinates. + /// The coordinate origin refers to the center of the fan , i.e. the sections and their profiles are typically shifted in negative x-direction. + /// Note : In the current CPACS release, transformations are still labeled as Cartesian coordinates. + /// It is current work in progress to explicitly introduce cylindrical coordinates. + /// Until this is implemented in a future CPACS release, the implicit conventions listed below apply: + /// Translation component Cylindrical coordinate equivalent Description x ϑ Rotation angle around x y h Horizontal translation z r Radial translation The following example illustrates the setup of a nacelle with 4 sections. + /// These are rotated by 0, 120, 180 and 240 degrees around the x -axis (given by translation/x ). + /// To illustrate the possible transformations, the profile of the upper section is shifted slightly further in the negative x -direction ( translation/y ), while the lower section has a smaller radial distance from the rotation axis ( translation/z ). + /// In addition, the sections are scaled differently ( transformation/scaling ; not shown in the example figures) in order to create a straight trailing edge and to realize a flattened profile near the ground. + /// The following example also shows the profile cut-outs due to the radially symmetric inner region of the nacelle defined by the rotationCurve . For detailed information, please refer to the documentation of the rotationCurve element. + /// @see nacelle_sections + /// The first section is not rotated ( x=ϑ=0 ), but shifted vertically in negative direction ( y=h=-0.257 ). + /// The radial distance is given by z=r=0.365 : /// + /// <section uID="fanCowl_upperSection"> + /// <name>Upper section</name> + /// <transformation> + /// <scaling> + /// <x>1.055</x> + /// <y>1</y> + /// <z>1</z> + /// </scaling> + /// <translation> + /// <x>0.0</x> + /// <y>-0.257</y> + /// <z>0.365</z> + /// </translation> + /// </transformation> + /// <profileUID>fanCowlUpperSectionProfile</profileUID> + /// </section> + /// The second section is rotated around the x -axis ( x=ϑ=120 ) as well as scaled by a factor of 1.1 in its profile height: + /// + /// <section uID="fanCowl_inboardSection"> + /// <name>Inboard section</name> + /// <transformation> + /// <scaling> + /// <x>1</x> + /// <y>1</y> + /// <z>1.1</z> + /// </scaling> + /// <translation> + /// <x>120.0</x> + /// <y>-0.2</y> + /// <z>0.365</z> + /// </translation> + /// </transformation> + /// <profileUID>fanCowlUpperSectionProfile</profileUID> + /// </section> + /// The third section is rotated around the x -axis by 180° and scaled by a factor of 0.8 in its profile height: + /// + /// <section uID="fanCowl_lowerSection"> + /// <name>Lower section</name> + /// <transformation> + /// <scaling> + /// <x>1</x> + /// <y>1</y> + /// <z>0.8</z> + /// </scaling> + /// <translation> + /// <x>180.0</x> + /// <y>-0.2</y> + /// <z>0.33</z> + /// </translation> + /// </transformation> + /// <profileUID>fanCowlUpperSectionProfile</profileUID> + /// </section> /// class CPACSNacelleSection : public CTiglReqUIDObject, public ITiglUIDRefObject { @@ -81,9 +147,16 @@ namespace generated CTiglUIDManager* m_uidMgr; std::string m_uID; + + /// Name std::string m_name; + + /// Description boost::optional m_description; + CCPACSTransformation m_transformation; + + /// UID of the profile std::string m_profileUID; private: diff --git a/src/generated/CPACSNacelleSections.h b/src/generated/CPACSNacelleSections.h index e34023952..7e0a63d5c 100644 --- a/src/generated/CPACSNacelleSections.h +++ b/src/generated/CPACSNacelleSections.h @@ -35,7 +35,7 @@ namespace generated // This class is used in: // CPACSNacelleCowl - /// @brief nacelleSectionsType + /// @brief Sections /// /// /// diff --git a/src/generated/CPACSPoint.cpp b/src/generated/CPACSPoint.cpp index dbe7beeaa..33e747923 100644 --- a/src/generated/CPACSPoint.cpp +++ b/src/generated/CPACSPoint.cpp @@ -17,11 +17,12 @@ #include #include "CCPACSTransformation.h" +#include "CPACSBoundingBox.h" #include "CPACSControlSurfaceHingePoint.h" #include "CPACSControlSurfaceStep.h" +#include "CPACSDeckElementMass.h" #include "CPACSPoint.h" #include "CPACSPointList.h" -#include "CPACSSeatModule.h" #include "CTiglError.h" #include "CTiglLogging.h" #include "CTiglUIDManager.h" @@ -31,6 +32,14 @@ namespace tigl { namespace generated { + CPACSPoint::CPACSPoint(CPACSBoundingBox* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSBoundingBox); + } + CPACSPoint::CPACSPoint(CPACSControlSurfaceHingePoint* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { @@ -47,20 +56,20 @@ namespace generated m_parentType = &typeid(CPACSControlSurfaceStep); } - CPACSPoint::CPACSPoint(CPACSPointList* parent, CTiglUIDManager* uidMgr) + CPACSPoint::CPACSPoint(CPACSDeckElementMass* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CPACSPointList); + m_parentType = &typeid(CPACSDeckElementMass); } - CPACSPoint::CPACSPoint(CPACSSeatModule* parent, CTiglUIDManager* uidMgr) + CPACSPoint::CPACSPoint(CPACSPointList* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; - m_parentType = &typeid(CPACSSeatModule); + m_parentType = &typeid(CPACSPointList); } CPACSPoint::CPACSPoint(CCPACSTransformation* parent, CTiglUIDManager* uidMgr) @@ -79,18 +88,21 @@ namespace generated const CTiglUIDObject* CPACSPoint::GetNextUIDParent() const { if (m_parent) { + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } if (IsParent()) { return GetParent()->GetNextUIDParent(); } if (IsParent()) { return GetParent()->GetNextUIDParent(); } + if (IsParent()) { + return GetParent(); + } if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent(); - } if (IsParent()) { if (GetParent()->GetUID()) return GetParent(); @@ -104,18 +116,21 @@ namespace generated CTiglUIDObject* CPACSPoint::GetNextUIDParent() { if (m_parent) { + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } if (IsParent()) { return GetParent()->GetNextUIDParent(); } if (IsParent()) { return GetParent()->GetNextUIDParent(); } + if (IsParent()) { + return GetParent(); + } if (IsParent()) { return GetParent()->GetNextUIDParent(); } - if (IsParent()) { - return GetParent(); - } if (IsParent()) { if (GetParent()->GetUID()) return GetParent(); diff --git a/src/generated/CPACSPoint.h b/src/generated/CPACSPoint.h index bb06957ff..83743bd54 100644 --- a/src/generated/CPACSPoint.h +++ b/src/generated/CPACSPoint.h @@ -33,16 +33,18 @@ class CCPACSTransformation; namespace generated { + class CPACSBoundingBox; class CPACSControlSurfaceHingePoint; class CPACSControlSurfaceStep; + class CPACSDeckElementMass; class CPACSPointList; - class CPACSSeatModule; // This class is used in: + // CPACSBoundingBox // CPACSControlSurfaceHingePoint // CPACSControlSurfaceStep + // CPACSDeckElementMass // CPACSPointList - // CPACSSeatModule // CPACSTransformation /// @brief Point: x,y,z @@ -52,10 +54,11 @@ namespace generated class CPACSPoint : public CTiglOptUIDObject { public: + TIGL_EXPORT CPACSPoint(CPACSBoundingBox* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSPoint(CPACSControlSurfaceHingePoint* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSPoint(CPACSControlSurfaceStep* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSPoint(CPACSDeckElementMass* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSPoint(CPACSPointList* parent, CTiglUIDManager* uidMgr); - TIGL_EXPORT CPACSPoint(CPACSSeatModule* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSPoint(CCPACSTransformation* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSPoint(); @@ -69,7 +72,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSPoint"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSPoint"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -79,7 +82,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSPoint"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSPoint"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -136,8 +139,9 @@ namespace generated // CPACSPoint is customized, use type CCPACSPoint directly // Aliases in tigl namespace +using CCPACSBoundingBox = generated::CPACSBoundingBox; using CCPACSControlSurfaceHingePoint = generated::CPACSControlSurfaceHingePoint; using CCPACSControlSurfaceStep = generated::CPACSControlSurfaceStep; +using CCPACSDeckElementMass = generated::CPACSDeckElementMass; using CCPACSPointList = generated::CPACSPointList; -using CCPACSSeatModule = generated::CPACSSeatModule; } // namespace tigl diff --git a/src/generated/CPACSPointListRelXYZVector.h b/src/generated/CPACSPointListRelXYZVector.h index 6a39b8aef..a05fa972f 100644 --- a/src/generated/CPACSPointListRelXYZVector.h +++ b/src/generated/CPACSPointListRelXYZVector.h @@ -73,7 +73,7 @@ namespace generated CCPACSGuideCurveProfile* m_parent; /// Vector of rX coordinates. Relative - /// circumferential coordinate on wing / fuselage profile + /// circumferential coordinate on wing, fuselage or nacelle profile CCPACSStringVector m_rX; /// Vector of rY coordinates. Relative span diff --git a/src/generated/CPACSPosExcl0IntBase.cpp b/src/generated/CPACSPosExcl0IntBase.cpp new file mode 100644 index 000000000..db2812ac2 --- /dev/null +++ b/src/generated/CPACSPosExcl0IntBase.cpp @@ -0,0 +1,191 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSGalleyElement.h" +#include "CPACSPosExcl0IntBase.h" +#include "CPACSSeatElement.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSPosExcl0IntBase::CPACSPosExcl0IntBase(CPACSGalleyElement* parent) + : m_value(0) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSGalleyElement); + } + + CPACSPosExcl0IntBase::CPACSPosExcl0IntBase(CPACSSeatElement* parent) + : m_value(0) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSSeatElement); + } + + CPACSPosExcl0IntBase::~CPACSPosExcl0IntBase() + { + } + + const CTiglUIDObject* CPACSPosExcl0IntBase::GetNextUIDParent() const + { + if (m_parent) { + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + } + return nullptr; + } + + CTiglUIDObject* CPACSPosExcl0IntBase::GetNextUIDParent() + { + if (m_parent) { + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + } + return nullptr; + } + + void CPACSPosExcl0IntBase::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute externalDataNodePath + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataNodePath")) { + m_externalDataNodePath = tixi::TixiGetAttribute(tixiHandle, xpath, "externalDataNodePath"); + if (m_externalDataNodePath->empty()) { + LOG(WARNING) << "Optional attribute externalDataNodePath is present but empty at xpath " << xpath; + } + } + + // read attribute externalFileName + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalFileName")) { + m_externalFileName = tixi::TixiGetAttribute(tixiHandle, xpath, "externalFileName"); + if (m_externalFileName->empty()) { + LOG(WARNING) << "Optional attribute externalFileName is present but empty at xpath " << xpath; + } + } + + // read attribute externalDataDirectory + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataDirectory")) { + m_externalDataDirectory = tixi::TixiGetAttribute(tixiHandle, xpath, "externalDataDirectory"); + if (m_externalDataDirectory->empty()) { + LOG(WARNING) << "Optional attribute externalDataDirectory is present but empty at xpath " << xpath; + } + } + + // read simpleContent + if (tixi::TixiCheckElement(tixiHandle, xpath)) { + m_value = tixi::TixiGetElement(tixiHandle, xpath); + } + else { + LOG(ERROR) << "Required simpleContent is missing at xpath " << xpath; + } + + } + + void CPACSPosExcl0IntBase::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write attribute externalDataNodePath + if (m_externalDataNodePath) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "externalDataNodePath", *m_externalDataNodePath); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataNodePath")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "externalDataNodePath"); + } + } + + // write attribute externalFileName + if (m_externalFileName) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "externalFileName", *m_externalFileName); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalFileName")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "externalFileName"); + } + } + + // write attribute externalDataDirectory + if (m_externalDataDirectory) { + tixi::TixiSaveAttribute(tixiHandle, xpath, "externalDataDirectory", *m_externalDataDirectory); + } + else { + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "externalDataDirectory")) { + tixi::TixiRemoveAttribute(tixiHandle, xpath, "externalDataDirectory"); + } + } + + // write simpleContent + tixi::TixiSaveElement(tixiHandle, xpath, m_value); + + } + + const boost::optional& CPACSPosExcl0IntBase::GetExternalDataNodePath() const + { + return m_externalDataNodePath; + } + + void CPACSPosExcl0IntBase::SetExternalDataNodePath(const boost::optional& value) + { + m_externalDataNodePath = value; + } + + const boost::optional& CPACSPosExcl0IntBase::GetExternalFileName() const + { + return m_externalFileName; + } + + void CPACSPosExcl0IntBase::SetExternalFileName(const boost::optional& value) + { + m_externalFileName = value; + } + + const boost::optional& CPACSPosExcl0IntBase::GetExternalDataDirectory() const + { + return m_externalDataDirectory; + } + + void CPACSPosExcl0IntBase::SetExternalDataDirectory(const boost::optional& value) + { + m_externalDataDirectory = value; + } + + const int& CPACSPosExcl0IntBase::GetValue() const + { + return m_value; + } + + void CPACSPosExcl0IntBase::SetValue(const int& value) + { + m_value = value; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSPosExcl0IntBase.h b/src/generated/CPACSPosExcl0IntBase.h new file mode 100644 index 000000000..44651918d --- /dev/null +++ b/src/generated/CPACSPosExcl0IntBase.h @@ -0,0 +1,120 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include +#include +#include "CTiglError.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDObject; + +namespace generated +{ + class CPACSGalleyElement; + class CPACSSeatElement; + + // This class is used in: + // CPACSGalleyElement + // CPACSSeatElement + + /// @brief integerBaseType + /// + /// Base type for integer nodes (including external data + /// attributes) + /// + class CPACSPosExcl0IntBase + { + public: + TIGL_EXPORT CPACSPosExcl0IntBase(CPACSGalleyElement* parent); + TIGL_EXPORT CPACSPosExcl0IntBase(CPACSSeatElement* parent); + + TIGL_EXPORT virtual ~CPACSPosExcl0IntBase(); + + template + bool IsParent() const + { + return m_parentType != NULL && *m_parentType == typeid(P); + } + + template + P* GetParent() + { + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSPosExcl0IntBase"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + template + const P* GetParent() const + { + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSPosExcl0IntBase"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const boost::optional& GetExternalDataNodePath() const; + TIGL_EXPORT virtual void SetExternalDataNodePath(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetExternalFileName() const; + TIGL_EXPORT virtual void SetExternalFileName(const boost::optional& value); + + TIGL_EXPORT virtual const boost::optional& GetExternalDataDirectory() const; + TIGL_EXPORT virtual void SetExternalDataDirectory(const boost::optional& value); + + TIGL_EXPORT virtual const int& GetValue() const; + TIGL_EXPORT virtual void SetValue(const int& value); + + protected: + void* m_parent; + const std::type_info* m_parentType; + + boost::optional m_externalDataNodePath; + boost::optional m_externalFileName; + boost::optional m_externalDataDirectory; + int m_value; + + private: + CPACSPosExcl0IntBase(const CPACSPosExcl0IntBase&) = delete; + CPACSPosExcl0IntBase& operator=(const CPACSPosExcl0IntBase&) = delete; + + CPACSPosExcl0IntBase(CPACSPosExcl0IntBase&&) = delete; + CPACSPosExcl0IntBase& operator=(CPACSPosExcl0IntBase&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSPosExcl0IntBase = generated::CPACSPosExcl0IntBase; +using CCPACSGalleyElement = generated::CPACSGalleyElement; +using CCPACSSeatElement = generated::CPACSSeatElement; +} // namespace tigl diff --git a/src/generated/CPACSRotationCurve.h b/src/generated/CPACSRotationCurve.h index 6c22d0317..7df9960d4 100644 --- a/src/generated/CPACSRotationCurve.h +++ b/src/generated/CPACSRotationCurve.h @@ -33,6 +33,38 @@ namespace generated // This class is used in: // CPACSNacelleCowl + /// @brief Rotation curve + /// + /// The figure below shows an example of a rotation curve. + /// Together with the corresponding XML code, the definition is explained in more detail. + /// @see nacelle_rotationCurve + /// First, the reference system is defined via referenceSectionUID , for which in this example the section with uID="engine_nacelle_fanCowl_section1" is referenced. + /// This in turn contains a transformation (not shown here), for example a translation by z=0.4 and a scaling, where the x -direction is stretched by a factor of two. + /// The rotation curve is now described in this reference system. + /// It is predefined in the profile library and referenced via a its uID . + /// Note that the curve is defined in the range x=[0,..,1] in order to be reasonably transformed by the reference system. + /// Next, the blending from the rotated profile of the nacelle segment to the rotation curve is defined. + /// The corresponding start and end points are given in curve coordinates zeta of the corresponding profiles. + /// Note that the lower part of the segment profile counts from zeta=[-1,..,0] and the upper part counts from zeta=[0,..,1] . + /// In between, the blending is linear. + /// + /// <rotationCurve uID="rotationCurve"> + /// <referenceSectionUID>engine_nacelle_fanCowl_section1</referenceSectionUID> + /// <curveProfileUID>fanCowl_upperSection</curveProfileUID> + /// <startZetaBlending>-0.6</startZetaBlending> + /// <startZeta>-0.5</startZeta> + /// <endZeta>-0.2</endZeta>s + /// <endZetaBlending>-0.1</endZetaBlending> + /// </rotationCurve> + /// + /// <curveProfile uID="fanCowlRotationCurve"> + /// <name>Fan cowl rotation curve profile</name> + /// <pointList> + /// <x mapType="vector">0;0.5;1</x> + /// <y mapType="vector">-0.1;-0.2;-0.05</y> + /// </pointList> + /// </curveProfile> + /// class CPACSRotationCurve : public CTiglReqUIDObject, public ITiglUIDRefObject { public: @@ -80,11 +112,23 @@ namespace generated CTiglUIDManager* m_uidMgr; std::string m_uID; + + /// UID of the section which serves as reference std::string m_referenceSectionUID; + + /// Start zeta [-1,..,1]; relative curve coordante along the rotation curve from which it will be inserted in the nacelle. double m_startZeta; + + /// End zeta [-1,..,1]; relative curve coordante along the rotation curve up to which it will be inserted in the nacelle. double m_endZeta; + + /// Start zeta for blending [-1..1]; relative curve coordinate along the nacelle profile at which blending from the nacelle profile to the rotation curve will begin. double m_startZetaBlending; + + /// End zeta for blending; relative curve coordinate along the nacelle profile at which blending from the rotation curve to the nacelle profile will end. double m_endZetaBlending; + + /// UID of the rotation curve profile; the profile should be defined in x=[0..1] to be transformed by the section which is referenced by referenceSectionUID. std::string m_curveProfileUID; private: diff --git a/src/generated/CPACSSeatElement.cpp b/src/generated/CPACSSeatElement.cpp new file mode 100644 index 000000000..c443f3f69 --- /dev/null +++ b/src/generated/CPACSSeatElement.cpp @@ -0,0 +1,266 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSSeatElement.h" +#include "CPACSSeatElements.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSSeatElement::CPACSSeatElement(CPACSSeatElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + , m_geometry(this, m_uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSSeatElement::~CPACSSeatElement() + { + if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); + } + + const CPACSSeatElements* CPACSSeatElement::GetParent() const + { + return m_parent; + } + + CPACSSeatElements* CPACSSeatElement::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSSeatElement::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSSeatElement::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSSeatElement::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSSeatElement::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSSeatElement::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read attribute uID + if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { + m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); + if (m_uID.empty()) { + LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; + } + } + else { + LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; + } + + // read element description + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); + if (m_description->empty()) { + LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; + } + } + + // read element geometry + if (tixi::TixiCheckElement(tixiHandle, xpath + "/geometry")) { + m_geometry.ReadCPACS(tixiHandle, xpath + "/geometry"); + } + else { + LOG(ERROR) << "Required element geometry is missing at xpath " << xpath; + } + + // read element mass + if (tixi::TixiCheckElement(tixiHandle, xpath + "/mass")) { + m_mass = boost::in_place(this, m_uidMgr); + try { + m_mass->ReadCPACS(tixiHandle, xpath + "/mass"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read mass at xpath " << xpath << ": " << e.what(); + m_mass = boost::none; + } + } + + // read element numberOfSeats + if (tixi::TixiCheckElement(tixiHandle, xpath + "/numberOfSeats")) { + m_numberOfSeats = boost::in_place(this); + try { + m_numberOfSeats->ReadCPACS(tixiHandle, xpath + "/numberOfSeats"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read numberOfSeats at xpath " << xpath << ": " << e.what(); + m_numberOfSeats = boost::none; + } + } + + if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); + } + + void CPACSSeatElement::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write attribute uID + tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); + + // write element description + if (m_description) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description"); + tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); + } + } + + // write element geometry + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/geometry"); + m_geometry.WriteCPACS(tixiHandle, xpath + "/geometry"); + + // write element mass + if (m_mass) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/mass"); + m_mass->WriteCPACS(tixiHandle, xpath + "/mass"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/mass")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/mass"); + } + } + + // write element numberOfSeats + if (m_numberOfSeats) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/numberOfSeats"); + m_numberOfSeats->WriteCPACS(tixiHandle, xpath + "/numberOfSeats"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/numberOfSeats")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/numberOfSeats"); + } + } + + } + + const std::string& CPACSSeatElement::GetUID() const + { + return m_uID; + } + + void CPACSSeatElement::SetUID(const std::string& value) + { + if (m_uidMgr && value != m_uID) { + if (m_uID.empty()) { + m_uidMgr->RegisterObject(value, *this); + } + else { + m_uidMgr->UpdateObjectUID(m_uID, value); + } + } + m_uID = value; + } + + const boost::optional& CPACSSeatElement::GetDescription() const + { + return m_description; + } + + void CPACSSeatElement::SetDescription(const boost::optional& value) + { + m_description = value; + } + + const CPACSDeckElementGeometry& CPACSSeatElement::GetGeometry() const + { + return m_geometry; + } + + CPACSDeckElementGeometry& CPACSSeatElement::GetGeometry() + { + return m_geometry; + } + + const boost::optional& CPACSSeatElement::GetMass() const + { + return m_mass; + } + + boost::optional& CPACSSeatElement::GetMass() + { + return m_mass; + } + + const boost::optional& CPACSSeatElement::GetNumberOfSeats() const + { + return m_numberOfSeats; + } + + boost::optional& CPACSSeatElement::GetNumberOfSeats() + { + return m_numberOfSeats; + } + + CPACSDeckElementMass& CPACSSeatElement::GetMass(CreateIfNotExistsTag) + { + if (!m_mass) + m_mass = boost::in_place(this, m_uidMgr); + return *m_mass; + } + + void CPACSSeatElement::RemoveMass() + { + m_mass = boost::none; + } + + CPACSPosExcl0IntBase& CPACSSeatElement::GetNumberOfSeats(CreateIfNotExistsTag) + { + if (!m_numberOfSeats) + m_numberOfSeats = boost::in_place(this); + return *m_numberOfSeats; + } + + void CPACSSeatElement::RemoveNumberOfSeats() + { + m_numberOfSeats = boost::none; + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSSeatElement.h b/src/generated/CPACSSeatElement.h new file mode 100644 index 000000000..ee7c88c57 --- /dev/null +++ b/src/generated/CPACSSeatElement.h @@ -0,0 +1,116 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include +#include "CPACSDeckElementGeometry.h" +#include "CPACSDeckElementMass.h" +#include "CPACSPosExcl0IntBase.h" +#include "CreateIfNotExists.h" +#include "CTiglUIDObject.h" +#include "tigl_internal.h" + +namespace tigl +{ +class CTiglUIDManager; + +namespace generated +{ + class CPACSSeatElements; + + // This class is used in: + // CPACSSeatElements + + /// @brief Seat element + /// + /// Seat element type, containing the base elements of the cabin + /// + class CPACSSeatElement : public CTiglReqUIDObject + { + public: + TIGL_EXPORT CPACSSeatElement(CPACSSeatElements* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSSeatElement(); + + TIGL_EXPORT CPACSSeatElements* GetParent(); + + TIGL_EXPORT const CPACSSeatElements* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::string& GetUID() const; + TIGL_EXPORT virtual void SetUID(const std::string& value); + + TIGL_EXPORT virtual const boost::optional& GetDescription() const; + TIGL_EXPORT virtual void SetDescription(const boost::optional& value); + + TIGL_EXPORT virtual const CPACSDeckElementGeometry& GetGeometry() const; + TIGL_EXPORT virtual CPACSDeckElementGeometry& GetGeometry(); + + TIGL_EXPORT virtual const boost::optional& GetMass() const; + TIGL_EXPORT virtual boost::optional& GetMass(); + + TIGL_EXPORT virtual const boost::optional& GetNumberOfSeats() const; + TIGL_EXPORT virtual boost::optional& GetNumberOfSeats(); + + TIGL_EXPORT virtual CPACSDeckElementMass& GetMass(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveMass(); + + TIGL_EXPORT virtual CPACSPosExcl0IntBase& GetNumberOfSeats(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveNumberOfSeats(); + + protected: + CPACSSeatElements* m_parent; + + CTiglUIDManager* m_uidMgr; + + std::string m_uID; + + /// Description + boost::optional m_description; + + CPACSDeckElementGeometry m_geometry; + + boost::optional m_mass; + + /// Number of seats + boost::optional m_numberOfSeats; + + private: + CPACSSeatElement(const CPACSSeatElement&) = delete; + CPACSSeatElement& operator=(const CPACSSeatElement&) = delete; + + CPACSSeatElement(CPACSSeatElement&&) = delete; + CPACSSeatElement& operator=(CPACSSeatElement&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSSeatElement = generated::CPACSSeatElement; +using CCPACSSeatElements = generated::CPACSSeatElements; +} // namespace tigl diff --git a/src/generated/CPACSSeatElements.cpp b/src/generated/CPACSSeatElements.cpp new file mode 100644 index 000000000..a81e09233 --- /dev/null +++ b/src/generated/CPACSSeatElements.cpp @@ -0,0 +1,129 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSDeckElements.h" +#include "CPACSSeatElement.h" +#include "CPACSSeatElements.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSSeatElements::CPACSSeatElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSSeatElements::~CPACSSeatElements() + { + } + + const CPACSDeckElements* CPACSSeatElements::GetParent() const + { + return m_parent; + } + + CPACSDeckElements* CPACSSeatElements::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSSeatElements::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSSeatElements::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSSeatElements::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSSeatElements::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSSeatElements::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element seatElement + if (tixi::TixiCheckElement(tixiHandle, xpath + "/seatElement")) { + tixi::TixiReadElements(tixiHandle, xpath + "/seatElement", m_seatElements, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSSeatElements::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element seatElement + tixi::TixiSaveElements(tixiHandle, xpath + "/seatElement", m_seatElements); + + } + + const std::vector>& CPACSSeatElements::GetSeatElements() const + { + return m_seatElements; + } + + std::vector>& CPACSSeatElements::GetSeatElements() + { + return m_seatElements; + } + + CPACSSeatElement& CPACSSeatElements::AddSeatElement() + { + m_seatElements.push_back(make_unique(this, m_uidMgr)); + return *m_seatElements.back(); + } + + void CPACSSeatElements::RemoveSeatElement(CPACSSeatElement& ref) + { + for (std::size_t i = 0; i < m_seatElements.size(); i++) { + if (m_seatElements[i].get() == &ref) { + m_seatElements.erase(m_seatElements.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSSeatElements.h b/src/generated/CPACSSeatElements.h new file mode 100644 index 000000000..a5bd4ccec --- /dev/null +++ b/src/generated/CPACSSeatElements.h @@ -0,0 +1,90 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSSeatElement; + class CPACSDeckElements; + + // This class is used in: + // CPACSDeckElements + + /// @brief Seat elements + /// + /// Seat element collection type + /// + class CPACSSeatElements + { + public: + TIGL_EXPORT CPACSSeatElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSSeatElements(); + + TIGL_EXPORT CPACSDeckElements* GetParent(); + + TIGL_EXPORT const CPACSDeckElements* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetSeatElements() const; + TIGL_EXPORT virtual std::vector>& GetSeatElements(); + + TIGL_EXPORT virtual CPACSSeatElement& AddSeatElement(); + TIGL_EXPORT virtual void RemoveSeatElement(CPACSSeatElement& ref); + + protected: + CPACSDeckElements* m_parent; + + CTiglUIDManager* m_uidMgr; + + /// Seat element for use in the decks + std::vector> m_seatElements; + + private: + CPACSSeatElements(const CPACSSeatElements&) = delete; + CPACSSeatElements& operator=(const CPACSSeatElements&) = delete; + + CPACSSeatElements(CPACSSeatElements&&) = delete; + CPACSSeatElements& operator=(CPACSSeatElements&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSSeatElements = generated::CPACSSeatElements; +using CCPACSSeatElement = generated::CPACSSeatElement; +using CCPACSDeckElements = generated::CPACSDeckElements; +} // namespace tigl diff --git a/src/generated/CPACSSeatModule.cpp b/src/generated/CPACSSeatModule.cpp deleted file mode 100644 index c7fe64e9a..000000000 --- a/src/generated/CPACSSeatModule.cpp +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// 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 -#include "CPACSSeatModule.h" -#include "CPACSSeatModules.h" -#include "CTiglError.h" -#include "CTiglLogging.h" -#include "CTiglUIDManager.h" -#include "TixiHelper.h" - -namespace tigl -{ -namespace generated -{ - CPACSSeatModule::CPACSSeatModule(CPACSSeatModules* parent, CTiglUIDManager* uidMgr) - : m_uidMgr(uidMgr) - , m_numberOfSeats(0) - , m_widthOfSeatModule(0) - { - //assert(parent != NULL); - m_parent = parent; - } - - CPACSSeatModule::~CPACSSeatModule() - { - if (m_uidMgr) m_uidMgr->TryUnregisterObject(m_uID); - } - - const CPACSSeatModules* CPACSSeatModule::GetParent() const - { - return m_parent; - } - - CPACSSeatModules* CPACSSeatModule::GetParent() - { - return m_parent; - } - - const CTiglUIDObject* CPACSSeatModule::GetNextUIDParent() const - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDObject* CPACSSeatModule::GetNextUIDParent() - { - if (m_parent) { - return m_parent->GetNextUIDParent(); - } - return nullptr; - } - - CTiglUIDManager& CPACSSeatModule::GetUIDManager() - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - const CTiglUIDManager& CPACSSeatModule::GetUIDManager() const - { - if (!m_uidMgr) { - throw CTiglError("UIDManager is null"); - } - return *m_uidMgr; - } - - void CPACSSeatModule::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) - { - // read attribute uID - if (tixi::TixiCheckAttribute(tixiHandle, xpath, "uID")) { - m_uID = tixi::TixiGetAttribute(tixiHandle, xpath, "uID"); - if (m_uID.empty()) { - LOG(WARNING) << "Required attribute uID is empty at xpath " << xpath; - } - } - else { - LOG(ERROR) << "Required attribute uID is missing at xpath " << xpath; - } - - // read element name - if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { - m_name = tixi::TixiGetElement(tixiHandle, xpath + "/name"); - if (m_name->empty()) { - LOG(WARNING) << "Optional element name is present but empty at xpath " << xpath; - } - } - - // read element description - if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { - m_description = tixi::TixiGetElement(tixiHandle, xpath + "/description"); - if (m_description->empty()) { - LOG(WARNING) << "Optional element description is present but empty at xpath " << xpath; - } - } - - // read element numberOfSeats - if (tixi::TixiCheckElement(tixiHandle, xpath + "/numberOfSeats")) { - m_numberOfSeats = tixi::TixiGetElement(tixiHandle, xpath + "/numberOfSeats"); - } - else { - LOG(ERROR) << "Required element numberOfSeats is missing at xpath " << xpath; - } - - // read element widthOfSeatModule - if (tixi::TixiCheckElement(tixiHandle, xpath + "/widthOfSeatModule")) { - m_widthOfSeatModule = tixi::TixiGetElement(tixiHandle, xpath + "/widthOfSeatModule"); - } - else { - LOG(ERROR) << "Required element widthOfSeatModule is missing at xpath " << xpath; - } - - // read element moduleMass - if (tixi::TixiCheckElement(tixiHandle, xpath + "/moduleMass")) { - m_moduleMass = tixi::TixiGetElement(tixiHandle, xpath + "/moduleMass"); - } - - // read element moduleCoG - if (tixi::TixiCheckElement(tixiHandle, xpath + "/moduleCoG")) { - m_moduleCoG = boost::in_place(this, m_uidMgr); - try { - m_moduleCoG->ReadCPACS(tixiHandle, xpath + "/moduleCoG"); - } catch(const std::exception& e) { - LOG(ERROR) << "Failed to read moduleCoG at xpath " << xpath << ": " << e.what(); - m_moduleCoG = boost::none; - } - } - - if (m_uidMgr && !m_uID.empty()) m_uidMgr->RegisterObject(m_uID, *this); - } - - void CPACSSeatModule::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const - { - // write attribute uID - tixi::TixiSaveAttribute(tixiHandle, xpath, "uID", m_uID); - - // write element name - if (m_name) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/name"); - tixi::TixiSaveElement(tixiHandle, xpath + "/name", *m_name); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/name")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/name"); - } - } - - // write element description - if (m_description) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/description"); - tixi::TixiSaveElement(tixiHandle, xpath + "/description", *m_description); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/description")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/description"); - } - } - - // write element numberOfSeats - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/numberOfSeats"); - tixi::TixiSaveElement(tixiHandle, xpath + "/numberOfSeats", m_numberOfSeats); - - // write element widthOfSeatModule - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/widthOfSeatModule"); - tixi::TixiSaveElement(tixiHandle, xpath + "/widthOfSeatModule", m_widthOfSeatModule); - - // write element moduleMass - if (m_moduleMass) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/moduleMass"); - tixi::TixiSaveElement(tixiHandle, xpath + "/moduleMass", *m_moduleMass); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/moduleMass")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/moduleMass"); - } - } - - // write element moduleCoG - if (m_moduleCoG) { - tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/moduleCoG"); - m_moduleCoG->WriteCPACS(tixiHandle, xpath + "/moduleCoG"); - } - else { - if (tixi::TixiCheckElement(tixiHandle, xpath + "/moduleCoG")) { - tixi::TixiRemoveElement(tixiHandle, xpath + "/moduleCoG"); - } - } - - } - - const std::string& CPACSSeatModule::GetUID() const - { - return m_uID; - } - - void CPACSSeatModule::SetUID(const std::string& value) - { - if (m_uidMgr && value != m_uID) { - if (m_uID.empty()) { - m_uidMgr->RegisterObject(value, *this); - } - else { - m_uidMgr->UpdateObjectUID(m_uID, value); - } - } - m_uID = value; - } - - const boost::optional& CPACSSeatModule::GetName() const - { - return m_name; - } - - void CPACSSeatModule::SetName(const boost::optional& value) - { - m_name = value; - } - - const boost::optional& CPACSSeatModule::GetDescription() const - { - return m_description; - } - - void CPACSSeatModule::SetDescription(const boost::optional& value) - { - m_description = value; - } - - const int& CPACSSeatModule::GetNumberOfSeats() const - { - return m_numberOfSeats; - } - - void CPACSSeatModule::SetNumberOfSeats(const int& value) - { - m_numberOfSeats = value; - } - - const double& CPACSSeatModule::GetWidthOfSeatModule() const - { - return m_widthOfSeatModule; - } - - void CPACSSeatModule::SetWidthOfSeatModule(const double& value) - { - m_widthOfSeatModule = value; - } - - const boost::optional& CPACSSeatModule::GetModuleMass() const - { - return m_moduleMass; - } - - void CPACSSeatModule::SetModuleMass(const boost::optional& value) - { - m_moduleMass = value; - } - - const boost::optional& CPACSSeatModule::GetModuleCoG() const - { - return m_moduleCoG; - } - - boost::optional& CPACSSeatModule::GetModuleCoG() - { - return m_moduleCoG; - } - - CCPACSPoint& CPACSSeatModule::GetModuleCoG(CreateIfNotExistsTag) - { - if (!m_moduleCoG) - m_moduleCoG = boost::in_place(this, m_uidMgr); - return *m_moduleCoG; - } - - void CPACSSeatModule::RemoveModuleCoG() - { - m_moduleCoG = boost::none; - } - -} // namespace generated -} // namespace tigl diff --git a/src/generated/CPACSSeatModule.h b/src/generated/CPACSSeatModule.h deleted file mode 100644 index 7f8e43966..000000000 --- a/src/generated/CPACSSeatModule.h +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) 2020 RISC Software GmbH -// -// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). -// Do not edit, all changes are lost when files are re-generated. -// -// 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 -#include -#include -#include -#include -#include "CreateIfNotExists.h" -#include "CTiglUIDObject.h" -#include "tigl_internal.h" - -namespace tigl -{ -class CTiglUIDManager; - -namespace generated -{ - class CPACSSeatModules; - - // This class is used in: - // CPACSSeatModules - - /// @brief seatModuleType - /// - /// SeatModule type, containing data of a seat module - /// - class CPACSSeatModule : public CTiglReqUIDObject - { - public: - TIGL_EXPORT CPACSSeatModule(CPACSSeatModules* parent, CTiglUIDManager* uidMgr); - - TIGL_EXPORT virtual ~CPACSSeatModule(); - - TIGL_EXPORT CPACSSeatModules* GetParent(); - - TIGL_EXPORT const CPACSSeatModules* GetParent() const; - - TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); - TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; - - TIGL_EXPORT CTiglUIDManager& GetUIDManager(); - TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; - - TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); - TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - - TIGL_EXPORT virtual const std::string& GetUID() const; - TIGL_EXPORT virtual void SetUID(const std::string& value); - - TIGL_EXPORT virtual const boost::optional& GetName() const; - TIGL_EXPORT virtual void SetName(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetDescription() const; - TIGL_EXPORT virtual void SetDescription(const boost::optional& value); - - TIGL_EXPORT virtual const int& GetNumberOfSeats() const; - TIGL_EXPORT virtual void SetNumberOfSeats(const int& value); - - TIGL_EXPORT virtual const double& GetWidthOfSeatModule() const; - TIGL_EXPORT virtual void SetWidthOfSeatModule(const double& value); - - TIGL_EXPORT virtual const boost::optional& GetModuleMass() const; - TIGL_EXPORT virtual void SetModuleMass(const boost::optional& value); - - TIGL_EXPORT virtual const boost::optional& GetModuleCoG() const; - TIGL_EXPORT virtual boost::optional& GetModuleCoG(); - - TIGL_EXPORT virtual CCPACSPoint& GetModuleCoG(CreateIfNotExistsTag); - TIGL_EXPORT virtual void RemoveModuleCoG(); - - protected: - CPACSSeatModules* m_parent; - - CTiglUIDManager* m_uidMgr; - - std::string m_uID; - - /// Name of the seat module - boost::optional m_name; - - /// Description of the seat module - boost::optional m_description; - - /// Number of seats in the seat module, e.g 1, 2 - /// or 3 - int m_numberOfSeats; - - /// Total width of the seat module - double m_widthOfSeatModule; - - /// seat module mass (optional, use of data to be - /// clarified) - boost::optional m_moduleMass; - - /// seat module mass CoG (optional, use of data to - /// be clarified) - boost::optional m_moduleCoG; - - private: - CPACSSeatModule(const CPACSSeatModule&) = delete; - CPACSSeatModule& operator=(const CPACSSeatModule&) = delete; - - CPACSSeatModule(CPACSSeatModule&&) = delete; - CPACSSeatModule& operator=(CPACSSeatModule&&) = delete; - }; -} // namespace generated - -// Aliases in tigl namespace -using CCPACSSeatModule = generated::CPACSSeatModule; -using CCPACSSeatModules = generated::CPACSSeatModules; -} // namespace tigl diff --git a/src/generated/CPACSSeatModules.cpp b/src/generated/CPACSSeatModules.cpp index d4c628a8a..750e3132f 100644 --- a/src/generated/CPACSSeatModules.cpp +++ b/src/generated/CPACSSeatModules.cpp @@ -16,7 +16,7 @@ // limitations under the License. #include -#include "CPACSSeatModule.h" +#include "CPACSDeckComponent2DBase.h" #include "CPACSSeatModules.h" #include "CPACSStructuralElements.h" #include "CTiglError.h" @@ -98,23 +98,23 @@ namespace generated } - const std::vector>& CPACSSeatModules::GetSeatModules() const + const std::vector>& CPACSSeatModules::GetSeatModules() const { return m_seatModules; } - std::vector>& CPACSSeatModules::GetSeatModules() + std::vector>& CPACSSeatModules::GetSeatModules() { return m_seatModules; } - CPACSSeatModule& CPACSSeatModules::AddSeatModule() + CPACSDeckComponent2DBase& CPACSSeatModules::AddSeatModule() { - m_seatModules.push_back(make_unique(this, m_uidMgr)); + m_seatModules.push_back(make_unique(this, m_uidMgr)); return *m_seatModules.back(); } - void CPACSSeatModules::RemoveSeatModule(CPACSSeatModule& ref) + void CPACSSeatModules::RemoveSeatModule(CPACSDeckComponent2DBase& ref) { for (std::size_t i = 0; i < m_seatModules.size(); i++) { if (m_seatModules[i].get() == &ref) { diff --git a/src/generated/CPACSSeatModules.h b/src/generated/CPACSSeatModules.h index ba907350d..711241646 100644 --- a/src/generated/CPACSSeatModules.h +++ b/src/generated/CPACSSeatModules.h @@ -30,15 +30,15 @@ class CTiglUIDObject; namespace generated { - class CPACSSeatModule; + class CPACSDeckComponent2DBase; class CPACSStructuralElements; // This class is used in: // CPACSStructuralElements - /// @brief seatModulesType + /// @brief Seat modules /// - /// SeatModules type, containing seat modules + /// Seat module instance collection type. /// class CPACSSeatModules { @@ -60,18 +60,19 @@ namespace generated TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; - TIGL_EXPORT virtual const std::vector>& GetSeatModules() const; - TIGL_EXPORT virtual std::vector>& GetSeatModules(); + TIGL_EXPORT virtual const std::vector>& GetSeatModules() const; + TIGL_EXPORT virtual std::vector>& GetSeatModules(); - TIGL_EXPORT virtual CPACSSeatModule& AddSeatModule(); - TIGL_EXPORT virtual void RemoveSeatModule(CPACSSeatModule& ref); + TIGL_EXPORT virtual CPACSDeckComponent2DBase& AddSeatModule(); + TIGL_EXPORT virtual void RemoveSeatModule(CPACSDeckComponent2DBase& ref); protected: CPACSStructuralElements* m_parent; CTiglUIDManager* m_uidMgr; - std::vector> m_seatModules; + /// Seat module + std::vector> m_seatModules; private: CPACSSeatModules(const CPACSSeatModules&) = delete; @@ -84,6 +85,6 @@ namespace generated // Aliases in tigl namespace using CCPACSSeatModules = generated::CPACSSeatModules; -using CCPACSSeatModule = generated::CPACSSeatModule; +using CCPACSDeckComponent2DBase = generated::CPACSDeckComponent2DBase; using CCPACSStructuralElements = generated::CPACSStructuralElements; } // namespace tigl diff --git a/src/generated/CPACSSidewallPanelElements.cpp b/src/generated/CPACSSidewallPanelElements.cpp new file mode 100644 index 000000000..4b44ca25d --- /dev/null +++ b/src/generated/CPACSSidewallPanelElements.cpp @@ -0,0 +1,129 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include "CPACSDeckElementBase.h" +#include "CPACSDeckElements.h" +#include "CPACSSidewallPanelElements.h" +#include "CTiglError.h" +#include "CTiglLogging.h" +#include "CTiglUIDManager.h" +#include "CTiglUIDObject.h" +#include "TixiHelper.h" + +namespace tigl +{ +namespace generated +{ + CPACSSidewallPanelElements::CPACSSidewallPanelElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + } + + CPACSSidewallPanelElements::~CPACSSidewallPanelElements() + { + } + + const CPACSDeckElements* CPACSSidewallPanelElements::GetParent() const + { + return m_parent; + } + + CPACSDeckElements* CPACSSidewallPanelElements::GetParent() + { + return m_parent; + } + + const CTiglUIDObject* CPACSSidewallPanelElements::GetNextUIDParent() const + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDObject* CPACSSidewallPanelElements::GetNextUIDParent() + { + if (m_parent) { + return m_parent->GetNextUIDParent(); + } + return nullptr; + } + + CTiglUIDManager& CPACSSidewallPanelElements::GetUIDManager() + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + const CTiglUIDManager& CPACSSidewallPanelElements::GetUIDManager() const + { + if (!m_uidMgr) { + throw CTiglError("UIDManager is null"); + } + return *m_uidMgr; + } + + void CPACSSidewallPanelElements::ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) + { + // read element sidewallPanelElement + if (tixi::TixiCheckElement(tixiHandle, xpath + "/sidewallPanelElement")) { + tixi::TixiReadElements(tixiHandle, xpath + "/sidewallPanelElement", m_sidewallPanelElements, 1, tixi::xsdUnbounded, this, m_uidMgr); + } + + } + + void CPACSSidewallPanelElements::WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const + { + // write element sidewallPanelElement + tixi::TixiSaveElements(tixiHandle, xpath + "/sidewallPanelElement", m_sidewallPanelElements); + + } + + const std::vector>& CPACSSidewallPanelElements::GetSidewallPanelElements() const + { + return m_sidewallPanelElements; + } + + std::vector>& CPACSSidewallPanelElements::GetSidewallPanelElements() + { + return m_sidewallPanelElements; + } + + CPACSDeckElementBase& CPACSSidewallPanelElements::AddSidewallPanelElement() + { + m_sidewallPanelElements.push_back(make_unique(this, m_uidMgr)); + return *m_sidewallPanelElements.back(); + } + + void CPACSSidewallPanelElements::RemoveSidewallPanelElement(CPACSDeckElementBase& ref) + { + for (std::size_t i = 0; i < m_sidewallPanelElements.size(); i++) { + if (m_sidewallPanelElements[i].get() == &ref) { + m_sidewallPanelElements.erase(m_sidewallPanelElements.begin() + i); + return; + } + } + throw CTiglError("Element not found"); + } + +} // namespace generated +} // namespace tigl diff --git a/src/generated/CPACSSidewallPanelElements.h b/src/generated/CPACSSidewallPanelElements.h new file mode 100644 index 000000000..cdc82bd04 --- /dev/null +++ b/src/generated/CPACSSidewallPanelElements.h @@ -0,0 +1,90 @@ +// Copyright (c) 2020 RISC Software GmbH +// +// This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). +// Do not edit, all changes are lost when files are re-generated. +// +// 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 +#include +#include +#include "tigl_internal.h" +#include "UniquePtr.h" + +namespace tigl +{ +class CTiglUIDManager; +class CTiglUIDObject; + +namespace generated +{ + class CPACSDeckElementBase; + class CPACSDeckElements; + + // This class is used in: + // CPACSDeckElements + + /// @brief Sidewall panel elements + /// + /// Sidewall panel element collection type + /// + class CPACSSidewallPanelElements + { + public: + TIGL_EXPORT CPACSSidewallPanelElements(CPACSDeckElements* parent, CTiglUIDManager* uidMgr); + + TIGL_EXPORT virtual ~CPACSSidewallPanelElements(); + + TIGL_EXPORT CPACSDeckElements* GetParent(); + + TIGL_EXPORT const CPACSDeckElements* GetParent() const; + + TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); + TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; + + TIGL_EXPORT CTiglUIDManager& GetUIDManager(); + TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; + + TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); + TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; + + TIGL_EXPORT virtual const std::vector>& GetSidewallPanelElements() const; + TIGL_EXPORT virtual std::vector>& GetSidewallPanelElements(); + + TIGL_EXPORT virtual CPACSDeckElementBase& AddSidewallPanelElement(); + TIGL_EXPORT virtual void RemoveSidewallPanelElement(CPACSDeckElementBase& ref); + + protected: + CPACSDeckElements* m_parent; + + CTiglUIDManager* m_uidMgr; + + /// Sidewall panel element for use in the decks + std::vector> m_sidewallPanelElements; + + private: + CPACSSidewallPanelElements(const CPACSSidewallPanelElements&) = delete; + CPACSSidewallPanelElements& operator=(const CPACSSidewallPanelElements&) = delete; + + CPACSSidewallPanelElements(CPACSSidewallPanelElements&&) = delete; + CPACSSidewallPanelElements& operator=(CPACSSidewallPanelElements&&) = delete; + }; +} // namespace generated + +// Aliases in tigl namespace +using CCPACSSidewallPanelElements = generated::CPACSSidewallPanelElements; +using CCPACSDeckElementBase = generated::CPACSDeckElementBase; +using CCPACSDeckElements = generated::CPACSDeckElements; +} // namespace tigl diff --git a/src/generated/CPACSStructuralElements.h b/src/generated/CPACSStructuralElements.h index 2b2fd7cc3..bd897476c 100644 --- a/src/generated/CPACSStructuralElements.h +++ b/src/generated/CPACSStructuralElements.h @@ -130,13 +130,22 @@ namespace generated CTiglUIDManager* m_uidMgr; boost::optional m_sheetBasedStructuralElements; + boost::optional m_profileBasedStructuralElements; + boost::optional m_structuralWallElements; + boost::optional m_pressureBulkheads; + boost::optional m_windows; + boost::optional m_doors; + boost::optional m_doorSurroundStructures; + + /// Seat elements (Deprecation warning: This element will soon be removed from the official CPACS. Use the new seat modules located at cpacs/vehicles/deckElements!) boost::optional m_seatModules; + boost::optional m_rivets; private: diff --git a/src/generated/CPACSSymmetry.h b/src/generated/CPACSSymmetryXyXzYz.h similarity index 90% rename from src/generated/CPACSSymmetry.h rename to src/generated/CPACSSymmetryXyXzYz.h index fc97d8088..4a5133af2 100644 --- a/src/generated/CPACSSymmetry.h +++ b/src/generated/CPACSSymmetryXyXzYz.h @@ -40,7 +40,7 @@ namespace generated // CPACSRotor // CPACSWing - enum CPACSSymmetry + enum CPACSSymmetryXyXzYz { none, inherit, @@ -49,7 +49,7 @@ namespace generated y_z_plane }; - inline std::string TiglSymmetryAxisToString(const CPACSSymmetry& value) + inline std::string TiglSymmetryAxisToString(const CPACSSymmetryXyXzYz& value) { switch(value) { case none: return "none"; @@ -57,10 +57,10 @@ namespace generated case x_y_plane: return "x-y-plane"; case x_z_plane: return "x-z-plane"; case y_z_plane: return "y-z-plane"; - default: throw CTiglError("Invalid enum value \"" + std_to_string(static_cast(value)) + "\" for enum type CPACSSymmetry"); + default: throw CTiglError("Invalid enum value \"" + std_to_string(static_cast(value)) + "\" for enum type CPACSSymmetryXyXzYz"); } } - inline CPACSSymmetry stringToTiglSymmetryAxis(const std::string& value) + inline CPACSSymmetryXyXzYz stringToTiglSymmetryAxis(const std::string& value) { auto toLower = [](std::string str) { for (char& c : str) { c = std::tolower(c); } return str; }; if (toLower(value) == "none") { return none; } @@ -68,9 +68,9 @@ namespace generated if (toLower(value) == "x-y-plane") { return x_y_plane; } if (toLower(value) == "x-z-plane") { return x_z_plane; } if (toLower(value) == "y-z-plane") { return y_z_plane; } - throw CTiglError("Invalid string value \"" + value + "\" for enum type CPACSSymmetry"); + throw CTiglError("Invalid string value \"" + value + "\" for enum type CPACSSymmetryXyXzYz"); } } // namespace generated -// CPACSSymmetry is customized, use type TiglSymmetryAxis directly +// CPACSSymmetryXyXzYz is customized, use type TiglSymmetryAxis directly } // namespace tigl diff --git a/src/generated/CPACSTransformation.cpp b/src/generated/CPACSTransformation.cpp index 557eda843..a30f06213 100644 --- a/src/generated/CPACSTransformation.cpp +++ b/src/generated/CPACSTransformation.cpp @@ -31,6 +31,7 @@ #include "CCPACSWing.h" #include "CCPACSWingSection.h" #include "CCPACSWingSectionElement.h" +#include "CPACSGenericGeometryComponent.h" #include "CPACSLandingGearBase.h" #include "CPACSTransformation.h" #include "CTiglError.h" @@ -106,6 +107,14 @@ namespace generated m_parentType = &typeid(CCPACSExternalObject); } + CPACSTransformation::CPACSTransformation(CPACSGenericGeometryComponent* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) + { + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CPACSGenericGeometryComponent); + } + CPACSTransformation::CPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { @@ -202,6 +211,9 @@ namespace generated if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } if (IsParent()) { return GetParent(); } @@ -257,6 +269,9 @@ namespace generated if (IsParent()) { return GetParent(); } + if (IsParent()) { + return GetParent()->GetNextUIDParent(); + } if (IsParent()) { return GetParent(); } diff --git a/src/generated/CPACSTransformation.h b/src/generated/CPACSTransformation.h index 2de35de84..3b59248ce 100644 --- a/src/generated/CPACSTransformation.h +++ b/src/generated/CPACSTransformation.h @@ -50,6 +50,7 @@ class CCPACSWingSection; namespace generated { + class CPACSGenericGeometryComponent; class CPACSLandingGearBase; // This class is used in: @@ -61,6 +62,7 @@ namespace generated // CPACSFuselageElement // CPACSFuselageSection // CPACSGenericGeometricComponent + // CPACSGenericGeometryComponent // CPACSGenericSystem // CPACSLandingGearBase // CPACSNacelleSection @@ -94,6 +96,7 @@ namespace generated TIGL_EXPORT CPACSTransformation(CCPACSFuselageSectionElement* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSFuselageSection* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CPACSTransformation(CPACSGenericGeometryComponent* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CPACSLandingGearBase* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation(CCPACSNacelleSection* parent, CTiglUIDManager* uidMgr); @@ -114,7 +117,7 @@ namespace generated template P* GetParent() { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -124,7 +127,7 @@ namespace generated template const P* GetParent() const { - static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); + static_assert(std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation"); if (!IsParent

()) { throw CTiglError("bad parent"); } @@ -183,9 +186,7 @@ namespace generated /// Translation data default: 0,0,0. Translations /// can either be made absolute in the global coordinate system - /// (absGlobal), absolute in the local Coordinate system (absLocal) - /// or relative (relative), normalized with the maximum dimensions - /// of the parent. + /// (absGlobal) or absolute in the local Coordinate system (absLocal). boost::optional m_translation; private: @@ -200,5 +201,6 @@ namespace generated // CPACSTransformation is customized, use type CCPACSTransformation directly // Aliases in tigl namespace +using CCPACSGenericGeometryComponent = generated::CPACSGenericGeometryComponent; using CCPACSLandingGearBase = generated::CPACSLandingGearBase; } // namespace tigl diff --git a/src/generated/CPACSTransformation2D.cpp b/src/generated/CPACSTransformation2D.cpp index 69615ab3d..0629bf98f 100644 --- a/src/generated/CPACSTransformation2D.cpp +++ b/src/generated/CPACSTransformation2D.cpp @@ -17,6 +17,7 @@ #include #include "CCPACSProfileBasedStructuralElement.h" +#include "CPACSDeckComponent2DBase.h" #include "CPACSTransformation2D.h" #include "CTiglError.h" #include "CTiglLogging.h" @@ -27,36 +28,51 @@ namespace tigl { namespace generated { - CPACSTransformation2D::CPACSTransformation2D(CCPACSProfileBasedStructuralElement* parent, CTiglUIDManager* uidMgr) + CPACSTransformation2D::CPACSTransformation2D(CPACSDeckComponent2DBase* parent, CTiglUIDManager* uidMgr) : m_uidMgr(uidMgr) { //assert(parent != NULL); m_parent = parent; + m_parentType = &typeid(CPACSDeckComponent2DBase); } - CPACSTransformation2D::~CPACSTransformation2D() - { - if (m_uidMgr && m_uID) m_uidMgr->TryUnregisterObject(*m_uID); - } - - const CCPACSProfileBasedStructuralElement* CPACSTransformation2D::GetParent() const + CPACSTransformation2D::CPACSTransformation2D(CCPACSProfileBasedStructuralElement* parent, CTiglUIDManager* uidMgr) + : m_uidMgr(uidMgr) { - return m_parent; + //assert(parent != NULL); + m_parent = parent; + m_parentType = &typeid(CCPACSProfileBasedStructuralElement); } - CCPACSProfileBasedStructuralElement* CPACSTransformation2D::GetParent() + CPACSTransformation2D::~CPACSTransformation2D() { - return m_parent; + if (m_uidMgr && m_uID) m_uidMgr->TryUnregisterObject(*m_uID); } const CTiglUIDObject* CPACSTransformation2D::GetNextUIDParent() const { - return m_parent; + if (m_parent) { + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + } + return nullptr; } CTiglUIDObject* CPACSTransformation2D::GetNextUIDParent() { - return m_parent; + if (m_parent) { + if (IsParent()) { + return GetParent(); + } + if (IsParent()) { + return GetParent(); + } + } + return nullptr; } CTiglUIDManager& CPACSTransformation2D::GetUIDManager() diff --git a/src/generated/CPACSTransformation2D.h b/src/generated/CPACSTransformation2D.h index ffcf4a1e4..8173f85d3 100644 --- a/src/generated/CPACSTransformation2D.h +++ b/src/generated/CPACSTransformation2D.h @@ -22,8 +22,10 @@ #include #include #include +#include #include "CPACSPointZ.h" #include "CreateIfNotExists.h" +#include "CTiglError.h" #include "CTiglUIDObject.h" #include "tigl_internal.h" @@ -34,7 +36,10 @@ class CCPACSProfileBasedStructuralElement; namespace generated { + class CPACSDeckComponent2DBase; + // This class is used in: + // CPACSDeckComponent2DBase // CPACSProfileBasedStructuralElement /// @brief 2D transformation @@ -44,13 +49,36 @@ namespace generated class CPACSTransformation2D : public CTiglOptUIDObject { public: + TIGL_EXPORT CPACSTransformation2D(CPACSDeckComponent2DBase* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSTransformation2D(CCPACSProfileBasedStructuralElement* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSTransformation2D(); - TIGL_EXPORT CCPACSProfileBasedStructuralElement* GetParent(); - - TIGL_EXPORT const CCPACSProfileBasedStructuralElement* GetParent() const; + template + bool IsParent() const + { + return m_parentType != NULL && *m_parentType == typeid(P); + } + + template + P* GetParent() + { + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation2D"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } + + template + const P* GetParent() const + { + static_assert(std::is_same::value || std::is_same::value, "template argument for P is not a parent class of CPACSTransformation2D"); + if (!IsParent

()) { + throw CTiglError("bad parent"); + } + return static_cast(m_parent); + } TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; @@ -83,7 +111,8 @@ namespace generated TIGL_EXPORT virtual void RemoveTranslation(); protected: - CCPACSProfileBasedStructuralElement* m_parent; + void* m_parent; + const std::type_info* m_parentType; CTiglUIDManager* m_uidMgr; @@ -109,4 +138,5 @@ namespace generated // Aliases in tigl namespace using CCPACSTransformation2D = generated::CPACSTransformation2D; +using CCPACSDeckComponent2DBase = generated::CPACSDeckComponent2DBase; } // namespace tigl diff --git a/src/generated/CPACSVehicles.cpp b/src/generated/CPACSVehicles.cpp index 543c25cd2..2508b5787 100644 --- a/src/generated/CPACSVehicles.cpp +++ b/src/generated/CPACSVehicles.cpp @@ -160,6 +160,17 @@ namespace generated } } + // read element deckElements + if (tixi::TixiCheckElement(tixiHandle, xpath + "/deckElements")) { + m_deckElements = boost::in_place(this, m_uidMgr); + try { + m_deckElements->ReadCPACS(tixiHandle, xpath + "/deckElements"); + } catch(const std::exception& e) { + LOG(ERROR) << "Failed to read deckElements at xpath " << xpath << ": " << e.what(); + m_deckElements = boost::none; + } + } + // read element materials if (tixi::TixiCheckElement(tixiHandle, xpath + "/materials")) { m_materials = boost::in_place(this, m_uidMgr); @@ -252,6 +263,17 @@ namespace generated } } + // write element deckElements + if (m_deckElements) { + tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/deckElements"); + m_deckElements->WriteCPACS(tixiHandle, xpath + "/deckElements"); + } + else { + if (tixi::TixiCheckElement(tixiHandle, xpath + "/deckElements")) { + tixi::TixiRemoveElement(tixiHandle, xpath + "/deckElements"); + } + } + // write element materials if (m_materials) { tixi::TixiCreateElementIfNotExists(tixiHandle, xpath + "/materials"); @@ -335,6 +357,16 @@ namespace generated return m_structuralElements; } + const boost::optional& CPACSVehicles::GetDeckElements() const + { + return m_deckElements; + } + + boost::optional& CPACSVehicles::GetDeckElements() + { + return m_deckElements; + } + const boost::optional& CPACSVehicles::GetMaterials() const { return m_materials; @@ -429,6 +461,18 @@ namespace generated m_structuralElements = boost::none; } + CPACSDeckElements& CPACSVehicles::GetDeckElements(CreateIfNotExistsTag) + { + if (!m_deckElements) + m_deckElements = boost::in_place(this, m_uidMgr); + return *m_deckElements; + } + + void CPACSVehicles::RemoveDeckElements() + { + m_deckElements = boost::none; + } + CPACSMaterials& CPACSVehicles::GetMaterials(CreateIfNotExistsTag) { if (!m_materials) diff --git a/src/generated/CPACSVehicles.h b/src/generated/CPACSVehicles.h index 8587824b2..0d83d839c 100644 --- a/src/generated/CPACSVehicles.h +++ b/src/generated/CPACSVehicles.h @@ -24,6 +24,7 @@ #include #include #include "CPACSAircraft.h" +#include "CPACSDeckElements.h" #include "CPACSFlightPoints.h" #include "CPACSGlobalPerformanceCases.h" #include "CPACSMaterials.h" @@ -93,6 +94,9 @@ namespace generated TIGL_EXPORT virtual const boost::optional& GetStructuralElements() const; TIGL_EXPORT virtual boost::optional& GetStructuralElements(); + TIGL_EXPORT virtual const boost::optional& GetDeckElements() const; + TIGL_EXPORT virtual boost::optional& GetDeckElements(); + TIGL_EXPORT virtual const boost::optional& GetMaterials() const; TIGL_EXPORT virtual boost::optional& GetMaterials(); @@ -117,6 +121,9 @@ namespace generated TIGL_EXPORT virtual CPACSStructuralElements& GetStructuralElements(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveStructuralElements(); + TIGL_EXPORT virtual CPACSDeckElements& GetDeckElements(CreateIfNotExistsTag); + TIGL_EXPORT virtual void RemoveDeckElements(); + TIGL_EXPORT virtual CPACSMaterials& GetMaterials(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveMaterials(); @@ -132,6 +139,7 @@ namespace generated boost::optional m_engines; boost::optional m_profiles; boost::optional m_structuralElements; + boost::optional m_deckElements; boost::optional m_materials; private: diff --git a/src/geometry/CCPACSTransformation.cpp b/src/geometry/CCPACSTransformation.cpp index 76c7a2122..521438df8 100644 --- a/src/geometry/CCPACSTransformation.cpp +++ b/src/geometry/CCPACSTransformation.cpp @@ -77,6 +77,12 @@ CCPACSTransformation::CCPACSTransformation(CCPACSGenericSystem* parent, CTiglUID { } +CCPACSTransformation::CCPACSTransformation(CCPACSGenericGeometryComponent* parent, CTiglUIDManager* uidMgr) + : generated::CPACSTransformation(parent, uidMgr) + , _transformationMatrix(*this, &CCPACSTransformation::updateMatrix) +{ +} + CCPACSTransformation::CCPACSTransformation(CCPACSLandingGearBase* parent, CTiglUIDManager* uidMgr) : generated::CPACSTransformation(parent, uidMgr) , _transformationMatrix(*this, &CCPACSTransformation::updateMatrix) diff --git a/src/geometry/CCPACSTransformation.h b/src/geometry/CCPACSTransformation.h index 95d545400..24ae565bd 100644 --- a/src/geometry/CCPACSTransformation.h +++ b/src/geometry/CCPACSTransformation.h @@ -41,6 +41,7 @@ class CCPACSTransformation : public generated::CPACSTransformation TIGL_EXPORT CCPACSTransformation(CCPACSFuselageSection* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSExternalObject* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSGenericSystem* parent, CTiglUIDManager* uidMgr); + TIGL_EXPORT CCPACSTransformation(CCPACSGenericGeometryComponent* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSLandingGearBase* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSNacelleSection* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CCPACSTransformation(CCPACSRotor* parent, CTiglUIDManager* uidMgr);