ATLAS Offline Software
Loading...
Searching...
No Matches
AssociatedObjectHandleBase.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7// //
8// Implementation of class AssociatedObjectHandleBase //
9// //
10// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11// Initial version: March 2008 //
12// //
14
21#include "VP1Base/VP1Msg.h"
22
23#include <Inventor/nodes/SoSeparator.h>
24#include <optional>
25
26//____________________________________________________________________
28public:
29 static int nascobjs;
30 Imp() : sep_simple(nullptr),
31 sep_detailed(nullptr),
32 attachhandle(nullptr)
33 //,transform(0)
34 {}
35 SoSeparator * sep_simple;
36 SoSeparator * sep_detailed;
38
39 //SoTransform * transform;
40 void detach() const;
41 void attach(AssociatedObjectHandleBase * theclass );
44};
45
47
48//____________________________________________________________________
50{
52 return;
53 if (!sep_simple&&!sep_detailed) {
55 if (!sep_simple&&!sep_detailed) {
56 VP1Msg::messageDebug("AssociatedObjectHandleBase WARNING: Got null shapes! Replacing with simple points.");
57 sep_simple = new SoSeparator;//Fixme: Shared point!!!
58 }
59 if (sep_simple)
60 sep_simple->ref();
61 if (sep_detailed)
62 sep_detailed->ref();
63 }
64 if (!sep_detailed) {
66 sep_detailed->ref();
67 }
68 if (!sep_simple) {
70 sep_simple->ref();
71 }
72
74}
75
76//____________________________________________________________________
78{
81 if (sep_simple) {
82 sep_simple->unref();
83 sep_simple = nullptr;
84 }
85 if (sep_detailed) {
86 sep_detailed->unref();
87 sep_detailed = nullptr;
88 }
89 }
90}
91
92//____________________________________________________________________
93void AssociatedObjectHandleBase::registerShapes(SoSeparator*simple,SoSeparator*detailed)
94{
95 m_trackHandle->collHandle()->common()->ascObjSelectionManager()->registerAscObj(simple,detailed,this);
96}
97
98//____________________________________________________________________
99void AssociatedObjectHandleBase::unregisterShapes(SoSeparator*simple,SoSeparator*detailed)
100{
101 m_trackHandle->collHandle()->common()->ascObjSelectionManager()->unregisterAscObj(simple,detailed);
102}
103
104//____________________________________________________________________
109
110//____________________________________________________________________
116
117//____________________________________________________________________
119{
120 if (m_d->attachhandle&&m_visible&&m_d->sep_simple&&m_d->sep_detailed) {
121 m_d->attachhandle->detachNodes(m_d->sep_simple,m_d->sep_detailed);
122 }
123 m_d->ensureShapesErased(this );
124 delete m_d;
126
127}
128
129//____________________________________________________________________
134
135//____________________________________________________________________
137{
138 if (m_pickStyle==ps)
139 return;
140 m_pickStyle=ps;
141
142 //Fixme...
143
144}
145
146//____________________________________________________________________
148{
149 if (!attachhandle)
150 return;//Can't have been attached.
152}
153
154//____________________________________________________________________
159
160
161//____________________________________________________________________
168
169
170//____________________________________________________________________
172{
173 if (m_visible==b)
174 return;
175 m_visible=b;
176 if (b) {
177 m_d->ensureShapesBuild(this);
178 m_d->attach(this);
179 } else {
180 m_d->detach();
181 }
182}
183
184//____________________________________________________________________
186{
187 VP1Msg::messageVerbose("AssociatedObjectHandleBase update3DObjects.");
188
189 if (m_visible) {
190 m_d->detach();
191 m_d->ensureShapesErased(this);
192 m_d->ensureShapesBuild(this);
193 m_d->attach(this);
194 } else {
195 m_d->ensureShapesErased(this);
196 }
197}
198
199//____________________________________________________________________
201{
202 return m_d->sep_simple;
203}
204
205//____________________________________________________________________
207{
208 return m_d->sep_detailed;
209}
void ensureShapesBuild(AssociatedObjectHandleBase *theclass)
void attach(AssociatedObjectHandleBase *theclass)
void ensureShapesErased(AssociatedObjectHandleBase *theclass)
void registerShapes(SoSeparator *simple, SoSeparator *detailed)
AssocObjAttachmentHandle * getAttachmentHandle()
TrackSysCommonData * common() const
virtual void buildShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)=0
void unregisterShapes(SoSeparator *simple, SoSeparator *detailed)
virtual double lodCrossOverValue() const
static void messageVerbose(const QString &)
Definition VP1Msg.cxx:84
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39