3.5.0-rc1
Loading...
Searching...
No Matches
tigl::CCPACSComponent Class Reference

Geometric component representing a CPACS <component> within systems. More...

#include <CCPACSComponent.h>

Inheritance diagram for tigl::CCPACSComponent:

Data Structures

struct  MassCache

Public Member Functions

TIGL_EXPORT CCPACSComponent (CCPACSComponents *parent, CTiglUIDManager *uidMgr)
 Constructs a CCPACSComponent.
TIGL_EXPORT boost::optional< CTiglPointGetCenterOfGravityGlobal () const
 Returns the center of gravity in the global coordinate system.
TIGL_EXPORT boost::optional< CTiglPointGetCenterOfGravityLocal () const
 Returns the center of gravity in the component's local coordinate system.
TIGL_EXPORT boost::optional< CTiglPointGetCentroidGlobal () const
 Returns the geometric centroid of the component in the global coordinate system.
TIGL_EXPORT CTiglPoint GetCentroidLocal () const
 Returns the geometric centroid of the component in the local coordinate system.
TIGL_EXPORT TiglGeometricComponentIntent GetComponentIntent () const override
 Returns the TiGL geometric component intent.
TIGL_EXPORT TiglGeometryRepresentation GetComponentRepresentation () const
 Returns the geometric representation type of the referenced system element.
TIGL_EXPORT std::string GetComponentRepresentationAsString () const
 Returns the geometry representation of the referenced system element as string.
TIGL_EXPORT TiglGeometricComponentType GetComponentType () const override
 Returns the TiGL geometric component type.
TIGL_EXPORT CCPACSConfiguration const & GetConfiguration () const
TIGL_EXPORT std::string GetDefaultedUID () const override
 Returns the component UID (defaulted if required).
TIGL_EXPORT boost::optional< double > GetMass () const
 Returns the component mass.
TIGL_EXPORT boost::optional< CTiglMassInertiaGetMassInertiaLocal () const
 Returns the mass inertia tensor components in the local coordinate system.
TIGL_EXPORT bool IsPositioned () const
 Returns whether this component is explicitly positioned in CPACS.
TIGL_EXPORT void ReadCPACS (const TixiDocumentHandle &tixiHandle, const std::string &objectXPath) override
 Reads the CPACS subtree of this component.
Public Member Functions inherited from tigl::generated::CPACSComponent
TIGL_EXPORT CPACSComponent (CPACSComponents *parent, CTiglUIDManager *uidMgr)
virtual TIGL_EXPORT const boost::optional< std::string > & GetDescription () const
virtual TIGL_EXPORT const std::string & GetName () const
virtual TIGL_EXPORT CTiglUIDObjectGetNextUIDParent ()
virtual TIGL_EXPORT const CTiglUIDObjectGetNextUIDParent () const
TIGL_EXPORT CPACSComponentsGetParent ()
TIGL_EXPORT const CPACSComponentsGetParent () const
virtual TIGL_EXPORT const boost::optional< std::string > & GetParentUID () const
virtual TIGL_EXPORT boost::optional< CPACSUIDSequence > & GetStructuralMountUIDs ()
virtual TIGL_EXPORT const boost::optional< CPACSUIDSequence > & GetStructuralMountUIDs () const
virtual TIGL_EXPORT CPACSUIDSequenceGetStructuralMountUIDs (CreateIfNotExistsTag)
virtual TIGL_EXPORT const std::string & GetSystemElementUID () const
virtual TIGL_EXPORT boost::optional< CCPACSTransformationSE3 > & GetTransformation ()
virtual TIGL_EXPORT const boost::optional< CCPACSTransformationSE3 > & GetTransformation () const
virtual TIGL_EXPORT CCPACSTransformationSE3GetTransformation (CreateIfNotExistsTag)
virtual TIGL_EXPORT const std::string & GetUID () const
TIGL_EXPORT CTiglUIDManagerGetUIDManager ()
TIGL_EXPORT const CTiglUIDManagerGetUIDManager () const
virtual TIGL_EXPORT void RemoveStructuralMountUIDs ()
virtual TIGL_EXPORT void RemoveTransformation ()
virtual TIGL_EXPORT void SetDescription (const boost::optional< std::string > &value)
virtual TIGL_EXPORT void SetName (const std::string &value)
virtual TIGL_EXPORT void SetParentUID (const boost::optional< std::string > &value)
virtual TIGL_EXPORT void SetSystemElementUID (const std::string &value)
virtual TIGL_EXPORT void SetUID (const std::string &value)
virtual TIGL_EXPORT void WriteCPACS (const TixiDocumentHandle &tixiHandle, const std::string &xpath) const
virtual TIGL_EXPORT ~CPACSComponent ()
Public Member Functions inherited from tigl::CTiglReqUIDObject
boost::optional< std::string > GetObjectUID () const
virtual ~CTiglReqUIDObject ()=default
Public Member Functions inherited from tigl::CTiglUIDObject
TIGL_EXPORT void Invalidate (const boost::optional< std::string > &source=boost::none) const
Public Member Functions inherited from tigl::ITiglUIDRefObject
virtual ~ITiglUIDRefObject ()=default
Public Member Functions inherited from tigl::CTiglRelativelyPositionedComponent
TIGL_EXPORT CTiglRelativelyPositionedComponent (MaybeOptionalPtr< std::string > parentUid, MaybeOptionalPtr< CCPACSTransformation > trans)
TIGL_EXPORT CTiglRelativelyPositionedComponent (MaybeOptionalPtr< std::string > parentUid, MaybeOptionalPtr< CCPACSTransformation > trans, boost::optional< TiglSymmetryAxis > *symmetryAxis)
TIGL_EXPORT CTiglRelativelyPositionedComponent (MaybeOptionalPtr< std::string > parentUid, MaybeOptionalPtr< CCPACSTransformationSE3 > trans)
TIGL_EXPORT CTiglRelativelyPositionedComponent (tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr< CCPACSTransformation > trans)
TIGL_EXPORT CTiglRelativelyPositionedComponent (tigl::CTiglRelativelyPositionedComponent *parent, MaybeOptionalPtr< CCPACSTransformation > trans, boost::optional< TiglSymmetryAxis > *symmetryAxis)
TIGL_EXPORT ChildContainerType GetChildren (bool recursive)
TIGL_EXPORT boost::optional< const std::string & > GetParentUID () const
virtual TIGL_EXPORT CTiglPoint GetRotation () const
virtual TIGL_EXPORT ECPACSTranslationType GetRotationType () const
virtual TIGL_EXPORT CTiglPoint GetScaling () const
virtual TIGL_EXPORT ECPACSTranslationType GetScalingType () const
TIGL_EXPORT TiglSymmetryAxis GetSymmetryAxis () const override
virtual TIGL_EXPORT CTiglTransformation GetTransformationMatrix () const
virtual TIGL_EXPORT CTiglPoint GetTranslation () const
virtual TIGL_EXPORT ECPACSTranslationType GetTranslationType () const
TIGL_EXPORT void Reset () const
TIGL_EXPORT void SetParentUID (const std::string &parentUID)
virtual TIGL_EXPORT void SetSymmetryAxis (const TiglSymmetryAxis &axis)
virtual TIGL_EXPORT void SetTransformation (const CCPACSTransformation &transform)
Public Member Functions inherited from tigl::CTiglAbstractGeometricComponent
 CTiglAbstractGeometricComponent ()
TIGL_EXPORT Bnd_Box const & GetBoundingBox () const
virtual TIGL_EXPORT bool GetIsOn (const gp_Pnt &pnt) const
TIGL_EXPORT bool GetIsOnMirrored (const gp_Pnt &pnt) const
TIGL_EXPORT PNamedShape GetLoft () const override
virtual TIGL_EXPORT PNamedShape GetMirroredLoft () const
TIGL_EXPORT void Reset () const
Public Member Functions inherited from tigl::ITiglGeometricComponent
virtual bool IsIndependentGeometry () const
virtual ~ITiglGeometricComponent ()

Protected Member Functions

virtual PNamedShape BuildLoft () const override
Protected Member Functions inherited from tigl::CTiglUIDObject
 ~CTiglUIDObject ()=default

Private Member Functions

PNamedShape BuildLocalLoft () const
void BuildMass (MassCache &cache) const
const CCPACSElementGeometryGetElementGeometry () const

Private Attributes

std::string _cpacsDocPath
Cache< MassCache, CCPACSComponentm_mass

Additional Inherited Members

Public Types inherited from tigl::CTiglRelativelyPositionedComponent
typedef std::vector< CTiglRelativelyPositionedComponent * > ChildContainerType
Protected Types inherited from tigl::CTiglRelativelyPositionedComponent
typedef std::map< int, int > FusedElementsContainerType
Protected Attributes inherited from tigl::generated::CPACSComponent
boost::optional< std::string > m_description
 Description.
std::string m_name
 Name.
CPACSComponentsm_parent
boost::optional< std::string > m_parentUID
 Optional UID reference to the parent object used for relative positioning.
boost::optional< CPACSUIDSequencem_structuralMountUIDs
 UIDs of the structural mounts as defined in the fuselages or wings (see structuralMountType for further details).
std::string m_systemElementUID
 UID reference to the predefined system element.
boost::optional< CCPACSTransformationSE3m_transformation
 Optional rigid transformation defining the component position and orientation.
std::string m_uID
CTiglUIDManagerm_uidMgr
Protected Attributes inherited from tigl::CTiglAbstractGeometricComponent
Cache< Bnd_Box, CTiglAbstractGeometricComponentbounding_box
Cache< PNamedShape, CTiglAbstractGeometricComponentloft

Detailed Description

Geometric component representing a CPACS <component> within systems.

A CCPACSComponent references a system element via systemElementUID and provides geometric and mass properties derived from that referenced element.

Mass properties:

  • The mass can be given explicitly or computed from a density and the component volume.
  • The center of gravity (CoG) can be given explicitly via CPACS location. If not provided, it is derived from the geometric centroid of the component.

Coordinate frames:

  • Local values (mass, CoG local) are expressed in the component's local coordinate system.
  • Global CoG is only available if the component is explicitly positioned via a CPACS <transformation> element (see IsPositioned()).

Constructor & Destructor Documentation

◆ CCPACSComponent()

TIGL_EXPORT tigl::CCPACSComponent::CCPACSComponent ( CCPACSComponents * parent,
CTiglUIDManager * uidMgr )

Constructs a CCPACSComponent.

Parameters
parentParent CPACS <components> container.
uidMgrUID manager for resolving referenced system elements.

Member Function Documentation

◆ BuildLocalLoft()

PNamedShape tigl::CCPACSComponent::BuildLocalLoft ( ) const
private

◆ BuildLoft()

virtual PNamedShape tigl::CCPACSComponent::BuildLoft ( ) const
overrideprotectedvirtual

◆ BuildMass()

void tigl::CCPACSComponent::BuildMass ( MassCache & cache) const
private

◆ GetCenterOfGravityGlobal()

TIGL_EXPORT boost::optional< CTiglPoint > tigl::CCPACSComponent::GetCenterOfGravityGlobal ( ) const

Returns the center of gravity in the global coordinate system.

The global CoG is obtained by applying the component transformation to the local CoG. This value is only available if the component is explicitly positioned (see IsPositioned()) and a local CoG exists.

Returns
Global CoG, or boost::none if unavailable.

◆ GetCenterOfGravityLocal()

TIGL_EXPORT boost::optional< CTiglPoint > tigl::CCPACSComponent::GetCenterOfGravityLocal ( ) const

Returns the center of gravity in the component's local coordinate system.

If a CPACS location is provided, that value is used. Otherwise, the geometric centroid of the component volume is computed.

If the center of gravity cannot be determined (e.g., missing mass definition or zero-volume geometry), boost::none is returned.

Returns
Local CoG (x, y, z), or boost::none if not available.

◆ GetCentroidGlobal()

TIGL_EXPORT boost::optional< CTiglPoint > tigl::CCPACSComponent::GetCentroidGlobal ( ) const

Returns the geometric centroid of the component in the global coordinate system.

The global centroid is obtained by applying the component transformation to the local centroid. This value is only available if the component is explicitly positioned (see IsPositioned()).

Exceptions
CTiglErrorif the component has no valid, non-zero volume geometry.
Returns
Global geometric centroid, or boost::none if the component is not positioned.

◆ GetCentroidLocal()

TIGL_EXPORT CTiglPoint tigl::CCPACSComponent::GetCentroidLocal ( ) const

Returns the geometric centroid of the component in the local coordinate system.

The centroid is computed purely from the component's volume geometry and is independent of any mass or density definition.

Exceptions
CTiglErrorif the component has no valid, non-zero volume geometry.
Returns
Local geometric centroid (x, y, z).

◆ GetComponentIntent()

TIGL_EXPORT TiglGeometricComponentIntent tigl::CCPACSComponent::GetComponentIntent ( ) const
overridevirtual

Returns the TiGL geometric component intent.

Implements tigl::ITiglGeometricComponent.

◆ GetComponentRepresentation()

TIGL_EXPORT TiglGeometryRepresentation tigl::CCPACSComponent::GetComponentRepresentation ( ) const

Returns the geometric representation type of the referenced system element.

The representation is obtained from the referenced element geometry definition. It is returned as one of the TiGL constants TIGL_GEOMREP_PHYSICAL (1), TIGL_GEOMREP_ENVELOPE (2), or TIGL_GEOMREP_PLACEHOLDER (4). If no explicit representation is given in CPACS, TIGL_GEOMREP_PHYSICAL (1) is returned.

Returns
Geometry representation type of the component.

◆ GetComponentRepresentationAsString()

TIGL_EXPORT std::string tigl::CCPACSComponent::GetComponentRepresentationAsString ( ) const

Returns the geometry representation of the referenced system element as string.

Possible return values are:

  • "physical"
  • "envelope"
  • "placeholder"

If no explicit representation is given in CPACS, "physical" is returned.

Returns
Geometry representation as human-readable string.

◆ GetComponentType()

TIGL_EXPORT TiglGeometricComponentType tigl::CCPACSComponent::GetComponentType ( ) const
overridevirtual

Returns the TiGL geometric component type.

Implements tigl::ITiglGeometricComponent.

◆ GetConfiguration()

TIGL_EXPORT CCPACSConfiguration const & tigl::CCPACSComponent::GetConfiguration ( ) const

◆ GetDefaultedUID()

TIGL_EXPORT std::string tigl::CCPACSComponent::GetDefaultedUID ( ) const
overridevirtual

Returns the component UID (defaulted if required).

Implements tigl::ITiglGeometricComponent.

◆ GetElementGeometry()

const CCPACSElementGeometry & tigl::CCPACSComponent::GetElementGeometry ( ) const
private

◆ GetMass()

TIGL_EXPORT boost::optional< double > tigl::CCPACSComponent::GetMass ( ) const

Returns the component mass.

The mass is obtained from the referenced system element:

  • If an explicit mass is provided in CPACS, it is returned.
  • Otherwise, if a density is provided, the mass is computed as density * volume.
  • If neither mass nor density is available, no mass value is returned.
Returns
Component mass, or boost::none if the mass cannot be determined.

◆ GetMassInertiaLocal()

TIGL_EXPORT boost::optional< CTiglMassInertia > tigl::CCPACSComponent::GetMassInertiaLocal ( ) const

Returns the mass inertia tensor components in the local coordinate system.

If a CPACS massInertia definition is present, its values are returned. Otherwise, boost::none is returned. Cross terms (Jxy, Jxz, Jyz) are optional as in the CPACS schema.

Returns
Local mass inertia components, or boost::none if not defined.

◆ IsPositioned()

TIGL_EXPORT bool tigl::CCPACSComponent::IsPositioned ( ) const

Returns whether this component is explicitly positioned in CPACS.

This checks for the presence of the optional CPACS <transformation> element under the component.

Returns
true if an explicit transformation is present, false otherwise.

◆ ReadCPACS()

TIGL_EXPORT void tigl::CCPACSComponent::ReadCPACS ( const TixiDocumentHandle & tixiHandle,
const std::string & objectXPath )
overridevirtual

Reads the CPACS subtree of this component.

Reimplemented from tigl::generated::CPACSComponent.

Field Documentation

◆ _cpacsDocPath

std::string tigl::CCPACSComponent::_cpacsDocPath
private

◆ m_mass

Cache<MassCache, CCPACSComponent> tigl::CCPACSComponent::m_mass
private

The documentation for this class was generated from the following file: