Quad that uses texture to represent a 2D photo in 3D space.
More...
#include <Photo.h>
|
| Photo () |
|
| Photo (const Photo &photo, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) |
|
void | setWidth (float w) |
|
float | getWidth () const |
|
void | setHeight (float h) |
|
float | getHeight () const |
|
void | setCenter (const osg::Vec3f &c) |
|
const osg::Vec3f & | getCenter () const |
|
void | setAngle (float a) |
|
float | getAngle () const |
|
void | loadImage (const std::string &fname) |
|
osg::StateAttribute * | getTextureAsAttribute () const |
|
void | move (const double u, const double v) |
|
void | moveDelta (double du, double dv) |
|
void | rotate (double angle) |
|
void | rotate (double theta, osg::Vec3f center) |
|
void | flipH () |
|
void | flipV () |
|
void | scale (double scale, osg::Vec3f center) |
|
void | scale (double scaleX, double scaleY, osg::Vec3f center) |
|
bool | scaleWithinViewport (const osg::Plane &plane, const osg::Vec3f &C, const osg::Matrix &invM) |
|
void | scaleAndPositionWith (const entity::SVMData *svm, const osg::Vec3d &eye, const osg::Vec3d ¢er, const osg::Vec3d &up) |
|
void | setColor (const osg::Vec4f &color) |
|
const osg::Vec4f & | getColor () const |
|
virtual void | setSelected (float alpha) |
|
virtual void | setUnselected (float alpha) |
|
void | setTransparency (float alpha) |
|
float | getTransparency () const |
|
cher::ENTITY_TYPE | getEntityType () const |
|
| Entity2D (const Entity2D ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) |
|
Quad that uses texture to represent a 2D photo in 3D space.
§ Photo() [1/2]
Default constructor, creates empty object and initializes OpenGL states.
§ Photo() [2/2]
entity::Photo::Photo |
( |
const Photo & |
photo, |
|
|
const osg::CopyOp & |
copyop = osg::CopyOp::SHALLOW_COPY |
|
) |
| |
Constructor which is only used for OSG factorization. Not used otherwise.
§ flipH()
void entity::Photo::flipH |
( |
| ) |
|
A method to perform a horizontal flip.
§ flipV()
void entity::Photo::flipV |
( |
| ) |
|
A method to perform a vertical flip.
§ getColor()
const osg::Vec4f & entity::Photo::getColor |
( |
| ) |
const |
|
virtual |
- Returns
- geometry color. Assumed it is binded per geometry.
Implements entity::Entity2D.
§ getEntityType()
cher::ENTITY_TYPE entity::Photo::getEntityType |
( |
| ) |
const |
|
virtual |
§ getTransparency()
float entity::Photo::getTransparency |
( |
| ) |
const |
- Returns
- quad's transparency level.
§ move()
void entity::Photo::move |
( |
const double |
u, |
|
|
const double |
v |
|
) |
| |
A method to change location of the Photo center.
- Parameters
-
u | is a new local U coordinate, |
v | is a new local V coordinate. |
§ moveDelta()
void entity::Photo::moveDelta |
( |
double |
du, |
|
|
double |
dv |
|
) |
| |
|
virtual |
A method to change photo location within a canvas by using delta movement.
- Parameters
-
du | is delta movement in local U coordinate, |
dv | is delta movement in local V coordinate. |
Implements entity::Entity2D.
§ rotate() [1/2]
void entity::Photo::rotate |
( |
double |
angle | ) |
|
A method to change photo orientation within its canvas.
- Parameters
-
angle | is the new rotation angle from positive U coordinate and around photo center, in radians. |
§ rotate() [2/2]
void entity::Photo::rotate |
( |
double |
theta, |
|
|
osg::Vec3f |
center |
|
) |
| |
|
virtual |
A method to change photo orientation around a specified photo center.
- Parameters
-
theta | is the rotation angle, in radians. |
center | is the local coordinates of new photo center around which the rotation will be performed. |
Implements entity::Entity2D.
§ scale() [1/2]
void entity::Photo::scale |
( |
double |
scale, |
|
|
osg::Vec3f |
center |
|
) |
| |
|
virtual |
A method to scale photo quad uniformly around specified center.
Implements entity::Entity2D.
§ scale() [2/2]
void entity::Photo::scale |
( |
double |
scaleX, |
|
|
double |
scaleY, |
|
|
osg::Vec3f |
center |
|
) |
| |
|
virtual |
A method to scale both directions of photo quad independently around specified center.
Implements entity::Entity2D.
§ scaleAndPositionWith()
void entity::Photo::scaleAndPositionWith |
( |
const entity::SVMData * |
svm, |
|
|
const osg::Vec3d & |
eye, |
|
|
const osg::Vec3d & |
center, |
|
|
const osg::Vec3d & |
up |
|
) |
| |
A method to perform auto re-scaling and re-positionning by using SVMData and specifed camera position.
intersected ||
transformed ||
§ scaleWithinViewport()
bool entity::Photo::scaleWithinViewport |
( |
const osg::Plane & |
plane, |
|
|
const osg::Vec3f & |
C, |
|
|
const osg::Matrix & |
invM |
|
) |
| |
A method to perform automatic re-scaling so that whole photo is fit within current camera view.
- Parameters
-
normal | is the photo plane's normal vector. |
C | is an arbitrary point within the photo plane. |
- Returns
- true if re-scaling was performed, false - otherwire (e.g., when eye direction is parallel to photo plane).
§ setColor()
void entity::Photo::setColor |
( |
const osg::Vec4f & |
color | ) |
|
|
virtual |
A method to set up quad color, e.g., when performing selection.
Implements entity::Entity2D.
§ setTransparency()
void entity::Photo::setTransparency |
( |
float |
alpha | ) |
|
A method to set up quad transparency.
The documentation for this class was generated from the following files:
- src/libSGEntities/Photo.h
- src/libSGEntities/Photo.cpp