CAD System Web Site - Computer Aided Design Software
i NET1000.COM
by Makoto Honda
Last Update: 2010-September-10                   Update Info     Site Index     Licensing     Copyright Notice     Privacy Policy     Contact Us  

 


 
System Architecture

 DLL Hierarchy
 Element Classes
 FM Programming
 Temp Elements
 Current Plane
 Rendering
 Undo/Redo
 OpenGL Display List


 
HOME  

                                   
Scene Rendering
Computer-Aided Design Software
(CAD System)



 

Description

The entire scene in the graphical viewport is rendered by OpenGL.
 

CGView::DrawMyScene

I. Projection + Lighting + HLR

Draw All Elements

II. Projection + No lighting + HLR

Draw Current Plane

III. No HLR

Draw Rubberband 3d

IV. No projection + No lighting

Draw Visual Cue FM Frame One Vpt();
Draw Zoom Box
Draw Group Box
Draw Rubberband 2d
 

 

void CGView::DrawMyScene()
{
CGDoc* pDoc = GetDocument();

glMatrixMode ( GL_MODELVIEW ); // should be GL_MODELVIEW 97-4-25 NO!
glLoadIdentity ();

// Shading mode
if (m_shadeMode == DM_SMOOTH) glShadeModel ( GL_SMOOTH );
else glShadeModel ( GL_FLAT );

glEnable ( GL_DEPTH_TEST );
glClearColor (m_backgdR, m_backgdG, m_backgdB, 1.0f); // set background color

glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

// < I > --- Projection + Lighting
glColor3f (0.0f, 1.0f, 0.0f);
DrawAllElems();
glLoadIdentity(); // Must clear ModelView matrix

///////////////////////////////////////////////////////////// PUSH 1
glPushAttrib ( GL_ALL_ATTRIB_BITS );
glDisable ( GL_LIGHTING ); // to draw flat lines 96-5-8
// glDisable ( GL_DEPTH_TEST ); // for zoom box 2000-8-20
///////////////////////////////////////////////////////////// PUSH 1
//glColorMaterial (GL_FRONT, GL_AMBIENT_AND_DIFFUSE );
//glEnable ( GL_COLOR_MATERIAL );

// < II > --- Projection + No lighting
glCallList ( DL_AXIS ); // DrawAxes ( 5.0f );
// glCallList ( DL_CAGE ); // DrawCagee ( 1.5f );
DrawCurPlane (); // DrawVptCurPlane ();
// DrawRotator (); // DrawRotator ();

// pDoc->DrawCfdGrids(); // 2009-10-09 qaz

/** 2000-12-9
DrawLightSource ();
**/

// Temporary Displays....
// 11-15-97 pDoc->DrawVisCuePolygonMaking ();
//// pDoc->DrawVisCueTempElem3D ();
///////////////////////////////////////////////////////////// after CurPlane
glDisable ( GL_DEPTH_TEST ); // for zoom box 2000-8-20
/////////////////////////////////////////////////////////////

m_pData->DrawRubberBand3d ();
m_pData->DrawAllTempElems();

/////////////////////////////////////////// PUSH 2
glMatrixMode (GL_PROJECTION );
glPushMatrix();
glLoadIdentity();
/////////////////////////////////////////// PUSH 2

// < III > --- No projection + No lighting
DrawVisCueFkFrameOneVpt();
DrawZoomBox();
DrawGroupBox();
m_pData->DrawRubberBand2d ();

//////////////////////////////////////////// POP 2
glMatrixMode (GL_PROJECTION );
glPopMatrix ();
glMatrixMode (GL_MODELVIEW ); // added for consistency 97-4-26
//////////////////////////////////////////// POP 2

/////////////////////////////////////////////////////////////
glEnable ( GL_DEPTH_TEST ); // for zoom box 2000-8-20
/////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////// POP 1
glEnable ( GL_LIGHTING );
// glEnable ( GL_DEPTH_TEST ); // for zoom box 2000-8-20
glPopAttrib ();
///////////////////////////////////////////////////////////// POP 1

// glFlush(); // not needed if double buffer
}
 

CAD System Web Site - Computer Aided Design Software:  Copyright 2010-2013 Makoto Honda. All Rights Reserved.  

Copyright 2010-2013 Makoto Honda. All Rights Reserved.                                       www.iNET1000.com