Geant4-11
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Slots | Private Member Functions | Static Private Member Functions | Private Attributes
G4OpenInventorQtViewer Class Reference

#include <G4OpenInventorQtViewer.hh>

Inheritance diagram for G4OpenInventorQtViewer:
G4OpenInventorViewer G4VViewer

Public Member Functions

virtual void ClearView ()
 
std::vector< G4ThreeVectorComputeFlyThrough (G4Vector3D *)
 
virtual void DrawView ()
 
virtual void FinishView ()
 
 G4OpenInventorQtViewer (G4OpenInventorSceneHandler &scene, const G4String &name="")
 
const G4VisAttributesGetApplicableVisAttributes (const G4VisAttributes *) const
 
const G4ViewParametersGetDefaultViewParameters () const
 
const G4StringGetName () const
 
virtual const std::vector< G4ModelingParameters::VisAttributesModifier > * GetPrivateVisAttributesModifiers () const
 
G4VSceneHandlerGetSceneHandler () const
 
const G4StringGetShortName () const
 
G4int GetViewId () const
 
const G4ViewParametersGetViewParameters () const
 
void Initialise ()
 
virtual void KernelVisitDecision ()
 
void NeedKernelVisit ()
 
void ProcessView ()
 
void RefreshView ()
 
virtual void ResetView ()
 
void SetDefaultViewParameters (const G4ViewParameters &vp)
 
void SetName (const G4String &)
 
void SetNeedKernelVisit (G4bool need)
 
virtual void SetView ()
 
void SetViewParameters (const G4ViewParameters &vp)
 
virtual void ShowView ()
 
virtual ~G4OpenInventorQtViewer ()
 

Protected Member Functions

void EraseDetector ()
 
void EraseEvent ()
 
void Escape ()
 Menu items callbacks /////////////////////////////////////////////////////. More...
 
virtual SoCamera * GetCamera ()
 
G4String Help (const G4String &topic="controls")
 
void SceneGraphStatistics ()
 
void SetPreview ()
 
void SetPreviewAndFull ()
 
void SetReducedWireFrame (bool)
 
void SetSolid ()
 
void SetTouchable (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath)
 
void SetWireFrame ()
 
void TouchableSetColour (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, const G4Colour &)
 
void TouchableSetVisibility (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, G4bool visibility)
 
void UpdateScene ()
 
virtual void ViewerRender ()
 
void WriteInventor (const G4String &file="g4out.iv")
 
void WritePDF (const G4String &file="g4out.pdf")
 
void WritePixmapPostScript (const G4String &file="g4out.ps")
 
void WritePostScript (const G4String &file="g4out.ps")
 

Static Protected Member Functions

static void SelectionCB (void *, SoPath *)
 

Protected Attributes

G4ViewParameters fDefaultVP
 
G4OpenInventorSceneHandlerfG4OpenInventorSceneHandler
 
Geant4_SoGL2PSAction * fGL2PSAction
 
SoNodeSensor * fGroupCameraSensor
 
G4VInteractorManagerfInteractorManager
 
G4String fName
 
G4bool fNeedKernelVisit
 
G4VSceneHandlerfSceneHandler
 
G4String fShortName
 
Geant4_SoImageWriter * fSoImageWriter
 
SoSelection * fSoSelection
 
G4OpenInventorQtExaminerViewerfViewer
 
G4int fViewId
 
G4ViewParameters fVP
 

Private Slots

void EtcEraseDetectorCB ()
 
void EtcEraseEventCB ()
 
void EtcSceneGraphStatsCB ()
 
void EtcSetFullWireframeCB ()
 
void EtcSetReducedWireframeCB ()
 
void EtcSetSolidCB ()
 
void EtcUpdateSceneCB ()
 
void EtcVisibMInvisibDCB ()
 
void EtcVisibMVisibDCB ()
 
void FileEscapeCB ()
 
void FileWriteIVCB ()
 
void FileWritePDFCB ()
 
void FileWritePSCB ()
 

Private Member Functions

G4bool CompareForKernelVisit (G4ViewParameters &)
 
void DrawDetector ()
 

Static Private Member Functions

static void GroupCameraSensorCB (void *, SoSensor *)
 
static void lookAt (SoCamera *, const SbVec3f &dir, const SbVec3f &up)
 
static void lookedAt (SoCamera *, SbVec3f &dir, SbVec3f &up)
 
static void pointAt (SoCamera *, const SbVec3f &targetpoint, const SbVec3f &upvector)
 

Private Attributes

QAction * EtcEraseDetector
 
QAction * EtcEraseEvent
 
QAction * EtcSceneGraphStats
 
QAction * EtcSetFullWireframe
 
QAction * EtcSetReducedWireframe
 
QAction * EtcSetSolid
 
QAction * EtcUpdateScene
 
QAction * EtcVisibMInvisibD
 
QAction * EtcVisibMVisibD
 
QAction * FileEscape
 
QAction * FileWriteIV
 
QAction * FileWritePDF
 
QAction * FileWritePS
 
G4ViewParameters fLastVP
 

Detailed Description

Definition at line 48 of file G4OpenInventorQtViewer.hh.

Constructor & Destructor Documentation

◆ G4OpenInventorQtViewer()

G4OpenInventorQtViewer::G4OpenInventorQtViewer ( G4OpenInventorSceneHandler scene,
const G4String name = "" 
)

Definition at line 61 of file G4OpenInventorQtViewer.cc.

63 : G4OpenInventorViewer(sceneHandler, name), fViewer(0)
64{
65 // FWJ fName is in G4VViewer parent of G4OpenInventorViewer
67 G4cout << "Window name: " << fName << G4endl;
68}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4OpenInventorQtExaminerViewer * fViewer
G4OpenInventorViewer(G4OpenInventorSceneHandler &scene, const G4String &name="")
G4String fName
Definition: G4VViewer.hh:217
static Verbosity GetVerbosity()
const char * name(G4int ptype)

References G4VisManager::confirmations, G4VViewer::fName, G4cout, G4endl, and G4VisManager::GetVerbosity().

◆ ~G4OpenInventorQtViewer()

G4OpenInventorQtViewer::~G4OpenInventorQtViewer ( )
virtual

Definition at line 260 of file G4OpenInventorQtViewer.cc.

261{
262 // if(fShell) fInteractorManager->RemoveShell(fShell);
263 if(fViewer) {
264 fViewer->setSceneGraph(0);
265 //FIXME : SGI : the below "delete" block things.
266 //FIXME : CoinXt : the below "delete" crashe in ~SoXtRenderArea.
267 //FIXME : delete fViewer;
268 }
269 // if(fShell) XtDestroyWidget(fShell);
270}

References fViewer.

Member Function Documentation

◆ ClearView()

void G4OpenInventorViewer::ClearView ( void  )
virtualinherited

Implements G4VViewer.

Definition at line 234 of file G4OpenInventorViewer.cc.

234 {
235}

◆ CompareForKernelVisit()

G4bool G4OpenInventorViewer::CompareForKernelVisit ( G4ViewParameters vp)
privateinherited

Definition at line 158 of file G4OpenInventorViewer.cc.

158 {
159
160 if (
161 (vp.GetDrawingStyle () != fVP.GetDrawingStyle ()) ||
163 (vp.IsAuxEdgeVisible () != fVP.IsAuxEdgeVisible ()) ||
164 (vp.IsCulling () != fVP.IsCulling ()) ||
166 (vp.IsDensityCulling () != fVP.IsDensityCulling ()) ||
167 (vp.IsCullingCovered () != fVP.IsCullingCovered ()) ||
168 (vp.GetCBDAlgorithmNumber() !=
170 (vp.IsSection () != fVP.IsSection ()) ||
171 (vp.IsCutaway () != fVP.IsCutaway ()) ||
172 // This assumes use of generic clipping (sectioning, slicing,
173 // DCUT, cutaway). If a decision is made to implement locally,
174 // this will need changing. See G4OpenGLViewer::SetView,
175 // G4OpenGLStoredViewer.cc::CompareForKernelVisit and
176 // G4OpenGLStoredSceneHander::CreateSection/CutawayPolyhedron.
177 (vp.IsExplode () != fVP.IsExplode ()) ||
178 (vp.GetNoOfSides () != fVP.GetNoOfSides ()) ||
187 (vp.IsPicking () != fVP.IsPicking ()) ||
188 // Scaling for Open Inventor is done by the scene handler so it
189 // needs a kernel visit. (In this respect, it differs from the
190 // OpenGL drivers, where it's done in SetView.)
191 (vp.GetScaleFactor () != fVP.GetScaleFactor ()) ||
192 // If G4OpenInventor ever introduces VAMs, the following might need
193 // changing to a complete comparison, i.e., remove ".size()". See
194 // G4OpenGLStoredViewer::CompareForKernelVisit.
199 )
200 return true;
201
202 if (vp.IsDensityCulling () &&
204 return true;
205
206 if (vp.GetCBDAlgorithmNumber() > 0) {
207 if (vp.GetCBDParameters().size() != fVP.GetCBDParameters().size()) return true;
208 else if (vp.GetCBDParameters() != fVP.GetCBDParameters()) return true;
209 }
210
211 if (vp.IsSection () &&
212 (vp.GetSectionPlane () != fVP.GetSectionPlane ()))
213 return true;
214
215 if (vp.IsCutaway ()) {
216 if (vp.GetCutawayPlanes ().size () !=
217 fVP.GetCutawayPlanes ().size ()) return true;
218 for (size_t i = 0; i < vp.GetCutawayPlanes().size(); ++i)
219 if (vp.GetCutawayPlanes()[i] != fVP.GetCutawayPlanes()[i])
220 return true;
221 }
222
223 if (vp.IsExplode () &&
225 return true;
226
227 if (vp.IsSpecialMeshRendering() &&
229 return true;
230
231 return false;
232}
G4ViewParameters fVP
Definition: G4VViewer.hh:219
const std::vector< G4ModelingParameters::VisAttributesModifier > & GetVisAttributesModifiers() const
const G4Vector3D & GetScaleFactor() const
G4int GetNoOfSides() const
G4bool IsSpecialMeshRendering() const
G4double GetExplodeFactor() const
G4int GetNumberOfCloudPoints() const
G4bool IsMarkerNotHidden() const
G4double GetGlobalLineWidthScale() const
G4bool IsCutaway() const
const G4Colour & GetBackgroundColour() const
G4bool IsSection() const
G4bool IsPicking() const
G4bool IsCulling() const
const G4VisAttributes * GetDefaultTextVisAttributes() const
G4bool IsExplode() const
const std::vector< G4double > & GetCBDParameters() const
G4int GetCBDAlgorithmNumber() const
const std::vector< G4ModelingParameters::PVNameCopyNo > & GetSpecialMeshVolumes() const
G4double GetGlobalMarkerScale() const
G4bool IsCullingInvisible() const
const G4VisAttributes * GetDefaultVisAttributes() const
const G4Planes & GetCutawayPlanes() const
G4bool IsDensityCulling() const
G4double GetVisibleDensity() const
G4bool IsCullingCovered() const
const G4Plane3D & GetSectionPlane() const
DrawingStyle GetDrawingStyle() const
G4bool IsAuxEdgeVisible() const
const G4Colour & GetColour() const

References G4VViewer::fVP, G4ViewParameters::GetBackgroundColour(), G4ViewParameters::GetCBDAlgorithmNumber(), G4ViewParameters::GetCBDParameters(), G4VisAttributes::GetColour(), G4ViewParameters::GetCutawayPlanes(), G4ViewParameters::GetDefaultTextVisAttributes(), G4ViewParameters::GetDefaultVisAttributes(), G4ViewParameters::GetDrawingStyle(), G4ViewParameters::GetExplodeFactor(), G4ViewParameters::GetGlobalLineWidthScale(), G4ViewParameters::GetGlobalMarkerScale(), G4ViewParameters::GetNoOfSides(), G4ViewParameters::GetNumberOfCloudPoints(), G4ViewParameters::GetScaleFactor(), G4ViewParameters::GetSectionPlane(), G4ViewParameters::GetSpecialMeshVolumes(), G4ViewParameters::GetVisAttributesModifiers(), G4ViewParameters::GetVisibleDensity(), G4ViewParameters::IsAuxEdgeVisible(), G4ViewParameters::IsCulling(), G4ViewParameters::IsCullingCovered(), G4ViewParameters::IsCullingInvisible(), G4ViewParameters::IsCutaway(), G4ViewParameters::IsDensityCulling(), G4ViewParameters::IsExplode(), G4ViewParameters::IsMarkerNotHidden(), G4ViewParameters::IsPicking(), G4ViewParameters::IsSection(), and G4ViewParameters::IsSpecialMeshRendering().

Referenced by G4OpenInventorViewer::KernelVisitDecision().

◆ ComputeFlyThrough()

std::vector< G4ThreeVector > G4VViewer::ComputeFlyThrough ( G4Vector3D )
inherited

Definition at line 215 of file G4VViewer.cc.

216{
217 enum CurveType {
218 Bezier,
219 G4SplineTest};
220
221 // Choose a curve type (for testing)
222// int myCurveType = Bezier;
223
224 // number if step points
225 int stepPoints = 500;
226
227
228 G4Spline spline;
229
230
231 // At the moment we don't use the aVect parameters, but build it here :
232 // Good step points for exampleB5
233 spline.AddSplinePoint(G4Vector3D(0,1000,-14000));
234 spline.AddSplinePoint(G4Vector3D(0,1000,0));
235 spline.AddSplinePoint(G4Vector3D(-4000,1000,4000));
236
237
238 std::vector <G4ThreeVector> viewVect;
239
240// if(myCurveType == Bezier) {
241
242
243 // Draw the spline
244
245 for (int i = 0; i < stepPoints; i++) {
246 float t = (float)i / (float)stepPoints;
247 G4Vector3D cameraPosition = spline.GetInterpolatedSplinePoint(t);
248 // G4Vector3D targetPoint = spline.GetInterpolatedSplinePoint(t);
249
250 // viewParam->SetViewAndLights(G4ThreeVector (cameraPosition.x(), cameraPosition.y(), cameraPosition.z()));
251 // viewParam->SetCurrentTargetPoint(targetPoint);
252 G4cout << "FLY CR("<< i << "):" << cameraPosition << G4endl;
253 viewVect.push_back(G4ThreeVector (cameraPosition.x(), cameraPosition.y(), cameraPosition.z()));
254 }
255
256// } else if (myCurveType == G4SplineTest) {
257 /*
258 This method is a inspire from a Bezier curve. The problem of the Bezier curve is that the path does not go straight between two waypoints.
259 This method add "stay straight" parameter which could be between 0 and 1 where the pass will follow exactly the line between the waypoints
260 Ex : stay straight = 50%
261 m1 = 3*(P1+P0)/2
262
263 Ex : stay straight = 0%
264 m1 = (P1+P0)/2
265
266 P1
267 / \
268 / \
269 a--x--b
270 / ° ° \
271 / ° ° \
272 m1 m2
273 / \
274 / \
275 / \
276 / \
277 P0 P2
278
279 */
280// G4Vector3D a;
281// G4Vector3D b;
282// G4Vector3D m1;
283// G4Vector3D m2;
284// G4Vector3D P0;
285// G4Vector3D P1;
286// G4Vector3D P2;
287// G4double stayStraight = 0;
288// G4double bezierSpeed = 0.4; // Spend 40% time in bezier curve (time between m1-m2 is 40% of time between P0-P1)
289//
290// G4Vector3D firstPoint;
291// G4Vector3D lastPoint;
292//
293// float nbBezierSteps = (stepPoints * bezierSpeed*(1-stayStraight)) * (2./spline.GetNumPoints());
294// float nbFirstSteps = ((stepPoints/2-nbBezierSteps/2) /(1+stayStraight)) * (2./spline.GetNumPoints());
295//
296// // First points
297// firstPoint = spline.GetPoint(0);
298// lastPoint = (firstPoint + spline.GetPoint(1))/2;
299//
300// for( float j=0; j<1; j+= 1/nbFirstSteps) {
301// G4ThreeVector pt = firstPoint + (lastPoint - firstPoint) * j;
302// viewVect.push_back(pt);
303// G4cout << "FLY Bezier A1("<< viewVect.size()<< "):" << pt << G4endl;
304// }
305//
306// for (int i = 0; i < spline.GetNumPoints()-2; i++) {
307// P0 = spline.GetPoint(i);
308// P1 = spline.GetPoint(i+1);
309// P2 = spline.GetPoint(i+2);
310//
311// m1 = P1 - (P1-P0)*(1-stayStraight)/2;
312// m2 = P1 + (P2-P1)*(1-stayStraight)/2;
313//
314// // We have to get straight path from (middile of P0-P1) to (middile of P0-P1 + (dist P0-P1) * stayStraight/2)
315// if (stayStraight >0) {
316//
317// firstPoint = (P0 + P1)/2;
318// lastPoint = (P0 + P1)/2 + (P1-P0)*stayStraight/2;
319//
320// for( float j=0; j<1; j+= 1/(nbFirstSteps*stayStraight)) {
321// G4ThreeVector pt = firstPoint + (lastPoint - firstPoint)* j;
322// viewVect.push_back(pt);
323// G4cout << "FLY Bezier A2("<< viewVect.size()<< "):" << pt << G4endl;
324// }
325// }
326// // Compute Bezier curve
327// for( float delta = 0 ; delta < 1 ; delta += 1/nbBezierSteps)
328// {
329// // The Green Line
330// a = m1 + ( (P1 - m1) * delta );
331// b = P1 + ( (m2 - P1) * delta );
332//
333// // Final point
334// G4ThreeVector pt = a + ((b-a) * delta );
335// viewVect.push_back(pt);
336// G4cout << "FLY Bezier("<< viewVect.size()<< "):" << pt << G4endl;
337// }
338//
339// // We have to get straight path
340// if (stayStraight >0) {
341// firstPoint = (P1 + P2)/2 - (P2-P1)*stayStraight/2;
342// lastPoint = (P1 + P2)/2;
343//
344// for( float j=0; j<1; j+= 1/(nbFirstSteps*stayStraight)) {
345// G4ThreeVector pt = firstPoint + (lastPoint - firstPoint)* j;
346// viewVect.push_back(pt);
347// G4cout << "FLY Bezier B1("<< viewVect.size()<< "):" << pt << G4endl;
348// }
349// }
350// }
351//
352// // last points
353// firstPoint = spline.GetPoint(spline.GetNumPoints()-2);
354// lastPoint = spline.GetPoint(spline.GetNumPoints()-1);
355// for( float j=1; j>0; j-= 1/nbFirstSteps) {
356// G4ThreeVector pt = lastPoint - ((lastPoint-firstPoint)*((1-stayStraight)/2) * j );
357// viewVect.push_back(pt);
358// G4cout << "FLY Bezier B2("<< viewVect.size()<< "):" << pt << G4endl;
359// }
360// }
361 return viewVect;
362}
HepGeom::Vector3D< G4double > G4Vector3D
Definition: G4Vector3D.hh:34

References G4VViewer::G4Spline::AddSplinePoint(), G4cout, G4endl, G4VViewer::G4Spline::GetInterpolatedSplinePoint(), HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

◆ DrawDetector()

void G4OpenInventorViewer::DrawDetector ( )
privateinherited

Definition at line 502 of file G4OpenInventorViewer.cc.

502 {
503 /* Replace this... - JA
504 // DrawView does a ClearStore. Do not clear the transient store :
505 SoSeparator* tmp = fG4OpenInventorSceneHandler.fTransientRoot;
506 fG4OpenInventorSceneHandler.fTransientRoot = new SoSeparator;
507 if (!fNeedKernelVisit) KernelVisitDecision();
508 ProcessView();
509 fG4OpenInventorSceneHandler.fTransientRoot->unref();
510 fG4OpenInventorSceneHandler.fTransientRoot = tmp;
511 */
512 // ...by this... - JA
513 DrawView();
514}

References G4OpenInventorViewer::DrawView().

Referenced by G4OpenInventorViewer::SetPreview(), G4OpenInventorViewer::SetPreviewAndFull(), G4OpenInventorViewer::SetReducedWireFrame(), G4OpenInventorViewer::SetSolid(), and G4OpenInventorViewer::SetWireFrame().

◆ DrawView()

void G4OpenInventorViewer::DrawView ( )
virtualinherited

Implements G4VViewer.

Definition at line 383 of file G4OpenInventorViewer.cc.

383 {
384 //G4cout << "debug Iv::DrawViewer " <<G4endl;
386 fLastVP= fVP;
387 ProcessView();
388 FinishView();
389}
virtual void KernelVisitDecision()
G4bool fNeedKernelVisit
Definition: G4VViewer.hh:224
void ProcessView()
Definition: G4VViewer.cc:105
virtual void FinishView()
Definition: G4VViewer.cc:101

References G4VViewer::FinishView(), G4OpenInventorViewer::fLastVP, G4VViewer::fNeedKernelVisit, G4VViewer::fVP, G4OpenInventorViewer::KernelVisitDecision(), and G4VViewer::ProcessView().

Referenced by G4OpenInventorViewer::DrawDetector(), and G4OpenInventorViewer::UpdateScene().

◆ EraseDetector()

void G4OpenInventorViewer::EraseDetector ( )
protectedinherited

◆ EraseEvent()

void G4OpenInventorViewer::EraseEvent ( )
protectedinherited

◆ Escape()

void G4OpenInventorViewer::Escape ( )
protectedinherited

◆ EtcEraseDetectorCB

void G4OpenInventorQtViewer::EtcEraseDetectorCB ( )
privateslot

Definition at line 350 of file G4OpenInventorQtViewer.cc.

351{
352 // G4cout << "G4OIQtViewer: Etc: Erase Detector CALLBACK" << G4endl;
354}

References G4OpenInventorViewer::EraseDetector().

Referenced by Initialise().

◆ EtcEraseEventCB

void G4OpenInventorQtViewer::EtcEraseEventCB ( )
privateslot

Definition at line 357 of file G4OpenInventorQtViewer.cc.

358{
359 // G4cout << "G4OIQtViewer: Etc: Erase Event CALLBACK" << G4endl;
360 EraseEvent();
361}

References G4OpenInventorViewer::EraseEvent().

Referenced by Initialise().

◆ EtcSceneGraphStatsCB

void G4OpenInventorQtViewer::EtcSceneGraphStatsCB ( )
privateslot

Definition at line 401 of file G4OpenInventorQtViewer.cc.

402{
403 // G4cout << "G4OIQtViewer: Etc: Scene Graph Stats CALLBACK" << G4endl;
405}

References G4OpenInventorViewer::SceneGraphStatistics().

Referenced by Initialise().

◆ EtcSetFullWireframeCB

void G4OpenInventorQtViewer::EtcSetFullWireframeCB ( )
privateslot

Definition at line 375 of file G4OpenInventorQtViewer.cc.

376{
377 // G4cout << "G4OIQtViewer: Etc: Set Full Wireframe CALLBACK" << G4endl;
378 SetReducedWireFrame(false);
379}

References G4OpenInventorViewer::SetReducedWireFrame().

Referenced by Initialise().

◆ EtcSetReducedWireframeCB

void G4OpenInventorQtViewer::EtcSetReducedWireframeCB ( )
privateslot

Definition at line 369 of file G4OpenInventorQtViewer.cc.

370{
371 // G4cout << "G4OIQtViewer: Etc: Set Reduced Wireframe CALLBACK" << G4endl;
373}

References G4OpenInventorViewer::SetReducedWireFrame().

Referenced by Initialise().

◆ EtcSetSolidCB

void G4OpenInventorQtViewer::EtcSetSolidCB ( )
privateslot

Definition at line 363 of file G4OpenInventorQtViewer.cc.

364{
365 // G4cout << "G4OIQtViewer: Etc: Set Solid CALLBACK" << G4endl;
366 SetSolid();
367}

References G4OpenInventorViewer::SetSolid().

Referenced by Initialise().

◆ EtcUpdateSceneCB

void G4OpenInventorQtViewer::EtcUpdateSceneCB ( )
privateslot

Definition at line 395 of file G4OpenInventorQtViewer.cc.

396{
397 // G4cout << "G4OIQtViewer: Etc: Update Scene CALLBACK" << G4endl;
398 UpdateScene();
399}

References G4OpenInventorViewer::UpdateScene().

Referenced by Initialise().

◆ EtcVisibMInvisibDCB

void G4OpenInventorQtViewer::EtcVisibMInvisibDCB ( )
privateslot

Definition at line 381 of file G4OpenInventorQtViewer.cc.

382{
383 // G4cout << "G4OIQtViewer: Etc: Visible Mothers + Invisible Daughters"
384 // " CALLBACK" << G4endl;
385 SetPreview();
386}

References G4OpenInventorViewer::SetPreview().

Referenced by Initialise().

◆ EtcVisibMVisibDCB

void G4OpenInventorQtViewer::EtcVisibMVisibDCB ( )
privateslot

Definition at line 388 of file G4OpenInventorQtViewer.cc.

389{
390 // G4cout << "G4OIQtViewer: Etc: Visible Mothers + Visible Daughters"
391 // "CALLBACK" << G4endl;
393}

References G4OpenInventorViewer::SetPreviewAndFull().

Referenced by Initialise().

◆ FileEscapeCB

void G4OpenInventorQtViewer::FileEscapeCB ( )
privateslot

Definition at line 340 of file G4OpenInventorQtViewer.cc.

341{
342 // G4cout << "G4OIQtViewer: File: Escape CALLBACK" << G4endl;
343 static_cast<G4SoQt*>(fInteractorManager)->ExitSecondaryLoop();
344 // Escape();
345}
Definition: G4SoQt.hh:46

References G4OpenInventorViewer::fInteractorManager.

Referenced by Initialise().

◆ FileWriteIVCB

void G4OpenInventorQtViewer::FileWriteIVCB ( )
privateslot

Definition at line 334 of file G4OpenInventorQtViewer.cc.

335{
336 // G4cout << "G4OIQtViewer: File: Write IV CALLBACK" << G4endl;
338}
void WriteInventor(const G4String &file="g4out.iv")

References G4OpenInventorViewer::WriteInventor().

Referenced by Initialise().

◆ FileWritePDFCB

void G4OpenInventorQtViewer::FileWritePDFCB ( )
privateslot

Definition at line 322 of file G4OpenInventorQtViewer.cc.

323{
324 // G4cout << "G4OIQtViewer: File: Write PDF CALLBACK" << G4endl;
325 // FWJ Workaround: avoids empty 2nd page in file
326 SbBool superimpState =
327 fViewer->getSuperimpositionEnabled(fViewer->superimposition);
328 fViewer->setSuperimpositionEnabled(fViewer->superimposition, FALSE);
329 WritePDF();
330 if (superimpState)
331 fViewer->setSuperimpositionEnabled(fViewer->superimposition, TRUE);
332}
#define TRUE
Definition: Globals.hh:27
#define FALSE
Definition: Globals.hh:23
void WritePDF(const G4String &file="g4out.pdf")

References FALSE, fViewer, G4OpenInventorQtExaminerViewer::superimposition, TRUE, and G4OpenInventorViewer::WritePDF().

Referenced by Initialise().

◆ FileWritePSCB

void G4OpenInventorQtViewer::FileWritePSCB ( )
privateslot

Definition at line 310 of file G4OpenInventorQtViewer.cc.

311{
312 // G4cout << "G4OIQtViewer: File: Write PS CALLBACK" << G4endl;
313 // FWJ Workaround: avoids empty 2nd page in file
314 SbBool superimpState =
315 fViewer->getSuperimpositionEnabled(fViewer->superimposition);
316 fViewer->setSuperimpositionEnabled(fViewer->superimposition, FALSE);
318 if (superimpState)
319 fViewer->setSuperimpositionEnabled(fViewer->superimposition, TRUE);
320}
void WritePostScript(const G4String &file="g4out.ps")

References FALSE, fViewer, G4OpenInventorQtExaminerViewer::superimposition, TRUE, and G4OpenInventorViewer::WritePostScript().

Referenced by Initialise().

◆ FinishView()

void G4OpenInventorQtViewer::FinishView ( void  )
virtual

Reimplemented from G4VViewer.

Definition at line 272 of file G4OpenInventorQtViewer.cc.

273{
274 if(!fViewer) return;
275 fViewer->viewAll();
276 fViewer->saveHomePosition();
277}

References fViewer.

◆ GetApplicableVisAttributes()

const G4VisAttributes * G4VViewer::GetApplicableVisAttributes ( const G4VisAttributes ) const
inherited

◆ GetCamera()

SoCamera * G4OpenInventorQtViewer::GetCamera ( )
protectedvirtual

Implements G4OpenInventorViewer.

Definition at line 295 of file G4OpenInventorQtViewer.cc.

295 {
296 if(!fViewer) return 0;
297 return fViewer->getCamera();
298}

References fViewer.

◆ GetDefaultViewParameters()

const G4ViewParameters & G4VViewer::GetDefaultViewParameters ( ) const
inherited

◆ GetName()

const G4String & G4VViewer::GetName ( ) const
inherited

◆ GetPrivateVisAttributesModifiers()

virtual const std::vector< G4ModelingParameters::VisAttributesModifier > * G4VViewer::GetPrivateVisAttributesModifiers ( ) const
virtualinherited

◆ GetSceneHandler()

G4VSceneHandler * G4VViewer::GetSceneHandler ( ) const
inherited

◆ GetShortName()

const G4String & G4VViewer::GetShortName ( ) const
inherited

◆ GetViewId()

G4int G4VViewer::GetViewId ( ) const
inherited

◆ GetViewParameters()

const G4ViewParameters & G4VViewer::GetViewParameters ( ) const
inherited

Referenced by G4OpenGLXmViewer::actions_callback(), G4OpenInventorSceneHandler::AddCircleSquare(), G4Qt3DSceneHandler::AddPrimitive(), G4ToolsSGSceneHandler::AddPrimitive(), G4OpenInventorSceneHandler::AddPrimitive(), G4OpenGLSceneHandler::AddPrimitive(), G4OpenGLImmediateSceneHandler::AddPrimitivePreambleInternal(), G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal(), G4OpenInventorSceneHandler::AddTransform(), G4OpenGLXmViewer::background_color_callback(), G4OpenGLImmediateQtViewer::ComputeView(), G4OpenGLStoredQtViewer::ComputeView(), G4VSceneHandler::CreateSectionSolid(), G4VisManager::CreateViewer(), G4OpenGLImmediateWin32Viewer::DrawView(), G4OpenGLImmediateXmViewer::DrawView(), G4OpenGLImmediateXViewer::DrawView(), G4OpenGLStoredWin32Viewer::DrawView(), G4OpenGLStoredXmViewer::DrawView(), G4OpenGLStoredXViewer::DrawView(), G4OpenGLStoredSceneHandler::EndModeling(), G4VisManager::EndOfRun(), G4VSceneHandler::GetAuxEdgeVisible(), G4VSceneHandler::GetColour(), G4VSceneHandler::GetDrawingStyle(), G4VSceneHandler::GetNoOfSides(), G4VSceneHandler::GetNumberOfCloudPoints(), G4VSceneHandler::GetTextColour(), G4VVisCommand::RefreshIfRequired(), G4VSceneHandler::RequestPrimitives(), G4VisCommandDrawView::SetNewValue(), G4VisCommandDrawLogicalVolume::SetNewValue(), G4VisCommandGeometrySetDaughtersInvisible::SetNewValue(), G4VisCommandGeometrySetVisibility::SetNewValue(), G4VisCommandSceneNotifyHandlers::SetNewValue(), G4VisCommandSceneAddLogo::SetNewValue(), G4VisCommandSceneAddScale::SetNewValue(), G4VisCommandSceneHandlerCreate::SetNewValue(), G4VisCommandsTouchable::SetNewValue(), G4VisCommandsTouchableSet::SetNewValue(), G4VisCommandViewerAddCutawayPlane::SetNewValue(), G4VisCommandViewerCentreOn::SetNewValue(), G4VisCommandViewerChangeCutawayPlane::SetNewValue(), G4VisCommandViewerClearCutawayPlanes::SetNewValue(), G4VisCommandViewerClearVisAttributesModifiers::SetNewValue(), G4VisCommandViewerClone::SetNewValue(), G4VisCommandViewerColourByDensity::SetNewValue(), G4VisCommandViewerCopyViewFrom::SetNewValue(), G4VisCommandViewerCreate::SetNewValue(), G4VisCommandViewerDolly::SetNewValue(), G4VisCommandViewerInterpolate::SetNewValue(), G4VisCommandViewerPan::SetNewValue(), G4VisCommandViewerSave::SetNewValue(), G4VisCommandViewerScale::SetNewValue(), G4VisCommandViewerZoom::SetNewValue(), G4VisCommandsViewerSet::SetNewValue(), G4VisCommandGeometrySetVisibility::SetNewValueOnLV(), G4OpenInventorViewer::SetReducedWireFrame(), G4OpenInventorViewer::SetSolid(), and G4OpenInventorViewer::SetWireFrame().

◆ GroupCameraSensorCB()

void G4OpenInventorViewer::GroupCameraSensorCB ( void *  aThis,
SoSensor *  aSensor 
)
staticprivateinherited

Definition at line 396 of file G4OpenInventorViewer.cc.

397{
399
400 SoNode* node = ((SoNodeSensor*)aSensor)->getTriggerNode();
401 // printf("debug : GroupCameraSensorCB %s\n",
402 // node->getTypeId().getName().getString());
403
404 if(node->isOfType(SoCamera::getClassTypeId())) {
405 SoCamera* camera = (SoCamera*)node;
406
407 // FWJ DEBUG
408 // G4cout << " UPDATING fVP FROM CAMERA " << camera << G4endl;
409 SbVec3f direction, up;
410 lookedAt(camera, direction, up);
412 (G4Vector3D(-direction[0], -direction[1], -direction[2]));
413 This->fVP.SetUpVector(G4Vector3D(up[0], up[1], up[2]));
414
415 SbVec3f pos = camera->position.getValue();
416 SbVec3f target = pos + direction * camera->focalDistance.getValue();
417
418 This->fVP.SetCurrentTargetPoint(G4Point3D(target[0], target[1], target[2]));
419
420 // FWJ camera sensor no longer needed
421 // Viewer had changed the camera type,
422 // attach the fCameraSensor to the new camera.
423 // FWJ DEBUG
424 // G4cout << " SWITCHING TO CAMERA " << camera << G4endl;
425 // This->fCameraSensor->detach();
426 // This->fCameraSensor->attach(camera);
427 }
428
429}
static const G4double pos
HepGeom::Point3D< G4double > G4Point3D
Definition: G4Point3D.hh:34
static void lookedAt(SoCamera *, SbVec3f &dir, SbVec3f &up)
void SetViewpointDirection(const G4Vector3D &viewpointDirection)
void SetCurrentTargetPoint(const G4Point3D &currentTargetPoint)
void SetUpVector(const G4Vector3D &upVector)

References G4VViewer::fVP, G4OpenInventorViewer::lookedAt(), pos, G4ViewParameters::SetCurrentTargetPoint(), G4ViewParameters::SetUpVector(), and G4ViewParameters::SetViewpointDirection().

Referenced by G4OpenInventorViewer::G4OpenInventorViewer().

◆ Help()

G4String G4OpenInventorViewer::Help ( const G4String topic = "controls")
protectedinherited

Definition at line 774 of file G4OpenInventorViewer.cc.

774 {
775 if(aTopic=="controls") {
776 return G4String("\
777Controls on an Inventor examiner viewer are :\n\
778- in picking mode (cursor is the upper left arrow)\n\
779 Ctrl + pick a volume : see daughters.\n\
780 Shift + pick a volume : see mother.\n\
781- in viewing mode (cursor is the hand)\n\
782 Left-button + pointer move : rotate.\n\
783 Ctrl+Left-button + pointer move : pan.\n\
784 Ctrl+Shift+Left-button + pointer move : scale.\n\
785 Middle-button + pointer move : pan.\n\
786 Right-button : popup menu.\n");
787 } else {
788 return "";
789 }
790}

Referenced by G4OpenInventorXtExtendedViewer::HelpCbk(), G4OpenInventorXtViewer::HelpCbk(), and G4OpenInventorWinViewer::WindowProc().

◆ Initialise()

void G4OpenInventorQtViewer::Initialise ( )
virtual

Reimplemented from G4VViewer.

Definition at line 71 of file G4OpenInventorQtViewer.cc.

72{
73
74 QWidget* parent = SoQt::getTopLevelWidget();
75
76 // FWJ DEBUG
77 // G4cout << "G4OIQtViewer: Creating G4OIQtExaminerViewer with parent " <<
78 // parent << G4endl;
79
81
82 // FWJ tried this to replace sensors, but it misses some camera changes.
83 // fGroupCameraSensor->detach();
84 // fCameraSensor->detach();
85 // fViewer->addFinishCallback(FinishCB);
86
87 auto UI = G4UImanager::GetUIpointer();
88 auto uiQt = dynamic_cast<G4UIQt*>(UI->GetG4UIWindow());
89
90 // Moved this to G4OpenInventorQtExaminerViewer::afterRealizeHook()
92 //
93 // This explicitly sets the TabWidget as parent before addTab():
94 // if (uiQt) uiQt->AddTabWidget(parent, QString(fName));
96
97 // Simpler: calls addTab(), but causes viewer parts to show (temporarily)
98 // in the "Useful tips" page !!
99 // if (uiQt) uiQt->AddViewerTab(parent, fName);
100 // Leaves an empty viewer window frame hanging around:
101 // if (uiQt) uiQt->AddTabWidget(fViewer->getWidget(), QString(fName));
102
103 // G4String wName = fName;
104 //
105 // QWidget parent = (QWidget)fInteractorManager->GetParentInteractor();
106
107 int width = fVP.GetWindowSizeHintX();
108 int height = fVP.GetWindowSizeHintY();
109
110 // FWJ not sure what this is for
111 // fInteractorManager->AddShell(fShell);
112
113 // FWJ or this:
114 // } else {
115 // char* str = fInteractorManager->GetCreationString();
116 // if(str!=0) wName = str;
117 // fViewer = new SoQtExaminerViewer(parent,wName.c_str(),TRUE);
118 // }
119
120 fViewer->setSize(SbVec2s(width, height));
121 fViewer->setOrigWindowSize(width, height);
122
123 // Add common menu items...
124
125 // QMenuBar* menubar = fViewer->getMenubar();
126 QMenu* filemenu = fViewer->getFileMenu();
127 QMenu* etcmenu = fViewer->getEtcMenu();
128 QFont* font = fViewer->getFont();
129
130 // File menu
131
132 FileWritePS = new QAction("Write PostScript (gl2ps)", this);
133 FileWritePS->setFont(*font);
134 connect(FileWritePS, SIGNAL(triggered()), this,
135 SLOT(FileWritePSCB()));
136 filemenu->addAction(FileWritePS);
137
138 FileWritePDF = new QAction("Write PDF (gl2ps)", this);
139 FileWritePDF->setFont(*font);
140 connect(FileWritePDF, SIGNAL(triggered()), this,
141 SLOT(FileWritePDFCB()));
142 filemenu->addAction(FileWritePDF);
143
144 FileWriteIV = new QAction("Write IV", this);
145 FileWriteIV->setFont(*font);
146 connect(FileWriteIV, SIGNAL(triggered()), this,
147 SLOT(FileWriteIVCB()));
148 filemenu->addAction(FileWriteIV);
149
150 FileEscape = new QAction("Escape", this);
151 FileEscape->setFont(*font);
152 connect(FileEscape, SIGNAL(triggered()), this,
153 SLOT(FileEscapeCB()));
154 filemenu->addAction(FileEscape);
155
156 // G4cout << "G4OIQtViewer: externalApp = " <<
157 // static_cast<G4SoQt*>(fInteractorManager)->IsExternalApp() << G4endl;
158 if (static_cast<G4SoQt*>(fInteractorManager)->IsExternalApp())
160
161 // Register escape CB with viewer, allowing E key escape
162 // fViewer->addEscapeCallback(FileEscapeCB);
163 // fViewer->addEscapeCallback(FileEscapeCB, (void*)this);
164
165 // Etc menu
166
167 EtcEraseDetector = new QAction("Erase detector", this);
168 EtcEraseDetector->setFont(*font);
169 connect(EtcEraseDetector, SIGNAL(triggered()), this,
170 SLOT(EtcEraseDetectorCB()));
171 etcmenu->addAction(EtcEraseDetector);
172
173 EtcEraseEvent = new QAction("Erase event", this);
174 EtcEraseEvent->setFont(*font);
175 connect(EtcEraseEvent, SIGNAL(triggered()), this,
176 SLOT(EtcEraseEventCB()));
177 etcmenu->addAction(EtcEraseEvent);
178
179 EtcSetSolid = new QAction("Set solid", this);
180 EtcSetSolid->setFont(*font);
181 connect(EtcSetSolid, SIGNAL(triggered()), this, SLOT(EtcSetSolidCB()));
182 etcmenu->addAction(EtcSetSolid);
183
184 EtcSetReducedWireframe = new QAction("Set (G4) reduced wireframe", this);
185 EtcSetReducedWireframe->setFont(*font);
186 connect(EtcSetReducedWireframe, SIGNAL(triggered()), this,
188 etcmenu->addAction(EtcSetReducedWireframe);
189
190 EtcSetFullWireframe = new QAction("Set full wireframe", this);
191 EtcSetFullWireframe->setFont(*font);
192 connect(EtcSetFullWireframe, SIGNAL(triggered()), this,
193 SLOT(EtcSetFullWireframeCB()));
194 etcmenu->addAction(EtcSetFullWireframe);
195
196 EtcVisibMInvisibD = new QAction("Visible mothers + invisible daughters",
197 this);
198 EtcVisibMInvisibD->setFont(*font);
199 connect(EtcVisibMInvisibD, SIGNAL(triggered()), this,
200 SLOT(EtcVisibMInvisibDCB()));
201 etcmenu->addAction(EtcVisibMInvisibD);
202
203 EtcVisibMVisibD = new QAction("Visible mothers + visible daughters", this);
204 EtcVisibMVisibD->setFont(*font);
205 connect(EtcVisibMVisibD, SIGNAL(triggered()), this,
206 SLOT(EtcVisibMVisibDCB()));
207 etcmenu->addAction(EtcVisibMVisibD);
208
209 EtcUpdateScene = new QAction("Update scene", this);
210 EtcUpdateScene->setFont(*font);
211 connect(EtcUpdateScene, SIGNAL(triggered()), this,
212 SLOT(EtcUpdateSceneCB()));
213 etcmenu->addAction(EtcUpdateScene);
214
215 EtcSceneGraphStats = new QAction("Scene graph stats", this);
216 EtcSceneGraphStats->setFont(*font);
217 connect(EtcSceneGraphStats, SIGNAL(triggered()), this,
218 SLOT(EtcSceneGraphStatsCB()));
219 etcmenu->addAction(EtcSceneGraphStats);
220
221
222 // Have a GL2PS render action :
223 const SbViewportRegion& vpRegion = fViewer->getViewportRegion();
224 fGL2PSAction = new SoGL2PSAction(vpRegion);
225 fViewer->setGLRenderAction(fGL2PSAction);
226
227 // Else :
228
229 // FWJ DEBUG
230 // G4cout << "G4OpenInventorQtViewer: setting scene graph " <<
231 // fSoSelection << G4endl;
232 // G4cout << "G4OpenInventorQtViewer: getNumChildren " <<
233 // fSoSelection->getNumChildren() << G4endl;
234
235 fViewer->setSceneGraph(fSoSelection);
236 fViewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_ADD);
237 fViewer->viewAll();
238 fViewer->saveHomePosition();
239 // SOMEHOW this also the OIQt main window title
240 if (!uiQt) fViewer->setTitle(fName);
241 fViewer->show();
242
243 // This SHOULD invoke the event loop:
244 // if(fShell) {
245
246 QWidget* mainWin = SoQt::getTopLevelWidget();
247
248 // FWJ DEBUG
249 // G4cout << "G4OIQtViewer: calling SoQt::show on mainWin = " << mainWin
250 // << G4endl;
251
252 SoQt::show(mainWin);
254
255 // }
257}
#define SoGL2PSAction
Definition: SoGL2PSAction.h:38
Geant4_SoGL2PSAction * fGL2PSAction
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
void SetCreatedInteractor(G4Interactor)
virtual void FlushAndWaitExecution()=0
unsigned int GetWindowSizeHintX() const
unsigned int GetWindowSizeHintY() const
def connect(endpoint="tcp://127.0.0.1:5555")
Definition: g4zmq.py:15

References g4zmq::connect(), EtcEraseDetector, EtcEraseDetectorCB(), EtcEraseEvent, EtcEraseEventCB(), EtcSceneGraphStats, EtcSceneGraphStatsCB(), EtcSetFullWireframe, EtcSetFullWireframeCB(), EtcSetReducedWireframe, EtcSetReducedWireframeCB(), EtcSetSolid, EtcSetSolidCB(), EtcUpdateScene, EtcUpdateSceneCB(), EtcVisibMInvisibD, EtcVisibMInvisibDCB(), EtcVisibMVisibD, EtcVisibMVisibDCB(), G4OpenInventorViewer::fGL2PSAction, FileEscape, FileEscapeCB(), FileWriteIV, FileWriteIVCB(), FileWritePDF, FileWritePDFCB(), FileWritePS, FileWritePSCB(), G4OpenInventorViewer::fInteractorManager, G4VInteractorManager::FlushAndWaitExecution(), G4VViewer::fName, G4OpenInventorViewer::fSoSelection, fViewer, G4VViewer::fVP, G4OpenInventorQtExaminerViewer::getEtcMenu(), G4OpenInventorQtExaminerViewer::getFileMenu(), G4OpenInventorQtExaminerViewer::getFont(), G4UImanager::GetUIpointer(), G4ViewParameters::GetWindowSizeHintX(), G4ViewParameters::GetWindowSizeHintY(), G4VInteractorManager::SetCreatedInteractor(), G4OpenInventorQtExaminerViewer::setExternalQtApp(), G4OpenInventorQtExaminerViewer::setOrigWindowSize(), SoGL2PSAction, and TRUE.

◆ KernelVisitDecision()

void G4OpenInventorViewer::KernelVisitDecision ( )
virtualinherited

Definition at line 143 of file G4OpenInventorViewer.cc.

143 {
144
145 // If there's a significant difference with the last view parameters
146 // of either the scene handler or this viewer, trigger a rebuild.
147
148 if (
149 //??fG4OpenInventorSceneHandler.fPODLList.size() == 0 ||
150 // We need a test for empty scene graph, such as
151 // staticRoot.size() or something?????????? See temporary fix
152 // in contructor. (John Allison Aug 2001)
155 }
156}
G4bool CompareForKernelVisit(G4ViewParameters &)
void NeedKernelVisit()
Definition: G4VViewer.cc:78

References G4OpenInventorViewer::CompareForKernelVisit(), G4OpenInventorViewer::fLastVP, and G4VViewer::NeedKernelVisit().

Referenced by G4OpenInventorViewer::DrawView().

◆ lookAt()

void G4OpenInventorViewer::lookAt ( SoCamera *  camera,
const SbVec3f &  dir,
const SbVec3f &  up 
)
staticprivateinherited

Definition at line 323 of file G4OpenInventorViewer.cc.

324{
325 SbVec3f z = -dir;
326 SbVec3f y = up;
327 SbVec3f x = y.cross(z);
328
329 // recompute y to create a valid coordinate system
330 y = z.cross(x);
331
332 // normalize x and y to create an orthonormal coord system
333 y.normalize();
334 x.normalize();
335
336 // create a rotation matrix
337 SbMatrix rot = SbMatrix::identity();
338 rot[0][0] = x[0];
339 rot[0][1] = x[1];
340 rot[0][2] = x[2];
341
342 rot[1][0] = y[0];
343 rot[1][1] = y[1];
344 rot[1][2] = y[2];
345
346 rot[2][0] = z[0];
347 rot[2][1] = z[1];
348 rot[2][2] = z[2];
349
350 camera->orientation.setValue(SbRotation(rot));
351}

Referenced by G4OpenInventorViewer::pointAt().

◆ lookedAt()

void G4OpenInventorViewer::lookedAt ( SoCamera *  camera,
SbVec3f &  dir,
SbVec3f &  up 
)
staticprivateinherited

Definition at line 354 of file G4OpenInventorViewer.cc.

355{
356 SbRotation rot = camera->orientation.getValue();
357 SbMatrix mrot; rot.getValue(mrot);
358
359 SbVec3f x, y, z;
360
361 // create a rotation matrix
362 x[0] = mrot[0][0];
363 x[1] = mrot[0][1];
364 x[2] = mrot[0][2];
365
366 y[0] = mrot[1][0];
367 y[1] = mrot[1][1];
368 y[2] = mrot[1][2];
369
370 z[0] = mrot[2][0];
371 z[1] = mrot[2][1];
372 z[2] = mrot[2][2];
373
374 dir = -z;
375 dir.normalize();
376 up = SbVec3f(0.f,1.f,0.f); // Choose y-axis if possible.
377 if (std::abs(up.dot(z)) > 1.e-6) {
378 up = y;
379 up.normalize();
380 }
381}

Referenced by G4OpenInventorViewer::GroupCameraSensorCB().

◆ NeedKernelVisit()

void G4VViewer::NeedKernelVisit ( )
inherited

Definition at line 78 of file G4VViewer.cc.

78 {
79
80 fNeedKernelVisit = true;
81
82 // At one time I thought we'd better notify all viewers. But I guess
83 // each viewer can take care of itself, so the following code is
84 // redundant (but keep it commented out for now). (John Allison)
85 // Notify all viewers that a kernel visit is required.
86 // const G4ViewerList& viewerList = fSceneHandler.GetViewerList ();
87 // G4ViewerListConstIterator i;
88 // for (i = viewerList.begin(); i != viewerList.end(); i++) {
89 // (*i) -> SetNeedKernelVisit ();
90 // }
91 // ??...but, there's a problem in OpenGL Stored which seems to
92 // require *all* viewers to revisit the kernel, so...
93 // const G4ViewerList& viewerList = fSceneHandler.GetViewerList ();
94 // G4ViewerListConstIterator i;
95 // for (i = viewerList.begin(); i != viewerList.end(); i++) {
96 // (*i) -> SetNeedKernelVisit (true);
97 // }
98 // Feb 2005 - commented out. Let's fix OpenGL if necessary.
99}

References G4VViewer::fNeedKernelVisit.

Referenced by G4OpenGLImmediateQtViewer::ComputeView(), G4DAWNFILEViewer::DrawView(), G4GMocrenFileViewer::DrawView(), G4HepRepFileViewer::DrawView(), G4OpenGLImmediateWin32Viewer::DrawView(), G4OpenGLImmediateXmViewer::DrawView(), G4OpenGLImmediateXViewer::DrawView(), G4VTreeViewer::DrawView(), G4VRML2FileViewer::DrawView(), G4VtkViewer::DrawView(), G4VisManager::GeometryHasChanged(), G4OpenGLStoredViewer::KernelVisitDecision(), G4OpenInventorViewer::KernelVisitDecision(), G4Qt3DViewer::KernelVisitDecision(), G4ToolsSGViewer< SG_SESSION, SG_VIEWER >::KernelVisitDecision(), G4VisManager::NotifyHandlers(), G4OpenGLImmediateViewer::ProcessView(), G4VisCommandViewerRebuild::SetNewValue(), G4OpenInventorViewer::SetPreview(), G4OpenInventorViewer::SetPreviewAndFull(), G4OpenInventorViewer::SetReducedWireFrame(), and G4OpenInventorViewer::UpdateScene().

◆ pointAt()

void G4OpenInventorViewer::pointAt ( SoCamera *  camera,
const SbVec3f &  targetpoint,
const SbVec3f &  upvector 
)
staticprivateinherited

Definition at line 312 of file G4OpenInventorViewer.cc.

313{
314 SbVec3f dir = targetpoint - camera->position.getValue();
315 if (dir.normalize() == 0.0f) return;
316 lookAt(camera,dir, upvector);
317}
static void lookAt(SoCamera *, const SbVec3f &dir, const SbVec3f &up)

References G4OpenInventorViewer::lookAt().

Referenced by G4OpenInventorViewer::SetView().

◆ ProcessView()

void G4VViewer::ProcessView ( )
inherited

Definition at line 105 of file G4VViewer.cc.

106{
107 // If the scene has changed, or if the concrete viewer has decided
108 // that it necessary to visit the kernel, perhaps because the view
109 // parameters have changed significantly (this should be done in the
110 // concrete viewer's DrawView)...
111 if (fNeedKernelVisit) {
112 // Reset flag. This must be done before ProcessScene to prevent
113 // recursive calls when recomputing transients...
114 fNeedKernelVisit = false;
117 }
118}
virtual void ProcessScene()
virtual void ClearStore()
G4VSceneHandler & fSceneHandler
Definition: G4VViewer.hh:215

References G4VSceneHandler::ClearStore(), G4VViewer::fNeedKernelVisit, G4VViewer::fSceneHandler, and G4VSceneHandler::ProcessScene().

Referenced by G4OpenGLStoredQtViewer::ComputeView(), G4DAWNFILEViewer::DrawView(), G4GMocrenFileViewer::DrawView(), G4HepRepFileViewer::DrawView(), G4OpenGLStoredWin32Viewer::DrawView(), G4OpenGLStoredXmViewer::DrawView(), G4OpenGLStoredXViewer::DrawView(), G4OpenInventorViewer::DrawView(), G4Qt3DViewer::DrawView(), G4RayTracerViewer::DrawView(), G4ToolsSGViewer< SG_SESSION, SG_VIEWER >::DrawView(), G4VTreeViewer::DrawView(), G4VRML2FileViewer::DrawView(), G4VtkViewer::DrawView(), and G4OpenGLImmediateViewer::ProcessView().

◆ RefreshView()

void G4VViewer::RefreshView ( )
inherited

◆ ResetView()

virtual void G4VViewer::ResetView ( )
virtualinherited

◆ SceneGraphStatistics()

void G4OpenInventorViewer::SceneGraphStatistics ( )
protectedinherited

Definition at line 633 of file G4OpenInventorViewer.cc.

633 {
634 Counter counter;
635 counter.fTriangles = 0;
636 counter.fLineSegments = 0;
637 counter.fPoints = 0;
638
639 SoCallbackAction callbackAction;
640 callbackAction.addTriangleCallback
641 (SoShape::getClassTypeId(),CountTrianglesCB,(void*)&counter);
642 callbackAction.addLineSegmentCallback
643 (SoShape::getClassTypeId(),CountLineSegmentsCB,(void*)&counter);
644 callbackAction.addPointCallback
645 (SoShape::getClassTypeId(),CountPointsCB,(void*)&counter);
646 callbackAction.apply(fSoSelection);
647
648 SoCounterAction counterAction;
649 counterAction.apply(fSoSelection);
650 int nodes = counterAction.getCount();
651
652 counterAction.setLookFor(SoCounterAction::TYPE);
653 counterAction.setType(SoShape::getClassTypeId());
654 counterAction.apply(fSoSelection);
655 int shapes = counterAction.getCount();
656
657 G4cout << "Number of triangles : " << counter.fTriangles << G4endl;
658 G4cout << "Number of line segments : " << counter.fLineSegments << G4endl;
659 G4cout << "Number of points : " << counter.fPoints << G4endl;
660 G4cout << "Number of nodes : " << nodes << G4endl;
661 G4cout << "Number of shapes : " << shapes << G4endl;
662}
static void CountLineSegmentsCB(void *userData, SoCallbackAction *, const SoPrimitiveVertex *, const SoPrimitiveVertex *)
static void CountPointsCB(void *userData, SoCallbackAction *, const SoPrimitiveVertex *)
static void CountTrianglesCB(void *userData, SoCallbackAction *, const SoPrimitiveVertex *, const SoPrimitiveVertex *, const SoPrimitiveVertex *)
int getCount() const
void setLookFor(LookFor)
void setType(const SoType, SbBool=TRUE)

References CountLineSegmentsCB(), CountPointsCB(), CountTrianglesCB(), Counter::fLineSegments, Counter::fPoints, G4OpenInventorViewer::fSoSelection, Counter::fTriangles, G4cout, G4endl, SoCounterAction::getCount(), geant4_check_module_cycles::nodes, SoCounterAction::setLookFor(), SoCounterAction::setType(), and SoCounterAction::TYPE.

Referenced by EtcSceneGraphStatsCB(), G4OpenInventorXtExtendedViewer::SceneGraphStatisticsCbk(), G4OpenInventorXtViewer::SceneGraphStatisticsCbk(), and G4OpenInventorWinViewer::WindowProc().

◆ SelectionCB()

void G4OpenInventorViewer::SelectionCB ( void *  aThis,
SoPath *  aPath 
)
staticprotectedinherited

Definition at line 458 of file G4OpenInventorViewer.cc.

462{
464 SoNode* node = ((SoFullPath*)aPath)->getTail();
465 G4AttHolder* attHolder = dynamic_cast<G4AttHolder*>(node);
466 if(attHolder && attHolder->GetAttDefs().size()) {
467 for (size_t i = 0; i < attHolder->GetAttDefs().size(); ++i) {
468 G4cout << G4AttCheck(attHolder->GetAttValues()[i],
469 attHolder->GetAttDefs()[i]);
470 }
471 } else {
472 G4String name((char*)node->getName().getString());
473 G4String cls((char*)node->getTypeId().getName().getString());
474 G4cout << "SoNode : " << node
475 << " SoType : " << cls
476 << " name : " << name
477 << G4endl;
478 G4cout << "No attributes attached." << G4endl;
479 }
480 /*FIXME : to explore (need different button - this is used for picking.
481 if(node->isOfType(Geant4_SoPolyhedron::getClassTypeId())) {
482 Geant4_SoPolyhedron* polyhedron = (Geant4_SoPolyhedron*)node;
483 if(polyhedron->solid.getValue()==FALSE)
484 polyhedron->solid.setValue(TRUE);
485 else
486 polyhedron->solid.setValue(FALSE);
487 }*/
488 This->fSoSelection->deselectAll();
489}
const std::vector< const std::vector< G4AttValue > * > & GetAttValues() const
Definition: G4AttHolder.hh:59
const std::vector< const std::map< G4String, G4AttDef > * > & GetAttDefs() const
Definition: G4AttHolder.hh:61

References G4OpenInventorViewer::fSoSelection, G4cout, G4endl, G4AttHolder::GetAttDefs(), G4AttHolder::GetAttValues(), and G4InuclParticleNames::name().

Referenced by G4OpenInventorViewer::G4OpenInventorViewer(), and G4OpenInventorXtExtendedViewer::Initialise().

◆ SetDefaultViewParameters()

void G4VViewer::SetDefaultViewParameters ( const G4ViewParameters vp)
inherited

◆ SetName()

void G4VViewer::SetName ( const G4String name)
inherited

Definition at line 72 of file G4VViewer.cc.

72 {
73 fName = name;
74 fShortName = fName.substr(0, fName.find (' '));
76}
G4String fShortName
Definition: G4VViewer.hh:218
void strip(G4String &str, char c=' ')
Remove leading and trailing characters from string.

References G4VViewer::fName, G4VViewer::fShortName, G4InuclParticleNames::name(), and G4StrUtil::strip().

◆ SetNeedKernelVisit()

void G4VViewer::SetNeedKernelVisit ( G4bool  need)
inherited

◆ SetPreview()

void G4OpenInventorViewer::SetPreview ( )
protectedinherited

◆ SetPreviewAndFull()

void G4OpenInventorViewer::SetPreviewAndFull ( )
protectedinherited

◆ SetReducedWireFrame()

void G4OpenInventorViewer::SetReducedWireFrame ( bool  aValue)
protectedinherited

Definition at line 734 of file G4OpenInventorViewer.cc.

734 {
736
737 // Set the wire frame kind :
738 vp.SetAuxEdgeVisible(!aValue);
739
740 // Set wire frame :
742 switch (existingStyle) {
744 break;
746 break;
749 break;
752 break;
755 break;
756 }
758 NeedKernelVisit(); // Just in case it was alread in wire framw.
759 DrawDetector();
760}
const G4ViewParameters & GetViewParameters() const
void SetViewParameters(const G4ViewParameters &vp)
Definition: G4VViewer.cc:120
void SetDrawingStyle(G4ViewParameters::DrawingStyle style)
void SetAuxEdgeVisible(G4bool)

References G4ViewParameters::cloud, G4OpenInventorViewer::DrawDetector(), G4ViewParameters::GetDrawingStyle(), G4VViewer::GetViewParameters(), G4ViewParameters::hlhsr, G4ViewParameters::hlr, G4ViewParameters::hsr, G4VViewer::NeedKernelVisit(), G4ViewParameters::SetAuxEdgeVisible(), G4ViewParameters::SetDrawingStyle(), G4VViewer::SetViewParameters(), and G4ViewParameters::wireframe.

Referenced by EtcSetFullWireframeCB(), EtcSetReducedWireframeCB(), G4OpenInventorXtExtendedViewer::SetFullWireFrameCbk(), G4OpenInventorXtViewer::SetFullWireFrameCbk(), G4OpenInventorXtExtendedViewer::SetReducedWireFrameCbk(), G4OpenInventorXtViewer::SetReducedWireFrameCbk(), and G4OpenInventorWinViewer::WindowProc().

◆ SetSolid()

void G4OpenInventorViewer::SetSolid ( )
protectedinherited

◆ SetTouchable()

void G4VViewer::SetTouchable ( const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &  fullPath)
protectedinherited

Definition at line 124 of file G4VViewer.cc.

126{
127 // Set the touchable for /vis/touchable/set/... commands.
128 std::ostringstream oss;
129 const auto& pvStore = G4PhysicalVolumeStore::GetInstance();
130 for (const auto& pvNodeId: fullPath) {
131 const auto& pv = pvNodeId.GetPhysicalVolume();
132 auto iterator = find(pvStore->begin(),pvStore->end(),pv);
133 if (iterator == pvStore->end()) {
135 ed << "Volume no longer in physical volume store.";
136 G4Exception("G4VViewer::SetTouchable", "visman0501", JustWarning, ed);
137 } else {
138 oss
139 << ' ' << pvNodeId.GetPhysicalVolume()->GetName()
140 << ' ' << pvNodeId.GetCopyNo();
141 }
142 }
143 G4UImanager::GetUIpointer()->ApplyCommand("/vis/set/touchable" + oss.str());
144}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
static G4PhysicalVolumeStore * GetInstance()
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:485

References G4UImanager::ApplyCommand(), G4Exception(), G4PhysicalVolumeStore::GetInstance(), G4UImanager::GetUIpointer(), and JustWarning.

Referenced by G4OpenGLQtViewer::changeColorAndTransparency(), and G4OpenGLQtViewer::setCheckComponent().

◆ SetView()

void G4OpenInventorQtViewer::SetView ( )
virtual

Reimplemented from G4OpenInventorViewer.

Definition at line 279 of file G4OpenInventorQtViewer.cc.

280{
282 if(!fViewer) return;
283 // Background.
285 fViewer->setBackgroundColor
286 (SbColor((float)b.GetRed(),(float)b.GetGreen(),(float)b.GetBlue()));
287}
G4double GetBlue() const
Definition: G4Colour.hh:154
G4double GetRed() const
Definition: G4Colour.hh:152
G4double GetGreen() const
Definition: G4Colour.hh:153

References fViewer, G4VViewer::fVP, G4ViewParameters::GetBackgroundColour(), G4Colour::GetBlue(), G4Colour::GetGreen(), G4Colour::GetRed(), and G4OpenInventorViewer::SetView().

◆ SetViewParameters()

void G4VViewer::SetViewParameters ( const G4ViewParameters vp)
inherited

◆ SetWireFrame()

void G4OpenInventorViewer::SetWireFrame ( )
protectedinherited

◆ ShowView()

void G4OpenInventorViewer::ShowView ( void  )
virtualinherited

Reimplemented from G4VViewer.

Definition at line 391 of file G4OpenInventorViewer.cc.

391 {
392 fInteractorManager -> SecondaryLoop ();
393}

References G4OpenInventorViewer::fInteractorManager.

◆ TouchableSetColour()

void G4VViewer::TouchableSetColour ( const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &  fullPath,
const G4Colour colour 
)
protectedinherited

Definition at line 180 of file G4VViewer.cc.

183{
184 // Changes the Vis Attribute Modifiers WITHOUT triggering a rebuild.
185
186 std::ostringstream oss;
187 oss << "/vis/touchable/set/colour "
188 << colour.GetRed() << ' ' << colour.GetGreen()
189 << ' ' << colour.GetBlue() << ' ' << colour.GetAlpha();
190
191 // The following is equivalent to
192 // G4UImanager::GetUIpointer()->ApplyCommand(oss.str());
193 // (assuming the touchable has already been set), but avoids view rebuild.
194
195 // Instantiate a working copy of a G4VisAttributes object...
196 G4VisAttributes workingVisAtts;
197 // and set the colour.
198 workingVisAtts.SetColour(colour);
199
202 (workingVisAtts,
205 // G4ModelingParameters::VASColour (VAS = Vis Attribute Signifier)
206 // signifies that it is the colour that should be picked out
207 // and merged with the touchable's normal vis attributes.
208
209 // Record on G4cout (with #) for information.
210 if (G4UImanager::GetUIpointer()->GetVerboseLevel() >= 2) {
211 G4cout << "# " << oss.str() << G4endl;
212 }
213}
G4double GetAlpha() const
Definition: G4Colour.hh:155
static G4ModelingParameters::PVNameCopyNoPath GetPVNameCopyNoPath(const std::vector< G4PhysicalVolumeNodeID > &)
void AddVisAttributesModifier(const G4ModelingParameters::VisAttributesModifier &)
void SetColour(const G4Colour &)

References G4ViewParameters::AddVisAttributesModifier(), G4VViewer::fVP, G4cout, G4endl, G4Colour::GetAlpha(), G4Colour::GetBlue(), G4Colour::GetGreen(), G4PhysicalVolumeModel::GetPVNameCopyNoPath(), G4Colour::GetRed(), G4UImanager::GetUIpointer(), G4VisAttributes::SetColour(), and G4ModelingParameters::VASColour.

Referenced by G4OpenGLQtViewer::changeColorAndTransparency().

◆ TouchableSetVisibility()

void G4VViewer::TouchableSetVisibility ( const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &  fullPath,
G4bool  visibility 
)
protectedinherited

Definition at line 146 of file G4VViewer.cc.

149{
150 // Changes the Vis Attribute Modifiers WITHOUT triggering a rebuild.
151
152 std::ostringstream oss;
153 oss << "/vis/touchable/set/visibility ";
154 if (visibiity) oss << "true"; else oss << "false";
155
156 // The following is equivalent to
157 // G4UImanager::GetUIpointer()->ApplyCommand(oss.str());
158 // (assuming the touchable has already been set), but avoids view rebuild.
159
160 // Instantiate a working copy of a G4VisAttributes object...
161 G4VisAttributes workingVisAtts;
162 // and set the visibility.
163 workingVisAtts.SetVisibility(visibiity);
164
167 (workingVisAtts,
170 // G4ModelingParameters::VASVisibility (VAS = Vis Attribute Signifier)
171 // signifies that it is the visibility that should be picked out
172 // and merged with the touchable's normal vis attributes.
173
174 // Record on G4cout (with #) for information.
175 if (G4UImanager::GetUIpointer()->GetVerboseLevel() >= 2) {
176 G4cout << "# " << oss.str() << G4endl;
177 }
178}
void SetVisibility(G4bool=true)

References G4ViewParameters::AddVisAttributesModifier(), G4VViewer::fVP, G4cout, G4endl, G4PhysicalVolumeModel::GetPVNameCopyNoPath(), G4UImanager::GetUIpointer(), G4VisAttributes::SetVisibility(), and G4ModelingParameters::VASVisibility.

Referenced by G4OpenGLQtViewer::setCheckComponent().

◆ UpdateScene()

void G4OpenInventorViewer::UpdateScene ( )
protectedinherited

Definition at line 762 of file G4OpenInventorViewer.cc.

762 {
763 /* Replace this... - JA
764 fG4OpenInventorSceneHandler.ClearStore();
765 ClearView();
766 if (!fNeedKernelVisit) KernelVisitDecision();
767 ProcessView();
768 ShowView();
769 */
770 // ...by this - JA
772 DrawView();
773}

References G4OpenInventorViewer::DrawView(), and G4VViewer::NeedKernelVisit().

Referenced by EtcUpdateSceneCB(), G4OpenInventorXtExtendedViewer::UpdateSceneCbk(), G4OpenInventorXtViewer::UpdateSceneCbk(), and G4OpenInventorWinViewer::WindowProc().

◆ ViewerRender()

void G4OpenInventorQtViewer::ViewerRender ( )
protectedvirtual

Implements G4OpenInventorViewer.

Definition at line 289 of file G4OpenInventorQtViewer.cc.

290{
291 if(!fViewer) return;
292 fViewer->render();
293}

References fViewer.

◆ WriteInventor()

void G4OpenInventorViewer::WriteInventor ( const G4String file = "g4out.iv")
protectedinherited

Definition at line 570 of file G4OpenInventorViewer.cc.

570 {
571 G4cout << "Produce " << aFile << "..." << G4endl;
572
573 SbBool genAlternateRep = TRUE;
574 //SbBool binary = FALSE;
575 SbBool binary = TRUE;
576 SoAlternateRepAction alternateRepAction;
577 if(genAlternateRep==TRUE) {
578 alternateRepAction.setGenerate(TRUE); //Clear alternate reps.
579 alternateRepAction.apply(fSoSelection);
580 }
581
582 SoWriteAction writeAction;
583 writeAction.getOutput()->openFile(aFile.c_str());
584 writeAction.getOutput()->setBinary(binary);
585 writeAction.apply(fSoSelection);
586 writeAction.getOutput()->closeFile();
587
588 if(genAlternateRep==TRUE) {
589 alternateRepAction.setGenerate(FALSE); //Clear alternate reps.
590 alternateRepAction.apply(fSoSelection);
591 }
592
593
594
595}
void setGenerate(SbBool)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

References FALSE, G4OpenInventorViewer::fSoSelection, G4cout, G4endl, SoAlternateRepAction::setGenerate(), and TRUE.

Referenced by FileWriteIVCB(), G4OpenInventorWinViewer::WindowProc(), G4OpenInventorXtExtendedViewer::WriteInventorCbk(), and G4OpenInventorXtViewer::WriteInventorCbk().

◆ WritePDF()

void G4OpenInventorViewer::WritePDF ( const G4String file = "g4out.pdf")
protectedinherited

Definition at line 539 of file G4OpenInventorViewer.cc.

539 {
540 if(!fGL2PSAction) return;
541 fGL2PSAction->setFileName(aFile.c_str());
542 fGL2PSAction->setExportImageFormat(GL2PS_PDF);
543 // Use gl2ps default buffer (2048*2048)
544 fGL2PSAction->setBufferSize(0);
545 G4cout << "Produce " << aFile << "..." << G4endl;
546 if (fGL2PSAction->enableFileWriting()) {
547 ViewerRender();
548 fGL2PSAction->disableFileWriting();
549 }
550 fGL2PSAction->resetBufferSizeParameters();
551}
virtual void ViewerRender()=0
#define GL2PS_PDF
Definition: gl2ps.h:132

References G4OpenInventorViewer::fGL2PSAction, G4cout, G4endl, GL2PS_PDF, and G4OpenInventorViewer::ViewerRender().

Referenced by FileWritePDFCB(), and G4OpenInventorXtExtendedViewer::PDFCbk().

◆ WritePixmapPostScript()

void G4OpenInventorViewer::WritePixmapPostScript ( const G4String file = "g4out.ps")
protectedinherited

Definition at line 553 of file G4OpenInventorViewer.cc.

553 {
554 fSoImageWriter->fileName.setValue(aFile.c_str());
555 //imageWriter->format.setValue(SoImageWriter::POST_SCRIPT);
556 fSoImageWriter->enable();
557 ViewerRender();
558 fSoImageWriter->disable();
559 if(fSoImageWriter->getStatus()) {
560 G4cout << G4String(fSoImageWriter->fileName.getValue().getString())
561 << " produced."
562 << G4endl;
563 } else {
564 G4cout << G4String(fSoImageWriter->fileName.getValue().getString())
565 << " not produced."
566 << G4endl;
567 }
568}
Geant4_SoImageWriter * fSoImageWriter

References G4OpenInventorViewer::fSoImageWriter, G4cout, G4endl, and G4OpenInventorViewer::ViewerRender().

Referenced by G4OpenInventorXtExtendedViewer::PixmapPostScriptCbk(), G4OpenInventorXtViewer::PixmapPostScriptCbk(), and G4OpenInventorWinViewer::WindowProc().

◆ WritePostScript()

void G4OpenInventorViewer::WritePostScript ( const G4String file = "g4out.ps")
protectedinherited

Definition at line 525 of file G4OpenInventorViewer.cc.

525 {
526 if(!fGL2PSAction) return;
527 fGL2PSAction->setFileName(aFile.c_str());
528 fGL2PSAction->setExportImageFormat(GL2PS_EPS);
529 // Use gl2ps default buffer (2048*2048)
530 fGL2PSAction->setBufferSize(0);
531 G4cout << "Produce " << aFile << "..." << G4endl;
532 if (fGL2PSAction->enableFileWriting()) {
533 ViewerRender();
534 fGL2PSAction->disableFileWriting();
535 }
536 fGL2PSAction->resetBufferSizeParameters();
537}
#define GL2PS_EPS
Definition: gl2ps.h:130

References G4OpenInventorViewer::fGL2PSAction, G4cout, G4endl, GL2PS_EPS, and G4OpenInventorViewer::ViewerRender().

Referenced by FileWritePSCB(), G4OpenInventorXtExtendedViewer::PostScriptCbk(), G4OpenInventorXtViewer::PostScriptCbk(), and G4OpenInventorWinViewer::WindowProc().

Field Documentation

◆ EtcEraseDetector

QAction* G4OpenInventorQtViewer::EtcEraseDetector
private

Definition at line 81 of file G4OpenInventorQtViewer.hh.

Referenced by Initialise().

◆ EtcEraseEvent

QAction* G4OpenInventorQtViewer::EtcEraseEvent
private

Definition at line 82 of file G4OpenInventorQtViewer.hh.

Referenced by Initialise().

◆ EtcSceneGraphStats

QAction* G4OpenInventorQtViewer::EtcSceneGraphStats
private

Definition at line 89 of file G4OpenInventorQtViewer.hh.

Referenced by Initialise().

◆ EtcSetFullWireframe

QAction* G4OpenInventorQtViewer::EtcSetFullWireframe
private

Definition at line 85 of file G4OpenInventorQtViewer.hh.

Referenced by Initialise().

◆ EtcSetReducedWireframe

QAction* G4OpenInventorQtViewer::EtcSetReducedWireframe
private

Definition at line 84 of file G4OpenInventorQtViewer.hh.

Referenced by Initialise().

◆ EtcSetSolid

QAction* G4OpenInventorQtViewer::EtcSetSolid
private

Definition at line 83 of file G4OpenInventorQtViewer.hh.

Referenced by Initialise().

◆ EtcUpdateScene

QAction* G4OpenInventorQtViewer::EtcUpdateScene
private

Definition at line 88 of file G4OpenInventorQtViewer.hh.

Referenced by Initialise().

◆ EtcVisibMInvisibD

QAction* G4OpenInventorQtViewer::EtcVisibMInvisibD
private

Definition at line 86 of file G4OpenInventorQtViewer.hh.

Referenced by Initialise().

◆ EtcVisibMVisibD

QAction* G4OpenInventorQtViewer::EtcVisibMVisibD
private

Definition at line 87 of file G4OpenInventorQtViewer.hh.

Referenced by Initialise().

◆ fDefaultVP

G4ViewParameters G4VViewer::fDefaultVP
protectedinherited

◆ fG4OpenInventorSceneHandler

G4OpenInventorSceneHandler& G4OpenInventorViewer::fG4OpenInventorSceneHandler
protectedinherited

◆ fGL2PSAction

Geant4_SoGL2PSAction* G4OpenInventorViewer::fGL2PSAction
protectedinherited

◆ fGroupCameraSensor

SoNodeSensor* G4OpenInventorViewer::fGroupCameraSensor
protectedinherited

◆ FileEscape

QAction* G4OpenInventorQtViewer::FileEscape
private

Definition at line 78 of file G4OpenInventorQtViewer.hh.

Referenced by Initialise().

◆ FileWriteIV

QAction* G4OpenInventorQtViewer::FileWriteIV
private

Definition at line 77 of file G4OpenInventorQtViewer.hh.

Referenced by Initialise().

◆ FileWritePDF

QAction* G4OpenInventorQtViewer::FileWritePDF
private

Definition at line 76 of file G4OpenInventorQtViewer.hh.

Referenced by Initialise().

◆ FileWritePS

QAction* G4OpenInventorQtViewer::FileWritePS
private

Definition at line 75 of file G4OpenInventorQtViewer.hh.

Referenced by Initialise().

◆ fInteractorManager

G4VInteractorManager* G4OpenInventorViewer::fInteractorManager
protectedinherited

◆ fLastVP

G4ViewParameters G4OpenInventorViewer::fLastVP
privateinherited

◆ fName

G4String G4VViewer::fName
protectedinherited

◆ fNeedKernelVisit

G4bool G4VViewer::fNeedKernelVisit
protectedinherited

◆ fSceneHandler

G4VSceneHandler& G4VViewer::fSceneHandler
protectedinherited

◆ fShortName

G4String G4VViewer::fShortName
protectedinherited

◆ fSoImageWriter

Geant4_SoImageWriter* G4OpenInventorViewer::fSoImageWriter
protectedinherited

◆ fSoSelection

SoSelection* G4OpenInventorViewer::fSoSelection
protectedinherited

◆ fViewer

G4OpenInventorQtExaminerViewer* G4OpenInventorQtViewer::fViewer
protected

◆ fViewId

G4int G4VViewer::fViewId
protectedinherited

◆ fVP

G4ViewParameters G4VViewer::fVP
protectedinherited

Definition at line 219 of file G4VViewer.hh.

Referenced by G4OpenGLQtViewer::actionChangeBackgroundColor(), G4OpenGLQtViewer::actionChangeDefaultColor(), G4OpenGLQtViewer::actionChangeTextColor(), G4OpenGLXmViewer::actions_callback(), G4OpenGLSceneHandler::AddPrimitive(), G4OpenGLImmediateSceneHandler::AddPrimitivePreambleInternal(), G4OpenGLStoredSceneHandler::AddPrimitivePreambleInternal(), G4OpenGLXmViewer::aux_edge_callback(), G4OpenGLQtViewer::changeDepthInSceneTree(), G4OpenGLStoredQtViewer::CompareForKernelVisit(), G4OpenGLStoredViewer::CompareForKernelVisit(), G4OpenInventorViewer::CompareForKernelVisit(), G4Qt3DViewer::CompareForKernelVisit(), G4ToolsSGViewer< SG_SESSION, SG_VIEWER >::CompareForKernelVisit(), G4OpenGLStoredQtViewer::ComputeView(), G4OpenGLWin32Viewer::CreateMainWindow(), G4OpenGLXmViewer::CreateMainWindow(), G4OpenGLXViewer::CreateMainWindow(), G4OpenGLQtViewer::CreateMainWindow(), G4OpenGLQtViewer::createPopupMenu(), G4OpenGLXmViewer::dolly_callback(), G4OpenGLStoredViewer::DrawDisplayLists(), G4OpenGLXmViewer::drawing_style_callback(), G4OpenGLStoredWin32Viewer::DrawView(), G4OpenGLStoredXmViewer::DrawView(), G4OpenGLStoredXViewer::DrawView(), G4OpenInventorViewer::DrawView(), G4Qt3DViewer::DrawView(), G4RayTracerViewer::DrawView(), G4ToolsSGViewer< SG_SESSION, SG_VIEWER >::DrawView(), G4VtkViewer::DrawViewHUD(), G4ToolsSGViewer< SG_SESSION, SG_VIEWER >::Export(), G4ASCIITreeViewer::G4ASCIITreeViewer(), G4HepRepFileViewer::G4HepRepFileViewer(), G4OpenGLQtViewer::G4keyPressEvent(), G4OpenGLQtViewer::G4MouseMoveEvent(), G4OpenGLQtViewer::G4MousePressEvent(), G4OpenGLQtViewer::G4MouseReleaseEvent(), G4OpenGLViewer::G4OpenGLViewer(), G4OpenInventorViewer::G4OpenInventorViewer(), G4VtkViewer::G4VtkViewer(), G4VViewer::G4VViewer(), G4OpenGLQtViewer::G4wheelEvent(), G4OpenGLViewer::getSceneDepth(), G4OpenGLViewer::getSceneFarWidth(), G4OpenGLViewer::getSceneNearWidth(), G4OpenGLXmViewer::GetXmConnection(), G4OpenInventorViewer::GroupCameraSensorCB(), Initialise(), G4OpenInventorWinViewer::Initialise(), G4OpenInventorXtExtendedViewer::Initialise(), G4OpenInventorXtViewer::Initialise(), G4Qt3DViewer::Initialise(), G4RayTracerViewer::Initialise(), G4RayTracerXViewer::Initialise(), G4ToolsSGViewer< SG_SESSION, SG_VIEWER >::Initialise(), G4VtkQtViewer::Initialise(), G4VtkViewer::Initialise(), G4OpenGLViewer::InitializeGLView(), G4OpenGLXmViewer::left_right_pan_callback(), G4OpenGLXmViewer::misc_callback(), G4ToolsSGViewer< SG_SESSION, SG_VIEWER >::mouse_move(), G4Qt3DViewer::mouseMoveEvent(), G4OpenGLQtViewer::moveScene(), G4OpenGLImmediateViewer::ProcessView(), G4OpenGLXmViewer::projection_callback(), G4OpenGLXmViewer::reset_callback(), G4OpenGLXmViewer::ResetView(), G4OpenGLViewer::rotateScene(), G4OpenGLViewer::rotateSceneInViewDirection(), G4OpenGLViewer::rotateSceneThetaPhi(), G4OpenGLViewer::rotateSceneToggle(), G4DAWNFILEViewer::SendDrawingStyleToDAWNGUI(), G4DAWNFILEViewer::SendViewParameters(), G4VRML2FileViewer::SendViewParameters(), G4OpenGLXmViewer::set_rot_subject_callback(), G4OpenGLViewerMessenger::SetNewValue(), G4OpenGLXmViewerMessenger::SetNewValue(), G4OpenGLWin32Viewer::SetRotation(), G4OpenGLWin32Viewer::SetShift(), G4OpenGLViewer::SetView(), SetView(), G4OpenInventorViewer::SetView(), G4OpenInventorWinViewer::SetView(), G4OpenInventorXtExtendedViewer::SetView(), G4OpenInventorXtViewer::SetView(), G4Qt3DViewer::SetView(), G4RayTracerViewer::SetView(), G4ToolsSGQtViewer::SetView(), G4ToolsSGViewer< SG_SESSION, SG_VIEWER >::SetView(), G4VtkViewer::SetView(), G4VViewer::SetViewParameters(), G4OpenGLWin32Viewer::SetZoom(), G4OpenGLXViewer::ShowView(), G4VtkViewer::ShowView(), G4OpenGLQtViewer::toggleAux(), G4OpenGLQtViewer::toggleHiddenMarkers(), G4OpenGLQtViewer::togglePicking(), G4OpenGLQtViewer::toggleProjection(), G4OpenGLQtViewer::toggleSurfaceAction(), G4VViewer::TouchableSetColour(), G4VViewer::TouchableSetVisibility(), G4OpenGLXmViewer::up_down_pan_callback(), G4OpenGLXmViewer::update_panels_callback(), G4OpenGLXmViewer::UpdateControlPanel(), G4OpenGLQtViewer::updateToolbarAndMouseContextMenu(), G4OpenGLQtViewer::updateViewerPropertiesTableWidget(), G4ToolsSGViewer< SG_SESSION, SG_VIEWER >::wheel_rotate(), G4Qt3DViewer::wheelEvent(), G4OpenGLXmViewer::wobble_callback(), G4OpenGLXmViewer::wobble_timer_callback(), and G4OpenGLXmViewer::zoom_callback().


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