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

#include <G4OpenInventorXtViewer.hh>

Inheritance diagram for G4OpenInventorXtViewer:
G4OpenInventorViewer G4VViewer

Public Member Functions

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

Protected Member Functions

void AddButton (Widget, const G4String &, XtCallbackProc)
 
Widget AddMenu (Widget, const G4String &, const G4String &)
 
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 EraseDetectorCbk (Widget, XtPointer, XtPointer)
 
static void EraseEventCbk (Widget, XtPointer, XtPointer)
 
static void EscapeCbk (Widget, XtPointer, XtPointer)
 
static void HelpCancelCbk (Widget, XtPointer, XtPointer)
 
static void HelpCbk (Widget, XtPointer, XtPointer)
 
static void PixmapPostScriptCbk (Widget, XtPointer, XtPointer)
 
static void PostScriptCbk (Widget, XtPointer, XtPointer)
 
static void SceneGraphStatisticsCbk (Widget, XtPointer, XtPointer)
 
static void SelectionCB (void *, SoPath *)
 
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)
 

Protected Attributes

G4ViewParameters fDefaultVP
 
G4OpenInventorSceneHandlerfG4OpenInventorSceneHandler
 
Geant4_SoGL2PSAction * fGL2PSAction
 
SoNodeSensor * fGroupCameraSensor
 
Widget fHelpForm
 
Widget fHelpText
 
G4VInteractorManagerfInteractorManager
 
G4String fName
 
G4bool fNeedKernelVisit
 
G4VSceneHandlerfSceneHandler
 
Widget fShell
 
G4String fShortName
 
Geant4_SoImageWriter * fSoImageWriter
 
SoSelection * fSoSelection
 
SoXtExaminerViewer * fViewer
 
G4int fViewId
 
G4ViewParameters fVP
 

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

G4ViewParameters fLastVP
 

Detailed Description

Definition at line 41 of file G4OpenInventorXtViewer.hh.

Constructor & Destructor Documentation

◆ G4OpenInventorXtViewer()

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

Definition at line 65 of file G4OpenInventorXtViewer.cc.

68:G4OpenInventorViewer (sceneHandler, name)
69,fShell(0)
70,fViewer(0)
71,fHelpForm(0)
72,fHelpText(0)
73{
75 G4cout << "Window name: " << fName << G4endl;
76}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4OpenInventorViewer(G4OpenInventorSceneHandler &scene, const G4String &name="")
SoXtExaminerViewer * 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().

◆ ~G4OpenInventorXtViewer()

G4OpenInventorXtViewer::~G4OpenInventorXtViewer ( )
virtual

Definition at line 206 of file G4OpenInventorXtViewer.cc.

206 {
208 if(fViewer) {
209 fViewer->setSceneGraph(0);
210 //FIXME : SGI : the below "delete" block things.
211 //FIXME : CoinXt : the below "delete" crashe in ~SoXtRenderArea.
212 //FIXME : delete fViewer;
213 }
214 if(fShell) XtDestroyWidget(fShell);
215}
G4VInteractorManager * fInteractorManager
void RemoveShell(G4Interactor)

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

Member Function Documentation

◆ AddButton()

void G4OpenInventorXtViewer::AddButton ( Widget  aMenu,
const G4String aLabel,
XtCallbackProc  aCallback 
)
protected

Definition at line 262 of file G4OpenInventorXtViewer.cc.

267{
268 Widget widget = XmCreatePushButton(aMenu,(char*)aLabel.c_str(),NULL,0);
269 XtManageChild(widget);
270 XtAddCallback(widget,XmNactivateCallback,aCallback,(XtPointer)this);
271}

Referenced by Initialise().

◆ AddMenu()

Widget G4OpenInventorXtViewer::AddMenu ( Widget  aMenuBar,
const G4String aName,
const G4String aLabel 
)
protected

Definition at line 243 of file G4OpenInventorXtViewer.cc.

248{
249 // Pulldown menu :
250 Widget menu = XmCreatePulldownMenu(aMenuBar,(char*)aName.c_str(),NULL,0);
251 // Cascade button :
252 Arg args[2];
253 XmString cps =
254 XmStringLtoRCreate((char*)aLabel.c_str(),(char*)XmSTRING_DEFAULT_CHARSET);
255 XtSetArg (args[0],XmNlabelString,cps);
256 XtSetArg (args[1],XmNsubMenuId,menu);
257 Widget widget = XmCreateCascadeButton(aMenuBar,(char*)aName.c_str(),args,2);
258 XmStringFree (cps);
259 XtManageChild(widget);
260 return menu;
261}
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 G4OpenInventorXtViewer::EraseDetectorCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

