OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
|
The SURVEY command. More...
#include <Survey.h>
Classes | |
class | Row |
The class for one row of the survey table. More... | |
Public Member Functions | |
Survey () | |
Exemplar constructor. More... | |
virtual | ~Survey () |
virtual Survey * | clone (const std::string &name) |
Make clone. More... | |
virtual void | execute () |
Check validity of survey definition. More... | |
virtual void | fill () |
Fill the buffer using the survey algorithm. More... | |
virtual double | getCell (const PlaceRep &row, const std::string &col) |
Return a selected value in a selected row. More... | |
virtual CellArray | getDefault () const |
Return the default print columns. More... | |
virtual std::vector< double > | getColumn (const RangeRep &range, const std::string &col) |
Return column [b]col[/b] of this table, limited by [b]range[/b]. More... | |
const Row & | getCurrent () const |
Return current row of table. More... | |
virtual double | getLength () |
Return the length of the table. More... | |
virtual const Beamline * | getLine () const |
Return embedded CLASSIC beamline. More... | |
virtual std::vector< double > | getRow (const PlaceRep &, const std::vector< std::string > &) |
Return a table row, possible user-defined. More... | |
double | getS (const Row &, int=0, int=0) const |
Arc length for given row. More... | |
const Euclid3D & | getMap (const Row &) const |
Position and orientation of local system. More... | |
double | getX (const Row &, int=0, int=0) const |
X component of displacement. More... | |
double | getY (const Row &, int=0, int=0) const |
Y component of displacement. More... | |
double | getZ (const Row &, int=0, int=0) const |
Z component of displacement. More... | |
double | getPhi (const Row &, int=0, int=0) const |
Rotation about X. More... | |
double | getTheta (const Row &, int=0, int=0) const |
Rotation about Y. More... | |
double | getPsi (const Row &, int=0, int=0) const |
Rotation about Z. More... | |
double | getW (const Row &, int i1, int i2) const |
Local axis vectors. More... | |
virtual bool | isDependent (const std::string &name) const |
Find dependency. More... | |
virtual Expressions::PtrToScalar < double > | makeColumnExpression (const std::string &colName) const |
Return column. More... | |
virtual bool | matches (Table *rhs) const |
Check compatibility. More... | |
virtual void | printTable (std::ostream &, const CellArray &) const |
Print list for the table. More... | |
Public Member Functions inherited from Table | |
virtual | ~Table () |
virtual bool | canReplaceBy (Object *newObject) |
Test if object can be replaced. More... | |
virtual const std::string | getCategory () const |
Return the object category as a string. More... | |
virtual bool | shouldTrace () const |
Trace flag. More... | |
virtual bool | shouldUpdate () const |
Update flag. More... | |
virtual void | invalidate () |
Mark this table as invalid, if it is dynamic. More... | |
Public Member Functions inherited from Object | |
virtual | ~Object () |
void | copyAttributes (const Object &) |
Copy attributes from another object. More... | |
virtual Attribute * | findAttribute (const std::string &name) |
Find an attribute by name. More... | |
virtual const Attribute * | findAttribute (const std::string &name) const |
Find an attribute by name. More... | |
virtual Object * | makeTemplate (const std::string &, TokenStream &, Statement &) |
Macro handler function. More... | |
virtual Object * | makeInstance (const std::string &name, Statement &, const Parser *) |
Macro handler function. More... | |
virtual void | parse (Statement &) |
Parse the object. More... | |
virtual void | parseShortcut (Statement &) |
Parser for single-attribute commands. More... | |
virtual void | print (std::ostream &) const |
Print the object. More... | |
virtual void | printValue (std::ostream &) const |
virtual void | printHelp (std::ostream &) const |
Print help. More... | |
virtual void | replace (Object *oldObject, Object *newObject) |
Replace references. More... | |
virtual void | update () |
Update this object. More... | |
bool | isBuiltin () const |
True, if [b]this[/b] is a built-in object. More... | |
virtual bool | isShared () const |
Shared flag. More... | |
virtual void | setShared (bool) |
Set/reset shared flag. More... | |
void | setDirty (bool) |
Set/reset the [b]modified[/b] flag. More... | |
bool | isDirty () const |
True, if the [b]modified[/b] flag is set. More... | |
void | setFlag (bool) |
Flag/unflag this object, e. g. to control output of objects for. More... | |
bool | isFlagged () const |
True, if [b]this[/b] is flagged by setFlag(true). More... | |
const Object * | getBaseObject () const |
Return the object's base type object. More... | |
const std::string & | getOpalName () const |
Return object name. More... | |
Object * | getParent () const |
Return parent pointer. More... | |
bool | isTreeMember (const Object *subTree) const |
Test for tree membership. More... | |
void | setOpalName (const std::string &name) |
Set object name. More... | |
void | setParent (Object *) |
Set parent object. More... | |
void | clear () |
Clear the occurrence counter. More... | |
int | increment () |
Increment and return the occurrence counter. More... | |
int | occurrenceCount () |
Return the occurrence counter. More... | |
void | registerReference (Invalidator *a) |
Register a reference to this object. More... | |
void | unregisterReference (Invalidator *a) |
Unegister a reference to this object. More... | |
void | registerOwnership (const AttributeHandler::OwnerType &itsClass) const |
Public Member Functions inherited from RCObject | |
int | addReference () const |
Increment reference count. More... | |
int | removeReference () const |
Decrement the reference count. More... | |
bool | isShared () const |
Test for sharing. More... | |
Private Types | |
typedef TBeamline< Row > | TLine |
Private Member Functions | |
Survey (const Survey &) | |
void | operator= (const Survey &) |
Survey (const std::string &name, Survey *parent) | |
const Row & | findRow (const PlaceRep &row) |
Private Attributes | |
TLine::const_iterator | current |
TLine * | itsTable |
Surveyor * | itsVisitor |
double | s |
std::string | itsLine |
Static Private Attributes | |
static const int | numColumns = 7 |
Number of table columns. More... | |
Additional Inherited Members | |
Public Types inherited from Table | |
typedef std::vector< Cell > | CellArray |
An array of cell descriptors. More... | |
Static Public Member Functions inherited from Table | |
static Table * | find (const std::string &name) |
Find named Table. More... | |
Public Attributes inherited from Object | |
std::vector< Attribute > | itsAttr |
The object attributes (see Attribute.hh). More... | |
Protected Member Functions inherited from Table | |
Table (int size, const char *name, const char *help) | |
Constructor for exemplars. More... | |
Table (const std::string &name, Table *parent) | |
Constructor for clones. More... | |
Protected Member Functions inherited from Object | |
Object (int size, const char *name, const char *help) | |
Constructor for exemplars. More... | |
Object (const std::string &name, Object *parent) | |
Constructor for clones. More... | |
Protected Member Functions inherited from RCObject | |
RCObject () | |
Default constructor. More... | |
RCObject (const RCObject &) | |
Copy constructor. More... | |
virtual | ~RCObject ()=0 |
RCObject & | operator= (const RCObject &right) |
Protected Attributes inherited from Table | |
bool | dynamic |
Flag dynamic table. More... | |
bool | refill |
Refill flag. More... | |
Protected Attributes inherited from Object | |
bool | builtin |
Built-in flag. More... | |
bool | modified |
Dirty flag. More... | |
bool | flagged |
Object flag. More... | |
|
private |
Survey::Survey | ( | ) |
Exemplar constructor.
Definition at line 258 of file Survey.cpp.
References AttributeHandler::COMMAND, Object::itsAttr, Attrib::Distribution::LINE, Attributes::makeBool(), Attributes::makeRange(), Attributes::makeReal(), Attributes::makeString(), Attributes::makeTableRow(), and Object::registerOwnership().
Referenced by clone().
|
virtual |
Definition at line 298 of file Survey.cpp.
References itsTable, and itsVisitor.
|
private |
|
private |
Definition at line 293 of file Survey.cpp.
|
virtual |
Make clone.
Implements Object.
Definition at line 304 of file Survey.cpp.
References Survey().
|
virtual |
Check validity of survey definition.
Reimplemented from Object.
Definition at line 309 of file Survey.cpp.
References Table::dynamic, endl(), Flatten< Member >::execute(), BeamSequence::fetchLine(), fill(), BeamSequence::find(), Attributes::getBool(), getDefault(), OpalData::getInstance(), Object::getOpalName(), Attributes::getRange(), Attributes::getString(), Object::itsAttr, itsLine, itsTable, itsVisitor, Attrib::Distribution::LINE, printTable(), OpalData::update(), and Options::warn.
|
virtual |
Fill the buffer using the survey algorithm.
Implements Table.
Definition at line 340 of file Survey.cpp.
References fill(), Table::find(), findRow(), Euclid3D::getAll(), ElementBase::getElementLength(), Surveyor::getMap(), getMap(), Object::getOpalName(), TableRowRep::getPosition(), Attributes::getReal(), Attributes::getTableRow(), TableRowRep::getTabName(), Object::itsAttr, itsTable, itsVisitor, matches(), Table::refill, s, Surveyor::setMap(), Attributes::setReal(), Rotation3D::XRotation(), Rotation3D::YRotation(), and Rotation3D::ZRotation().
Referenced by execute(), and fill().
|
private |
Definition at line 399 of file Survey.cpp.
References PlaceRep::enter(), Object::getOpalName(), PlaceRep::initialize(), PlaceRep::isActive(), itsTable, and PlaceRep::leave().
Referenced by fill(), getCell(), and getRow().
|
virtual |
Return a selected value in a selected row.
Implements Table.
Definition at line 416 of file Survey.cpp.
References findRow().
|
virtual |
Return column [b]col[/b] of this table, limited by [b]range[/b].
Implements Table.
Definition at line 434 of file Survey.cpp.
References current, RangeRep::enter(), RangeRep::initialize(), RangeRep::isActive(), itsTable, and RangeRep::leave().
const Survey::Row & Survey::getCurrent | ( | ) | const |
|
virtual |
Return the default print columns.
Implements Table.
Definition at line 423 of file Survey.cpp.
Referenced by execute().
|
virtual |
Return the length of the table.
Implements Table.
Definition at line 458 of file Survey.cpp.
References TBeamline< T >::getElementLength(), and itsTable.
|
virtual |
Return embedded CLASSIC beamline.
Implements Table.
Definition at line 463 of file Survey.cpp.
References itsTable.
Position and orientation of local system.
Definition at line 597 of file Survey.cpp.
References Survey::Row::getMap().
Referenced by fill().
double Survey::getPhi | ( | const Row & | row, |
int | = 0 , |
||
int | = 0 |
||
) | const |
Rotation about X.
Definition at line 617 of file Survey.cpp.
References atan2(), Survey::Row::getMap(), Euclid3D::getRotation(), and sqrt().
double Survey::getPsi | ( | const Row & | row, |
int | = 0 , |
||
int | = 0 |
||
) | const |
Rotation about Z.
Definition at line 630 of file Survey.cpp.
References abs(), arg(), atan2(), Physics::e, Survey::Row::getMap(), and Euclid3D::getRotation().
|
virtual |
Return a table row, possible user-defined.
Implements Table.
Definition at line 469 of file Survey.cpp.
References findRow(), and name.
double Survey::getS | ( | const Row & | row, |
int | = 0 , |
||
int | = 0 |
||
) | const |
double Survey::getTheta | ( | const Row & | row, |
int | = 0 , |
||
int | = 0 |
||
) | const |
Rotation about Y.
Definition at line 623 of file Survey.cpp.
References abs(), arg(), atan2(), Physics::e, Survey::Row::getMap(), and Euclid3D::getRotation().
double Survey::getW | ( | const Row & | row, |
int | i1, | ||
int | i2 | ||
) | const |
Local axis vectors.
Definition at line 637 of file Survey.cpp.
References Survey::Row::getMap(), and Euclid3D::M().
double Survey::getX | ( | const Row & | row, |
int | = 0 , |
||
int | = 0 |
||
) | const |
X component of displacement.
Definition at line 602 of file Survey.cpp.
References Survey::Row::getMap(), and Euclid3D::getX().
double Survey::getY | ( | const Row & | row, |
int | = 0 , |
||
int | = 0 |
||
) | const |
Y component of displacement.
Definition at line 607 of file Survey.cpp.
References Survey::Row::getMap(), and Euclid3D::getY().
double Survey::getZ | ( | const Row & | row, |
int | = 0 , |
||
int | = 0 |
||
) | const |
Z component of displacement.
Definition at line 612 of file Survey.cpp.
References Survey::Row::getMap(), and Euclid3D::getZ().
|
virtual |
|
virtual |
|
virtual |
Check compatibility.
Implements Table.
Definition at line 511 of file Survey.cpp.
Referenced by fill().
|
private |
|
virtual |
Print list for the table.
Implements Table.
Definition at line 516 of file Survey.cpp.
References current, OpalData::getInstance(), Object::itsAttr, itsTable, Attrib::Distribution::LINE, name, and OpalData::printTitle().
Referenced by execute().
|
mutableprivate |
Definition at line 170 of file Survey.h.
Referenced by getColumn(), getCurrent(), getS(), and printTable().
|
private |
Definition at line 182 of file Survey.h.
Referenced by execute(), and isDependent().
|
private |
Definition at line 173 of file Survey.h.
Referenced by execute(), fill(), findRow(), getColumn(), getLength(), getLine(), isDependent(), printTable(), and ~Survey().
|
private |
|
staticprivate |
|
private |
Definition at line 179 of file Survey.h.
Referenced by fill(), and Survey::Row::getS().