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

#include <G4OpenInventorXtExtendedViewer.hh>

Inheritance diagram for G4OpenInventorXtExtendedViewer:
G4OpenInventorViewer G4VViewer

Public Member Functions

virtual void ClearView ()
 
std::vector< G4ThreeVectorComputeFlyThrough (G4Vector3D *)
 
virtual void DrawView ()
 
virtual void FinishView ()
 
 G4OpenInventorXtExtendedViewer (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 ~G4OpenInventorXtExtendedViewer ()
 

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
 
G4int fViewId
 
G4ViewParameters fVP
 

Private Member Functions

void AddButton (Widget, const G4String &, XtCallbackProc)
 
Widget AddMenu (Widget, const G4String &, const G4String &)
 
G4bool CompareForKernelVisit (G4ViewParameters &)
 
void DrawDetector ()
 

Static Private Member Functions

static void EraseDetectorCbk (Widget, XtPointer, XtPointer)
 
static void EraseEventCbk (Widget, XtPointer, XtPointer)
 
static void EscapeCbk (Widget, XtPointer, XtPointer)
 
static void EscapeFromKeyboardCbk (void *o)
 
static void GroupCameraSensorCB (void *, SoSensor *)
 
static void HelpCancelCbk (Widget, XtPointer, XtPointer)
 
static void HelpCbk (Widget, XtPointer, XtPointer)
 
static void LoadInventorCbk (Widget, XtPointer, XtPointer)
 
static void lookAt (SoCamera *, const SbVec3f &dir, const SbVec3f &up)
 
static void lookedAt (SoCamera *, SbVec3f &dir, SbVec3f &up)
 
static void PDFCbk (Widget, XtPointer, XtPointer)
 
static void PixmapPostScriptCbk (Widget, XtPointer, XtPointer)
 
static void pointAt (SoCamera *, const SbVec3f &targetpoint, const SbVec3f &upvector)
 
static void PostScriptCbk (Widget, XtPointer, XtPointer)
 
static void SceneGraphStatisticsCbk (Widget, XtPointer, XtPointer)
 
static void SetFullWireFrameCbk (Widget, XtPointer, XtPointer)
 
static void SetPreviewAndFullCbk (Widget, XtPointer, XtPointer)
 
static void SetPreviewCbk (Widget, XtPointer, XtPointer)
 
static void SetReducedWireFrameCbk (Widget, XtPointer, XtPointer)
 
static void SetSolidCbk (Widget, XtPointer, XtPointer)
 
static void SetWireFrameCbk (Widget, XtPointer, XtPointer)
 
static void UpdateSceneCbk (Widget, XtPointer, XtPointer)
 
static void WriteInventorCbk (Widget, XtPointer, XtPointer)
 

Private Attributes

Widget fHelpForm
 
Widget fHelpText
 
G4ViewParameters fLastVP
 
Widget fShell
 
G4OpenInventorXtExaminerViewerfViewer
 

Detailed Description

Definition at line 43 of file G4OpenInventorXtExtendedViewer.hh.

Constructor & Destructor Documentation

◆ G4OpenInventorXtExtendedViewer()

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

Definition at line 71 of file G4OpenInventorXtExtendedViewer.cc.

74:G4OpenInventorViewer (sceneHandler, name)
75,fShell(0)
76,fViewer(0)
77,fHelpForm(0)
78,fHelpText(0)
79{
81 G4cout << "Window name: " << fName << G4endl;
82}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4OpenInventorViewer(G4OpenInventorSceneHandler &scene, const G4String &name="")
G4OpenInventorXtExaminerViewer * fViewer
G4String fName
Definition: G4VViewer.hh:217
static Verbosity GetVerbosity()
const char * name(G4int ptype)

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

◆ ~G4OpenInventorXtExtendedViewer()

G4OpenInventorXtExtendedViewer::~G4OpenInventorXtExtendedViewer ( )
virtual

Definition at line 232 of file G4OpenInventorXtExtendedViewer.cc.

232 {
234 if(fViewer) {
235 fViewer->setSceneGraph(0);
236 //FIXME : SGI : the below "delete" block things.
237 //FIXME : CoinXt : the below "delete" crashe in ~SoXtRenderArea.
238 //FIXME : delete fViewer;
239 }
240 if(fShell) XtDestroyWidget(fShell);
241}
G4VInteractorManager * fInteractorManager
void RemoveShell(G4Interactor)

References G4OpenInventorViewer::fInteractorManager, fShell, fViewer, and G4VInteractorManager::RemoveShell().

Member Function Documentation

◆ AddButton()

void G4OpenInventorXtExtendedViewer::AddButton ( Widget  aMenu,
const G4String aLabel,
XtCallbackProc  aCallback 
)
private

Definition at line 288 of file G4OpenInventorXtExtendedViewer.cc.

293{
294 Widget widget = XmCreatePushButton(aMenu,(char*)aLabel.c_str(),NULL,0);
295 XtManageChild(widget);
296 XtAddCallback(widget,XmNactivateCallback,aCallback,(XtPointer)this);
297}

Referenced by Initialise().

◆ AddMenu()

Widget G4OpenInventorXtExtendedViewer::AddMenu ( Widget  aMenuBar,
const G4String aName,
const G4String aLabel 
)
private

Definition at line 269 of file G4OpenInventorXtExtendedViewer.cc.

274{
275 // Pulldown menu :
276 Widget menu = XmCreatePulldownMenu(aMenuBar,(char*)aName.c_str(),NULL,0);
277 // Cascade button :
278 Arg args[2];
279 XmString cps =
280 XmStringLtoRCreate((char*)aLabel.c_str(),(char*)XmSTRING_DEFAULT_CHARSET);
281 XtSetArg (args[0],XmNlabelString,cps);
282 XtSetArg (args[1],XmNsubMenuId,menu);
283 Widget widget = XmCreateCascadeButton(aMenuBar,(char*)aName.c_str(),args,2);
284 XmStringFree (cps);
285 XtManageChild(widget);
286 return menu;
287}
static char ** args
Definition: G4Xt.cc:51

References args.

Referenced by Initialise().

◆ 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

◆ EraseDetectorCbk()

void G4OpenInventorXtExtendedViewer::EraseDetectorCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

◆ EraseEvent()

void G4OpenInventorViewer::EraseEvent ( )
protectedinherited

◆ EraseEventCbk()

void G4OpenInventorXtExtendedViewer::EraseEventCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

◆ Escape()

void G4OpenInventorViewer::Escape ( )
protectedinherited

Menu items callbacks /////////////////////////////////////////////////////.

Definition at line 520 of file G4OpenInventorViewer.cc.

520 {
521 G4cout << "Escape..." <<G4endl;
523}
#define OIV_EXIT_CODE

References G4OpenInventorViewer::fInteractorManager, G4cout, G4endl, OIV_EXIT_CODE, and G4VInteractorManager::RequireExitSecondaryLoop().

Referenced by EscapeCbk(), G4OpenInventorXtViewer::EscapeCbk(), EscapeFromKeyboardCbk(), and G4OpenInventorWinViewer::WindowProc().

◆ EscapeCbk()

void G4OpenInventorXtExtendedViewer::EscapeCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

Definition at line 310 of file G4OpenInventorXtExtendedViewer.cc.

311 {
313 This->Escape();
314}
void Escape()
Menu items callbacks /////////////////////////////////////////////////////.

References G4OpenInventorViewer::Escape().

Referenced by Initialise().

◆ EscapeFromKeyboardCbk()

void G4OpenInventorXtExtendedViewer::EscapeFromKeyboardCbk ( void *  o)
staticprivate

Definition at line 317 of file G4OpenInventorXtExtendedViewer.cc.

317 {
319 This->Escape();
320}

References G4OpenInventorViewer::Escape().

Referenced by Initialise().

◆ FinishView()

void G4OpenInventorXtExtendedViewer::FinishView ( void  )
virtual

Reimplemented from G4VViewer.

Definition at line 243 of file G4OpenInventorXtExtendedViewer.cc.

243 {
244 if(!fViewer) return;
245 fViewer->viewAll();
246 fViewer->saveHomePosition();
247}

References fViewer.

◆ GetApplicableVisAttributes()

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

◆ GetCamera()

SoCamera * G4OpenInventorXtExtendedViewer::GetCamera ( )
protectedvirtual

Implements G4OpenInventorViewer.

Definition at line 264 of file G4OpenInventorXtExtendedViewer.cc.

264 {
265 if(!fViewer) return 0;
266 return fViewer->getCamera();
267}

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 HelpCbk(), G4OpenInventorXtViewer::HelpCbk(), and G4OpenInventorWinViewer::WindowProc().

◆ HelpCancelCbk()

void G4OpenInventorXtExtendedViewer::HelpCancelCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

Definition at line 299 of file G4OpenInventorXtExtendedViewer.cc.

300 {
302 XtUnmanageChild(This->fHelpForm);
303}

References fHelpForm.

Referenced by Initialise().

◆ HelpCbk()

void G4OpenInventorXtExtendedViewer::HelpCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

Definition at line 421 of file G4OpenInventorXtExtendedViewer.cc.

422 {
424 XtManageChild(This->fHelpForm);
425 XmTextSetString(This->fHelpText,(char*)This->Help().c_str());
426}
G4String Help(const G4String &topic="controls")

References fHelpForm, fHelpText, and G4OpenInventorViewer::Help().

Referenced by Initialise().

◆ Initialise()

void G4OpenInventorXtExtendedViewer::Initialise ( )
virtual

Reimplemented from G4VViewer.

Definition at line 85 of file G4OpenInventorXtExtendedViewer.cc.

85 {
86
87 G4String wName = fName;
88
89 Widget parent = (Widget)fInteractorManager->GetParentInteractor ();
90 // G4cout << "DEBUG G4OpenInventorXtExtendedViewer: parent = " << parent << G4endl;
91 int width = 600;
92 int height = 600;
93
94 if(!parent) {
95 // Check if user has specified an X-Windows-type geometry string...
96 char s[32];
97
98 G4String sgeometry = fVP.GetXGeometryString();
99 if(sgeometry.empty()) {
100 G4cout << "ERROR: Geometry string \""
101 << sgeometry
102 << "\" is empty. Using \"600x600\"."
103 << G4endl;
104 width = 600;
105 height = 600;
106 sprintf(s,"%dx%d",width,height);
107 sgeometry = s;
108 } else {
109 width = fVP.GetWindowSizeHintX();
110 height = fVP.GetWindowSizeHintX();
111 }
112
113 //Create a shell window :
114 G4String shellName = wName;
115 shellName += "_shell";
116 Arg args[10];
117 XtSetArg(args[0],XtNgeometry,XtNewString(sgeometry.c_str()));
118 XtSetArg(args[1],XtNborderWidth,0);
119 XtSetArg(args[2],XtNtitle,XtNewString(wName.c_str()));
120 fShell = XtAppCreateShell(shellName.c_str(),"Inventor",
121 topLevelShellWidgetClass,
122 SoXt::getDisplay(),
123 args,3);
124
125 // G4cout << "DEBUG CREATING THE VIEWER WITH CREATED SHELL = " << fShell << G4endl;
126 fViewer = new G4OpenInventorXtExaminerViewer(fShell, wName.c_str(), TRUE);
128
129 // FWJ (viewpoints don't work with this!)
130 // fViewer->setAutoClipping((SbBool)0);
131
132 //XtSetArg(args[0],XmNtopAttachment ,XmATTACH_FORM);
133 //XtSetArg(args[1],XmNleftAttachment ,XmATTACH_FORM);
134 //XtSetArg(args[2],XmNrightAttachment ,XmATTACH_FORM);
135 //XtSetArg(args[3],XmNbottomAttachment,XmATTACH_FORM);
136 //Widget form = XmCreateForm (fShell,(char*)"form",args,4);
137 //XtManageChild (form);
138
139 Widget menuBar = fViewer->getMenuBar();
140
141 //XtSetArg(args[0],XmNtopAttachment ,XmATTACH_FORM);
142 //XtSetArg(args[1],XmNleftAttachment ,XmATTACH_FORM);
143 //XtSetArg(args[2],XmNrightAttachment ,XmATTACH_FORM);
144 //Widget menuBar = XmCreateMenuBar (form,(char*)"menuBar",args,3);
145 //XtManageChild(menuBar);
146
147 {Widget menu = fViewer->getMenu();
148 //{Widget menu = AddMenu(menuBar,"File","File");
149 AddButton(menu,"Write PS (gl2ps)",PostScriptCbk);
150 AddButton(menu, "Write PDF (gl2ps)", PDFCbk);
151 AddButton(menu,"Write PS (pixmap)",PixmapPostScriptCbk);
152 AddButton(menu,"Write IV",WriteInventorCbk);
153 AddButton(menu,"Escape",EscapeCbk);}
154
155 {Widget menu = AddMenu(menuBar,"Etc","Etc");
156 AddButton(menu,"Erase detector",EraseDetectorCbk);
157 AddButton(menu,"Erase event",EraseEventCbk);
158 AddButton(menu,"Set solid",SetSolidCbk);
159/* AddButton(menu,"Set (G4) wire frame",SetWireFrameCbk);*/
160 AddButton(menu,"Set (G4) reduced wire frame",SetReducedWireFrameCbk);
161 AddButton(menu,"Set (G4) full wire frame",SetFullWireFrameCbk);
162 AddButton(menu,"Visible mothers + invisible daughters",SetPreviewCbk);
163 AddButton(menu,"Visible mothers + visible daughters",SetPreviewAndFullCbk);
164 AddButton(menu,"Update scene",UpdateSceneCbk);
165 AddButton(menu,"Scene graph stats",SceneGraphStatisticsCbk);
166 }
167
168 {Widget menu = AddMenu(menuBar,"Help","Help");
169 AddButton(menu,"Controls",HelpCbk);}
170
171 //fViewer = new SoXtExaminerViewer(form,wName.c_str(),TRUE);
172
173 XtSetArg(args[0],XmNtopAttachment ,XmATTACH_WIDGET);
174 XtSetArg(args[1],XmNtopWidget ,menuBar);
175 XtSetArg(args[2],XmNleftAttachment ,XmATTACH_FORM);
176 XtSetArg(args[3],XmNrightAttachment ,XmATTACH_FORM);
177 XtSetArg(args[4],XmNbottomAttachment,XmATTACH_FORM);
178 XtSetValues(fViewer->getWidget(),args,5);
179
180 fHelpForm = XmCreateFormDialog(fShell,(char*)"help",NULL,0);
181 XtSetArg(args[0],XmNleftAttachment ,XmATTACH_FORM);
182 XtSetArg(args[1],XmNrightAttachment ,XmATTACH_FORM);
183 XtSetArg(args[2],XmNbottomAttachment,XmATTACH_FORM);
184 Widget cancel = XmCreatePushButton(fHelpForm,(char*)"helpCancel",args,3);
185 XtAddCallback(cancel,XmNactivateCallback,HelpCancelCbk,(XtPointer)this);
186 XtManageChild(cancel);
187 XtSetArg(args[0],XmNtopAttachment ,XmATTACH_FORM);
188 XtSetArg(args[1],XmNleftAttachment ,XmATTACH_FORM);
189 XtSetArg(args[2],XmNrightAttachment ,XmATTACH_FORM);
190 XtSetArg(args[3],XmNbottomAttachment,XmATTACH_WIDGET);
191 XtSetArg(args[4],XmNbottomWidget ,cancel);
192 fHelpText = XmCreateScrolledText(fHelpForm,(char*)"helpText",args,5);
193 XtManageChild(fHelpText);
194
196
197 } else {
199 if(str!=0) wName = str;
200 // G4cout << "DEBUG CREATING THE VIEWER WITH parent = " << parent << G4endl;
201 fViewer = new G4OpenInventorXtExaminerViewer(parent, wName.c_str(), TRUE);
202 }
203
204 // Use our own SelectionCB for the Xt viewer to allow for abbreviated output
205 // when picking a trajectory
206 fSoSelection->removeSelectionCallback(G4OpenInventorViewer::SelectionCB,
207 this);
208// fSoSelection->addSelectionCallback(SelectionCB, this);
209
210 fViewer->setSize(SbVec2s(width,height));
211
212 // Have a GL2PS render action :
213 const SbViewportRegion& vpRegion = fViewer->getViewportRegion();
214 fGL2PSAction = new SoGL2PSAction(vpRegion);
215 fViewer->setGLRenderAction(fGL2PSAction);
216
217 // Else :
218 fViewer->setSceneGraph(fSoSelection);
219 fViewer->viewAll();
220 fViewer->saveHomePosition();
221 fViewer->setTitle(fName);
222 fViewer->show();
223 if(fShell) {
224 SoXt::show(fShell);
226 }
228 // TJR added:
229 fViewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_ADD);
230}
static constexpr double s
Definition: G4SIunits.hh:154
#define TRUE
Definition: Globals.hh:27
#define SoGL2PSAction
Definition: SoGL2PSAction.h:38
static void SelectionCB(void *, SoPath *)
Geant4_SoGL2PSAction * fGL2PSAction
void addEscapeCallback(void(*cb)(void *), void *)
static void PostScriptCbk(Widget, XtPointer, XtPointer)
static void SetSolidCbk(Widget, XtPointer, XtPointer)
static void PixmapPostScriptCbk(Widget, XtPointer, XtPointer)
static void EraseEventCbk(Widget, XtPointer, XtPointer)
static void SceneGraphStatisticsCbk(Widget, XtPointer, XtPointer)
static void SetPreviewCbk(Widget, XtPointer, XtPointer)
void AddButton(Widget, const G4String &, XtCallbackProc)
static void SetPreviewAndFullCbk(Widget, XtPointer, XtPointer)
static void PDFCbk(Widget, XtPointer, XtPointer)
Widget AddMenu(Widget, const G4String &, const G4String &)
static void SetReducedWireFrameCbk(Widget, XtPointer, XtPointer)
static void SetFullWireFrameCbk(Widget, XtPointer, XtPointer)
static void WriteInventorCbk(Widget, XtPointer, XtPointer)
static void EraseDetectorCbk(Widget, XtPointer, XtPointer)
static void HelpCbk(Widget, XtPointer, XtPointer)
static void UpdateSceneCbk(Widget, XtPointer, XtPointer)
static void HelpCancelCbk(Widget, XtPointer, XtPointer)
static void EscapeCbk(Widget, XtPointer, XtPointer)
void SetCreatedInteractor(G4Interactor)
virtual void FlushAndWaitExecution()=0
G4Interactor GetParentInteractor()
void AddShell(G4Interactor)
const G4String & GetXGeometryString() const
unsigned int GetWindowSizeHintX() const

References AddButton(), G4OpenInventorXtExaminerViewer::addEscapeCallback(), AddMenu(), G4VInteractorManager::AddShell(), args, EraseDetectorCbk(), EraseEventCbk(), EscapeCbk(), EscapeFromKeyboardCbk(), G4OpenInventorViewer::fGL2PSAction, fHelpForm, fHelpText, G4OpenInventorViewer::fInteractorManager, G4VInteractorManager::FlushAndWaitExecution(), G4VViewer::fName, fShell, G4OpenInventorViewer::fSoSelection, fViewer, G4VViewer::fVP, G4cout, G4endl, G4VInteractorManager::GetCreationString(), G4OpenInventorXtExaminerViewer::getMenu(), G4OpenInventorXtExaminerViewer::getMenuBar(), G4VInteractorManager::GetParentInteractor(), G4ViewParameters::GetWindowSizeHintX(), G4ViewParameters::GetXGeometryString(), HelpCancelCbk(), HelpCbk(), PDFCbk(), PixmapPostScriptCbk(), PostScriptCbk(), s, SceneGraphStatisticsCbk(), G4OpenInventorViewer::SelectionCB(), G4VInteractorManager::SetCreatedInteractor(), SetFullWireFrameCbk(), SetPreviewAndFullCbk(), SetPreviewCbk(), SetReducedWireFrameCbk(), SetSolidCbk(), SoGL2PSAction, TRUE, UpdateSceneCbk(), and WriteInventorCbk().

◆ 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().

◆ LoadInventorCbk()

static void G4OpenInventorXtExtendedViewer::LoadInventorCbk ( Widget  ,
XtPointer  ,
XtPointer   
)
staticprivate

◆ 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().

◆ PDFCbk()

void G4OpenInventorXtExtendedViewer::PDFCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

Definition at line 335 of file G4OpenInventorXtExtendedViewer.cc.

336 {
338 // FWJ Workaround: avoids empty 2nd page in file
339 SbBool superimpState =
340 This->fViewer->getSuperimpositionEnabled(This->fViewer->superimposition);
341 This->fViewer->setSuperimpositionEnabled(This->fViewer->superimposition,
342 FALSE);
343 This->WritePDF();
344 if (superimpState)
345 This->fViewer->setSuperimpositionEnabled(This->fViewer->superimposition,
346 TRUE);
347}
#define FALSE
Definition: Globals.hh:23
void WritePDF(const G4String &file="g4out.pdf")

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

Referenced by Initialise().

◆ PixmapPostScriptCbk()

void G4OpenInventorXtExtendedViewer::PixmapPostScriptCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

Definition at line 349 of file G4OpenInventorXtExtendedViewer.cc.

350 {
352 This->WritePixmapPostScript();
353}
void WritePixmapPostScript(const G4String &file="g4out.ps")

References G4OpenInventorViewer::WritePixmapPostScript().

Referenced by Initialise().

◆ 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().

◆ PostScriptCbk()

void G4OpenInventorXtExtendedViewer::PostScriptCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

Definition at line 322 of file G4OpenInventorXtExtendedViewer.cc.

323 {
325 // FWJ Workaround: avoids empty 2nd page in file
326 SbBool superimpState =
327 This->fViewer->getSuperimpositionEnabled(This->fViewer->superimposition);
328 This->fViewer->setSuperimpositionEnabled(This->fViewer->superimposition,
329 FALSE);
330 This->WritePostScript();
331 if (superimpState)
332 This->fViewer->setSuperimpositionEnabled(This->fViewer->superimposition,
333 TRUE);
334}
void WritePostScript(const G4String &file="g4out.ps")

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

Referenced by Initialise().

◆ 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 G4OpenInventorQtViewer::EtcSceneGraphStatsCB(), SceneGraphStatisticsCbk(), G4OpenInventorXtViewer::SceneGraphStatisticsCbk(), and G4OpenInventorWinViewer::WindowProc().

◆ SceneGraphStatisticsCbk()

void G4OpenInventorXtExtendedViewer::SceneGraphStatisticsCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

◆ 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 Initialise().

◆ SetDefaultViewParameters()

void G4VViewer::SetDefaultViewParameters ( const G4ViewParameters vp)
inherited

◆ SetFullWireFrameCbk()

void G4OpenInventorXtExtendedViewer::SetFullWireFrameCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

◆ 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

◆ SetPreviewAndFullCbk()

void G4OpenInventorXtExtendedViewer::SetPreviewAndFullCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

◆ SetPreviewCbk()

void G4OpenInventorXtExtendedViewer::SetPreviewCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

◆ 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 G4OpenInventorQtViewer::EtcSetFullWireframeCB(), G4OpenInventorQtViewer::EtcSetReducedWireframeCB(), SetFullWireFrameCbk(), G4OpenInventorXtViewer::SetFullWireFrameCbk(), SetReducedWireFrameCbk(), G4OpenInventorXtViewer::SetReducedWireFrameCbk(), and G4OpenInventorWinViewer::WindowProc().

◆ SetReducedWireFrameCbk()

void G4OpenInventorXtExtendedViewer::SetReducedWireFrameCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

◆ SetSolid()

void G4OpenInventorViewer::SetSolid ( )
protectedinherited

◆ SetSolidCbk()

void G4OpenInventorXtExtendedViewer::SetSolidCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

◆ 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
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77

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

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

◆ SetView()

void G4OpenInventorXtExtendedViewer::SetView ( )
virtual

Reimplemented from G4OpenInventorViewer.

Definition at line 249 of file G4OpenInventorXtExtendedViewer.cc.

249 {
251 if(!fViewer) return;
252 // Background.
254 fViewer->setBackgroundColor
255 (SbColor((float)b.GetRed(),(float)b.GetGreen(),(float)b.GetBlue()));
256}
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

◆ SetWireFrameCbk()

void G4OpenInventorXtExtendedViewer::SetWireFrameCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

◆ 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 G4OpenInventorQtViewer::EtcUpdateSceneCB(), UpdateSceneCbk(), G4OpenInventorXtViewer::UpdateSceneCbk(), and G4OpenInventorWinViewer::WindowProc().

◆ UpdateSceneCbk()

void G4OpenInventorXtExtendedViewer::UpdateSceneCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

◆ ViewerRender()

void G4OpenInventorXtExtendedViewer::ViewerRender ( )
protectedvirtual

Implements G4OpenInventorViewer.

Definition at line 259 of file G4OpenInventorXtExtendedViewer.cc.

259 {
260 if(!fViewer) return;
261 fViewer->render();
262}

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 G4OpenInventorQtViewer::FileWriteIVCB(), G4OpenInventorWinViewer::WindowProc(), WriteInventorCbk(), and G4OpenInventorXtViewer::WriteInventorCbk().

◆ WriteInventorCbk()

void G4OpenInventorXtExtendedViewer::WriteInventorCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprivate

Definition at line 361 of file G4OpenInventorXtExtendedViewer.cc.

362 {
364 This->WriteInventor();
365}
void WriteInventor(const G4String &file="g4out.iv")

References G4OpenInventorViewer::WriteInventor().

Referenced by Initialise().

◆ 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 G4OpenInventorQtViewer::FileWritePDFCB(), and 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 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 G4OpenInventorQtViewer::FileWritePSCB(), PostScriptCbk(), G4OpenInventorXtViewer::PostScriptCbk(), and G4OpenInventorWinViewer::WindowProc().

Field Documentation

◆ fDefaultVP

G4ViewParameters G4VViewer::fDefaultVP
protectedinherited

◆ fG4OpenInventorSceneHandler

G4OpenInventorSceneHandler& G4OpenInventorViewer::fG4OpenInventorSceneHandler
protectedinherited

◆ fGL2PSAction

Geant4_SoGL2PSAction* G4OpenInventorViewer::fGL2PSAction
protectedinherited

◆ fGroupCameraSensor

SoNodeSensor* G4OpenInventorViewer::fGroupCameraSensor
protectedinherited

◆ fHelpForm

Widget G4OpenInventorXtExtendedViewer::fHelpForm
private

Definition at line 82 of file G4OpenInventorXtExtendedViewer.hh.

Referenced by HelpCancelCbk(), HelpCbk(), and Initialise().

◆ fHelpText

Widget G4OpenInventorXtExtendedViewer::fHelpText
private

Definition at line 83 of file G4OpenInventorXtExtendedViewer.hh.

Referenced by HelpCbk(), and 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

◆ fShell

Widget G4OpenInventorXtExtendedViewer::fShell
private

◆ fShortName

G4String G4VViewer::fShortName
protectedinherited

◆ fSoImageWriter

Geant4_SoImageWriter* G4OpenInventorViewer::fSoImageWriter
protectedinherited

◆ fSoSelection

SoSelection* G4OpenInventorViewer::fSoSelection
protectedinherited

◆ fViewer

G4OpenInventorXtExaminerViewer* G4OpenInventorXtExtendedViewer::fViewer
private

◆ 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(), G4OpenInventorQtViewer::Initialise(), G4OpenInventorWinViewer::Initialise(), 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(), G4OpenInventorQtViewer::SetView(), G4OpenInventorViewer::SetView(), G4OpenInventorWinViewer::SetView(), 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: