ATLAS Offline Software
Loading...
Searching...
No Matches
VolumeHandle::Imp Class Reference
Collaboration diagram for VolumeHandle::Imp:

Classes

class  VolState

Public Member Functions

 Imp (VolumeHandleSharedData *the_cd, const GeoPVConstLink &the_pV, const SbMatrix &the_ac)
void attach (VolumeHandle *vh)
void detach ()

Static Public Member Functions

static VolState getChildStates (const VolumeHandle *theclass)
static void applyChildStates (const VolState &, VolumeHandle *theclass)
static bool hasNonStandardShapeChildren (const SoGroup *g)

Public Attributes

VolumeHandleSharedDatacommondata
GeoPVConstLink pV
const SbMatrix accumTrans
VP1ExtraSepLayerHelperattachsepHelper
VP1ExtraSepLayerHelperattachlabelSepHelper
SoSeparator * nodesep
SoMaterial * material
SoSeparator * label_sep
int labels
QList< int > labelsPosOffsets
bool isattached

Detailed Description

Definition at line 48 of file VolumeHandle.cxx.

Constructor & Destructor Documentation

◆ Imp()

VolumeHandle::Imp::Imp ( VolumeHandleSharedData * the_cd,
const GeoPVConstLink & the_pV,
const SbMatrix & the_ac )
inline

Definition at line 50 of file VolumeHandle.cxx.

51 : commondata(the_cd), pV(the_pV),accumTrans(the_ac),attachsepHelper(0),attachlabelSepHelper(0),nodesep(0), material(0), label_sep(0), labels(0), isattached(false) {}
const SbMatrix accumTrans
GeoPVConstLink pV
VP1ExtraSepLayerHelper * attachlabelSepHelper
VolumeHandleSharedData * commondata
SoSeparator * label_sep
SoMaterial * material
VP1ExtraSepLayerHelper * attachsepHelper
SoSeparator * nodesep

Member Function Documentation

◆ applyChildStates()

void VolumeHandle::Imp::applyChildStates ( const VolState & vs,
VolumeHandle * theclass )
static

Definition at line 608 of file VolumeHandle.cxx.

609{
610 bool hasExpandedChildren = !vs.m_expandedChildren.isEmpty();
611 bool hasZappedChildren = !vs.m_zappedChildren.isEmpty();
612 if (!hasExpandedChildren&&!hasZappedChildren)
613 return;
614
615 QMap<quint32,VolState>::const_iterator expItr, expItrEnd = vs.m_expandedChildren.end();
616 QSet<quint32>::const_iterator zapItr, zapItrEnd = vs.m_zappedChildren.end();
617
618 theclass->initialiseChildren();
619 VolumeHandleListConstItr it, itE = theclass->m_children.end();
620 for (it = theclass->m_children.begin(); it!=itE; ++it) {
621 quint32 id = (*it)->hashID();
622 zapItr = vs.m_zappedChildren.find(id);
623 if (zapItr!=zapItrEnd) {
624 (*it)->setState(VP1GeoFlags::ZAPPED);
625 continue;
626 }
627 expItr = vs.m_expandedChildren.find(id);
628 if (expItr!=expItrEnd) {
629 (*it)->setState(VP1GeoFlags::ZAPPED);
630 applyChildStates(expItr.value(),*it);
631 (*it)->setState(VP1GeoFlags::EXPANDED);
632 }
633 }
634}
static void applyChildStates(const VolState &, VolumeHandle *theclass)
VolumeHandleList::const_iterator VolumeHandleListConstItr
void initialiseChildren()
VolumeHandleList m_children

◆ attach()

void VolumeHandle::Imp::attach ( VolumeHandle * vh)

Definition at line 317 of file VolumeHandle.cxx.

318{
319 VP1Msg::messageDebug("VolumeHandle::Imp::attach() - name: " + vh->getName());
320 if (!isattached) {
321 vh->ensureBuildNodeSep();
322 if (attachsepHelper) {
323 VP1Msg::messageDebug("adding node...");
324 attachsepHelper->addNodeUnderMaterial(nodesep,vh->material());
325 }
327 VP1Msg::messageDebug("adding label...");
329 }
330 isattached=true;
331 commondata->volumeBrowser()->scheduleUpdateOfAllNonHiddenIndices();//Browser need to change e.g. colour for this volume
332 }
333 //VP1Msg::messageDebug("attach: DONE.");
334}
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39
QString getName() const
void ensureBuildNodeSep()
SoMaterial * material()

◆ detach()

void VolumeHandle::Imp::detach ( )

Definition at line 337 of file VolumeHandle.cxx.

338{
339 if (isattached) {
340 if (attachsepHelper)
341 attachsepHelper->removeNodeUnderMaterial(nodesep,material);
343 attachlabelSepHelper->removeNode(label_sep);
344 isattached=false;
345 commondata->volumeBrowser()->scheduleUpdateOfAllNonHiddenIndices();//Browser need to change e.g. colour for this volume
346 }
347}

◆ getChildStates()

VolumeHandle::Imp::VolState VolumeHandle::Imp::getChildStates ( const VolumeHandle * theclass)
static

Definition at line 591 of file VolumeHandle.cxx.

592{
593 VolState vs;
594 if (theclass->m_state!=VP1GeoFlags::EXPANDED||theclass->m_nchildren==0||!theclass->childrenAreInitialised())
595 return vs;
596
597 VolumeHandleListConstItr it, itE = theclass->m_children.end();
598 for (it = theclass->m_children.begin(); it!=itE; ++it) {
599 if ((*it)->state()==VP1GeoFlags::ZAPPED)
600 vs.m_zappedChildren.insert((*it)->hashID());
601 else if ((*it)->state()==VP1GeoFlags::EXPANDED)
602 vs.m_expandedChildren.insert((*it)->hashID(),(*it)->m_d->getChildStates(*it));
603 }
604 return vs;
605}
bool childrenAreInitialised() const
VP1GeoFlags::VOLSTATE m_state
const unsigned m_nchildren

◆ hasNonStandardShapeChildren()

bool VolumeHandle::Imp::hasNonStandardShapeChildren ( const SoGroup * g)
static

Definition at line 637 of file VolumeHandle.cxx.

638{
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()))
646 return true;
647 } else if (c->getTypeId().isDerivedFrom(SoGroup::getClassTypeId())) {
648 if (hasNonStandardShapeChildren(static_cast<const SoGroup*>(c)))
649 return true;
650 }
651 }
652 return false;
653}
static bool hasNonStandardShapeChildren(const SoGroup *g)

Member Data Documentation

◆ accumTrans

const SbMatrix VolumeHandle::Imp::accumTrans

Definition at line 55 of file VolumeHandle.cxx.

◆ attachlabelSepHelper

VP1ExtraSepLayerHelper* VolumeHandle::Imp::attachlabelSepHelper

Definition at line 58 of file VolumeHandle.cxx.

◆ attachsepHelper

VP1ExtraSepLayerHelper* VolumeHandle::Imp::attachsepHelper

Definition at line 57 of file VolumeHandle.cxx.

◆ commondata

VolumeHandleSharedData* VolumeHandle::Imp::commondata

Definition at line 53 of file VolumeHandle.cxx.

◆ isattached

bool VolumeHandle::Imp::isattached

Definition at line 66 of file VolumeHandle.cxx.

◆ label_sep

SoSeparator* VolumeHandle::Imp::label_sep

Definition at line 62 of file VolumeHandle.cxx.

◆ labels

int VolumeHandle::Imp::labels

Definition at line 63 of file VolumeHandle.cxx.

◆ labelsPosOffsets

QList<int> VolumeHandle::Imp::labelsPosOffsets

Definition at line 64 of file VolumeHandle.cxx.

◆ material

SoMaterial* VolumeHandle::Imp::material

Definition at line 61 of file VolumeHandle.cxx.

◆ nodesep

SoSeparator* VolumeHandle::Imp::nodesep

Definition at line 60 of file VolumeHandle.cxx.

◆ pV

GeoPVConstLink VolumeHandle::Imp::pV

Definition at line 54 of file VolumeHandle.cxx.


The documentation for this class was generated from the following file: