34 #define G4DAWNFILE_STRUCTURE_PRIORITY 1.
66 sceneHandler.IncrementViewCount (),
72 if( getenv(
"G4DAWNFILE_VIEWER" ) != NULL ) {
90 if( getenv(
"G4DAWNFILE_PS_VIEWER" ) != NULL ) {
91 strcpy(
fPSViewer, getenv(
"G4DAWNFILE_PS_VIEWER" ) ) ;
103 #if defined DEBUG_FR_VIEW
105 G4cout <<
"***** G4DAWNFILEViewer::SetView(): No effects" <<
G4endl;
116 #if defined DEBUG_FR_VIEW
118 G4cout <<
"***** G4DAWNFILEViewer::ClearView (): No effects " <<
G4endl;
134 #if defined DEBUG_FR_VIEW
136 G4cout <<
"***** G4DAWNFILEViewer::DrawView () " <<
G4endl;
154 #if defined DEBUG_FR_VIEW
156 G4cout <<
"***** G4DAWNFILEViewer::ShowView () " <<
G4endl;
185 G4cout <<
"ERROR: Failed to generate file ";
217 enum { FR_WIREFRAME_STYLE = 1, FR_WF_STORED_STYLE = 2,
218 FR_HID_STYLE = 3, FR_HID2_STYLE = 4,
219 FR_HID3_STYLE = 5, FR_DRAWING_MODE_END_STYLE = 6 };
224 out << FR_WIREFRAME_STYLE <<
G4endl;
227 out << FR_HID2_STYLE <<
G4endl;
231 out << FR_HID_STYLE <<
G4endl;
234 out << FR_WIREFRAME_STYLE <<
G4endl;
249 #if defined DEBUG_FR_VIEW
251 G4cout <<
"***** G4DAWNFILEViewer::SendViewParameters() ";
258 const G4double MIN_HALF_ANGLE = 0.01 ;
267 if( half_view_angle > MAX_HALF_ANGLE ) {
268 half_view_angle = MAX_HALF_ANGLE ;
271 if( half_view_angle < MIN_HALF_ANGLE ) {
273 camera_distance = radius * HOW_FAR ;
276 camera_distance = radius / std::sin ( half_view_angle );
280 if ( camera_distance < radius ) {
283 G4cout <<
" Camera cannot enter inside objects" <<
G4endl;
285 camera_distance =
radius ;
292 const G4double h_angle = (180.0 /
pi) * camera_direction.phi () ;
297 std::ofstream gui_out (
".DAWN_1.history") ;
302 gui_out << camera_distance <<
G4endl;
303 gui_out << v_angle <<
G4endl ;
304 gui_out << h_angle <<
G4endl ;
305 gui_out <<
"0" <<
G4endl ;
311 gui_out << target_point.
x() <<
G4endl ;
312 gui_out << target_point.
y() <<
G4endl ;
313 gui_out << target_point.
z() <<
G4endl ;
317 if( half_view_angle < MIN_HALF_ANGLE ) {
319 gui_out << zoom_factor <<
G4endl;
322 const G4double FR_HALF_SCREEN_SIZE = 0.5 ;
324 = FR_HALF_SCREEN_SIZE / std::tan( half_view_angle );
325 focal_distance *= zoom_factor ;
327 gui_out <<
"fd" << focal_distance <<
G4endl;
331 gui_out <<
"0.001" <<
G4endl ;
332 gui_out <<
"0" <<
G4endl ;
342 gui_out << 19.0 <<
G4endl;
343 gui_out << 71.0 <<
G4endl;
void SendStr(const char *char_string)
char fG4PrimViewerInvocation[64]
system("rm -rf microbeam.root")
const G4Point3D & GetCurrentTargetPoint() const
BasicVector3D< T > unit() const
G4bool FRflag_in_modeling
G4DAWNFILEViewer(G4DAWNFILESceneHandler &scene, const G4String &name="")
G4double GetZoomFactor() const
const G4Vector3D & GetViewpointDirection() const
const char * GetG4PrimViewerInvocation()
const char FR_ENV_MULTI_WINDOW2[]
G4double GetDolly() const
static Verbosity GetVerbosity()
G4double GetFieldHalfAngle() const
char fG4PrimFileName[256]
DrawingStyle GetDrawingStyle() const
void SendViewParameters()
void Open(const char *filename)
G4double GetExtentRadius() const
G4GLOB_DLL std::ostream G4cout
const G4VisExtent & GetExtent() const
virtual ~G4DAWNFILEViewer()
const char * GetPSViewer()
const char * GetG4PrimFileName()
static constexpr double pi
G4DAWNFILESceneHandler & fSceneHandler
const G4Point3D & GetStandardTargetPoint() const
const char FR_ENV_MULTI_WINDOW[]
const char FR_G4_PRIM_HEADER[]
void SendDrawingStyleToDAWNGUI(std::ostream &out)
typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData
G4Scene * GetScene() const
static G4bool DoesFileExist(const char *filename)