|
ATLAS Offline Software
|
Go to the documentation of this file.
18 #include <Inventor/C/errors/debugerror.h>
19 #include <Inventor/nodes/SoSeparator.h>
20 #include <Inventor/nodes/SoTransform.h>
21 #include <Inventor/nodes/SoMaterial.h>
67 : m_d(
new Imp), m_common(colhandle->
common()),m_visible(false)
137 SoNode* shape_simple(0), * shape_detailed(0);
138 theclass->
buildShapes(shape_simple, shape_detailed);
142 shape_detailed = shape_simple;
190 if (!currentmaterial) {
191 currentmaterial = determineMaterial(theclass);
192 currentmaterial->ref();
195 if (colhandle->sephelperDetailedNodes())
196 colhandle->sephelperDetailedNodes()->addNodeUnderMaterial(
sepDetailed,currentmaterial);
197 if (sephelper_lod_detail)
198 sephelper_lod_detail->addNodeUnderMaterial(
sepDetailed,currentmaterial);
201 if (colhandle->sephelperSimpleNodes())
202 colhandle->sephelperSimpleNodes()->addNodeUnderMaterial(
sepSimple,currentmaterial);
203 if (sephelper_lod_simple)
204 sephelper_lod_simple->addNodeUnderMaterial(
sepSimple,currentmaterial);
211 if (!currentmaterial)
214 if (colhandle->sephelperDetailedNodes())
215 colhandle->sephelperDetailedNodes()->removeNodeUnderMaterial(
sepDetailed,currentmaterial);
216 if (sephelper_lod_detail)
217 sephelper_lod_detail->removeNodeUnderMaterial(
sepDetailed,currentmaterial);
220 if (colhandle->sephelperSimpleNodes())
221 colhandle->sephelperSimpleNodes()->removeNodeUnderMaterial(
sepSimple,currentmaterial);
222 if (sephelper_lod_simple)
223 sephelper_lod_simple->removeNodeUnderMaterial(
sepSimple,currentmaterial);
280 return QStringList(
"Null PRD");
281 std::ostringstream
os;
283 return QString(
os.str().c_str()).split(
"\n");
330 transform->translation.getValue().getValue(
tx,ty,tz);
333 transform->rotation.getValue().getValue(so_rotaxis, so_rotangle);
335 so_rotaxis.getValue(rx,ry,rz);
343 std::cout<<
"VP1 PRDHandleBase Warning: getTransform_CLHEP called at inopportune moment!!"<<std::endl;
349 return Amg::Transform3D::Identity();
376 std::cerr<<
"PRDHandleBase::createTransform() No prd!"<<std::endl;
377 return new SoTransform;
390 if ((theHitGPos)[0]!=(theHitGPos)[0] || (theHitGPos)[1]!=(theHitGPos)[1] || (theHitGPos)[2]!=(theHitGPos)[2]){
391 std::cerr<<
"PRDHandleBase::createTransform() NaN in globalposition"<<std::endl;
393 theHitTransform->translation.setValue((theHitGPos)[0], (theHitGPos)[1], (theHitGPos)[2]);
394 return theHitTransform;
400 double hlw = colhandle->highLightWeight();
404 std::map<SoMaterial*,double> materials;
409 if (colhandle->colourByTracks()) {
410 for (
unsigned i = 0;
i <
ts->tracks.size(); ++
i) {
415 std::cout<<
"PRDHandleBase ERROR: Did not find track material!"<<std::endl;
419 if (colhandle->colourBySegments()) {
420 for (
unsigned i = 0;
i <
ts->segments.size(); ++
i) {
425 std::cout<<
"PRDHandleBase ERROR: Did not find segment material (2)!"<<std::endl;
428 if (hlw>0.0&&colhandle->highLightOutliers()) {
430 if (colhandle->colourByTracks()&&!
ts->tracks_outliers.empty()) {
432 materials[colhandle->highLightMaterial()] =
ts->tracks_outliers.size();
434 for (
unsigned i = 0;
i <
ts->tracks_outliers.size(); ++
i) {
437 materials[
mat]=1.0/(hlw+1.0);
439 std::cout<<
"PRDHandleBase ERROR: Did not find track material (3)!"<<std::endl;
441 materials[colhandle->highLightMaterial()] =
ts->tracks_outliers.size()*hlw/(hlw+1.0);
446 if (colhandle->colourByTracks()) {
447 for (
unsigned i = 0;
i <
ts->tracks_outliers.size(); ++
i) {
452 std::cout<<
"PRDHandleBase ERROR: Did not find track material (4)!"<<std::endl;
455 if (hlw>0.0&&!colhandle->highLightOutliers()&&theclass->
highLight()) {
456 unsigned ntrackssegments= (colhandle->colourByTracks()?
ts->tracks.size()+
ts->tracks_outliers.size():0)
457 +(colhandle->colourBySegments()?
ts->segments.size():0);
459 materials[colhandle->highLightMaterial()] = hlw*ntrackssegments;
462 if (!materials.empty())
469 if (hlw>0.0&&!colhandle->highLightOutliers()&&theclass->
highLight()) {
471 return colhandle->highLightMaterial();
474 return colhandle->material();
VP1ExtraSepLayerHelper * sephelper_lod_simple
VP1SoMaterialMixer * materialMixer() const
void rebuild3DObjects(PRDHandleBase *)
Eigen::Quaternion< double > Rotation3D
Amg::Transform3D getTransform_CLHEP() const
static Amg::Vector3D positionPRD(const Trk::PrepRawData *prd)
void registerTransform2Handle(SoTransform *transform, PRDHandleBase *handle)
void incrementNumberOfObjectsForPV(const GeoPVConstLink &chamberPV)
TouchedMuonChamberHelper * touchedMuonChamberHelper() const
SoSeparator * sepDetailed
PRDCollHandleBase * collHandle() const
Amg::Vector3D positionPRD() const
SoMaterial * getMixedMaterial(const std::set< SoMaterial * > &)
const Amg::Vector3D & center() const
Returns the center position of the Surface.
void attach3DObjects(PRDHandleBase *)
virtual SoTransform * createTransform() const
virtual int regionIndex()
PRDSysCommonData * common() const
virtual QStringList clicked() const
SoMaterial * currentmaterial
void decrementNShownHandles()
HitsSoNodeManager * nodeManager() const
void getLODSeparators(int index, VP1ExtraSepLayerHelper *&sephelper_detail, VP1ExtraSepLayerHelper *&sephelper_simple)
Amg::Vector3D getTranslationVectorFromTransform(const Amg::Transform3D &tr)
Get the Translation vector out of a Transformation.
Amg::Rotation3D getRotation3DfromAngleAxis(double angle, Amg::Vector3D &axis)
get a AngleAxis from an angle and an axis.
const TracksAndSegments * tracksAndSegments(const Trk::PrepRawData *)
virtual const Trk::PrepRawData * getSecondPRD() const
PRDCollHandleBase * colhandle
virtual GeoPVConstLink parentMuonChamberPV() const
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
virtual const Surface & surface() const =0
Return surface associated with this detector element.
SoSeparator * sepSimple() const
Amg::Vector3D positionSecondPRD() const
virtual bool transformUsesSurfacePositionOnly() const
Identifier identify() const
return the identifier
virtual const Trk::PrepRawData * getPRD() const =0
const Amg::Vector2D & localPosition() const
return the local position reference
Eigen::Matrix< double, 3, 1 > Vector3D
SoSeparator * sepDetailed() const
void decrementNumberOfObjectsForPV(const GeoPVConstLink &chamberPV)
SoMaterial * segmentMaterial(const Trk::Segment *) const
SoNode * getShapeNode_Point()
Eigen::Translation< double, 3 > Translation3D
PRDTrackSegmentHelper * trackAndSegmentHelper() const
virtual bool highLight() const
SoMaterial * determineMaterial(PRDHandleBase *)
SoMaterial * trackMaterial(const Trk::Track *) const
void incrementNShownHandles()
virtual bool inMuonChamber() const
VP1ExtraSepLayerHelper * sephelper_lod_detail
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
PRDHandleBase(PRDCollHandleBase *)
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const =0
Specified by each surface type: LocalToGlobal method without dynamic memory allocation.
virtual Amg::Vector3D center() const
virtual const TrkDetElementBase * detectorElement() const =0
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
virtual void buildShapes(SoNode *&shape_simple, SoNode *&shape_detailed)=0