fr.cnes.sirius.patrius.assembly
Class Assembly

java.lang.Object
  extended by fr.cnes.sirius.patrius.assembly.Assembly
All Implemented Interfaces:
Serializable

public class Assembly
extends Object
implements Serializable

This class describes an assembly by all its sub parts.

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.

Since:
1.1
Version:
$Id: Assembly.java 17587 2017-05-10 13:31:11Z bignon $
Author:
Thomas Trapier
See Also:
AssemblyBuilder, MainPart, Part, Serialized Form
Concurrency :
not thread-safe
Concurrency comment :
The use of a frame linked to the tree of frames in each of the parts makes this class not thread-safe.

Field Summary
static String FRAME
          String Frame
 
Constructor Summary
protected Assembly()
          Assembly simple constructor.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FRAME

public static final String FRAME
String Frame

See Also:
Constant Field Values
Constructor Detail

Assembly

protected Assembly()
Assembly simple constructor. Shall be accessed only from the builder.

Method Detail

addPart

public final void addPart(IPart part)
Adds a part to the assembly.

Parameters:
part - the part to add to the assembly
Throws:
IllegalArgumentException - if a part with this name already exists or if the main part has not been created yet.

addMainPart

public final void addMainPart(MainPart part)
Adds the main part to the assembly.

Parameters:
part - the main part to add
Throws:
IllegalArgumentException - if the main part is already created

removePart

public final void removePart(String partName)
Removes a part from the assembly. All the children parts of the one removed will be removed too : they won't have no parent frame.

Parameters:
partName - the name of the part to remove
Throws:
IllegalArgumentException - if no part has this name

getPart

public final IPart getPart(String name)
Returns the part whose name is specified.

Parameters:
name - the name of the part
Returns:
the part whose the name is specified
Throws:
IllegalArgumentException - if no part has this name

getMainPart

public final MainPart getMainPart()
Returns:
the main part

getParts

public final Map<String,IPart> getParts()
Returns all the parts of the assembly.

Returns:
the assembly parts

getAllPartsNames

public final Set<String> getAllPartsNames()
Gets the list of the name of the parts in the assembly (the main part is excluded).

Returns:
the list of the names of the parts

initMainPartFrame

public final void initMainPartFrame(UpdatableFrame frame)
Initialize the main part's frame using a UpdatableFrame as an input argument. This allows the user to link the entire assembly frame tree to the Orekit frames tree (if argument frame) is in the OREKIT Frames tree (see FramesFactory). This method asks for an UpdatableFrame that will later allow to redefine its transformation.

Parameters:
frame - the new main part's frame

initMainPartFrame

public final void initMainPartFrame(SpacecraftState state)
                             throws OrekitException
Initialize the main part's frame using a 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 Orekit frames tree.

Parameters:
state - the SpacecraftState defining the position and orientation of the main part in its parent frame
Throws:
OrekitException - if no attitude is defined

updateMainPartFrame

public final void updateMainPartFrame(Transform transform)
                               throws OrekitException
Updates the main part frame's transformation to its parent frame using a 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.

Parameters:
transform - the Transform
Throws:
OrekitException - if a problem occurs during frames transformations
IllegalArgumentException - if the main frame has no parent yet

updateMainPartFrame

public final void updateMainPartFrame(SpacecraftState state)
                               throws OrekitException
Updates the main part frame's transformation to its parent frame using a 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.

Parameters:
state - the SpacecraftState
Throws:
OrekitException - if a problem occurs during frames transformations
IllegalArgumentException - if the main frame has no parent yet


Copyright © 2017 CNES. All Rights Reserved.