Package theia :: Package optics :: Module component :: Class SetupComponent
[hide private]
[frames] | no frames]

Class SetupComponent

source code




SetupComponent class.

This is an Abstract Base Class for all the components (optical or not) of
the setup. Its methods may be implemented in daughter classes.

*=== Attributes ===*
SetupCount: class attribute, counts setup components. [integer]
HRCenter: center of the principal face of the component in space.
    [3D vector]
ARCenter: center of the secondary face of the component in space.
    [3D vector]
HRNorm: normal unitary vector the this principal face, supposed to point
    outside the media. [3D vector]
Thick: thickness of the component, counted in opposite direction to
    HRNorm. [float]
Dia: diameter of the component. [float]
Name: name of the component. [string]
InBeams: list of all beams incident on the component. [list of GaussianBeam]
OutBeams: list of all beams out
Ref: reference string (for keeping track with the lab). [string]

Nested Classes [hide private]
  __metaclass__
Metaclass for defining Abstract Base Classes (ABCs).
Instance Methods [hide private]
 
__init__(self, HRCenter, HRNorm, Ref, Thickness, Diameter, ARCenter)
SetupComponent initializer.
source code
 
__str__(self)
String representation of the component, when calling print(object).
source code
 
hit(self, beam, order, threshold)
Compute the refracted and reflected beams after interaction.
source code
 
isHit(self, beam)
Method to determine if component is hit by a beam.
source code
 
lines(self)
Method to return the list of strings to __str__.
source code
 
translate(self, X=0.0, Y=0.0, Z=0.0)
Move the component to (current position + (X, Y, Z)).
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  Name = 'SetupComponent'
  SetupCount = 0
  __abstractmethods__ = frozenset(['hit', 'isHit', 'lines'])
  _abc_cache = 'WeakSet'
  _abc_negative_cache = 'WeakSet'
  _abc_negative_cache_version = 29
  _abc_registry = 'WeakSet'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, HRCenter, HRNorm, Ref, Thickness, Diameter, ARCenter)
(Constructor)

source code 

SetupComponent initializer.

Parameters are the attributes of the object to construct.

Returns a setupComponent.

Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

String representation of the component, when calling print(object).

Overrides: object.__str__

hit(self, beam, order, threshold)

source code 

Compute the refracted and reflected beams after interaction.

Abstract (pure virtual) method.

Decorators:
  • @abstractmethod

isHit(self, beam)

source code 

Method to determine if component is hit by a beam.

Abstract (pure virtual) method.

Decorators:
  • @abstractmethod

lines(self)

source code 

Method to return the list of strings to __str__.

Abstract (pure virtual) method.

Decorators:
  • @abstractmethod

translate(self, X=0.0, Y=0.0, Z=0.0)

source code 

Move the component to (current position + (X, Y, Z)).

This version only takes care of the HRCenter, version of sub classes take care of ARCenter if relevant.

X, Y, Z: components of the translation vector.

No return value.