Cytosim PI Cytoskeleton Simulator

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

List of all members | Public Member Functions | Static Public Member Functions
Movable Class Reference

## Detailed Description

This provides a common interface, in which translation and rotation are disabled. These features can be enabled by redefining the related functions in a derived class.

To enable translation:

- position() should be implemented
- translate() should be implemented
- translatable() should return true

To enable rotation:

- rotate() should be implemented
- rotatable() should return true

To support periodic boundary conditions, foldPosition() should be defined.

Inheritance diagram for Movable:

## Public Member Functions
| Movable ()
| constructor
virtual | ~Movable ()
| destructor
virtual Vector | position () const
| return the position in space of the object
virtual void | setPosition (Vector const &)
| move object to specified position More...
virtual bool | translatable () const
| true if object accepts translations (default=false)
virtual void | translate (Vector const &)
| move the object ( position += given vector ) More...
virtual bool | rotatable () const
| true if object accepts rotations (default=false)
virtual void | rotate (Rotation const &)
| rotate the object around the origin of coordinates More...
virtual void | rotateP (Rotation const &)
| rotate the object around its current position More...
virtual void | foldPosition (Modulo const *)
| perform modulo for periodic boundary conditions More...

## Static Public Member Functions
static Vector | readPrimitive (std::istream &, const Space *)
| read a position specified with primitives, such as 'circle 5', etc. More...
static Vector | readPosition (std::istream &, const Space *)
| read a position in space More...
static Vector | readDirection (std::istream &, const Vector &, const Space *)
| read an orientation, and return a normalized vector More...
static Rotation | readRotation (std::istream &, const Vector &, const Space *)
| read a rotation specified in is, at position pos More...

## Member Function Documentation

virtual void foldPosition | ( | Modulo const * |  | ) |
| inline virtual

This brings the object to its centered fiMirror image in Modulo

Reimplemented in PointSet, Single, Couple, Sphere, Bead, and Wrist.

Vector readDirection | ( | std::istream & | is,
|  | const Vector & | pos,
|  | const Space * | spc
| ) |  |
| static

The initial orientation of objects is defined by specifying a rotation.

A rotation can be specified in various ways:

Keyword | Rotation / Result
--- | ---
`random` | A rotation selected uniformly among all possible rotations
`identity` | The object is not rotated
`X Y Z` | A random rotation transforming (1,0,0) into (X,Y,Z)
`horizontal` `aligned_X` | A rotation where (1,0,0) is invariant or transformed into (-1,0,0)
`vertical` `aligned_Y` | A rotation that transforms (1,0,0) into (0,1,0) or (0,-1,0)
`aligned_Z` | A rotation that transforms (1,0,0) into (0,0,1) or (0,0,-1)
`aligned_XY` `aligned_XZ` `aligned_YZ` | A rotation that transforms (1,0,0) into a unit vector in the specified plane
`angle A B C` | As specified by 3 Euler angles in radians (in 2D, only A is needed)
`degree A B C` | As specified by 3 Euler angles in degrees (in 2D, only A is needed)
`quat q0 q1 q2 q3` | As specified by the Quaternion (q0, q1, q2, q3)

If a Space is defined, one may also use:

Keyword | Rotation / Result
--- | ---
`tangent` | perpendicular to the normal of the Space
`radial` | normal to the Space
`centrifuge` | normal to the Space, directed outward
`centripete` | normal to the Space, directed inward

Note: when the rotation is not uniquely determined in 3D (eg. `horizontal`), cytosim will pick uniformly among all the possible rotations that fulfill the requirements.

Vector readPosition | ( | std::istream & | is,
|  | const Space * | space
| ) |  |
| static

A position is defined with a SHAPE followed by a number of transformations.

Operation | Transformation
--- | ---
`at X Y Z` | Translate by specified vector (X,Y,Z)
`add SHAPE` | Translate by a vector chosen according to SHAPE
`align VECTOR` | Rotate to align parallel with specified vector
`turn ROTATION` | Apply specified rotation
`blur REAL` | Add centered Gaussian noise of variance REAL

A vector is set according to SHAPE, and the transformations are applied one after the other, in the order in which they were given.
Examples:

position = 1 0 0
position = circle 3 at 1 0
position = square 3 turn 1 1 0 at 1 1

Todo:
  : specify a croping plane, eg: "circle 4 if x > 0"

Vector readPrimitive | ( | std::istream & | is,
|  | const Space * | spc
| ) |  |
| static

Geometrical Primitives:

Keyword | Position (X, Y, Z) / Remark
--- | ---
`A B C` | The specified vector (A,B,C) X=A, Y=B, Z=C
`inside` | A random position inside the current Space
`edge E` | At distance E from the edge of the current Space
`surface E` | On the surface of the current Space The point is generated by projecting a point at distance E from the surface.
`sphere R T` | A distance R +/- T/2 from the origin `R-T/2 < norm(X,Y,Z) < R+T/2`
`ball R` | At distance R at most from the origin `norm(X,Y,Z) < R`
`disc R T` | in 2D, a disc in the XY-plane in 3D, a disc in the XY-plane of thickness T in Z
`circle R T` | A circle of radius R and thickness T At distance T from the circle of radius R
`cylinder T R` | Cylinder of axis X, R=radius in YZ and T=thickness in X
`ellipse A B C` | Inside the ellipse or ellipsoid of main axes 2A, 2B and 2C
`arc L Theta` | A piece of circle of length L and covering an angle Theta
`stripe L R` | Random Vector with L < X < R
`square R` | Random Vector with -R < X < R; -R < Y < R; -R < Z < R;
`rectangle A B C` | Random Vector with -A < X < A; -B < Y < B; -C < Z < C;
`gradient S E` | Provides a linear density gradient, from 0 at X=S to 1 at X=E

The primitive describe a certain area in Space. Except when specified (gradient), the returned position is chosen following a random distribution inside the area.

A contribution from Beat Rupp

Rotation readRotation | ( | std::istream & | is,
|  | const Vector & | pos,
|  | const Space * | spc
| ) |  |
| static

The initial orientation of objects is defined by specifying a rotation.

A rotation can be specified in various ways:

Keyword | Rotation / Result
--- | ---
`random` | A rotation selected uniformly among all possible rotations
`identity` | The object is not rotated
`X Y Z` | A random rotation transforming (1,0,0) into (X,Y,Z)
`horizontal` `aligned_X` | A rotation where (1,0,0) is invariant or transformed into (-1,0,0)
`vertical` `aligned_Y` | A rotation that transforms (1,0,0) into (0,1,0) or (0,-1,0)
`aligned_Z` | A rotation that transforms (1,0,0) into (0,0,1) or (0,0,-1)
`aligned_XY` `aligned_XZ` `aligned_YZ` | A rotation that transforms (1,0,0) into a unit vector in the specified plane
`angle A B C` | As specified by 3 Euler angles in radians (in 2D, only A is needed)
`degree A B C` | As specified by 3 Euler angles in degrees (in 2D, only A is needed)
`quat q0 q1 q2 q3` | As specified by the Quaternion (q0, q1, q2, q3)

If a Space is defined, one may also use:

Keyword | Rotation / Result
--- | ---
`tangent` | perpendicular to the normal of the Space
`radial` | normal to the Space
`centrifuge` | normal to the Space, directed outward
`centripete` | normal to the Space, directed inward

Note: when the rotation is not uniquely determined in 3D (eg. `horizontal`), cytosim will pick uniformly among all the possible rotations that fulfill the requirements.

void rotate | ( | Rotation const & | T | ) |
| virtual

The default implementation is not valid

Reimplemented in PointSet, and Organizer.

void rotateP | ( | Rotation const & | T | ) |
| virtual

The default implementation:

Vector G = position();
translate( -G );
rotate( T );
translate( G );

can be redefined in derived class for efficiency.

void setPosition | ( | Vector const & | w | ) |
| virtual

The default implementation:

translate( w - position() );

can be redefined in derived class for efficiency.

Reimplemented in Single, Couple, and Bead.

void translate | ( | Vector const & |  | ) |
| virtual

The default implementation should not be called

Reimplemented in PointSet, Single, Couple, Organizer, Bead, Wrist, and Picket.