Example #1
0
PyObject *_PY_fb2(PyObject *self, PyObject *args, PyObject *kwds)
   {int ok;
    PyObject *_lo;
    char _la1;
    char *_la2;
    int _rv;
    char *kw_list[] = {"a1", "a2", NULL};

/* local variable initializations */
    _la1       = '\0';
    _la2       = NULL;

    ok = PyArg_ParseTupleAndKeywords(args, kwds,
                                     "ss:fb2_p",
                                     kw_list,
                                     &_la1, &_la2);
    if (ok == FALSE)
       return(NULL);

    _rv = fb2(_la1, _la2);
    _lo = PY_build_object("fb2",
                          G_INT_I, 0, &_rv,
                          0);

    return(_lo);}
Example #2
0
StatusCode FileMgrTest::execute() {

  MsgStream log(msgSvc(), name());

  log << MSG::INFO << "writing to " << p_fileMgr->fname((void*)fp_2) << endmsg;

  std::ofstream ofs;
  __gnu_cxx::stdio_filebuf<char> fb(fp_2, std::ios::out);

  ofs.std::ios::rdbuf(&fb);
  ofs << "Hello World!" << std::endl;


  log << MSG::INFO << "appending to " << p_fileMgr->fname((void*)fp_3) << endmsg;

  std::ofstream ofs2;
  __gnu_cxx::stdio_filebuf<char> fb2(fp_3, std::ios::out);

  ofs2.std::ios::rdbuf(&fb2);
  ofs2 << "Hello World!" << std::endl;



  return StatusCode::SUCCESS;

}
Example #3
0
void FF_ID(fb2_f, FB2_F)(int *a, int *b)
   {int _la;
    int _lb;
    
    _la        = (int) *a;
    _lb        = (int) *b;

    fb2(_la, _lb);

    return;}
Example #4
0
int main()
{
    // Create a sink for output
    std::shared_ptr<smlog::Sink> sink =
            std::make_shared<SinkToStdOut>();

    // Create the log
    smlog::Logger log;
    log.AddSink(sink);

    // Add some prefix tokens for each log message
    std::unique_ptr<smlog::FBCustomStr> fb0(
            new smlog::FBCustomStr("TRACE: LIBNAME: " ));

    std::unique_ptr<smlog::FBCustomStr> fb1(
            new smlog::FBCustomStr("DEBUG: LIBNAME: " ));

    std::unique_ptr<smlog::FBCustomStr> fb2(
            new smlog::FBCustomStr("INFO:  LIBNAME: " ));

    std::unique_ptr<smlog::FBCustomStr> fb3(
            new smlog::FBCustomStr("WARN:  LIBNAME: " ));

    std::unique_ptr<smlog::FBCustomStr> fb4(
            new smlog::FBCustomStr("ERROR: LIBNAME: " ));

    std::unique_ptr<smlog::FBCustomStr> fb5(
            new smlog::FBCustomStr("FATAL: LIBNAME: " ));

    log.AddFormatBlock(std::move(fb0),smlog::Logger::Level::TRACE);
    log.AddFormatBlock(std::move(fb1),smlog::Logger::Level::DEBUG);
    log.AddFormatBlock(std::move(fb2),smlog::Logger::Level::INFO);
    log.AddFormatBlock(std::move(fb3),smlog::Logger::Level::WARN);
    log.AddFormatBlock(std::move(fb4),smlog::Logger::Level::ERROR);
    log.AddFormatBlock(std::move(fb5),smlog::Logger::Level::FATAL);

    testLog(log);

    // Test setting / unsetting log levels. All levels
    // are initially enabled by default
    log.UnsetLevel(smlog::Logger::Level::TRACE);
    log.UnsetLevel(smlog::Logger::Level::DEBUG);
    log.UnsetLevel(smlog::Logger::Level::WARN);

    std::cout << std::endl;
    testLog(log);

    log.SetLevel(smlog::Logger::Level::DEBUG);
    std::cout << std::endl;
    testLog(log);

    return 0;
}
Example #5
0
FbScheme FbScheme::typeScheme() const
{
    QString typeName = type();
    if (typeName.isEmpty()) return *this;

    FbScheme child = fb2().firstChildElement("xs:schema").firstChildElement();
    while (!child.isNull()) {
        if (child.tagName() == "xs:complexType") {
            if (child.attribute("name") == typeName) return child.element(typeName);
        }
        child = child.nextSiblingElement();
    }

    return FbScheme();
}
Example #6
0
FbScheme FbScheme::element(const QString &name) const
{
    FbScheme parent = *this;
    if (parent.isNull()) {
        parent = fb2().documentElement();
        parent = parent.element("FictionBook");
    }

    FbScheme child = parent.item(name);
    if (!child.isNull()) return child;

    QString type = this->type();
    if (type.isEmpty()) return *this;

    child = fb2().firstChildElement("xs:schema").firstChildElement();
    while (!child.isNull()) {
        if (child.tagName() == "xs:complexType") {
            if (child.attribute("name") == type) return child.element(name);
        }
        child = child.nextSiblingElement();
    }

    return FbScheme();
}
int main()
{
  FooBar fb;
  FooBar fb2(fb);
  return 0;
}
Example #8
0
void player::draw(float x, float y, float z){
	glPushAttrib(GL_ALL_ATTRIB_BITS);
	float ambient=1;
	float diffuse=1;
	float specular=1;
	float emission=0;
	float shininess=50;
	GLfloat mat_ambient[]  = {ambient, ambient, ambient, 1.0f};         
        GLfloat mat_diffuse[]  = {diffuse, diffuse, diffuse, 1.0f};         
        GLfloat mat_specular[] = {specular, specular, specular, 1.0f};         
        GLfloat mat_emission[] = {emission, emission, emission, 1.0f};         
        GLfloat mat_shininess  = shininess;           
        glMaterialfv(GL_FRONT, GL_AMBIENT,   mat_ambient);         
        glMaterialfv(GL_FRONT, GL_DIFFUSE,   mat_diffuse);         
        glMaterialfv(GL_FRONT, GL_SPECULAR,  mat_specular);         
        glMaterialfv(GL_FRONT, GL_EMISSION,  mat_emission);         
        glMaterialf (GL_FRONT, GL_SHININESS, mat_shininess);

	glPushMatrix();
	glTranslatef(x, 0, 0);
	glTranslatef(0, y-1, 0);
	glTranslatef(0, 0, z-5);
	glRotatef(45,1,0,0);
	glEnable(GL_TEXTURE_2D);
	
  
    node back1(-0.25, 0.15, 0.25); 
    node back2(-.5, -.35, .25); 
    node back3(.5, -.35, .25); 
    node back4(.25, .15, .25); 
      
    node front1(-.25,.25,-.25); 
    node front2(.25, .25, -.25); 
    node front3(.25,-.25,-.25); 
    node front4(-.25, -.25, -.25); 
  
    node hexA1(0.05, .087, -0.25); 
    node hexA2(0.1, 0, -0.25); 
    node hexA3(0.05, -0.087, -0.25); 
    node hexA4(-0.05, -0.087, -0.25); 
    node hexA5(-0.1, 0, -0.25); 
    node hexA6(-0.05, 0.087, -0.25); 
  
    node hexB1(0.05, .087, -0.75); 
    node hexB2(0.1, 0, -0.75); 
    node hexB3(0.05, -0.087, -0.75); 
    node hexB4(-0.05, -0.087, -0.75); 
    node hexB5(-0.1, 0, -0.75); 
    node hexB6(-0.05, 0.087, -0.75); 
  
    node fa1(0.25, 0.087, -0.25); 
    node fa2(0.25, 0, -0.25); 
    node fa3(0.25, -0.087, -0.25); 
  
    node fb1(-0.25, 0.087, -0.25); 
    node fb2(-0.25, 0, -0.25); 
    node fb3(-0.25, -0.087, -0.25); 
  
    //backside 
	glBindTexture(GL_TEXTURE_2D, p_tex);
	glColor3f(.25, .30, 0.3);
	glBegin(GL_QUADS);
	
	glTexCoord2d(1, 1);
	glVertex3f(back1.x, back1.y, back1.z);
	glTexCoord2d(0, 1);
	glVertex3f(back2.x, back2.y, back2.z);
	glTexCoord2d(1, 0);
	glVertex3f(back3.x, back3.y, back3.z);
	glTexCoord2d(0, 0);
	glVertex3f(back4.x, back4.y, back4.z);
	glEnd();
	glDisable(GL_TEXTURE_2D);
	//frontside 
	glBegin(GL_QUADS);
	
	glColor3f(0.6, 0.1, 0); glVertex3f(front1.x, front1.y, front1.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(front2.x, front2.y, front2.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(fa1.x, fa1.y, fa1.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(fb1.x, fb1.y, fb1.z);

	glColor3f(0.6, 0.1, 0); glVertex3f(fa1.x, fa1.y, fa1.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(fa2.x, fa2.y, fa2.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(hexA2.x, hexA2.y, hexA2.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(hexA1.x, hexA1.y, hexA1.z);

	glColor3f(0.6, 0.1, 0); glVertex3f(fa2.x, fa2.y, fa2.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(fa3.x, fa3.y, fa3.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(hexA3.x, hexA3.y, hexA3.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(hexA2.x, hexA2.y, hexA2.z);

	glColor3f(0.6, 0.1, 0); glVertex3f(fa3.x, fa3.y, fa3.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(front3.x, front3.y, front3.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(front4.x, front4.y, front4.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(fb3.x, fb3.y, fb3.z);

	glColor3f(0.6, 0.1, 0); glVertex3f(hexA5.x, hexA5.y, hexA5.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(hexA4.x, hexA4.y, hexA4.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(fb3.x, fb3.y, fb3.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(fb2.x, fb2.y, fb2.z);

	glColor3f(0.6, 0.1, 0); glVertex3f(hexA5.x, hexA5.y, hexA5.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(fb2.x, fb2.y, fb2.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(fb1.x, fb1.y, fb1.z);
	glColor3f(0.6, 0.1, 0); glVertex3f(hexA6.x, hexA6.y, hexA6.z);
	glEnd();
	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D, p_tex1);
	//upside 
	glColor3f(.25, .30, 0.3);
	glBegin(GL_QUADS);
	//
	glTexCoord2d(1, 1);
	glVertex3f(back1.x, back1.y, back1.z);
	glTexCoord2d(0, 1);
	glVertex3f(back4.x, back4.y, back4.z);
	glTexCoord2d(1, 0);
	glVertex3f(front2.x, front2.y, front2.z);
	glTexCoord2d(0, 0);
	glVertex3f(front1.x, front1.y, front1.z);
	glEnd();
	glBindTexture(GL_TEXTURE_2D, p_tex);
	//leftside 
	glColor3f(.25, .30, 0.3);
	glBegin(GL_QUADS);
	//
	glTexCoord2d(1, 1);
	glVertex3f(back1.x, back1.y, back1.z);
	glTexCoord2d(0, 1);
	glVertex3f(front1.x, front1.y, front1.z);
	glTexCoord2d(1, 0);
	glVertex3f(front4.x, front4.y, front4.z);
	glTexCoord2d(0, 0);
	glVertex3f(back2.x, back2.y, back2.z);
	glEnd();
	glBindTexture(GL_TEXTURE_2D, p_tex);
	//rightside 
	glColor3f(.25, .30, 0.3);
	glBegin(GL_QUADS);
	//
	glTexCoord2d(1, 1);
	glVertex3f(back4.x, back4.y, back4.z);
	glTexCoord2d(0, 1);
	glVertex3f(back3.x, back3.y, back3.z);
	glTexCoord2d(1, 0);
	glVertex3f(front3.x, front3.y, front3.z);
	glTexCoord2d(0, 0);
	glVertex3f(front2.x, front2.y, front2.z);
	glEnd();
	glDisable(GL_TEXTURE_2D);
	//downside 
	glBegin(GL_QUADS);
	
	glColor3f(.25, .30, 0.3); glVertex3f(back3.x, back3.y, back3.z);
	glColor3f(.25, .30, 0.3); glVertex3f(back2.x, back2.y, back2.z);
	glColor3f(.25, .30, 0.3); glVertex3f(front4.x, front4.y, front4.z);
	glColor3f(.25, .30, 0.3); glVertex3f(front3.x, front3.y, front3.z);
	glEnd();
	//pipe 
	glBegin(GL_QUADS);
	
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexA1.x, hexA1.y, hexA1.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexA2.x, hexA2.y, hexA2.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexB2.x, hexB2.y, hexB2.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexB1.x, hexB1.y, hexB1.z);

	
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexB2.x, hexB2.y, hexB2.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexA2.x, hexA2.y, hexA2.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexA3.x, hexA3.y, hexA3.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexB3.x, hexB3.y, hexB3.z);

	
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexA3.x, hexA3.y, hexA3.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexA4.x, hexA4.y, hexA4.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexB4.x, hexB4.y, hexB4.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexB3.x, hexB3.y, hexB3.z);

	
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexA4.x, hexA4.y, hexA4.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexA5.x, hexA5.y, hexA5.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexB5.x, hexB5.y, hexB5.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexB4.x, hexB4.y, hexB4.z);

	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexA5.x, hexA5.y, hexA5.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexA6.x, hexA6.y, hexA6.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexB6.x, hexB6.y, hexB6.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexB5.x, hexB5.y, hexB5.z);

	
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexA6.x, hexA6.y, hexA6.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexA1.x, hexA1.y, hexA1.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexB1.x, hexB1.y, hexB1.z);
	glColor3f(0.2, 0.0, 0.0); glVertex3f(hexB6.x, hexB6.y, hexB6.z);

	glEnd();
	glTranslatef(0, 0.4, 0);
	glTranslatef(0, 0, -1);
	glBegin(GL_LINES);

	glColor3f(1, 0, 0); 
	glVertex3f(-0.25, 0, 0);
	glColor3f(1, 0, 0);
	glVertex3f(0.25, 0, 0);
	glColor3f(1, 0, 0);
	glVertex3f(0, 0.25, 0);
	glColor3f(1, 0, 0);
	glVertex3f(0, -0.25, 0);
	glEnd();
	
/*
	//glTranslatef(x, 0, 0);
	glTranslatef(0, 1, 0);
	glTranslatef(0, 0, 0);

	glBegin(GL_LINES);

	glColor3f(1, 0, 0); 
	glVertex3f(-0.5, 0, 0);
	glVertex3f(0.5, 0, 0);

	glVertex3f(0, 0.5, 0);
	glVertex3f(0, -0.5, 0);

	/*glEnable(GL_LINE_STIPPLE);  
    glLineStipple(1,0xAAAA);  
    glBegin(GL_LINES);  
         
    glVertex2f(0.0,0.0);  
    glVertex2f(0.0,0.5);  
    //glDisable(GL_LINE_STIPPLE);  
    glEnd();  
    glDisable(GL_LINE_STIPPLE);  
    glBegin(GL_LINE_LOOP);  
    //draw a circle with specific points.  
    int circle_points = 100;  
    float angle = 0;  
    int i = 0;  
      
    for(i = 0;i<circle_points;i++) {  
        // draw with yellow and black in turn.  
        if(i%2==0){  
          glColor3f(1.0,1.0,0.0);         
        }else{  
          glColor3f(0.0,0.0,0.0);  
        }  
        angle = 2*i*PI/circle_points;  
        //the cos and sin will occupy hole screen.  
        glVertex2f(0.5*cos(angle),0.5*sin(angle));      
    }  */
    //glEnd(); 
	


    glPopMatrix(); 
	glPopAttrib();
	 
	}