public class AssemblyBuilder extends Object
- This class is the builder that shall be needed to create an instance of the assembly.
- Its purpose is to simplify the building process of the assembly. It provides the method that allow the user to add a part to the assembly, and then to add properties to each of the parts.
Assembly
Constructor and Description |
---|
AssemblyBuilder()
Simple constructor of an assembly builder.
|
AssemblyBuilder(Assembly inAssembly)
Constructor with an assembly instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addMainPart(String mainBodyName)
Adds the main part to the assembly : shall be done before adding any other part.
|
void |
addPart(String partName,
String parentPartName,
Transform transform)
This method adds a new part to the currently built assembly, defining its new frame by a
Transform object.
|
void |
addPart(String partName,
String parentPartName,
TransformStateProvider transformStateProvider)
This method adds a new part to the currently built assembly.
|
void |
addPart(String partName,
String parentPartName,
Vector3D translation,
Rotation rotation)
This method adds a new part to the currently built assembly.
|
void |
addProperty(IPartProperty property,
String partName)
Adds a property of any type to a part of the assembly.
|
IPart |
getPart(String name)
This method returns the part whose name is given in parameter.
|
void |
initMainPartFrame(SpacecraftState state)
Sets up the main frame of the assembly from a "SpacecraftState" object.
|
void |
initMainPartFrame(UpdatableFrame newFrame)
Sets up the frame of the main part.
|
void |
removePart(String partName)
This method removes one part from the assembly.
|
Assembly |
returnAssembly()
This method returns the assembly when the user wants to get the instance of the assembly that
has been built so far.
|
public AssemblyBuilder()
public AssemblyBuilder(Assembly inAssembly)
inAssembly
- the assembly instancepublic final void addPart(String partName, String parentPartName, TransformStateProvider transformStateProvider)
partName
- the name of the partparentPartName
- the name of the parent of the parttransformStateProvider
- the transformation law that defines the new part's frame wrt the parent frameIllegalArgumentException
- if a part with this name already exists, if the main part
has not been created yet or if the parent part does not exist (no part with this
name).public final void addPart(String partName, String parentPartName, Transform transform)
partName
- the name of the partparentPartName
- the name of the parent of the parttransform
- the transformation law that defines the new part's frameIllegalArgumentException
- if a part with this name already exists, if the main part
has not been created yet or if the parent part does not exist (no part with this
name).public final void addPart(String partName, String parentPartName, Vector3D translation, Rotation rotation)
partName
- the name of the partparentPartName
- the name of the parent of the parttranslation
- the translationrotation
- the rotationpublic final IPart getPart(String name)
name
- the name of the partpublic final void removePart(String partName)
partName
- the name of the part to remove.public final void addMainPart(String mainBodyName)
mainBodyName
- the name of the partpublic final void initMainPartFrame(UpdatableFrame newFrame) throws PatriusException
Warning: the assembly should contain no mobile parts, otherwise call
initMainPartFrame(SpacecraftState)
newFrame
- the new frame of the main partPatriusException
- thrown if the assembly contains mobile partspublic final void initMainPartFrame(SpacecraftState state) throws PatriusException
state
- the new SpacecraftState of the assemblyPatriusException
- if a problem occurs during frames transformationspublic final Assembly returnAssembly()
public final void addProperty(IPartProperty property, String partName)
property
- the property to addpartName
- the name of the part to which the property must be addedIllegalArgumentException
- if the part already contains a property of this type or if
the assembly contains no part of this name.Copyright © 2021 CNES. All rights reserved.