◆ EraseEvent()

void G4OpenInventorViewer::EraseEvent ( )
protectedinherited

◆ EraseEventCbk()

void G4OpenInventorXtViewer::EraseEventCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 320 of file G4OpenInventorXtViewer.cc.

321 {
323 This->EraseEvent();
324}

References G4OpenInventorViewer::EraseEvent().

Referenced by Initialise().

◆ Escape()

void G4OpenInventorViewer::Escape ( )
protectedinherited

◆ EscapeCbk()

void G4OpenInventorXtViewer::EscapeCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 284 of file G4OpenInventorXtViewer.cc.

285 {
287 This->Escape();
288}
void Escape()
Menu items callbacks /////////////////////////////////////////////////////.

References G4OpenInventorViewer::Escape().

Referenced by Initialise().

◆ FinishView()

void G4OpenInventorXtViewer::FinishView ( void  )
virtual

Reimplemented from G4VViewer.

Definition at line 217 of file G4OpenInventorXtViewer.cc.

217 {
218 if(!fViewer) return;
219 fViewer->viewAll();
220 fViewer->saveHomePosition();
221}

References fViewer.

◆ GetApplicableVisAttributes()

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

◆ GetCamera()

SoCamera * G4OpenInventorXtViewer::GetCamera ( )
protectedvirtual

Implements G4OpenInventorViewer.

Definition at line 238 of file G4OpenInventorXtViewer.cc.

238 {
239 if(!fViewer) return 0;
240 return fViewer->getCamera();
241}

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

◆ HelpCancelCbk()

void G4OpenInventorXtViewer::HelpCancelCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 273 of file G4OpenInventorXtViewer.cc.

274 {
276 XtUnmanageChild(This->fHelpForm);
277}

References fHelpForm.

Referenced by Initialise().

◆ HelpCbk()

void G4OpenInventorXtViewer::HelpCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 368 of file G4OpenInventorXtViewer.cc.

369 {
371 XtManageChild(This->fHelpForm);
372 XmTextSetString(This->fHelpText,(char*)This->Help().c_str());
373}
G4String Help(const G4String &topic="controls")

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

Referenced by Initialise().

◆ Initialise()

void G4OpenInventorXtViewer::Initialise ( )
virtual

Reimplemented from G4VViewer.

Definition at line 79 of file G4OpenInventorXtViewer.cc.

79 {
80
81 G4String wName = fName;
82
83 Widget parent = (Widget)fInteractorManager->GetParentInteractor ();
84 int width = 600;
85 int height = 600;
86
87 if(!parent) {
88 // Check if user has specified an X-Windows-type geometry string...
89 char str[32];
90
91 G4String sgeometry = fVP.GetXGeometryString();
92 if(sgeometry.empty()) {
93 G4cout << "ERROR: Geometry string \""
94 << sgeometry
95 << "\" is empty. Using \"600x600\"."
96 << G4endl;
97 width = 600;
98 height = 600;
99 sprintf(str,"%dx%d",width,height);
100 sgeometry = str;
101 } else {
102 width = fVP.GetWindowSizeHintX();
103 height = fVP.GetWindowSizeHintX();
104 }
105
106 //Create a shell window :
107 G4String shellName = wName;
108 shellName += "_shell";
109 Arg args[10];
110 XtSetArg(args[0],XtNgeometry,XtNewString(sgeometry.c_str()));
111 XtSetArg(args[1],XtNborderWidth,0);
112 XtSetArg(args[2],XtNtitle,XtNewString(wName.c_str()));
113 fShell = XtAppCreateShell(shellName.c_str(),"Inventor",
114 topLevelShellWidgetClass,
115 SoXt::getDisplay(),
116 args,3);
117
118 XtSetArg(args[0],XmNtopAttachment ,XmATTACH_FORM);
119 XtSetArg(args[1],XmNleftAttachment ,XmATTACH_FORM);
120 XtSetArg(args[2],XmNrightAttachment ,XmATTACH_FORM);
121 XtSetArg(args[3],XmNbottomAttachment,XmATTACH_FORM);
122 Widget form = XmCreateForm (fShell,(char*)"form",args,4);
123 XtManageChild (form);
124
125 XtSetArg(args[0],XmNtopAttachment ,XmATTACH_FORM);
126 XtSetArg(args[1],XmNleftAttachment ,XmATTACH_FORM);
127 XtSetArg(args[2],XmNrightAttachment ,XmATTACH_FORM);
128 Widget menuBar = XmCreateMenuBar (form,(char*)"menuBar",args,3);
129 XtManageChild(menuBar);
130
131 {Widget menu = AddMenu(menuBar,"File","File");
132 AddButton(menu,"PS (gl2ps)",PostScriptCbk);
133 AddButton(menu,"PS (pixmap)",PixmapPostScriptCbk);
134 AddButton(menu,"IV",WriteInventorCbk);
135 AddButton(menu,"Escape",EscapeCbk);}
136
137 {Widget menu = AddMenu(menuBar,"Etc","Etc");
138 AddButton(menu,"Erase detector",EraseDetectorCbk);
139 AddButton(menu,"Erase event",EraseEventCbk);
140 AddButton(menu,"Set solid",SetSolidCbk);
141/* AddButton(menu,"Set (G4) wire frame",SetWireFrameCbk);*/
142 AddButton(menu,"Set (G4) reduced wire frame",SetReducedWireFrameCbk);
143 AddButton(menu,"Set (G4) full wire frame",SetFullWireFrameCbk);
144 AddButton(menu,"Visible mothers + invisible daughters",SetPreviewCbk);
145 AddButton(menu,"Visible mothers + visible daughters",SetPreviewAndFullCbk);
146 AddButton(menu,"Update scene",UpdateSceneCbk);
147 AddButton(menu,"Scene graph stats",SceneGraphStatisticsCbk);
148 }
149
150 {Widget menu = AddMenu(menuBar,"Help","Help");
151 AddButton(menu,"Controls",HelpCbk);}
152
153 fViewer = new SoXtExaminerViewer(form,wName.c_str(),TRUE);
154
155 XtSetArg(args[0],XmNtopAttachment ,XmATTACH_WIDGET);
156 XtSetArg(args[1],XmNtopWidget ,menuBar);
157 XtSetArg(args[2],XmNleftAttachment ,XmATTACH_FORM);
158 XtSetArg(args[3],XmNrightAttachment ,XmATTACH_FORM);
159 XtSetArg(args[4],XmNbottomAttachment,XmATTACH_FORM);
160 XtSetValues(fViewer->getWidget(),args,5);
161
162 fHelpForm = XmCreateFormDialog(fShell,(char*)"help",NULL,0);
163 XtSetArg(args[0],XmNleftAttachment ,XmATTACH_FORM);
164 XtSetArg(args[1],XmNrightAttachment ,XmATTACH_FORM);
165 XtSetArg(args[2],XmNbottomAttachment,XmATTACH_FORM);
166 Widget cancel = XmCreatePushButton(fHelpForm,(char*)"helpCancel",args,3);
167 XtAddCallback(cancel,XmNactivateCallback,HelpCancelCbk,(XtPointer)this);
168 XtManageChild(cancel);
169 XtSetArg(args[0],XmNtopAttachment ,XmATTACH_FORM);
170 XtSetArg(args[1],XmNleftAttachment ,XmATTACH_FORM);
171 XtSetArg(args[2],XmNrightAttachment ,XmATTACH_FORM);
172 XtSetArg(args[3],XmNbottomAttachment,XmATTACH_WIDGET);
173 XtSetArg(args[4],XmNbottomWidget ,cancel);
174 fHelpText = XmCreateScrolledText(fHelpForm,(char*)"helpText",args,5);
175 XtManageChild(fHelpText);
176
178
179 } else {
181 if(str!=0) wName = str;
182 fViewer = new SoXtExaminerViewer(parent,wName.c_str(),TRUE);
183 }
184
185 fViewer->setSize(SbVec2s(width,height));
186
187 // Have a GL2PS render action :
188 const SbViewportRegion& vpRegion = fViewer->getViewportRegion();
189 fGL2PSAction = new SoGL2PSAction(vpRegion);
190 fViewer->setGLRenderAction(fGL2PSAction);
191
192 // Else :
193 fViewer->setSceneGraph(fSoSelection);
194 fViewer->viewAll();
195 fViewer->saveHomePosition();
196 fViewer->setTitle(fName);
197 fViewer->show();
198 if(fShell) {
199 SoXt::show(fShell);
201 }
203 fViewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_ADD);
204}
#define TRUE
Definition: Globals.hh:27
#define SoGL2PSAction
Definition: SoGL2PSAction.h:38
Geant4_SoGL2PSAction * fGL2PSAction
static void SetPreviewCbk(Widget, XtPointer, XtPointer)
static void SetReducedWireFrameCbk(Widget, XtPointer, XtPointer)
static void SceneGraphStatisticsCbk(Widget, XtPointer, XtPointer)
static void SetPreviewAndFullCbk(Widget, XtPointer, XtPointer)
static void EraseDetectorCbk(Widget, XtPointer, XtPointer)
static void PixmapPostScriptCbk(Widget, XtPointer, XtPointer)
static void SetFullWireFrameCbk(Widget, XtPointer, XtPointer)
static void PostScriptCbk(Widget, XtPointer, XtPointer)
static void WriteInventorCbk(Widget, XtPointer, XtPointer)
void AddButton(Widget, const G4String &, XtCallbackProc)
static void HelpCancelCbk(Widget, XtPointer, XtPointer)
static void EraseEventCbk(Widget, XtPointer, XtPointer)
static void UpdateSceneCbk(Widget, XtPointer, XtPointer)
static void EscapeCbk(Widget, XtPointer, XtPointer)
static void SetSolidCbk(Widget, XtPointer, XtPointer)
static void HelpCbk(Widget, XtPointer, XtPointer)
Widget AddMenu(Widget, const G4String &, const G4String &)
void SetCreatedInteractor(G4Interactor)
virtual void FlushAndWaitExecution()=0
G4Interactor GetParentInteractor()
void AddShell(G4Interactor)
const G4String & GetXGeometryString() const
unsigned int GetWindowSizeHintX() const

References AddButton(), AddMenu(), G4VInteractorManager::AddShell(), args, EraseDetectorCbk(), EraseEventCbk(), EscapeCbk(), G4OpenInventorViewer::fGL2PSAction, fHelpForm, fHelpText, G4OpenInventorViewer::fInteractorManager, G4VInteractorManager::FlushAndWaitExecution(), G4VViewer::fName, fShell, G4OpenInventorViewer::fSoSelection, fViewer, G4VViewer::fVP, G4cout, G4endl, G4VInteractorManager::GetCreationString(), G4VInteractorManager::GetParentInteractor(), G4ViewParameters::GetWindowSizeHintX(), G4ViewParameters::GetXGeometryString(), HelpCancelCbk(), HelpCbk(), PixmapPostScriptCbk(), PostScriptCbk(), SceneGraphStatisticsCbk(), 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().

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

◆ PixmapPostScriptCbk()

void G4OpenInventorXtViewer::PixmapPostScriptCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 296 of file G4OpenInventorXtViewer.cc.

297 {
299 This->WritePixmapPostScript();
300}
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 G4OpenInventorXtViewer::PostScriptCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 290 of file G4OpenInventorXtViewer.cc.

291 {
293 This->WritePostScript();
294}
void WritePostScript(const G4String &file="g4out.ps")

References 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(), G4OpenInventorXtExtendedViewer::SceneGraphStatisticsCbk(), SceneGraphStatisticsCbk(), and G4OpenInventorWinViewer::WindowProc().

◆ SceneGraphStatisticsCbk()

void G4OpenInventorXtViewer::SceneGraphStatisticsCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 302 of file G4OpenInventorXtViewer.cc.

303 {
305 This->SceneGraphStatistics();
306}

References G4OpenInventorViewer::SceneGraphStatistics().

Referenced by Initialise().

◆ 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

◆ SetFullWireFrameCbk()

void G4OpenInventorXtViewer::SetFullWireFrameCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 344 of file G4OpenInventorXtViewer.cc.

345 {
347 This->SetReducedWireFrame(false);
348}

References G4OpenInventorViewer::SetReducedWireFrame().

Referenced by Initialise().

◆ 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 G4OpenInventorXtViewer::SetPreviewAndFullCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 362 of file G4OpenInventorXtViewer.cc.

363 {
365 This->SetPreviewAndFull();
366}

References G4OpenInventorViewer::SetPreviewAndFull().

Referenced by Initialise().

◆ SetPreviewCbk()

void G4OpenInventorXtViewer::SetPreviewCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 356 of file G4OpenInventorXtViewer.cc.

357 {
359 This->SetPreview();
360}

References G4OpenInventorViewer::SetPreview().

Referenced by Initialise().

◆ 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(), G4OpenInventorXtExtendedViewer::SetFullWireFrameCbk(), SetFullWireFrameCbk(), G4OpenInventorXtExtendedViewer::SetReducedWireFrameCbk(), SetReducedWireFrameCbk(), and G4OpenInventorWinViewer::WindowProc().

◆ SetReducedWireFrameCbk()

void G4OpenInventorXtViewer::SetReducedWireFrameCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 338 of file G4OpenInventorXtViewer.cc.

339 {
341 This->SetReducedWireFrame(true);
342}

References G4OpenInventorViewer::SetReducedWireFrame().

Referenced by Initialise().

◆ SetSolid()

void G4OpenInventorViewer::SetSolid ( )
protectedinherited

◆ SetSolidCbk()

void G4OpenInventorXtViewer::SetSolidCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 326 of file G4OpenInventorXtViewer.cc.

327 {
329 This->SetSolid();
330}

References G4OpenInventorViewer::SetSolid().

Referenced by Initialise().

◆ 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 G4OpenInventorXtViewer::SetView ( )
virtual

Reimplemented from G4OpenInventorViewer.

Definition at line 223 of file G4OpenInventorXtViewer.cc.

223 {
225 if(!fViewer) return;
226 // Background.
228 fViewer->setBackgroundColor
229 (SbColor((float)b.GetRed(),(float)b.GetGreen(),(float)b.GetBlue()));
230}
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 G4OpenInventorXtViewer::SetWireFrameCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 332 of file G4OpenInventorXtViewer.cc.

333 {
335 This->SetWireFrame();
336}

References G4OpenInventorViewer::SetWireFrame().

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

◆ UpdateSceneCbk()

void G4OpenInventorXtViewer::UpdateSceneCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 350 of file G4OpenInventorXtViewer.cc.

351 {
353 This->UpdateScene();
354}

References G4OpenInventorViewer::UpdateScene().

Referenced by Initialise().

◆ ViewerRender()

void G4OpenInventorXtViewer::ViewerRender ( )
protectedvirtual

Implements G4OpenInventorViewer.

Definition at line 233 of file G4OpenInventorXtViewer.cc.

233 {
234 if(!fViewer) return;
235 fViewer->render();
236}

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}
#define FALSE
Definition: Globals.hh:23
void setGenerate(SbBool)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

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

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

◆ WriteInventorCbk()

void G4OpenInventorXtViewer::WriteInventorCbk ( Widget  ,
XtPointer  aData,
XtPointer   
)
staticprotected

Definition at line 308 of file G4OpenInventorXtViewer.cc.

309 {
311 This->WriteInventor();
312}
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 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(), 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(), G4OpenInventorXtExtendedViewer::PostScriptCbk(), 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 G4OpenInventorXtViewer::fHelpForm
protected

Definition at line 75 of file G4OpenInventorXtViewer.hh.

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

◆ fHelpText

Widget G4OpenInventorXtViewer::fHelpText
protected

Definition at line 76 of file G4OpenInventorXtViewer.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 G4OpenInventorXtViewer::fShell
protected

Definition at line 73 of file G4OpenInventorXtViewer.hh.

Referenced by Initialise(), and ~G4OpenInventorXtViewer().

◆ fShortName

G4String G4VViewer::fShortName
protectedinherited

◆ fSoImageWriter

Geant4_SoImageWriter* G4OpenInventorViewer::fSoImageWriter
protectedinherited

◆ fSoSelection

SoSelection* G4OpenInventorViewer::fSoSelection
protectedinherited

◆ fViewer

SoXtExaminerViewer* G4OpenInventorXtViewer::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(), G4OpenInventorQtViewer::Initialise(), G4OpenInventorWinViewer::Initialise(), G4OpenInventorXtExtendedViewer::Initialise(), 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(), G4OpenInventorXtExtendedViewer::SetView(), 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: