예제 #1
0
//--------------------------------------------------------------
void testApp::draw(){
    
    if(capture){
        string fName = "test" + ofToString(curStep) + ".ps";
        output.beginEPS(fName);
        output.noFill();
        output.setColor(0x000000);
    }
    ofBackground(255,255,255);
    ofNoFill();
    ofSetLineWidth(1.0);
    drawNetwork();
    drawCircle();
    
    if(capture){
        output.endEPS();
        capture = !capture;
    }
    
}
예제 #2
0
void
NetworkObject::draw(QGLViewer *viewer,
		    bool active,
		    float pnear, float pfar,
		    bool backToFront)
{
  if (!m_show)
    return;

  if (active)
    {
      Vec lineColor = Vec(0.7f, 0.3f, 0.0f);
      StaticFunctions::drawEnclosingCube(m_tenclosingBox, lineColor);
    }
  
  if (m_Vopacity < 0.05 && m_Eopacity < 0.05)
    return;

  glShadeModel(GL_SMOOTH);

  // emissive when active
  if (active)
    {
      float emiss[] = { 0.5f, 0, 0, 1.0f };
      glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, emiss);
    }
  else
    {
      float emiss[] = { 0, 0, 0, 1.0f };
      glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, emiss);
    }

  drawNetwork(pnear, pfar, backToFront);

  { // reset emissivity
    float emiss[] = { 0, 0, 0, 1.0f };
    glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, emiss);
  }
}