SpherePackingScenarioGenerator
|
#include <Channel.h>
Public Types | |
enum | BOUNDINGBOXBORDER { LEFT = 0, RIGHT = 1, BOTTOM = 2, TOP = 3 } |
Public Member Functions | |
Channel () | |
Channel (const double &length, const double &width, const double &positionX, const double &positionY, const double &orientation) | |
Channel (const double &length, const double &width, const Vector ¢er, const double &orientation) | |
void | exchangeVertices (unsigned int i, unsigned j, std::vector< tarch::la::Vector< 2, double > > &vertices) const |
tarch::la::Vector< 4, double > | getBoundingBox () const |
Vector | getCenter () const |
double | getCenterPositionX () const |
double | getCenterPositionY () const |
double | getLength () const |
double | getOrientation () const |
std::vector< tarch::la::Vector < 2, double > > | getSortedVertices () |
std::vector< Vector > | getUnsortedVertices () |
double | getWidth () const |
void | setCenter (const Vector ¢er) |
void | setOrientation (const double &orientation) |
std::vector< tarch::la::Vector < 2, double > > & | sortVertices (std::vector< tarch::la::Vector< 2, double > > &vertices) const |
std::ostream & | toStream (std::ostream &stream) |
std::string | toString () |
virtual | ~Channel () |
Static Public Member Functions | |
static std::vector < algorithms::geometries::Channel * > | getPtrVectorGeometryChannels (std::vector< algorithms::geometries::Channel > &channels) |
static algorithms::geometries::Channel & | rotateChannel (algorithms::geometries::Channel &channelToBeRotated, const double &rotationAngle, const double &sinRotationAngle, const double &cosRotationAngle, const tarch::la::Vector< 2, double > &rotationCenter) |
Public Attributes | |
double | _cosOrientation |
double | _sinOrientation |
Protected Attributes | |
Vector | _center |
double | _length |
double | _orientation |
double | _width |
Private Types | |
typedef tarch::la::Vector < 2, double > | Vector |
typedef tarch::la::Vector<2,double> algorithms::geometries::Channel::Vector [private] |
Channel::Channel | ( | ) |
Channel::Channel | ( | const double & | length, |
const double & | width, | ||
const double & | positionX, | ||
const double & | positionY, | ||
const double & | orientation | ||
) |
Channel::Channel | ( | const double & | length, |
const double & | width, | ||
const Vector & | center, | ||
const double & | orientation | ||
) |
Channel::~Channel | ( | ) | [virtual] |
void algorithms::geometries::Channel::exchangeVertices | ( | unsigned int | i, |
unsigned | j, | ||
std::vector< tarch::la::Vector< 2, double > > & | vertices | ||
) | const [inline] |
tarch::la::Vector<4,double> algorithms::geometries::Channel::getBoundingBox | ( | ) | const [inline] |
Computes and returns 2D bounding box Vector entries 0: Leftmost point 1: Rightmost 2: Lowermost 3: Uppermost
Quadrants: |-------- | 2 | 1 | |-------- | 3 | 4 | |-------|
Vector algorithms::geometries::Channel::getCenter | ( | ) | const [inline] |
double algorithms::geometries::Channel::getCenterPositionX | ( | ) | const [inline] |
double algorithms::geometries::Channel::getCenterPositionY | ( | ) | const [inline] |
double algorithms::geometries::Channel::getLength | ( | ) | const [inline] |
double algorithms::geometries::Channel::getOrientation | ( | ) | const [inline] |
static std::vector<algorithms::geometries::Channel*> algorithms::geometries::Channel::getPtrVectorGeometryChannels | ( | std::vector< algorithms::geometries::Channel > & | channels | ) | [inline, static] |
std::vector<tarch::la::Vector<2, double> > algorithms::geometries::Channel::getSortedVertices | ( | ) | [inline] |
std::vector<Vector> algorithms::geometries::Channel::getUnsortedVertices | ( | ) | [inline] |
double algorithms::geometries::Channel::getWidth | ( | ) | const [inline] |
static algorithms::geometries::Channel& algorithms::geometries::Channel::rotateChannel | ( | algorithms::geometries::Channel & | channelToBeRotated, |
const double & | rotationAngle, | ||
const double & | sinRotationAngle, | ||
const double & | cosRotationAngle, | ||
const tarch::la::Vector< 2, double > & | rotationCenter | ||
) | [inline, static] |
Rotates the Point around the offspring
void algorithms::geometries::Channel::setCenter | ( | const Vector & | center | ) | [inline] |
void algorithms::geometries::Channel::setOrientation | ( | const double & | orientation | ) | [inline] |
std::vector<tarch::la::Vector<2,double> >& algorithms::geometries::Channel::sortVertices | ( | std::vector< tarch::la::Vector< 2, double > > & | vertices | ) | const [inline] |
Sort vertices such that 0: Leftmost point 1: Rightmost 2: Lowest 3: Uppermost
This order is hard-coded in the enum and used here.
Put edge with smallest y-value to position 2 and edge with largest y-value to position 3
std::ostream& algorithms::geometries::Channel::toStream | ( | std::ostream & | stream | ) | [inline] |
std::string algorithms::geometries::Channel::toString | ( | ) | [inline] |
Vector algorithms::geometries::Channel::_center [protected] |
double algorithms::geometries::Channel::_length [protected] |
double algorithms::geometries::Channel::_orientation [protected] |
double algorithms::geometries::Channel::_width [protected] |