2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
9 // PofViewView.cpp : implementation of the CPofViewView class
15 #include "pofviewdoc.h"
16 #include "pofviewview.h"
31 static char THIS_FILE[] = __FILE__;
34 /////////////////////////////////////////////////////////////////////////////
37 IMPLEMENT_DYNCREATE(CPofViewView, CView)
39 BEGIN_MESSAGE_MAP(CPofViewView, CView)
40 //{{AFX_MSG_MAP(CPofViewView)
46 ON_COMMAND(ID_POF_OUTLINE, OnPofOutline)
47 ON_UPDATE_COMMAND_UI(ID_POF_OUTLINE, OnUpdatePofOutline)
48 ON_COMMAND(ID_POF_LIGHTING, OnPofLighting)
49 ON_UPDATE_COMMAND_UI(ID_POF_LIGHTING, OnUpdatePofLighting)
50 ON_COMMAND(ID_POF_PIVOTS, OnPofPivots)
51 ON_UPDATE_COMMAND_UI(ID_POF_PIVOTS, OnUpdatePofPivots)
52 ON_UPDATE_COMMAND_UI(ID_DETAIL_1, OnUpdateDetail1)
53 ON_COMMAND(ID_DETAIL_1, OnDetail1)
54 ON_COMMAND(ID_DETAIL_2, OnDetail2)
55 ON_UPDATE_COMMAND_UI(ID_DETAIL_2, OnUpdateDetail2)
56 ON_COMMAND(ID_DETAIL_3, OnDetail3)
57 ON_UPDATE_COMMAND_UI(ID_DETAIL_3, OnUpdateDetail3)
58 ON_COMMAND(ID_DETAIL_4, OnDetail4)
59 ON_UPDATE_COMMAND_UI(ID_DETAIL_4, OnUpdateDetail4)
60 ON_COMMAND(ID_DETAIL_5, OnDetail5)
61 ON_UPDATE_COMMAND_UI(ID_DETAIL_5, OnUpdateDetail5)
62 ON_COMMAND(ID_DETAIL_6, OnDetail6)
63 ON_UPDATE_COMMAND_UI(ID_DETAIL_6, OnUpdateDetail6)
64 ON_COMMAND(ID_SHOW_TREE, OnShowTree)
65 ON_UPDATE_COMMAND_UI(ID_SHOW_TREE, OnUpdateShowTree)
66 ON_COMMAND(ID_POF_PATHS, OnPofPaths)
67 ON_UPDATE_COMMAND_UI(ID_POF_PATHS, OnUpdatePofPaths)
68 ON_COMMAND(ID_POF_RADIUS, OnPofRadius)
69 ON_UPDATE_COMMAND_UI(ID_POF_RADIUS, OnUpdatePofRadius)
70 ON_COMMAND(ID_POF_OVERWRITE, OnPofOverwrite)
71 ON_UPDATE_COMMAND_UI(ID_POF_OVERWRITE, OnUpdatePofOverwrite)
72 ON_COMMAND(IDC_SHOW_DAMAGED_SUBOBJECTS, OnShowDamagedSubobjects)
73 ON_UPDATE_COMMAND_UI(IDC_SHOW_DAMAGED_SUBOBJECTS, OnUpdateShowDamagedSubobjects)
74 ON_COMMAND(IDC_SHOW_DEBRIS, OnShowDebris)
75 ON_UPDATE_COMMAND_UI(IDC_SHOW_DEBRIS, OnUpdateShowDebris)
79 ON_COMMAND(ID_POF_SMOOTHING, OnPofSmoothing)
80 ON_UPDATE_COMMAND_UI(ID_POF_SMOOTHING, OnUpdatePofSmoothing)
81 ON_COMMAND(ID_POF_TEXTURING, OnPofTexturing)
82 ON_UPDATE_COMMAND_UI(ID_POF_TEXTURING, OnUpdatePofTexturing)
83 ON_COMMAND(ID_POF_SHIELDS, OnPofShields)
84 ON_UPDATE_COMMAND_UI(ID_POF_SHIELDS, OnUpdatePofShields)
85 ON_COMMAND(IDC_TOGGLE_LIGHTING, OnToggleLighting)
86 ON_UPDATE_COMMAND_UI(IDC_TOGGLE_LIGHTING, OnUpdateToggleLighting)
87 ON_COMMAND(ID_INVISIBLEFACES, OnInvisiblefaces)
88 ON_UPDATE_COMMAND_UI(ID_INVISIBLEFACES, OnUpdateInvisiblefaces)
89 ON_COMMAND(ID_BAY_PATHS, OnBayPaths)
90 ON_UPDATE_COMMAND_UI(ID_BAY_PATHS, OnUpdateBayPaths)
91 ON_COMMAND(ID_AUTOCEN, OnAutocenter)
92 ON_UPDATE_COMMAND_UI(ID_AUTOCEN, OnUpdateAutocenter)
94 // Standard printing commands
95 ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
96 ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
97 ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
100 /////////////////////////////////////////////////////////////////////////////
101 // CPofViewView construction/destruction
103 CPofViewView::CPofViewView()
105 // TODO: add construction code here
109 matrix temp_orient = IDENTITY_MATRIX;
110 vector temp_pos = {0.0f, 0.0f, -10.0f};
113 m_ViewerPos = temp_pos;
114 m_ViewerOrient = temp_orient;
115 m_ObjectOrient = vmd_identity_matrix;
117 // m_ViewerPos.x=f2fl(0xadd3); m_ViewerPos.y = f2fl(0x32cbb); m_ViewerPos.z =f2fl(0x10006e);
118 // m_ViewerOrient.rvec.x=f2fl(0xffff40e2); m_ViewerOrient.rvec.y=f2fl(0x2b3); m_ViewerOrient.rvec.z = f2fl(0xffff55b4);
119 // m_ViewerOrient.uvec.x=f2fl(0x5cba); m_ViewerOrient.uvec.y=f2fl(0xd859); m_ViewerOrient.uvec.z = f2fl(0xffff9b5d);
120 // m_ViewerOrient.fvec.x=f2fl(0x8edd); m_ViewerOrient.fvec.y=f2fl(0xffff772f); m_ViewerOrient.fvec.z=f2fl(0xffff5d80);
122 physics_init( &m_ViewerPhysics );
123 m_ViewerPhysics.flags |= PF_ACCELERATES | PF_SLIDE_ENABLED;
125 memset( &m_Viewer_ci, 0, sizeof(control_info) );
130 m_current_detail_level = 1; // If 0, show debris
133 m_show_overwrite = 0;
134 m_show_destroyed_subobjects = 0;
136 m_show_invisible_faces = 0;
137 m_show_bay_paths = 0;
143 m_mouse_x = m_mouse_y = 0;
144 m_mouse_dx = m_mouse_dy = 0;
150 // CObjectTree m_subobjects;
153 void CPofViewView::MoveViewer(float FrameTime, BOOL is_active, int key )
155 control_info * ci = &m_Viewer_ci;
157 polymodel *pm = NULL;
159 CPofViewDoc* pDoc = GetDocument();
162 int n_detail_levels = 0;
163 if ( pDoc->m_model_num > -1 ) {
164 pm = model_get(pDoc->m_model_num);
165 n_detail_levels = pm->n_detail_levels;
170 if ( n_detail_levels >= 1){
171 m_current_detail_level = 1;
175 if ( n_detail_levels >= 2){
176 m_current_detail_level = 2;
180 if ( n_detail_levels >= 3){
181 m_current_detail_level = 3;
185 if ( n_detail_levels >= 4){
186 m_current_detail_level = 4;
190 if ( n_detail_levels >= 5){
191 m_current_detail_level = 5;
195 if ( n_detail_levels >= 6){
196 m_current_detail_level = 6;
200 // Scales the engines thrusters by this much
201 model_thrust -= 0.1f;
202 if ( model_thrust < 0.0f ){
207 // Scales the engines thrusters by this much
208 model_thrust += 0.1f;
209 if ( model_thrust > 1.0f ){
215 float c_scale = 1.0f;
217 if((pm != NULL) && (pm->core_radius < 200.0f)){
218 c_scale = 1.0f / 6.0f;
223 float temp = ci->heading;
224 float temp1 = ci->pitch;
225 memset( ci, 0, sizeof(control_info) );
229 if ( keyd_pressed[KEY_BACKSP] ) {
230 model_afterburner = 1;
232 model_afterburner = 0;
236 kh = (key_down_timef(KEY_PAD6) - key_down_timef(KEY_PAD4)) / 32.0f;
239 } else if (kh > 0.0f) {
240 if (ci->heading < 0.0f){
244 if (ci->heading > 0.0f){
250 kh = (key_down_timef(KEY_PAD8) - key_down_timef(KEY_PAD2)) / 32.0f;
253 } else if (kh > 0.0f) {
254 if (ci->pitch < 0.0f){
258 if (ci->pitch > 0.0f){
264 ci->bank = (key_down_timef(KEY_PAD7) - key_down_timef(KEY_PAD9)) / 8.0f;
265 ci->forward = (key_down_timef(KEY_A) - key_down_timef(KEY_Z)) * c_scale;
266 ci->sideways = (key_down_timef(KEY_PAD3) - key_down_timef(KEY_PAD1)) * c_scale;
267 ci->vertical = (key_down_timef(KEY_PADMINUS) - key_down_timef(KEY_PADPLUS)) * c_scale;
269 memset( ci, 0, sizeof(control_info) );
271 physics_read_flying_controls( &m_ViewerOrient, &m_ViewerPhysics, &m_Viewer_ci, FrameTime );
273 physics_sim(&m_ViewerPos, &m_ViewerOrient, &m_ViewerPhysics, FrameTime * 6 );
277 if ( m_mouse_down ) {
278 matrix tempm, mousem;
280 if ( m_mouse_dx || m_mouse_dy ) {
281 vm_trackball( -m_mouse_dx, m_mouse_dy, &mousem );
282 vm_matrix_x_matrix(&tempm, &m_ObjectOrient, &mousem);
283 m_ObjectOrient = tempm;
285 m_mouse_dx = m_mouse_dy = 0;
292 CPofViewView::~CPofViewView()
298 extern int shipp_thruster_glow_bitmap;
299 extern float shipp_thruster_glow_noise;
300 extern int shipp_thruster_bitmap; // In PofView.cpp // What frame the current thruster bitmap is at for this ship
301 extern int Tmap_show_layers;
302 extern float Ambient_light;
305 /////////////////////////////////////////////////////////////////////////////
306 // CPofViewView drawing
307 void CPofViewView::OnDraw(CDC* pDC)
309 CPofViewDoc* pDoc = GetDocument();
311 polymodel * pm = NULL;
313 // TODO: add draw code for native data here
315 if ( pDoc->m_model_num >= 0 ) {
319 pm = model_get(pDoc->m_model_num);
322 GetClientRect(&client);
323 w = client.right - client.left + 1;
324 h = client.bottom - client.top + 1;
325 if (w>= gr_screen.max_w ) w = gr_screen.max_w-1;
326 if (h>= gr_screen.max_h ) h = gr_screen.max_h-1;
329 gr_set_clip(0,0,w,h);
334 gr_set_color( 127, 127, 127 );
336 float saved_Ambient_light = Ambient_light;
339 static vector Global_light_world = { -0.208758f, -0.688253f, 0.694782f };
343 light_add_directional( &Global_light_world, 1.0f, 1.0f, 1.0f, 1.0f );
345 Ambient_light = 0.0f;
351 g3_set_view_matrix(&m_ViewerPos, &m_ViewerOrient, m_ViewerZoom);
353 uint render_flags = 0;
354 if ( !m_dolighting ) render_flags |= MR_NO_LIGHTING;
355 if ( m_show_outline ) {
356 render_flags |= MR_SHOW_OUTLINE;
357 model_set_outline_color(0,0,0);
360 if ( m_show_shields ){
361 render_flags |= MR_SHOW_SHIELDS;
364 if ( m_show_invisible_faces ) {
365 render_flags |= MR_SHOW_INVISIBLE_FACES;
368 if (m_show_overwrite){
369 Tmap_show_layers = 1;
371 Tmap_show_layers = 0;
374 if ( m_show_pivots ) render_flags |= MR_SHOW_PIVOTS;
375 if ( m_show_paths ) render_flags |= MR_SHOW_PATHS;
376 if ( m_show_radius ) render_flags |= MR_SHOW_RADIUS;
377 if ( !m_smoothing ) render_flags |= MR_NO_SMOOTHING;
378 if ( !m_texturing ) render_flags |= MR_NO_TEXTURING;
379 if ( m_current_detail_level > 0 ) {
380 render_flags |= MR_LOCK_DETAIL;
381 model_set_detail_level(m_current_detail_level-1);
384 if(m_show_bay_paths) render_flags |= MR_BAY_PATHS;
386 if(m_autocenter) render_flags |= MR_AUTOCENTER;
388 vector temp_pos = {0.0f, 0.0f, 0.0f };
390 model_clear_instance( pDoc->m_model_num );
392 model_show_damaged(pDoc->m_model_num, m_show_destroyed_subobjects );
394 if ( model_afterburner ){
395 model_set_thrust( pDoc->m_model_num, 1.0f, shipp_thruster_bitmap, shipp_thruster_glow_bitmap, shipp_thruster_glow_noise );
397 model_set_thrust( pDoc->m_model_num, model_thrust, shipp_thruster_bitmap, shipp_thruster_glow_bitmap, shipp_thruster_glow_noise );
400 render_flags |= MR_SHOW_THRUSTERS;
402 static int whee = -1;
404 whee = bm_load("helvig.pcx");
407 model_set_insignia_bitmap(whee);
410 if ( m_current_detail_level > 0 ) {
411 model_render( pDoc->m_model_num, &m_ObjectOrient, &temp_pos, render_flags );
414 for (i=0; i<pm->num_debris_objects; i++ ) {
415 vector tmp = {0.0f, 0.0f, 0.0f };
416 vector tmp1 = pm->submodel[pm->debris_objects[i]].offset;
417 model_find_world_point(&tmp, &tmp1, pDoc->m_model_num, -1,&m_ObjectOrient, &temp_pos );
418 submodel_render( pDoc->m_model_num, pm->debris_objects[i],&m_ObjectOrient, &tmp, render_flags );
425 vm_vec_scale_add( &tmp1, &m_ViewerPos, &m_ViewerOrient.fvec, 100.0f );
426 int hit = model_check_collision(pDoc->m_model_num,&vmd_identity_matrix,&temp_pos, &m_ViewerPos, &tmp1, &hitpos, 0 );
432 flags = g3_rotate_vertex(&pt,&hitpos);
435 g3_project_vertex(&pt);
436 if (!(pt.flags & PF_OVERFLOW)) {
437 gr_set_color(128,0,0);
438 g3_draw_sphere( &pt, 1.0f );
445 gr_flip_window((uint) pDC->m_hDC, 0, 0, w, h );
447 Ambient_light = saved_Ambient_light;
451 /////////////////////////////////////////////////////////////////////////////
452 // CPofViewView printing
454 BOOL CPofViewView::OnPreparePrinting(CPrintInfo* pInfo)
456 // default preparation
457 return DoPreparePrinting(pInfo);
460 void CPofViewView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
462 // TODO: add extra initialization before printing
465 void CPofViewView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
467 // TODO: add cleanup after printing
470 /////////////////////////////////////////////////////////////////////////////
471 // CPofViewView diagnostics
474 void CPofViewView::AssertValid() const
476 CView::AssertValid();
479 void CPofViewView::Dump(CDumpContext& dc) const
484 CPofViewDoc* CPofViewView::GetDocument() // non-debug version is inline
486 ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPofViewDoc)));
487 return (CPofViewDoc*)m_pDocument;
491 /////////////////////////////////////////////////////////////////////////////
492 // CPofViewView message handlers
494 void CPofViewView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
496 // TODO: Add your message handler code here and/or call default
497 key_mark( nFlags&0x7F, 1, 0 );
499 CView::OnKeyDown(nChar, nRepCnt, nFlags);
502 void CPofViewView::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
504 // TODO: Add your message handler code here and/or call default
505 key_mark( nFlags&0x7F, 0, 0 );
507 CView::OnKeyUp(nChar, nRepCnt, nFlags);
510 extern int pofview_focus;
512 void CPofViewView::OnSetFocus(CWnd* pOldWnd)
514 CView::OnSetFocus(pOldWnd);
516 // TODO: Add your message handler code here
522 void CPofViewView::OnKillFocus(CWnd* pNewWnd)
524 CView::OnKillFocus(pNewWnd);
526 // TODO: Add your message handler code here
534 void CPofViewView::OnPofOutline()
536 m_show_outline = !m_show_outline;
540 void CPofViewView::OnUpdatePofOutline(CCmdUI* pCmdUI)
542 pCmdUI->SetCheck( m_show_outline );
545 void CPofViewView::OnPofLighting()
547 m_dolighting = !m_dolighting;
550 void CPofViewView::OnUpdatePofLighting(CCmdUI* pCmdUI)
552 pCmdUI->SetCheck( m_dolighting );
555 void CPofViewView::OnPofPivots()
557 m_show_pivots = !m_show_pivots;
561 void CPofViewView::OnUpdatePofPivots(CCmdUI* pCmdUI)
563 pCmdUI->SetCheck( m_show_pivots );
566 void CPofViewView::OnDetail1()
568 m_current_detail_level = 1;
571 void CPofViewView::OnUpdateDetail1(CCmdUI* pCmdUI)
573 CPofViewDoc* pDoc = GetDocument();
574 if ( pDoc->m_model_num > -1 ) {
575 polymodel * pm = model_get(pDoc->m_model_num);
576 if ( (pm->n_detail_levels >= 1) && (m_current_detail_level!=1) )
577 pCmdUI->Enable(TRUE);
579 pCmdUI->Enable(FALSE);
583 void CPofViewView::OnDetail2()
585 m_current_detail_level = 2;
588 void CPofViewView::OnUpdateDetail2(CCmdUI* pCmdUI)
590 CPofViewDoc* pDoc = GetDocument();
591 if ( pDoc->m_model_num > -1 ) {
592 polymodel * pm = model_get(pDoc->m_model_num);
593 if ( (pm->n_detail_levels >= 2) && (m_current_detail_level!=2) )
594 pCmdUI->Enable(TRUE);
596 pCmdUI->Enable(FALSE);
600 void CPofViewView::OnDetail3()
602 m_current_detail_level = 3;
605 void CPofViewView::OnUpdateDetail3(CCmdUI* pCmdUI)
607 CPofViewDoc* pDoc = GetDocument();
608 if ( pDoc->m_model_num > -1 ) {
609 polymodel * pm = model_get(pDoc->m_model_num);
610 if ( (pm->n_detail_levels >= 3) && (m_current_detail_level!=3) )
611 pCmdUI->Enable(TRUE);
613 pCmdUI->Enable(FALSE);
617 void CPofViewView::OnDetail4()
619 m_current_detail_level = 4;
622 void CPofViewView::OnUpdateDetail4(CCmdUI* pCmdUI)
624 CPofViewDoc* pDoc = GetDocument();
625 if ( pDoc->m_model_num > -1 ) {
626 polymodel * pm = model_get(pDoc->m_model_num);
627 if ( (pm->n_detail_levels >= 4) && (m_current_detail_level!=4) )
628 pCmdUI->Enable(TRUE);
630 pCmdUI->Enable(FALSE);
634 void CPofViewView::OnDetail5()
636 m_current_detail_level = 5;
639 void CPofViewView::OnUpdateDetail5(CCmdUI* pCmdUI)
641 CPofViewDoc* pDoc = GetDocument();
642 if ( pDoc->m_model_num > -1 ) {
643 polymodel * pm = model_get(pDoc->m_model_num);
644 if ( (pm->n_detail_levels >= 5) && (m_current_detail_level!=5) )
645 pCmdUI->Enable(TRUE);
647 pCmdUI->Enable(FALSE);
653 void CPofViewView::OnDetail6()
655 m_current_detail_level = 6;
658 void CPofViewView::OnUpdateDetail6(CCmdUI* pCmdUI)
660 CPofViewDoc* pDoc = GetDocument();
661 if ( pDoc->m_model_num > -1 ) {
662 polymodel * pm = model_get(pDoc->m_model_num);
663 if ( (pm->n_detail_levels >= 6) && (m_current_detail_level!=6) )
664 pCmdUI->Enable(TRUE);
666 pCmdUI->Enable(FALSE);
670 void CPofViewView::OnInitialUpdate()
672 CView::OnInitialUpdate();
674 // TODO: Add your specialized code here and/or call the base class
678 void CPofViewView::OnShowTree()
680 // TODO: Add your command handler code here
681 CPofViewDoc* pDoc = GetDocument();
682 if ( pDoc->m_model_num > -1 ) {
683 m_TreeDialog.MyCreate(this);
688 void CPofViewView::OnUpdateShowTree(CCmdUI* pCmdUI)
690 // TODO: Add your command update UI handler code here
694 void CPofViewView::OnPofPaths()
696 m_show_paths = !m_show_paths;
699 void CPofViewView::OnUpdatePofPaths(CCmdUI* pCmdUI)
701 pCmdUI->SetCheck( m_show_paths );
704 void CPofViewView::OnPofRadius()
706 m_show_radius = !m_show_radius;
710 void CPofViewView::OnUpdatePofRadius(CCmdUI* pCmdUI)
712 pCmdUI->SetCheck( m_show_radius );
715 void CPofViewView::OnPofOverwrite()
717 m_show_overwrite = !m_show_overwrite;
721 void CPofViewView::OnUpdatePofOverwrite(CCmdUI* pCmdUI)
723 pCmdUI->Enable(TRUE);
724 pCmdUI->SetCheck( m_show_destroyed_subobjects );
727 void CPofViewView::OnShowDamagedSubobjects()
729 m_show_destroyed_subobjects = !m_show_destroyed_subobjects;
732 void CPofViewView::OnUpdateShowDamagedSubobjects(CCmdUI* pCmdUI)
734 // TODO: Add your command update UI handler code here
738 void CPofViewView::OnShowDebris()
740 m_current_detail_level = 0;
743 void CPofViewView::OnUpdateShowDebris(CCmdUI* pCmdUI)
745 CPofViewDoc* pDoc = GetDocument();
746 if ( pDoc->m_model_num > -1 ) {
747 polymodel * pm = model_get(pDoc->m_model_num);
748 if ( (pm->num_debris_objects >= 1) && (m_current_detail_level!=0) )
749 pCmdUI->Enable(TRUE);
751 pCmdUI->Enable(FALSE);
755 void CPofViewView::OnMouseMove(UINT nFlags, CPoint point)
757 if (m_mouse_inited) {
758 m_mouse_dx = point.x - m_mouse_x;
759 m_mouse_dy = point.y - m_mouse_y;
767 CView::OnMouseMove(nFlags, point);
770 void CPofViewView::OnLButtonDown(UINT nFlags, CPoint point)
774 CView::OnLButtonDown(nFlags, point);
777 void CPofViewView::OnLButtonUp(UINT nFlags, CPoint point)
781 CView::OnLButtonUp(nFlags, point);
784 void CPofViewView::OnPofSmoothing()
786 m_smoothing = !m_smoothing;
789 void CPofViewView::OnUpdatePofSmoothing(CCmdUI* pCmdUI)
791 pCmdUI->SetCheck( m_smoothing );
794 void CPofViewView::OnPofTexturing()
796 m_texturing = !m_texturing;
799 void CPofViewView::OnUpdatePofTexturing(CCmdUI* pCmdUI)
801 pCmdUI->SetCheck( m_texturing );
804 void CPofViewView::OnPofShields()
806 m_show_shields = !m_show_shields;
809 void CPofViewView::OnUpdatePofShields(CCmdUI* pCmdUI)
811 pCmdUI->SetCheck( m_show_shields );
814 void CPofViewView::OnToggleLighting()
816 m_lights_on = !m_lights_on;
819 void CPofViewView::OnUpdateToggleLighting(CCmdUI* pCmdUI)
821 pCmdUI->SetCheck( m_lights_on );
825 void CPofViewView::OnInvisiblefaces()
827 m_show_invisible_faces = !m_show_invisible_faces;
830 void CPofViewView::OnUpdateInvisiblefaces(CCmdUI* pCmdUI)
832 pCmdUI->SetCheck( m_show_invisible_faces );
835 void CPofViewView::OnBayPaths()
837 m_show_bay_paths = !m_show_bay_paths;
840 void CPofViewView::OnUpdateBayPaths(CCmdUI* pCmdUI)
842 pCmdUI->SetCheck( m_show_bay_paths );
845 void CPofViewView::OnAutocenter()
847 m_autocenter = !m_autocenter;
850 void CPofViewView::OnUpdateAutocenter(CCmdUI* pCmdUI)
852 pCmdUI->SetCheck( m_autocenter );
855 void CPofViewView::OnSize(UINT nType, int cx, int cy)
857 CView::OnSize(nType, cx, cy);
859 if ((cx > 0) && (cy > 0)) {
860 gr_init(GR_640, GR_SOFTWARE, 8, cx, cy);