Changeset 593 for trunk/geant4/visualization/OpenInventor
- Timestamp:
- Nov 9, 2007, 3:32:25 PM (18 years ago)
- Location:
- trunk/geant4/visualization/OpenInventor
- Files:
-
- 34 edited
-
History (modified) (2 diffs)
-
include/G4OpenInventor.hh (modified) (1 diff)
-
include/G4OpenInventorSceneHandler.hh (modified) (3 diffs)
-
include/G4OpenInventorTransform3D.hh (modified) (1 diff)
-
include/G4OpenInventorWin.hh (modified) (1 diff)
-
include/G4OpenInventorWin32.hh (modified) (1 diff)
-
include/G4OpenInventorWinViewer.hh (modified) (1 diff)
-
include/G4OpenInventorX.hh (modified) (1 diff)
-
include/G4OpenInventorXt.hh (modified) (1 diff)
-
include/G4OpenInventorXtViewer.hh (modified) (1 diff)
-
include/HEPVis/SbMath.h (modified) (1 diff)
-
include/HEPVis/nodekits/SoDetectorTreeKit.h (modified) (1 diff)
-
include/HEPVis/nodes/SoBox.h (modified) (1 diff)
-
include/HEPVis/nodes/SoCons.h (modified) (1 diff)
-
include/HEPVis/nodes/SoTrap.h (modified) (1 diff)
-
include/HEPVis/nodes/SoTrd.h (modified) (1 diff)
-
include/HEPVis/nodes/SoTubs.h (modified) (1 diff)
-
include/SoG4LineSet.h (modified) (1 diff)
-
include/SoG4MarkerSet.h (modified) (1 diff)
-
include/SoG4Polyhedron.h (modified) (1 diff)
-
src/G4OpenInventor.cc (modified) (1 diff)
-
src/G4OpenInventorSceneHandler.cc (modified) (18 diffs)
-
src/G4OpenInventorTransform3D.cc (modified) (1 diff)
-
src/G4OpenInventorViewer.cc (modified) (3 diffs)
-
src/G4OpenInventorWin.cc (modified) (1 diff)
-
src/G4OpenInventorWinViewer.cc (modified) (1 diff)
-
src/G4OpenInventorXt.cc (modified) (1 diff)
-
src/G4OpenInventorXtViewer.cc (modified) (1 diff)
-
src/SoBox.cc (modified) (1 diff)
-
src/SoCons.cc (modified) (1 diff)
-
src/SoDetectorTreeKit.cc (modified) (1 diff)
-
src/SoTrap.cc (modified) (1 diff)
-
src/SoTrd.cc (modified) (1 diff)
-
src/SoTubs.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenInventor/History
r529 r593 1 $Id: History,v 1.9 0 2006/11/05 20:49:09allison Exp $1 $Id: History,v 1.93 2007/04/03 13:35:48 allison Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 20 20 History file for visualization/OpenInventor 21 21 ------------------------------------------- 22 23 3rd April 2007 John Allison (openinventor-V08-02-02 - needs visman-V08-02-03) 24 - Introduced picking control. Default is "true" for Open Inventor. 25 26 25th March 2007 John Allison (openinventor-V08-02-01) 27 - G4OpenInventorSceneHandler: Introduced AddProperties. Rationalises. 28 - G4OpenInventorViewer.cc: Added scale factor to list of changes 29 requiring kernel visit. 30 31 5th January 2007 John Allison (openinventor-V08-02-00) 32 - Moved LoadAtts to vis management. 22 33 23 34 5th November 2006 John Allison (openinventor-V08-01-04) -
trunk/geant4/visualization/OpenInventor/include/G4OpenInventor.hh
r529 r593 26 26 // 27 27 // $Id: G4OpenInventor.hh,v 1.9 2006/06/29 21:20:22 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // Guy Barrand 26 Mar 1998. -
trunk/geant4/visualization/OpenInventor/include/G4OpenInventorSceneHandler.hh
r529 r593 25 25 // 26 26 // 27 // $Id: G4OpenInventorSceneHandler.hh,v 1.3 1 2006/11/02 12:01:20allison Exp $28 // GEANT4 tag $Name: geant4-0 8-02-patch-01 $27 // $Id: G4OpenInventorSceneHandler.hh,v 1.33 2007/03/27 15:24:15 allison Exp $ 28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // … … 48 48 class SoSeparator; 49 49 class Geant4_SoStyleCache; 50 class G4 AttHolder;50 class G4VisAttributes; 51 51 52 52 // Base class for various OpenInventorScene classes. … … 86 86 private: 87 87 88 void LoadAtts(const G4Visible&, G4AttHolder*);89 88 static G4int fSceneIdCount; // static counter for OpenInventor scenes. 90 89 enum G4OIMarker {G4OICircle, G4OISquare}; 91 90 void AddCircleSquare (G4OIMarker markerType, const G4VMarker&); 92 91 void GeneratePrerequisites(); 92 void AddProperties(const G4VisAttributes*); 93 93 std::map <G4LogicalVolume*, SoSeparator*, 94 94 std::less <G4LogicalVolume*> > fSeparatorMap; -
trunk/geant4/visualization/OpenInventor/include/G4OpenInventorTransform3D.hh
r529 r593 26 26 // 27 27 // $Id: G4OpenInventorTransform3D.hh,v 1.7 2006/06/29 21:20:26 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // -
trunk/geant4/visualization/OpenInventor/include/G4OpenInventorWin.hh
r529 r593 26 26 // 27 27 // $Id: G4OpenInventorWin.hh,v 1.3 2006/06/29 21:20:30 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // OpenInventor graphics system factory. -
trunk/geant4/visualization/OpenInventor/include/G4OpenInventorWin32.hh
r529 r593 26 26 // 27 27 // $Id: G4OpenInventorWin32.hh,v 1.7 2006/06/29 21:20:32 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // OpenInventor graphics system factory. -
trunk/geant4/visualization/OpenInventor/include/G4OpenInventorWinViewer.hh
r529 r593 26 26 // 27 27 // $Id: G4OpenInventorWinViewer.hh,v 1.9 2006/06/29 21:20:34 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // -
trunk/geant4/visualization/OpenInventor/include/G4OpenInventorX.hh
r529 r593 26 26 // 27 27 // $Id: G4OpenInventorX.hh,v 1.7 2006/06/29 21:20:36 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // -
trunk/geant4/visualization/OpenInventor/include/G4OpenInventorXt.hh
r529 r593 26 26 // 27 27 // $Id: G4OpenInventorXt.hh,v 1.3 2006/06/29 21:20:38 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // -
trunk/geant4/visualization/OpenInventor/include/G4OpenInventorXtViewer.hh
r529 r593 26 26 // 27 27 // $Id: G4OpenInventorXtViewer.hh,v 1.14 2006/06/29 21:20:40 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // -
trunk/geant4/visualization/OpenInventor/include/HEPVis/SbMath.h
r529 r593 26 26 // 27 27 // $Id: SbMath.h,v 1.4 2006/06/29 21:20:46 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 #ifndef HEPVis_SbMath_h -
trunk/geant4/visualization/OpenInventor/include/HEPVis/nodekits/SoDetectorTreeKit.h
r529 r593 26 26 // 27 27 // $Id: SoDetectorTreeKit.h,v 1.5 2006/06/29 21:21:16 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 /*-----------------------------HEPVis----------------------------------------*/ -
trunk/geant4/visualization/OpenInventor/include/HEPVis/nodes/SoBox.h
r529 r593 26 26 // 27 27 // $Id: SoBox.h,v 1.3 2006/06/29 21:21:18 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 /*-----------------------------Hepvis----------------------------------------*/ -
trunk/geant4/visualization/OpenInventor/include/HEPVis/nodes/SoCons.h
r529 r593 26 26 // 27 27 // $Id: SoCons.h,v 1.3 2006/06/29 21:21:20 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 /*-----------------------------Hepvis----------------------------------------*/ -
trunk/geant4/visualization/OpenInventor/include/HEPVis/nodes/SoTrap.h
r529 r593 26 26 // 27 27 // $Id: SoTrap.h,v 1.4 2006/06/29 21:22:06 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 /*-----------------------------Hepvis----------------------------------------*/ -
trunk/geant4/visualization/OpenInventor/include/HEPVis/nodes/SoTrd.h
r529 r593 26 26 // 27 27 // $Id: SoTrd.h,v 1.3 2006/06/29 21:22:08 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 /*-----------------------------Hepvis----------------------------------------*/ -
trunk/geant4/visualization/OpenInventor/include/HEPVis/nodes/SoTubs.h
r529 r593 26 26 // 27 27 // $Id: SoTubs.h,v 1.3 2006/06/29 21:22:10 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 /*-----------------------------Hepvis----------------------------------------*/ -
trunk/geant4/visualization/OpenInventor/include/SoG4LineSet.h
r529 r593 25 25 // 26 26 // $Id: SoG4LineSet.h,v 1.2 2006/12/13 15:49:51 gunter Exp $ 27 // GEANT4 tag $Name: geant4-0 8-02-patch-01 $27 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 28 28 // 29 29 // John Allison 26th October 2006 -
trunk/geant4/visualization/OpenInventor/include/SoG4MarkerSet.h
r529 r593 25 25 // 26 26 // $Id: SoG4MarkerSet.h,v 1.2 2006/12/13 15:49:53 gunter Exp $ 27 // GEANT4 tag $Name: geant4-0 8-02-patch-01 $27 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 28 28 // 29 29 // John Allison 26th October 2006 -
trunk/geant4/visualization/OpenInventor/include/SoG4Polyhedron.h
r529 r593 26 26 // 27 27 // $Id: SoG4Polyhedron.h,v 1.2 2006/12/13 15:49:56 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-02-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // John Allison 26th October 2006 -
trunk/geant4/visualization/OpenInventor/src/G4OpenInventor.cc
r529 r593 26 26 // 27 27 // $Id: G4OpenInventor.cc,v 1.20 2006/06/29 21:22:12 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 #ifdef G4VIS_BUILD_OI_DRIVER -
trunk/geant4/visualization/OpenInventor/src/G4OpenInventorSceneHandler.cc
r529 r593 25 25 // 26 26 // 27 // $Id: G4OpenInventorSceneHandler.cc,v 1.5 0 2006/11/05 20:48:57allison Exp $28 // GEANT4 tag $Name: geant4-0 8-02-patch-01 $27 // $Id: G4OpenInventorSceneHandler.cc,v 1.53 2007/04/03 13:35:48 allison Exp $ 28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // … … 96 96 #include "G4Trap.hh" 97 97 #include "G4Trd.hh" 98 #include "G4PhysicalVolumeModel.hh"99 #include "G4TrajectoriesModel.hh"100 #include "G4VTrajectory.hh"101 #include "G4VTrajectoryPoint.hh"102 #include "G4HitsModel.hh"103 #include "G4VHit.hh"104 98 #include "G4ModelingParameters.hh" 105 99 #include "G4VPhysicalVolume.hh" … … 189 183 } 190 184 191 void G4OpenInventorSceneHandler::LoadAtts192 (const G4Visible& visible,193 G4AttHolder* holder)194 {195 // Load G4Atts from G4VisAttributes, if any...196 const std::map<G4String,G4AttDef>* vaDefs =197 visible.GetVisAttributes()->GetAttDefs();198 if (vaDefs) {199 holder->AddAtts(visible.GetVisAttributes()->CreateAttValues(), vaDefs);200 }201 202 G4PhysicalVolumeModel* pPVModel =203 dynamic_cast<G4PhysicalVolumeModel*>(fpModel);204 if (pPVModel) {205 // Load G4Atts from G4PhysicalVolumeModel...206 const std::map<G4String,G4AttDef>* defs = pPVModel->GetAttDefs();207 if (defs) {208 holder->AddAtts(pPVModel->CreateCurrentAttValues(), defs);209 }210 }211 212 G4TrajectoriesModel* trajModel = dynamic_cast<G4TrajectoriesModel*>(fpModel);213 if (trajModel) {214 // Load G4Atts from trajectory...215 const G4VTrajectory* traj = trajModel->GetCurrentTrajectory();216 const std::map<G4String,G4AttDef>* defs = traj->GetAttDefs();217 if (defs) {218 holder->AddAtts(traj->CreateAttValues(), defs);219 }220 G4int nPoints = traj->GetPointEntries();221 for (G4int i = 0; i < nPoints; ++i) {222 G4VTrajectoryPoint* trajPoint = traj->GetPoint(i);223 const std::map<G4String,G4AttDef>* defs = trajPoint->GetAttDefs();224 if (defs) {225 holder->AddAtts(trajPoint->CreateAttValues(), defs);226 }227 }228 }229 230 G4HitsModel* hitsModel = dynamic_cast<G4HitsModel*>(fpModel);231 if (hitsModel) {232 // Load G4Atts from hit...233 const G4VHit* hit = hitsModel->GetCurrentHit();234 const std::map<G4String,G4AttDef>* defs = hit->GetAttDefs();235 if (defs) {236 holder->AddAtts(hit->CreateAttValues(), defs);237 }238 }239 }240 241 185 // 242 186 // Method for handling G4Polyline objects (from tracking). 243 187 // 244 void G4OpenInventorSceneHandler::AddPrimitive (const G4Polyline& line) { 188 void G4OpenInventorSceneHandler::AddPrimitive (const G4Polyline& line) 189 { 190 AddProperties(line.GetVisAttributes()); // Transformation, colour, etc. 191 245 192 G4int nPoints = line.size(); 246 193 SbVec3f* pCoords = new SbVec3f[nPoints]; … … 252 199 } 253 200 254 // Don't understand why I have to do this again (done in255 // GeneratePrerequisites) - JA.256 //257 // Color258 //259 const G4Colour& c = GetColour (line);260 SoMaterial* material =261 fStyleCache->getMaterial((float)c.GetRed(),262 (float)c.GetGreen(),263 (float)c.GetBlue(),264 (float)(1-c.GetAlpha()));265 fCurrentSeparator->addChild(material);266 267 201 // 268 202 // Point Set … … 281 215 282 216 // Loads G4Atts for picking... 283 LoadAtts(line, pLine);217 if (fpViewer->GetViewParameters().IsPicking()) LoadAtts(line, pLine); 284 218 285 219 #ifdef INVENTOR2_0 … … 294 228 } 295 229 296 void G4OpenInventorSceneHandler::AddPrimitive (const G4Polymarker& polymarker) { 230 void G4OpenInventorSceneHandler::AddPrimitive (const G4Polymarker& polymarker) 231 { 232 AddProperties(polymarker.GetVisAttributes()); // Transformation, colour, etc. 233 297 234 G4int pointn = polymarker.size(); 298 235 if(pointn<=0) return; … … 305 242 } 306 243 307 // Don't understand why I have to do this again (done in308 // GeneratePrerequisites) - JA.309 const G4Colour& c = GetColour (polymarker);310 SoMaterial* material =311 fStyleCache->getMaterial((float)c.GetRed(),312 (float)c.GetGreen(),313 (float)c.GetBlue(),314 (float)(1-c.GetAlpha()));315 fCurrentSeparator->addChild(material);316 317 244 SoCoordinate3* coordinate3 = new SoCoordinate3; 318 245 coordinate3->point.setValues(0,pointn,points); … … 336 263 337 264 // Loads G4Atts for picking... 338 LoadAtts(polymarker, markerSet); 265 if (fpViewer->GetViewParameters().IsPicking()) 266 LoadAtts(polymarker, markerSet); 339 267 340 268 G4VMarker::FillStyle style = polymarker.GetFillStyle(); … … 410 338 // Method for handling G4Text objects 411 339 // 412 void G4OpenInventorSceneHandler::AddPrimitive (const G4Text& text) { 340 void G4OpenInventorSceneHandler::AddPrimitive (const G4Text& text) 341 { 342 AddProperties(text.GetVisAttributes()); // Transformation, colour, etc. 343 413 344 // 414 345 // Color. Note: text colour is worked out differently. This 415 // over-rides the colour added in GeneratePrerequisites...346 // over-rides the colour added in AddProperties... 416 347 // 417 348 const G4Colour& c = GetTextColour (text); … … 476 407 477 408 void G4OpenInventorSceneHandler::AddCircleSquare 478 (G4OIMarker markerType, const G4VMarker& marker) { 479 480 // Don't understand why I have to do this again (done in 481 // GeneratePrerequisites) - JA. 482 // 483 // Color 484 // 485 const G4Colour& c = GetColour (marker); 486 SoMaterial* material = 487 fStyleCache->getMaterial((float)c.GetRed(), 488 (float)c.GetGreen(), 489 (float)c.GetBlue(), 490 (float)(1-c.GetAlpha())); 491 fCurrentSeparator->addChild(material); 409 (G4OIMarker markerType, const G4VMarker& marker) 410 { 411 AddProperties(marker.GetVisAttributes()); // Transformation, colour, etc. 492 412 493 413 MarkerSizeType sizeType; … … 519 439 520 440 // Loads G4Atts for picking... 521 LoadAtts(marker, markerSet);441 if (fpViewer->GetViewParameters().IsPicking()) LoadAtts(marker, markerSet); 522 442 523 443 G4VMarker::FillStyle style = marker.GetFillStyle(); … … 574 494 // Method for handling G4Polyhedron objects for drawing solids. 575 495 // 576 void G4OpenInventorSceneHandler::AddPrimitive (const G4Polyhedron& polyhedron) { 496 void G4OpenInventorSceneHandler::AddPrimitive (const G4Polyhedron& polyhedron) 497 { 577 498 if (polyhedron.GetNoFacets() == 0) return; 578 499 500 AddProperties(polyhedron.GetVisAttributes()); // Transformation, colour, etc. 501 579 502 SoG4Polyhedron* soPolyhedron = new SoG4Polyhedron(polyhedron); 580 503 581 504 // Loads G4Atts for picking... 582 LoadAtts(polyhedron, soPolyhedron); 505 if (fpViewer->GetViewParameters().IsPicking()) 506 LoadAtts(polyhedron, soPolyhedron); 583 507 584 508 SbString name = "Non-geometry"; … … 600 524 // 601 525 void G4OpenInventorSceneHandler::AddPrimitive (const G4NURBS& nurb) { 526 527 AddProperties(nurb.GetVisAttributes()); // Transformation, colour, etc. 602 528 603 529 G4float *u_knot_array, *u_knot_array_ptr; … … 618 544 619 545 SoSeparator *surfSep = new SoSeparator(); 620 621 //622 // Color623 //624 const G4Colour& c = GetColour (nurb);625 SoMaterial* material =626 fStyleCache->getMaterial((float)c.GetRed(),627 (float)c.GetGreen(),628 (float)c.GetBlue(),629 (float)(1-c.GetAlpha()));630 surfSep->addChild(material);631 546 632 547 // … … 686 601 // location on in the scene database so that when the solid is 687 602 // actually added (in addthis), it is put in the right place. 688 689 // Use the applicable vis attributes...690 const G4VisAttributes* pApplicableVisAttribs =691 fpViewer->GetApplicableVisAttributes (fpVisAttribs);692 693 // First find the color attributes...694 const G4Colour& g4Col = pApplicableVisAttribs->GetColour ();695 const double red = g4Col.GetRed ();696 const double green = g4Col.GetGreen ();697 const double blue = g4Col.GetBlue ();698 double transparency = 1 - g4Col.GetAlpha();699 700 // Drawing style...701 G4ViewParameters::DrawingStyle drawing_style =702 GetDrawingStyle(pApplicableVisAttribs);703 switch (drawing_style) {704 case (G4ViewParameters::wireframe):705 fModelingSolid = false;706 break;707 case (G4ViewParameters::hlr):708 case (G4ViewParameters::hsr):709 case (G4ViewParameters::hlhsr):710 fModelingSolid = true;711 break;712 }713 714 // Edge visibility...715 G4bool isAuxEdgeVisible = GetAuxEdgeVisible (pApplicableVisAttribs);716 fReducedWireFrame = !isAuxEdgeVisible;717 603 718 604 G4PhysicalVolumeModel* pPVModel = … … 771 657 if(fPreviewAndFull) detectorTreeKit->setPreviewAndFull(); 772 658 else detectorTreeKit->setPreview(TRUE); 659 660 // Colour, etc., for SoDetectorTreeKit. Treated differently to 661 // othere SoNodes(?). Use fpVisAttribs stored away in 662 // PreAddSolid... 663 const G4VisAttributes* pApplicableVisAttribs = 664 fpViewer->GetApplicableVisAttributes (fpVisAttribs); 665 666 // First find the color attributes... 667 const G4Colour& g4Col = pApplicableVisAttribs->GetColour (); 668 const double red = g4Col.GetRed (); 669 const double green = g4Col.GetGreen (); 670 const double blue = g4Col.GetBlue (); 671 double transparency = 1 - g4Col.GetAlpha(); 672 673 // Drawing style... 674 G4ViewParameters::DrawingStyle drawing_style = 675 GetDrawingStyle(pApplicableVisAttribs); 676 switch (drawing_style) { 677 case (G4ViewParameters::wireframe): 678 fModelingSolid = false; 679 break; 680 case (G4ViewParameters::hlr): 681 case (G4ViewParameters::hsr): 682 case (G4ViewParameters::hlhsr): 683 fModelingSolid = true; 684 break; 685 } 773 686 774 687 SoMaterial* material = … … 853 766 } 854 767 } 768 } 769 770 void G4OpenInventorSceneHandler::AddProperties(const G4VisAttributes* visAtts) 771 { 772 // Use the applicable vis attributes... 773 const G4VisAttributes* pApplicableVisAttribs = 774 fpViewer->GetApplicableVisAttributes (visAtts); 775 776 // First find the color attributes... 777 const G4Colour& g4Col = pApplicableVisAttribs->GetColour (); 778 const double red = g4Col.GetRed (); 779 const double green = g4Col.GetGreen (); 780 const double blue = g4Col.GetBlue (); 781 double transparency = 1 - g4Col.GetAlpha(); 782 783 // Drawing style... 784 G4ViewParameters::DrawingStyle drawing_style = 785 GetDrawingStyle(pApplicableVisAttribs); 786 switch (drawing_style) { 787 case (G4ViewParameters::wireframe): 788 fModelingSolid = false; 789 break; 790 case (G4ViewParameters::hlr): 791 case (G4ViewParameters::hsr): 792 case (G4ViewParameters::hlhsr): 793 fModelingSolid = true; 794 break; 795 } 796 797 // Edge visibility... 798 G4bool isAuxEdgeVisible = GetAuxEdgeVisible (pApplicableVisAttribs); 799 fReducedWireFrame = !isAuxEdgeVisible; 855 800 856 801 SoMaterial* material = … … 883 828 fCurrentSeparator->addChild(matrixTransform); 884 829 } 885 886 830 #endif -
trunk/geant4/visualization/OpenInventor/src/G4OpenInventorTransform3D.cc
r529 r593 26 26 // 27 27 // $Id: G4OpenInventorTransform3D.cc,v 1.8 2006/06/29 21:22:16 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // -
trunk/geant4/visualization/OpenInventor/src/G4OpenInventorViewer.cc
r529 r593 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4OpenInventorViewer.cc,v 1.5 7 2006/11/01 11:06:07allison Exp $27 // GEANT4 tag $Name: geant4-0 8-02-patch-01 $26 // $Id: G4OpenInventorViewer.cc,v 1.59 2007/04/03 13:35:48 allison Exp $ 27 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 28 28 29 29 #ifdef G4VIS_BUILD_OI_DRIVER … … 69 69 fNeedKernelVisit = true; //?? Temporary, until KernelVisitDecision fixed. 70 70 71 fVP.SetAutoRefresh(true); 71 72 fDefaultVP.SetAutoRefresh(true); 72 fVP.SetAutoRefresh(true); 73 fVP.SetPicking(true); 74 fDefaultVP.SetPicking(true); 73 75 74 76 //FIXME : G.Barrand : not convinced that we have to rm culling. … … 175 177 (vp.GetNoOfSides () != fVP.GetNoOfSides ()) || 176 178 (vp.IsMarkerNotHidden () != fVP.IsMarkerNotHidden ()) || 177 (vp.GetBackgroundColour ()!= fVP.GetBackgroundColour ()) 178 ) { 179 return true;; 180 } 179 (vp.GetBackgroundColour ()!= fVP.GetBackgroundColour ())|| 180 (vp.IsPicking () != fVP.IsPicking ()) || 181 // Scaling for Open Inventor is done by the scene handler so it 182 // needs a kernel visit. (In this respect, it differs from the 183 // OpenGL drivers, where it's done in SetView.) 184 (vp.GetScaleFactor () != fVP.GetScaleFactor ()) 185 ) 186 return true; 187 181 188 if (vp.IsDensityCulling () && 182 189 (vp.GetVisibleDensity () != fVP.GetVisibleDensity ())) -
trunk/geant4/visualization/OpenInventor/src/G4OpenInventorWin.cc
r529 r593 26 26 // 27 27 // $Id: G4OpenInventorWin.cc,v 1.6 2006/06/29 21:22:20 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // OpenInventor graphics system factory. -
trunk/geant4/visualization/OpenInventor/src/G4OpenInventorWinViewer.cc
r529 r593 26 26 // 27 27 // $Id: G4OpenInventorWinViewer.cc,v 1.25 2006/06/29 21:22:22 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 /* -
trunk/geant4/visualization/OpenInventor/src/G4OpenInventorXt.cc
r529 r593 26 26 // 27 27 // $Id: G4OpenInventorXt.cc,v 1.4 2006/06/29 21:22:24 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 // -
trunk/geant4/visualization/OpenInventor/src/G4OpenInventorXtViewer.cc
r529 r593 26 26 // 27 27 // $Id: G4OpenInventorXtViewer.cc,v 1.24 2006/06/29 21:22:26 gunter Exp $ 28 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 // 30 30 /* -
trunk/geant4/visualization/OpenInventor/src/SoBox.cc
r529 r593 27 27 // 28 28 // $Id: SoBox.cc,v 1.8 2006/06/29 21:22:36 gunter Exp $ 29 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $29 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 30 30 // 31 31 /*----------------------------HEPVis----------------------------------------*/ -
trunk/geant4/visualization/OpenInventor/src/SoCons.cc
r529 r593 27 27 // 28 28 // $Id: SoCons.cc,v 1.8 2006/06/29 21:22:38 gunter Exp $ 29 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $29 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 30 30 // 31 31 /*-----------------------------HEPVis---------------------------------------*/ -
trunk/geant4/visualization/OpenInventor/src/SoDetectorTreeKit.cc
r529 r593 27 27 // 28 28 // $Id: SoDetectorTreeKit.cc,v 1.13 2006/06/29 21:22:51 gunter Exp $ 29 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $29 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 30 30 // 31 31 /*-----------------------------HEPVis----------------------------------------*/ -
trunk/geant4/visualization/OpenInventor/src/SoTrap.cc
r529 r593 27 27 // 28 28 // $Id: SoTrap.cc,v 1.8 2006/06/29 21:23:03 gunter Exp $ 29 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $29 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 30 30 // 31 31 /*-----------------------------HEPVis----------------------------------------*/ -
trunk/geant4/visualization/OpenInventor/src/SoTrd.cc
r529 r593 27 27 // 28 28 // $Id: SoTrd.cc,v 1.8 2006/06/29 21:23:05 gunter Exp $ 29 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $29 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 30 30 // 31 31 /*-----------------------------HEPVis---------------------------------------*/ -
trunk/geant4/visualization/OpenInventor/src/SoTubs.cc
r529 r593 27 27 // 28 28 // $Id: SoTubs.cc,v 1.8 2006/06/29 21:23:07 gunter Exp $ 29 // GEANT4 tag $Name: geant4-0 8-01-patch-01 $29 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 30 30 // 31 31 /*-----------------------------HEPVis---------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.
