public class Assembly extends Object implements Serializable
This assembly shall be created and modified using the associated builder. Then user can access to each part by its name and get its properties. This assembly does not include the physical models : models shall be created in separated classes using this one.
AssemblyBuilder
,
MainPart
,
Part
,
Serialized FormModifier | Constructor and Description |
---|---|
protected |
Assembly()
Assembly simple constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addMainPart(MainPart part)
Adds the main part to the assembly.
|
void |
addPart(IPart part)
Adds a part to the assembly.
|
Set<String> |
getAllPartsNames()
Gets the list of the name of the parts in the assembly (the main part is excluded).
|
MainPart |
getMainPart() |
IPart |
getPart(String name)
Returns the part whose name is specified.
|
Map<String,IPart> |
getParts()
Returns all the parts of the assembly.
|
void |
initMainPartFrame(SpacecraftState state)
Initialize the main part's frame using a
SpacecraftState as an input argument. |
void |
initMainPartFrame(UpdatableFrame frame)
Initialize the main part's frame using a
UpdatableFrame as an input argument. |
void |
removePart(String partName)
Removes a part from the assembly.
|
void |
updateMainPartFrame(SpacecraftState state)
Updates the main part frame's transformation to its parent frame using a
Transform as an input argument. |
void |
updateMainPartFrame(Transform transform)
Updates the main part frame's transformation to its parent frame using a
Transform as an input argument. |
public static final String FRAME
protected Assembly()
public final void addPart(IPart part)
part
- the part to add to the assemblyIllegalArgumentException
- if a part with this name already exists or if the main part has not been created yet.public final void addMainPart(MainPart part)
part
- the main part to addIllegalArgumentException
- if the main part is already createdpublic final void removePart(String partName)
boolean hasMobileParts
is not updated for simplicity (this situation is not common and is still
perfectly valid).
partName
- the name of the part to removeIllegalArgumentException
- if no part has this namepublic final IPart getPart(String name)
name
- the name of the partIllegalArgumentException
- if no part has this namepublic final MainPart getMainPart()
public final Map<String,IPart> getParts()
public final Set<String> getAllPartsNames()
public final void initMainPartFrame(UpdatableFrame frame) throws PatriusException
UpdatableFrame
as an input argument.
This allows the user to link the entire assembly frame tree to the PATRIUS frames tree
(if argument frame
) is in the PATRIUS Frames tree (see FramesFactory
).
This method asks for an UpdatableFrame that will later allow to redefine its transformation.
Warning: the assembly should contain no mobile parts, otherwise call
initMainPartFrame(SpacecraftState)
frame
- the new main part's framePatriusException
- thrown if the assembly contains mobiles partspublic final void initMainPartFrame(SpacecraftState state) throws PatriusException
SpacecraftState
as an input argument.
The main part's parent frame is then the SpacecraftState's definition frame.
This allows the user to link the entire assembly frame tree to the PATRIUS frames tree.state
- the SpacecraftState defining the position and orientation of the main part
in its parent framePatriusException
- if no attitude is definedpublic final void updateMainPartFrame(Transform transform) throws PatriusException
Transform
as an input argument.
It is assumed that user has already defined a UpdatableFrame
for the main part (using
initMainPartFrame(UpdatableFrame)
or initMainPartFrame(SpacecraftState)
). If that is not the
case, an IllegalArgumentException
is thrown.
Warning: the assembly should contain no mobile parts, otherwise call
updateMainPartFrame(SpacecraftState)
transform
- the TransformPatriusException
- if a problem occurs during frames transformationsIllegalArgumentException
- if the main frame has no parent yetpublic final void updateMainPartFrame(SpacecraftState state) throws PatriusException
Transform
as an input argument.
It is assumed that user has already defined a UpdatableFrame
for the main part (using
initMainPartFrame(UpdatableFrame)
or initMainPartFrame(SpacecraftState)
). If that is not the
case, an IllegalArgumentException
is thrown.
state
- the SpacecraftStatePatriusException
- if a problem occurs during frames transformationsIllegalArgumentException
- if the main frame has no parent yetCopyright © 2021 CNES. All rights reserved.