|
ATLAS Offline Software
|
Go to the documentation of this file.
21 #include "GeoModelKernel/GeoVolumeCursor.h"
22 #include "GeoModelKernel/GeoShapeShift.h"
23 #include "GeoModelKernel/GeoTube.h"
24 #include "GeoModelKernel/GeoTubs.h"
26 #include <Inventor/nodes/SoSeparator.h>
27 #include <Inventor/nodes/SoTransform.h>
28 #include <Inventor/nodes/SoSwitch.h>
29 #include <Inventor/nodes/SoShape.h>
30 #include <Inventor/nodes/SoMaterial.h>
31 #include <Inventor/nodes/SoText2.h>
32 #include <Inventor/nodes/SoTranslation.h>
40 #include <QDataStream>
44 # pragma GCC diagnostic ignored "-Wdeprecated-copy"
98 : m_d(
new Imp(
cd,pV,accumTrans)), m_childNumber(childNumber), m_nchildren(childNumber>=0?pV->getNChildVols():0), m_muonChamberState(mcs), m_parent(
parent),
146 GeoVolumeCursor av(
m_d->
pV);
147 while (!av.atEnd()) {
171 return m_d->
pV->getLogVol()->getName().c_str();
177 return m_d->
pV->getLogVol()->getName();
183 return m_d->
pV->getLogVol()->getName() ==
n;
259 std::cout <<
"Geomsys/VolumeHandle Error: Null shape!!!"<<std::endl;
271 if (
m_d->
pV->getLogVol()->getShape()->typeID()==GeoTube::getClassTypeID() )
274 const GeoTube * geotube =
static_cast<const GeoTube*
>(
m_d->
pV->getLogVol()->getShape());
275 if (geotube->getRMin()==0.0)
278 else if (
m_d->
pV->getLogVol()->getShape()->typeID()==GeoTubs::getClassTypeID() )
281 const GeoTubs * geotubs =
static_cast<const GeoTubs*
>(
m_d->
pV->getLogVol()->getShape());
282 if (geotubs->getRMin()==0.0 && geotubs->getDPhi() >= 2*
M_PI-1.0e-6)
289 if (
m_d->
pV->getLogVol()->getShape()->typeID()==GeoShapeShift::getClassTypeID())
298 SoSwitch * sw =
new SoSwitch;
300 SoSeparator * sep_slicedvols =
new SoSeparator;
301 sw->addChild(sep_slicedvols);
341 attachsepHelper->removeNodeUnderMaterial(nodesep,
material);
342 if (attachlabelSepHelper)
343 attachlabelSepHelper->removeNode(label_sep);
345 commondata->volumeBrowser()->scheduleUpdateOfAllNonHiddenIndices();
411 (*childItr)->contractDaughtersRecursively();
432 (*childItr)->m_d->attach(*childItr);
434 (*childItr)->attachAllContractedChildren();
448 (*childItr)->m_d->detach();
450 (*childItr)->detachAllContractedChildren();
457 GeoPVConstLink parent_pV;
462 if (parent_pV==
m_d->
pV) {
468 GeoVolumeCursor av(parent_pV);
470 while (!av.atEnd()) {
472 Query<int> Qint = av.getId();
473 return Qint.isValid() ?
int(Qint) : -1;
531 (*childItr)->expandMothersRecursivelyToNonEther();
543 buffer.open(QIODevice::WriteOnly);
559 buffer.open(QIODevice::ReadOnly);
612 if (!hasExpandedChildren&&!hasZappedChildren)
615 QMap<quint32,VolState>::const_iterator expItr, expItrEnd = vs.
m_expandedChildren.end();
616 QSet<quint32>::const_iterator zapItr, zapItrEnd = vs.
m_zappedChildren.end();
621 quint32
id = (*it)->hashID();
623 if (zapItr!=zapItrEnd) {
628 if (expItr!=expItrEnd) {
630 applyChildStates(expItr.value(),*
it);
639 const int n(
g->getNumChildren());
640 for (
int i=0;
i <
n; ++
i) {
641 const SoNode*
c =
g->getChild(
i);
642 if (
c->getTypeId().isDerivedFrom(SoShape::getClassTypeId())) {
643 if (
c->getTypeId().isDerivedFrom(SoPcons::getClassTypeId())
644 ||
c->getTypeId().isDerivedFrom(SoPolyhedron::getClassTypeId())
645 ||
c->getTypeId().isDerivedFrom(SoTransparency::getClassTypeId()))
647 }
else if (
c->getTypeId().isDerivedFrom(SoGroup::getClassTypeId())) {
648 if (hasNonStandardShapeChildren(
static_cast<const SoGroup*
>(
c)))
683 SoText2 *labelText =
new SoText2;
696 for (
unsigned int i=0;
i<3 ;++
i){
698 unsigned int mask=1<<(
i+1);
707 if (
i==2)
output+=
"<unknown>=";
715 for(
const QString&
str :
text){
717 labelText->string.set1Value(
row++,
array.data());
721 assert(labelTranslate!=0);
723 float labx,laby,labz;
724 labelTranslate->translation.getValue().getValue(labx,laby,labz);
727 labelTranslate->translation.setValue(labx+(offsets[0]*offScale),laby+(offsets[1]*offScale),labz+(offsets[2]*offScale));
SoMaterial * fallBackTopLevelMaterial() const
QDataStream & operator>>(QDataStream &in, VolumeHandle::Imp::VolState &vs)
bool isInitialisedAndHasNonStandardShape() const
virtual QString muonChamberT0(unsigned int=0) const
bool isInMuonChamber() const
VP1GeoFlags::SubSystemFlag subsystem() const
VP1GeoTreeView * volumeBrowser() const
VP1ExtraSepLayerHelper * getSepHelperForNode(VP1GeoFlags::SubSystemFlag flag, int iphi)
static bool hasNonStandardShapeChildren(const SoGroup *g)
void setState(const VP1GeoFlags::VOLSTATE &state)
const GeoMaterial * geoMaterial() const
void attachAllContractedChildren()
VolumeHandle * topLevelParent()
void attach(VolumeHandle *vh)
GeoPVConstLink geoPVConstLink() const
VolVisAttributes * volVisAttributes() const
VolumeHandleList m_children
bool isMuonChamber() const
bool childrenAreInitialised() const
std::string getNameStdString() const
int getVolumeType(const SbMatrix &transform, SoNode *shape) const
QDataStream & operator<<(QDataStream &out, const VolumeHandle::Imp::VolState &vs)
VP1ExtraSepLayerHelper * registerVolumeAroundZAxis(VP1GeoFlags::SubSystemFlag flag, SoSwitch *sw, const SbMatrix &tranformation)
static void initAllCustomClasses()
PhiSectorManager * phiSectorManager() const
void detachAllContractedChildren()
static VolState getChildStates(const VolumeHandle *theclass)
SoSeparator * nodeSoSeparator() const
static void applyChildStates(const VolState &, VolumeHandle *theclass)
void registerNodeSepForVolumeHandle(SoSeparator *, VolumeHandle *)
VolumeHandleSharedData * commondata
VP1GeoFlags::VOLSTATE m_state
QMap< quint32, VolState > m_expandedChildren
QByteArray getPersistifiableState() const
VolumeHandle(VolumeHandleSharedData *, VolumeHandle *parent, const GeoPVConstLink &, int childNumber, const MuonChamberState &mcs=NONMUONCHAMBER, const SbMatrix &accumTrans=SbMatrix())
Imp(VolumeHandleSharedData *the_cd, const GeoPVConstLink &the_pV, const SbMatrix &the_ac)
int nExpandedChildren() const
void initialiseChildren()
GeoPVConstLink geoPVConstLinkOfTreeTopsMother() const
unsigned nChildren() const
void expandMothersRecursivelyToNonEther()
bool haveParentsNotExpanded() const
void ensureBuildNodeSep()
static void transformToMatrix(SoTransform *xf, SbMatrix &result)
QSet< quint32 > m_zappedChildren
VP1ExtraSepLayerHelper * attachsepHelper
void applyPersistifiableState(QByteArray)
VP1GeoFlags::SubSystemFlag subSystemFlag() const
void removeZappedVolumesFromGui(VolumeHandle *)
VP1ExtraSepLayerHelper * getLabelSepHelperForNode(VP1GeoFlags::SubSystemFlag flag, int iphi)
Addition to handle label separators, in exactly the same way as getSepHelperForNode(....
static void messageDebug(const QString &)
void addZappedVolumeToGui(VolumeHandle *)
int nZappedChildren() const
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.
VolumeHandleList::iterator VolumeHandleListItr
VP1GeoFlags::VOLSTATE state() const
const SbMatrix accumTrans
VP1ExtraSepLayerHelper * attachlabelSepHelper
bool hasName(const std::string &) const
SbMatrix getLocalTransformToVolume() const
QList< int > labelsPosOffsets
GeoSysController * controller() const
SoNode * toShapeNode(const GeoPVConstLink &pV)
QList< int > labelPosOffset()
Offset in x,y,z.
SoMaterial * get(const std::string &name) const
SoNode * getSoCylinderOrientedLikeGeoTube(const double &radius, const double &halfLength)
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
const unsigned m_nchildren
void scheduleUpdateOfAllNonHiddenIndices()
const SbMatrix & getGlobalTransformToVolume() const
virtual QString getDescriptiveName() const
MatVisAttributes * matVisAttributes() const
void contractDaughtersRecursively()
VolumeHandleList::const_iterator VolumeHandleListConstItr