35 #ifdef G4VIS_BUILD_DAWN_DRIVER
39 #define G4FukuiRenderer_STRUCTURE_PRIORITY 1.
63 G4FukuiRendererViewer::G4FukuiRendererViewer (G4FukuiRendererSceneHandler& sceneHandler,
66 sceneHandler.IncrementViewCount (),
68 fSceneHandler (sceneHandler)
72 G4FukuiRendererViewer::~G4FukuiRendererViewer ()
76 void G4FukuiRendererViewer::SetView ()
78 #if defined DEBUG_FR_VIEW
80 G4cout <<
"***** G4FukuiRendererViewer::SetView(): No effects" <<
G4endl;
88 G4FukuiRendererViewer::ClearView(
void )
90 #if defined DEBUG_FR_VIEW
92 G4cout <<
"***** G4FukuiRendererViewer::ClearView (): No effects " <<
G4endl;
99 void G4FukuiRendererViewer::DrawView ()
101 #if defined DEBUG_FR_VIEW
103 G4cout <<
"***** G4FukuiRendererViewer::DrawView () " <<
G4endl;
107 fSceneHandler.FRBeginModeling();
119 void G4FukuiRendererViewer::ShowView(
void )
121 #if defined DEBUG_FR_VIEW
123 G4cout <<
"***** G4FukuiRendererViewer::ShowView () " <<
G4endl;
126 if( fSceneHandler.FRIsInModeling() )
131 fSceneHandler.FREndModeling();
141 void G4FukuiRendererViewer::Wait()
143 #if defined DEBUG_FR_VIEW
145 G4cout <<
"***** G4FukuiRendererViewer::Wait () : Begin" <<
G4endl;
147 fSceneHandler.SendStr (
FR_WAIT );
148 fSceneHandler.GetPrimDest().WaitSendBack(
FR_WAIT );
149 #if defined DEBUG_FR_VIEW
151 G4cout <<
"***** G4FukuiRendererViewer::Wait () : end" <<
G4endl;
159 G4FukuiRendererViewer::SendDevice( FRDEV dev )
161 #if defined DEBUG_FR_VIEW
163 G4cout <<
"***** G4FukuiRendererViewer::SendDevice() " <<
G4endl;
168 if( dev >= FRDEV_PS || dev < FRDEV_DEVICE_END ) {
169 fSceneHandler.SendStrInt (
FR_DEVICE, dev );
175 void G4FukuiRendererViewer::SendDrawingStyle()
177 #if defined DEBUG_FR_VIEW
179 G4cout <<
"***** G4FukuiRendererViewer::SendDrawingStyle() " <<
G4endl;
182 G4int style = fVP.GetDrawingStyle();
205 void G4FukuiRendererViewer::SendViewParameters ()
211 #if defined DEBUG_FR_VIEW
213 G4cout <<
"***** G4FukuiRendererViewer::SendViewParameters()" <<
G4endl;
218 const G4double MIN_HALF_ANGLE = 0.01 ;
224 G4double radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
226 G4double half_view_angle = std::fabs ( fVP.GetFieldHalfAngle () ) ;
227 if( half_view_angle > MAX_HALF_ANGLE ) {
228 half_view_angle = MAX_HALF_ANGLE ;
231 if( half_view_angle < MIN_HALF_ANGLE ) {
233 camera_distance = radius * HOW_FAR ;
236 camera_distance = radius / std::sin ( half_view_angle );
237 camera_distance -= fVP.GetDolly();
240 if ( camera_distance < radius ) {
242 G4cout <<
"WARNING from FukuiRenderer (DAWN) driver:" <<
G4endl;
243 G4cout <<
" Camera cannot enter inside objects" <<
G4endl;
245 camera_distance =
radius ;
250 = fVP.GetViewpointDirection().
unit();
252 const G4double h_angle = (180.0 /
pi) * camera_direction.phi () ;
262 = fSceneHandler.GetScene()->GetStandardTargetPoint()
263 + fVP.GetCurrentTargetPoint();
272 const G4double zoom_factor = fVP.GetZoomFactor();
275 if( half_view_angle < MIN_HALF_ANGLE ) {
278 = fSceneHandler.GetScene()->GetStandardTargetPoint();
282 std_target_point.x(),
283 std_target_point.y(),
284 std_target_point.z());
290 const G4double FR_HALF_SCREEN_SIZE = 0.5 ;
292 = FR_HALF_SCREEN_SIZE / std::tan( half_view_angle );
293 focal_distance *= zoom_factor ;
298 if( fSceneHandler.GetSystem().IsGUIMode() ) {
300 fSceneHandler.SendStr(
FR_GUI );
305 fSceneHandler.GetPrimDest().WaitSendBack(
FR_GUI );
310 #endif // G4VIS_BUILD_DAWN_DRIVER
BasicVector3D< T > unit() const
const char FR_ZOOM_FACTOR[]
const char FR_WIREFRAME[]
static Verbosity GetVerbosity()
G4GLOB_DLL std::ostream G4cout
static constexpr double pi
const char FR_CAMERA_POSITION[]
const char FR_FOCAL_DISTANCE[]
const char FR_TARGET_POINT[]