#include <Camera.h>
Inheritance diagram for Camera:
Public Member Functions | |
Camera () | |
~Camera () | |
virtual std::string | getKind () const |
void | setResolution (int x, int y) |
void | setOpeningAngles (double x, double y) |
void | setRange (double minimum, double maximum) |
virtual void | addToLists (std::vector< Sensorport * > &sensorportList, std::vector< Actuatorport * > &actuatorportList, std::vector< Actuator * > &actuatorList) |
virtual void | addToDescriptions (std::vector< ObjectDescription > &objectDescriptionTree, int depth) |
virtual SimObject * | clone () const |
void | computeValue (unsigned char *&value, int portId) |
void | renderingInstructions () const |
virtual void | draw (const Vector3d &pointOfView, const VisualizationParameterSet &visParams) |
Protected Attributes | |
int | resolutionX |
int | resolutionY |
double | angleX |
double | angleY |
double | minRange |
double | maxRange |
unsigned char * | image |
unsigned int | imageSize |
VisualizationParameterSet | visParams |
OffscreenRenderer * | osRenderer |
Definition at line 22 of file Camera.h.
Camera::Camera | ( | ) |
Constructor
Definition at line 9 of file Camera.cpp.
References image, maxRange, minRange, osRenderer, resolutionX, resolutionY, VisualizationParameterSet::SMOOTH_SHADING, VisualizationParameterSet::surfaceStyle, and visParams.
Referenced by clone().
Camera::~Camera | ( | ) |
void Camera::addToDescriptions | ( | std::vector< ObjectDescription > & | objectDescriptionTree, | |
int | depth | |||
) | [virtual] |
Adds descriptions of the object and its children to a list
objectDescriptionTree | The list of descriptions | |
The | depth of the object in the object tree |
Reimplemented from SimObject.
Definition at line 40 of file Camera.cpp.
References SimObject::addToDescriptions(), ObjectDescription::depth, SimObject::fullName, ObjectDescription::fullName, ObjectDescription::name, OBJECT_TYPE_SENSORPORT, and ObjectDescription::type.
void Camera::addToLists | ( | std::vector< Sensorport * > & | sensorportList, | |
std::vector< Actuatorport * > & | actuatorportList, | |||
std::vector< Actuator * > & | actuatorList | |||
) | [virtual] |
Adds the object to some internal lists
sensorportList | A list of all sensor ports in the scene | |
actuatorportList | A list of all actuator ports in the scene | |
actuatorList | A list of all actuators in the scene |
Reimplemented from SimObject.
Definition at line 26 of file Camera.cpp.
References cameraSensor, resolutionX, and resolutionY.
SimObject * Camera::clone | ( | ) | const [virtual] |
Clones the object and its child nodes
Reimplemented from SimObject.
Definition at line 135 of file Camera.cpp.
References SimObject::addChildNode(), angleX, angleY, Camera(), SimObject::childNodes, SimObject::fullName, image, imageSize, maxRange, minRange, SimObject::name, SimObject::position, resolutionX, resolutionY, SimObject::rotation, SimObject::setFullName(), SimObject::setName(), and SimObject::setPosition().
void Camera::computeValue | ( | unsigned char *& | value, | |
int | portId | |||
) | [virtual] |
Computes the image
value | A pointer to be set to the image | |
portId | The id of the sensorport |
Reimplemented from Sensor.
Definition at line 123 of file Camera.cpp.
References OffscreenRenderer::finishRendering(), image, Sensor::lastComputationStep, osRenderer, OffscreenRenderer::prepareRendering(), renderingInstructions(), resolutionX, resolutionY, and SimObject::simulationStep.
void Camera::draw | ( | const Vector3d & | pointOfView, | |
const VisualizationParameterSet & | visParams | |||
) | [virtual] |
Draws the camera opening and all child nodes
pointOfView | The point of view from which the scene is drawn | |
visParams | Parameters for Visualization |
Reimplemented from SimObject.
Definition at line 162 of file Camera.cpp.
References angleX, angleY, dist(), SimObject::draw(), SimObject::drawForCamera, M_PI, SimObject::position, Vector3d::rotate(), Vector3d::rotateY(), Vector3d::rotateZ(), SimObject::rotation, SimObject::standardLength, Vector3d::v, visParams, and SimObject::visualizeSensors.
virtual std::string Camera::getKind | ( | ) | const [inline, virtual] |
void Camera::renderingInstructions | ( | ) | const |
Executes the rendering of the image, called by offscreen renderer
Definition at line 66 of file Camera.cpp.
References SimObject::ambientColor, angleX, angleY, SimObject::backgroundColor, SimObject::draw(), M_PI, maxRange, minRange, SimObject::position, resolutionX, resolutionY, SimObject::rootNode, Vector3d::rotate(), SimObject::rotation, SimObject::setDrawForCamera(), Vector3d::v, and visParams.
Referenced by computeValue().
void Camera::setOpeningAngles | ( | double | x, | |
double | y | |||
) | [inline] |
Sets the opening angles of the camera in degrees
x | The horizontal opening angle | |
y | The vertical opening angle |
Definition at line 67 of file Camera.h.
References angleX, and angleY.
Referenced by SAX2Handler::parseCameraAttributes().
void Camera::setRange | ( | double | minimum, | |
double | maximum | |||
) | [inline] |
Sets the distance range of the camera
minRange | The minimum distance recognized | |
maxRange | The maximum distance recognized |
Definition at line 73 of file Camera.h.
References maxRange, and minRange.
Referenced by SAX2Handler::parseCameraAttributes().
void Camera::setResolution | ( | int | x, | |
int | y | |||
) |
Sets the resolution and initializes the image
x | The new image width | |
y | The new image height |
Definition at line 54 of file Camera.cpp.
References image, imageSize, resolutionX, and resolutionY.
Referenced by SAX2Handler::parseCameraAttributes().
double Camera::angleX [protected] |
The horizontal opening angle
Definition at line 30 of file Camera.h.
Referenced by clone(), draw(), renderingInstructions(), and setOpeningAngles().
double Camera::angleY [protected] |
The vertical opening angle
Definition at line 32 of file Camera.h.
Referenced by clone(), draw(), renderingInstructions(), and setOpeningAngles().
unsigned char* Camera::image [protected] |
A pointer to the image
Definition at line 38 of file Camera.h.
Referenced by Camera(), clone(), computeValue(), setResolution(), and ~Camera().
unsigned int Camera::imageSize [protected] |
The size of the image
Definition at line 40 of file Camera.h.
Referenced by clone(), and setResolution().
double Camera::maxRange [protected] |
The maximum range
Definition at line 36 of file Camera.h.
Referenced by Camera(), clone(), renderingInstructions(), and setRange().
double Camera::minRange [protected] |
The minimum range
Definition at line 34 of file Camera.h.
Referenced by Camera(), clone(), renderingInstructions(), and setRange().
OffscreenRenderer* Camera::osRenderer [protected] |
A pointer to an offscreen renderer
Definition at line 44 of file Camera.h.
Referenced by Camera(), computeValue(), and ~Camera().
int Camera::resolutionX [protected] |
The image width
Definition at line 26 of file Camera.h.
Referenced by addToLists(), Camera(), clone(), computeValue(), renderingInstructions(), and setResolution().
int Camera::resolutionY [protected] |
The image height
Definition at line 28 of file Camera.h.
Referenced by addToLists(), Camera(), clone(), computeValue(), renderingInstructions(), and setResolution().
VisualizationParameterSet Camera::visParams [protected] |
Parameters for visualization
Definition at line 42 of file Camera.h.
Referenced by Camera(), draw(), and renderingInstructions().