|
ATLAS Offline Software
|
|
void | getCameraCoordinateSystem (SoCamera *cameraarg, SoNode *root, SbMatrix &matrix, SbMatrix &inverse) |
|
void | updateLastVars () |
|
bool | lastParsChanged () const |
|
void | startSeekTimer (double duration_in_secs) |
|
bool | instanceInvalid () |
|
bool | getCameraParametersForBBox (const SbBox3f &box, SoSFVec3f &position, SoSFFloat &nearDistance, SoSFFloat &farDistance, SoSFFloat &focalDistance, bool &isPerspective, SoSFFloat &height) |
|
void | actual_animatedZoomToCameraState (const QByteArray &camstate, double duration_in_secs) |
|
void | actual_animatedZoomToPoint (SbVec3f, double duration_in_secs=1.0) |
|
void | actual_animatedZoomToPath (SoPath *path, double duration_in_secs=1.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999)) |
|
void | actual_animatedZoomToBBox (const SbBox3f &box, double duration_in_secs=1.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999)) |
|
void | actual_animatedZoomToSubTree (SoNode *subtreeroot, double duration_in_secs=1.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999)) |
|
void | die (bool abnormal=true) |
|
Definition at line 42 of file VP1CameraHelper.cxx.
◆ actual_animatedZoomToBBox()
void VP1CameraHelper::Imp::actual_animatedZoomToBBox |
( |
const SbBox3f & |
box, |
|
|
double |
duration_in_secs = 1.0 , |
|
|
double |
slack = 1.0 , |
|
|
const SbVec3f & |
lookat = SbVec3f(999,999,999) , |
|
|
const SbVec3f & |
upvec = SbVec3f(999,999,999) |
|
) |
| |
Definition at line 474 of file VP1CameraHelper.cxx.
482 if (slack<=0.0||duration_in_secs<0.0) {
496 SbBox3f actualbbox = box;
498 float minx, miny, minz, maxx, maxy, maxz;
499 actualbbox.getBounds (minx, miny, minz, maxx, maxy, maxz);
500 float dx(maxx-minx),
cx(0.5*(maxx+minx));
501 float dy(maxy-miny),
cy(0.5*(maxy+miny));
502 float dz(maxz-minz), cz(0.5*(maxz+minz));
503 actualbbox.setBounds (
cx-0.5*slack*
dx,
cy-0.5*slack*
dy, cz-0.5*slack*dz,
504 cx+0.5*slack*
dx,
cy+0.5*slack*
dy, cz+0.5*slack*dz);
509 SoSFVec3f target_position;
510 SoSFFloat target_nearDistance;
511 SoSFFloat target_farDistance;
512 SoSFFloat target_focalDistance;
513 bool currentcamera_isperspective;
514 SoSFFloat target_ortho_height;
518 bool changeorient(
false);
519 if (lookat==SbVec3f(999,999,999)&&upvec==SbVec3f(999,999,999)) {
524 SbVec3f actual_lookat(lookat);
525 if (lookat==SbVec3f(999,999,999)) {
527 SbRotation camrot =
camera->orientation.getValue();
528 actual_lookat = SbVec3f(0.0
f, 0.0
f, -1.0
f);
529 camrot.multVec(actual_lookat, actual_lookat);
531 SbVec3f actual_upvec(upvec);
532 if (upvec==SbVec3f(999,999,999)) {
534 SbRotation camrot =
camera->orientation.getValue();
535 actual_upvec = SbVec3f(0.0
f, 1.0
f, 0.0
f);
536 camrot.multVec(actual_upvec, actual_upvec);
551 target_position, target_nearDistance,
552 target_farDistance, target_focalDistance,
553 currentcamera_isperspective,target_ortho_height)) {
571 SoOrthographicCamera * orthocam =
static_cast<SoOrthographicCamera*
>(
camera);
◆ actual_animatedZoomToCameraState()
void VP1CameraHelper::Imp::actual_animatedZoomToCameraState |
( |
const QByteArray & |
camstate, |
|
|
double |
duration_in_secs |
|
) |
| |
Definition at line 320 of file VP1CameraHelper.cxx.
323 if (!
camera||camstate==QByteArray()||duration_in_secs<0.0) {
337 const bool perspective(
camera->getTypeId().isDerivedFrom(SoPerspectiveCamera::getClassTypeId()));
338 SoCamera * targetcam = perspective ?
static_cast<SoCamera*
>(
new SoPerspectiveCamera)
339 :
static_cast<SoCamera*
>(
new SoOrthographicCamera);
341 QByteArray ba = camstate;
◆ actual_animatedZoomToPath()
void VP1CameraHelper::Imp::actual_animatedZoomToPath |
( |
SoPath * |
path, |
|
|
double |
duration_in_secs = 1.0 , |
|
|
double |
slack = 1.0 , |
|
|
const SbVec3f & |
lookat = SbVec3f(999,999,999) , |
|
|
const SbVec3f & |
upvec = SbVec3f(999,999,999) |
|
) |
| |
Definition at line 384 of file VP1CameraHelper.cxx.
392 if (slack<=0.0||duration_in_secs<0.0) {
403 SbViewportRegion dummyvp;
404 SoGetBoundingBoxAction mybboxaction(dummyvp);
405 mybboxaction.apply(
path);
406 SbBox3f box = mybboxaction.getBoundingBox();
◆ actual_animatedZoomToPoint()
void VP1CameraHelper::Imp::actual_animatedZoomToPoint |
( |
SbVec3f |
targetpoint, |
|
|
double |
duration_in_secs = 1.0 |
|
) |
| |
Definition at line 619 of file VP1CameraHelper.cxx.
626 if (duration_in_secs<0.0) {
655 SbMatrix cameramatrix, camerainverse;
660 camerainverse.multVecMatrix(targetpoint, targetpoint);
663 fd *= (targetpoint -
camera->position.getValue()).
length()/100.0f;
672 camera->orientation.getValue().multVec(SbVec3f(0, 0, -1), olddir);
673 SbRotation diffrot(olddir,
dir);
◆ actual_animatedZoomToSubTree()
void VP1CameraHelper::Imp::actual_animatedZoomToSubTree |
( |
SoNode * |
subtreeroot, |
|
|
double |
duration_in_secs = 1.0 , |
|
|
double |
slack = 1.0 , |
|
|
const SbVec3f & |
lookat = SbVec3f(999,999,999) , |
|
|
const SbVec3f & |
upvec = SbVec3f(999,999,999) |
|
) |
| |
Definition at line 426 of file VP1CameraHelper.cxx.
434 if (slack<=0.0||duration_in_secs<0.0) {
444 SoSearchAction mysearchaction;
445 mysearchaction.setNode(subtreeroot);
447 SoPath *
mypath = mysearchaction.getPath();
449 VP1Msg::messageDebug(
"VP1CameraHelper WARNING: Cancelled operation due to failure to locate path to node.");
455 mysearchaction.reset();
◆ cameraOrientation()
SbRotation VP1CameraHelper::Imp::cameraOrientation |
( |
SbVec3f |
dir, |
|
|
SbVec3f |
up |
|
) |
| |
|
static |
Definition at line 927 of file VP1CameraHelper.cxx.
929 const float epsilon = 0.00001f;
932 if (
dir.sqrLength()==0.0f||
up.sqrLength()==0.0f) {
934 "view and up direction vectors that are not both non-zero");
935 return SbRotation(SbVec3f(0.0
f, 0.0
f, 1.0
f), 0.0
f);
943 SbVec3f dir0(0.0
f, 0.0
f, -1.0
f), up0(0.0
f, 1.0
f, 0.0
f);
946 SbRotation rot(dir0,
dir);
949 if (fabs(
dir.dot(
up))>1.0f-epsilon) {
951 "view and up direction vectors that are essentially parallel."
952 " Choosing new arbitrary up direction.");
953 up =
dir.cross(SbVec3f(1.0
f,1.0
f,0.0
f));
955 if (fabs(
dir.dot(
up))>1.0f-epsilon) {
956 up =
dir.cross(SbVec3f(1.0
f,0.0
f,1.0
f));
958 if (fabs(
dir.dot(
up))>1.0f-epsilon) {
974 if (
up.length()<epsilon) {
981 rot.multVec(up0,up0);
982 up0 = up0 -
dir*(
dir.dot(up0));
983 if (up0.length()<epsilon) {
991 return rot*SbRotation(up0,
up);
◆ die()
void VP1CameraHelper::Imp::die |
( |
bool |
abnormal = true | ) |
|
|
inline |
◆ getCameraCoordinateSystem()
void VP1CameraHelper::Imp::getCameraCoordinateSystem |
( |
SoCamera * |
cameraarg, |
|
|
SoNode * |
root, |
|
|
SbMatrix & |
matrix, |
|
|
SbMatrix & |
inverse |
|
) |
| |
◆ getCameraParametersForBBox()
bool VP1CameraHelper::Imp::getCameraParametersForBBox |
( |
const SbBox3f & |
box, |
|
|
SoSFVec3f & |
position, |
|
|
SoSFFloat & |
nearDistance, |
|
|
SoSFFloat & |
farDistance, |
|
|
SoSFFloat & |
focalDistance, |
|
|
bool & |
isPerspective, |
|
|
SoSFFloat & |
height |
|
) |
| |
Definition at line 851 of file VP1CameraHelper.cxx.
857 float aspect =
camera->aspectRatio.getValue();
861 if (
camera->getTypeId() == SoPerspectiveCamera::getClassTypeId()) {
863 }
else if (
camera->getTypeId() == SoOrthographicCamera::getClassTypeId()) {
870 SbVec3f cameradirection;
871 camera->orientation.getValue().multVec(SbVec3f(0, 0, -1), cameradirection);
872 position.setValue(box.getCenter() + -cameradirection);
876 bs.circumscribe(box);
877 float radius = bs.getRadius();
882 float aspectradius =
radius / (aspect < 1.0f ? aspect : 1.0f);
884 SoPerspectiveCamera * perspcam =
static_cast<SoPerspectiveCamera*
>(
camera);
889 SbVec3f direction = position.getValue() - box.getCenter();
890 (void) direction.normalize();
892 aspectradius + (aspectradius/
float(
atan(perspcam->heightAngle.getValue())));
893 position.setValue(box.getCenter() + direction * movelength);
904 SbVec3f direction = position.getValue() - box.getCenter();
905 (void) direction.normalize();
906 position.setValue(box.getCenter() + direction *
radius);
912 float distance_to_midpoint = (position.getValue() - box.getCenter()).
length();
913 nearDistance = distance_to_midpoint -
radius;
914 farDistance = distance_to_midpoint +
radius;
921 focalDistance = distance_to_midpoint;
◆ instanceInvalid()
bool VP1CameraHelper::Imp::instanceInvalid |
( |
| ) |
|
◆ lastParsChanged()
bool VP1CameraHelper::Imp::lastParsChanged |
( |
| ) |
const |
◆ seeksensorCB()
void VP1CameraHelper::Imp::seeksensorCB |
( |
void * |
data, |
|
|
SoSensor * |
s |
|
) |
| |
|
static |
Definition at line 682 of file VP1CameraHelper.cxx.
689 if (
d->instanceInvalid() ||
d->lastParsChanged()) {
694 SoTimerSensor * sensor = (SoTimerSensor *)
s;
700 if (
d->ntotframes<0) {
702 d->ntotframes =
std::max(1,
static_cast<int>((
d->fps)*(
d->seekperiod)+0.5));
708 t = ( (
d->iframe+1==
d->ntotframes) ? 1.0
f :
static_cast<float>((
d->iframe+1)*1.0/(
d->ntotframes*1.0)) );
716 if ((
t > 1.0
f) || (
d->fps<=0&&(
t + sensor->getInterval().getValue()/
d->seekperiod > 1.0f)))
t = 1.0f;
718 d->clipVol_percentage =
d->clipVol_startPercentage+(
d->clipVol_endPercentage -
d->clipVol_startPercentage)*
t;
719 emit
d->theclass->clipVolumePercentageOfATLAS(
d->clipVol_percentage);
721 bool end = (
t == 1.0f);
726 if (
d->camera->position.getValue()!=
d->cameraendposition) {
727 double rBegin=
d->camerastartposition.length();
728 double rEnd=
d->cameraendposition.length();
729 double lengthRatio = rEnd/rBegin;
730 SbVec3f
u =
d->camerastartposition;
u.normalize();
731 SbVec3f
v =
d->cameraendposition;
v.normalize();
733 if (
d->forceCircular||(lengthRatio>0.99 && lengthRatio<1.01 && angle<0.95*M_PI && angle>0.05*
M_PI)) {
734 double r = rBegin + (rEnd-rBegin)*
t;
735 SbVec3f
w =
u.cross(
v);
740 d->camera->position=
z;
742 d->camera->position =
d->camerastartposition + (
d->cameraendposition -
d->camerastartposition) *
t;
745 if (
d->camera->orientation.getValue()!=
d->cameraendorient)
746 d->camera->orientation = SbRotation::slerp(
d->camerastartorient,
d->cameraendorient,
t);
754 if (
d->camera->focalDistance!=
d->cameraend_focalDistance)
755 d->camera->focalDistance.setValue(
d->camerastart_focalDistance.getValue()*(1-
t) +
d->cameraend_focalDistance.getValue()*
t);
756 if (!
d->camera_isperspective) {
757 SoOrthographicCamera * orthocam =
static_cast<SoOrthographicCamera*
>(
d->camera);
758 if (orthocam&&orthocam->height!=
d->cameraend_ortho_height)
759 orthocam->height.setValue(
d->camerastart_ortho_height.getValue()*(1-
t) +
d->cameraend_ortho_height.getValue()*
t);
764 if (
d->ntotframes>0) {
767 if (
d->seekperiod>0.0) {
770 d->width,
d->height,
false);
781 if (
d->targetCamState!=QByteArray()) {
◆ startSeekTimer()
void VP1CameraHelper::Imp::startSeekTimer |
( |
double |
duration_in_secs | ) |
|
◆ updateLastVars()
void VP1CameraHelper::Imp::updateLastVars |
( |
| ) |
|
◆ camera
SoCamera* VP1CameraHelper::Imp::camera |
◆ camera_isperspective
bool VP1CameraHelper::Imp::camera_isperspective |
◆ camera_ref
int32_t VP1CameraHelper::Imp::camera_ref |
◆ cameraend_farDistance
SoSFFloat VP1CameraHelper::Imp::cameraend_farDistance |
◆ cameraend_focalDistance
SoSFFloat VP1CameraHelper::Imp::cameraend_focalDistance |
◆ cameraend_nearDistance
SoSFFloat VP1CameraHelper::Imp::cameraend_nearDistance |
◆ cameraend_ortho_height
SoSFFloat VP1CameraHelper::Imp::cameraend_ortho_height |
◆ cameraendorient
SbRotation VP1CameraHelper::Imp::cameraendorient |
◆ cameraendposition
SbVec3f VP1CameraHelper::Imp::cameraendposition |
◆ camerastart_farDistance
SoSFFloat VP1CameraHelper::Imp::camerastart_farDistance |
◆ camerastart_focalDistance
SoSFFloat VP1CameraHelper::Imp::camerastart_focalDistance |
◆ camerastart_nearDistance
SoSFFloat VP1CameraHelper::Imp::camerastart_nearDistance |
◆ camerastart_ortho_height
SoSFFloat VP1CameraHelper::Imp::camerastart_ortho_height |
◆ camerastartorient
SbRotation VP1CameraHelper::Imp::camerastartorient |
◆ camerastartposition
SbVec3f VP1CameraHelper::Imp::camerastartposition |
◆ clipVol_endPercentage
double VP1CameraHelper::Imp::clipVol_endPercentage |
◆ clipVol_lastPercentage
double VP1CameraHelper::Imp::clipVol_lastPercentage |
◆ clipVol_percentage
double VP1CameraHelper::Imp::clipVol_percentage |
◆ clipVol_startPercentage
double VP1CameraHelper::Imp::clipVol_startPercentage |
◆ forceCircular
bool VP1CameraHelper::Imp::forceCircular |
◆ fps
double VP1CameraHelper::Imp::fps |
◆ height
int VP1CameraHelper::Imp::height |
◆ helpers
◆ iframe
int VP1CameraHelper::Imp::iframe |
◆ inseekmode
SbBool VP1CameraHelper::Imp::inseekmode |
◆ instance_invalid
bool VP1CameraHelper::Imp::instance_invalid |
◆ last_camera_ortho_height
SoSFFloat VP1CameraHelper::Imp::last_camera_ortho_height |
◆ last_cameraorient
SbRotation VP1CameraHelper::Imp::last_cameraorient |
◆ last_cameraposition
SbVec3f VP1CameraHelper::Imp::last_cameraposition |
◆ matrixaction
SoGetMatrixAction* VP1CameraHelper::Imp::matrixaction |
◆ ntotframes
int VP1CameraHelper::Imp::ntotframes |
◆ outputdir
QString VP1CameraHelper::Imp::outputdir |
◆ prefix
QString VP1CameraHelper::Imp::prefix |
◆ renderArea
◆ sceneroot
SoGroup* VP1CameraHelper::Imp::sceneroot |
◆ searchaction
SoSearchAction* VP1CameraHelper::Imp::searchaction |
◆ seekdistance
float VP1CameraHelper::Imp::seekdistance |
◆ seekdistanceabs
SbBool VP1CameraHelper::Imp::seekdistanceabs |
◆ seekperiod
float VP1CameraHelper::Imp::seekperiod |
◆ seeksensor
SoTimerSensor* VP1CameraHelper::Imp::seeksensor |
◆ seektopoint
SbBool VP1CameraHelper::Imp::seektopoint |
◆ targetCamState
QByteArray VP1CameraHelper::Imp::targetCamState |
◆ theclass
◆ varySpeed
bool VP1CameraHelper::Imp::varySpeed |
◆ width
int VP1CameraHelper::Imp::width |
The documentation for this class was generated from the following file:
char data[hepevt_bytes_allocation_ATLAS]
SbVec3f last_cameraposition
path
python interpreter configuration --------------------------------------—
static bool deserializeSoCameraParameters(QByteArray &, SoCamera &)
static void getLastAndNextFrameFileNames(QString outputdir, QString prefix, QString &lastOfExistingFiles, QString &nextAvailableFile)
void actual_animatedZoomToPath(SoPath *path, double duration_in_secs=1.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999))
SbRotation camerastartorient
void getCameraCoordinateSystem(SoCamera *cameraarg, SoNode *root, SbMatrix &matrix, SbMatrix &inverse)
static SbRotation cameraOrientation(SbVec3f dir, SbVec3f up)
SoTimerSensor * seeksensor
SbRotation cameraendorient
static QString str(const QString &s)
void animationFinishedAbnormally()
@ u
Enums for curvilinear frames.
bool getCameraParametersForBBox(const SbBox3f &box, SoSFVec3f &position, SoSFFloat &nearDistance, SoSFFloat &farDistance, SoSFFloat &focalDistance, bool &isPerspective, SoSFFloat &height)
SoSFFloat cameraend_farDistance
SoSFFloat camerastart_nearDistance
QByteArray targetCamState
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
SoSFFloat cameraend_focalDistance
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
void startSeekTimer(double duration_in_secs)
void die(bool abnormal=true)
bool TRUE
for job options legacy (TODO: get rid of these!) ----------------------—
void actual_animatedZoomToBBox(const SbBox3f &box, double duration_in_secs=1.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999))
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
VP1CameraHelper * theclass
SoSFFloat cameraend_ortho_height
SoSearchAction * searchaction
static void messageVerbose(const QString &)
SoSFFloat camerastart_ortho_height
SoSFFloat camerastart_farDistance
SbVec3f camerastartposition
SoGetMatrixAction * matrixaction
SbRotation last_cameraorient
bool camera_isperspective
static void messageDebug(const QString &)
SoSFFloat cameraend_nearDistance
static QPixmap renderToPixmap(VP1ExaminerViewer *ra, int pixels_x, int pixels_y, bool transparent_background=false, double actualRenderedSizeFact=1.0)
double clipVol_lastPercentage
double clipVol_percentage
SoSFFloat last_camera_ortho_height
SbVec3f cameraendposition
SoSFFloat camerastart_focalDistance