ATLAS Offline Software
Classes | Functions
VP1ExaminerViewer.cxx File Reference
#include "VP1Base/VP1ExaminerViewer.h"
#include "VP1Base/VP1Controller.h"
#include "VP1Base/VP1Msg.h"
#include "VP1Base/VP1CameraHelper.h"
#include "VP1Base/VP1QtInventorUtils.h"
#include "VP1Base/VP1QtUtils.h"
#include "VP1Base/AnimationSequencer.h"
#include "VP1Base/VP1Settings.h"
#include "VP1Base/VP1CustomTourEditor.h"
#include "VP1Base/VP1CustomStereoEditor.h"
#include "VP1HEPVis/VP1HEPVisUtils.h"
#include "VP1HEPVis/actions/SoGL2PSAction.h"
#include <Inventor/nodes/SoSphere.h>
#include <Inventor/nodes/SoGroup.h>
#include <Inventor/nodes/SoPerspectiveCamera.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/Qt/widgets/SoQtPopupMenu.h>
#include <Inventor/events/SoKeyboardEvent.h>
#include <Inventor/events/SoMouseButtonEvent.h>
#include <Inventor/nodes/SoEnvironment.h>
#include <Inventor/actions/SoSearchAction.h>
#include <Inventor/nodekits/SoBaseKit.h>
#include <Inventor/SoSceneManager.h>
#include <QBuffer>
#include <QByteArray>
#include <QMenu>
#include <QCursor>
#include <QColorDialog>
#include <QFileDialog>
#include <QInputDialog>
#include <QPushButton>
#include <QGLFormat>
#include "VP1HEPVis/gl2ps.h"
#include <map>
#include <iostream>
#include <typeinfo>

Go to the source code of this file.

Classes

class  VP1ExaminerViewer::Imp
 
class  VP1ExaminerViewer::Imp::StoredView
 

Functions

void debugCameraClipPlanes (void *data, const SbVec2f &nearfar)
 tune the camera clipping planes More...
 
SbVec2f fixedDistanceClipPlanesCB (void *data, const SbVec2f &nearfar)
 set the clipping strategy and fix the clipping More...
 

Function Documentation

◆ debugCameraClipPlanes()

void debugCameraClipPlanes ( void *  data,
const SbVec2f &  nearfar 
)

tune the camera clipping planes

Definition at line 468 of file VP1ExaminerViewer.cxx.

469 {
470  SoCamera *camera = ((VP1ExaminerViewer *) data)->getCamera();
471  SoNode *scenegraph = ((VP1ExaminerViewer *) data)->getSceneGraph();
472 
473  SbVec3f pos = camera->position.getValue();
474 
475  SoSearchAction action;
476  SbBool oldsearch = SoBaseKit::isSearchingChildren();
477  SoBaseKit::setSearchingChildren(TRUE);
478 
479  action.setSearchingAll(true);
480  action.setType(SoCamera::getClassTypeId());
481  action.setInterest(SoSearchAction::ALL);
482  action.apply(scenegraph);
483 
484  SoBaseKit::setSearchingChildren(oldsearch);
485 
486  SoPathList &cameras = action.getPaths();
487 
488  for (int i = 0, e = cameras.getLength(); i != e; ++i) {
489  auto* tail = cameras[i]->getTail();
490  std::cerr << "Camera #" << i << " = " << (void *) tail << "(" << typeid(*tail).name() << ")\n";
491  }
492 
493  std::cerr << "Calculated clip-planes. Near: " << nearfar[0] << ". Far: " << nearfar[1] << "\n"
494  << "Current camera clip-planes. Near: " << camera->nearDistance.getValue() << ", Far: " << camera->farDistance.getValue() << "\n"
495  << "Camera ptr: " << (void *) camera << "\n"
496  << "Camera name: " << camera->getName() << "\n"
497  << "Camera type: " << typeid(*camera).name() << "\n"
498  << "Camera position:(" << pos[0] << ", " << pos[1] << ", " << pos[2] << ")\n"
499  << "Number of cameras in the scene: " << cameras.getLength() << "\n"
500  << "Focal distance: " << camera->focalDistance.getValue() << std::endl;
501 }

◆ fixedDistanceClipPlanesCB()

SbVec2f fixedDistanceClipPlanesCB ( void *  data,
const SbVec2f &  nearfar 
)

set the clipping strategy and fix the clipping

Definition at line 512 of file VP1ExaminerViewer.cxx.

513 {
514  SoCamera *camera = ((VP1ExaminerViewer *) data)->getCamera();
515  if (0) debugCameraClipPlanes(data, nearfar);
516 
517  if (camera->nearDistance.getValue() != nearfar[0])
518  camera->nearDistance = nearfar[0];
519  if (camera->farDistance.getValue() != nearfar[1])
520  camera->farDistance = nearfar[1];
521 
522  return nearfar;
523 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
tail
std::string tail(std::string s, const std::string &pattern)
tail of a string
Definition: computils.cxx:301
debugCameraClipPlanes
void debugCameraClipPlanes(void *data, const SbVec2f &nearfar)
tune the camera clipping planes
Definition: VP1ExaminerViewer.cxx:468
ALL
@ ALL
Definition: sTGCenumeration.h:14
lumiFormat.i
int i
Definition: lumiFormat.py:85
python.Constants.TRUE
bool TRUE
for job options legacy (TODO: get rid of these!) ----------------------—
Definition: Control/AthenaCommon/python/Constants.py:22
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77
VP1ExaminerViewer
Definition: VP1ExaminerViewer.h:30