void ofApp::setup(){
    ofEnableDataPath();

    setupConstants();

    setupGlobals();

    setupGL();

    setupGraph(forward_graph, forward_graph_path);

    setupParameters();

    cout<<params<<endl;

    forward_graph->initFbos();

    setupAudio();

    // if(use_camera){
    //     camera.setVerbose(true);
    //     camera.listDevices();
    //     camera.initGrabber(render_width, render_height);
    // }

    cout<<"setup complete"<<endl;
}
Esempio n. 2
0
static void QoSSetup(webs_t wp, char_t *path, char_t *query)
{
	char *submitUrl;

	char_t *QoS_type = websGetVar(wp, T("QoSSelect"), T("0"));
	if (QoS_type == NULL)
		QoS_type = "0";

	char_t *simpleqos = websGetVar(wp, T("simple_qos"), T("0"));
	if (strcmp(simpleqos, "on") != 0)
		simpleqos = "off";
	simpleqos = (strcmp(simpleqos, "on") == 0) ? "1" : "0";

	nvram_init(RT2860_NVRAM);
	nvram_bufset(RT2860_NVRAM, "QoSEnable", QoS_type);
	nvram_bufset(RT2860_NVRAM, "simple_qos", simpleqos);

	if (CHK_IF_DIGIT(QoS_type, 2))
		setupParameters(wp, QoS_args, 0);

	nvram_close(RT2860_NVRAM);
	doSystem("service shaper restart && service iptables restart && service kext restart");

	submitUrl = websGetVar(wp, T("submit-url"), T(""));   // hidden page
#ifdef PRINT_DEBUG
	if (!submitUrl || !submitUrl[0])
		websDone(wp, 200);
	else
#endif
		websRedirect(wp, submitUrl);
}
void itkDataSHImageVtkViewInteractor::setInputData(medAbstractData *data)
{
    medAbstractInteractor::setInputData(data);

    if (!data || !data->data())
        return;

    //  Two itk SH image formats are supported
    //  we need to convert them to vtkStructuredPoints so it's understood by the SH manager

    const QString& identifier = data->identifier();
    if (identifier=="itkDataSHImageFloat3")
        d->setVTKFilter<itk::VectorImage<float,3> >(data,d->filterFloat);
    else if (identifier=="itkDataSHImageDouble3")
        d->setVTKFilter<itk::VectorImage<double,3> >(data,d->filterDouble);
    else
    {
        dtkDebug() << "Unrecognized SH data type: " << identifier;
        return;
    }

    d->actorProperty = itkDataSHImageVtkViewInteractorPrivate::PropertySmartPointer::New();
    d->manager->GetSHVisuManagerAxial()->GetActor()->SetProperty( d->actorProperty );
    d->manager->GetSHVisuManagerSagittal()->GetActor()->SetProperty( d->actorProperty );
    d->manager->GetSHVisuManagerCoronal()->GetActor()->SetProperty( d->actorProperty );

    setupParameters();
}
void itkDataSHImageVtkViewInteractor::setData(medAbstractData *data)
{
    medAbstractInteractor::setData(data);

    if (!data || !data->data())
        return;

    //  Two itk SH image formats are supported
    //  we need to convert them to vtkStructuredPoints so it's understood by the SH manager

    const QString& identifier = data->identifier();
    if (identifier=="itkDataSHImageFloat3")
        d->setVTKFilter<itk::VectorImage<float,3> >(data,d->filterFloat);
    else if (identifier=="itkDataSHImageDouble3")
        d->setVTKFilter<itk::VectorImage<double,3> >(data,d->filterDouble);
    else
    {
        qDebug() << "Unrecognized SH data type: " << identifier;
        return;
    }

    int dim[3];
    d->manager->GetSphericalHarmonicDimensions(dim);
    d->view2d->SetInput(d->manager->GetSHVisuManagerAxial()->GetActor(), d->view->layer(d->data), dim);
    d->view2d->SetInput(d->manager->GetSHVisuManagerSagittal()->GetActor(), d->view->layer(d->data), dim);
    d->view2d->SetInput(d->manager->GetSHVisuManagerCoronal()->GetActor(), d->view->layer(d->data), dim);

    setupParameters();
}
GuiScanningDialog::GuiScanningDialog(GuiContainer* owner, string id)
: GuiElement(owner, id)
{
    locked = false;
    lock_start_time = 0;
    scan_depth = 0;

    setSize(GuiElement::GuiSizeMax, GuiElement::GuiSizeMax);
    
    box = new GuiPanel(this, id + "_BOX");
    box->setSize(500, 545)->setPosition(0, 0, ACenter);
    
    signal_label = new GuiLabel(box, id + "_LABEL", "Electric signature", 30);
    signal_label->addBackground()->setPosition(0, 20, ATopCenter)->setSize(450, 50);
    
    signal_quality = new GuiSignalQualityIndicator(box, id + "_SIGNAL");
    signal_quality->setPosition(0, 80, ATopCenter)->setSize(450, 100);
    
    locked_label = new GuiLabel(signal_quality, id + "_LOCK_LABEL", "LOCKED", 50);
    locked_label->setSize(GuiElement::GuiSizeMax, GuiElement::GuiSizeMax);
    
    for(int n=0; n<max_sliders; n++)
    {
        sliders[n] = new GuiSlider(box, id + "_SLIDER_" + string(n), 0.0, 1.0, 0.0, nullptr);
        sliders[n]->setPosition(0, 200 + n * 70, ATopCenter)->setSize(450, 50);
    }
    cancel_button = new GuiButton(box, id + "_CANCEL", "Cancel", []() {
        if (my_spaceship)
            my_spaceship->commandScanCancel();
    });
    cancel_button->setPosition(0, -20, ABottomCenter)->setSize(300, 50);

    setupParameters();
}
Esempio n. 6
0
int main (int argc, char *argv[]) 
{
    if (!preprocessCommands(&argc, argv, NULL, NULL)) {
    	xexit(0); 
	}

    printf("Resource Reading...\n");
    ResourceSource* res = setupParameters(true, &argc, argv);

    ConstData constData(*res);
    Intervals intervals(*res);
    BeamParams beamParams(*res);

    FILE* massOut = openOutDataFile(*res, "mass_out");
    FILE* crossSectionOut = openOutDataFile(*res, "total_cross_section_out");
    printFileHeaders(massOut, crossSectionOut);

    printf("Main loop...\n");
    DataSeparator massSeparator(massOut), csSeparator(crossSectionOut);
    loopMassMuTan(constData, intervals, beamParams, massSeparator, csSeparator,
                  massOut, crossSectionOut);
    printf("Resource releasing...\n");

    fclose(crossSectionOut);
    fclose(massOut);

    delete res;

    printf("Done...\n");
    xexit(0);

}
Esempio n. 7
0
//==============================================================================
BeatboxVoxAudioProcessor::BeatboxVoxAudioProcessor()
	: processorState(*this, nullptr),
	  classifier(480, 48000, 3, 10)
{
	usingOSDTestSound.store(false);

	setupParameters();
	initialiseSynth();
}
//-----------------------------------------------------------------------------
tresult PLUGIN_API PluginController::initialize (FUnknown* context)
{
	tresult result = EditController::initialize (context);
	if (result == kResultTrue)
	{
		// will be defined in plugin.cpp
		setupParameters();
	}
	return kResultTrue;
}
Esempio n. 9
0
int
pcl::modeler::AbstractWorker::exec()
{
  for (auto &cloud_mesh_item : cloud_mesh_items_)
    initParameters(cloud_mesh_item);

  setupParameters();

  return (parameter_dialog_->exec());
}
Esempio n. 10
0
int
pcl::modeler::AbstractWorker::exec()
{
  for (size_t i = 0, i_end = cloud_actors_.size(); i < i_end; ++ i)
    initParameters(cloud_actors_[i]->getCloud());

  setupParameters();

  return (parameter_dialog_->exec());
}
Esempio n. 11
0
 myPlugin(axContext* aContext)
 : axFormat(aContext, pf_None/*HasEditor*/)
   {
     m_Gain = 0;
     describe("test_buttons","ccernn","axonlib example",0,AX_MAGIC+0x0000);
     setupAudio(2,2,false);
     setupEditor(320,240);
     appendParameter( p_Gain = new axParameter(this,"gain","") );
     setupParameters();
   }
Esempio n. 12
0
int
pcl::modeler::AbstractWorker::exec()
{
  for (QList<CloudMeshItem*>::iterator cloud_mesh_items_it = cloud_mesh_items_.begin();
    cloud_mesh_items_it != cloud_mesh_items_.end();
    ++ cloud_mesh_items_it)
    initParameters(*cloud_mesh_items_it);

  setupParameters();

  return (parameter_dialog_->exec());
}
Esempio n. 13
0
 myInstance(axBase* aBase) : AX_INSTANCE(aBase)
   {
     //describe("fx_distortion","ccernn","axonlib example",2,AX_MAGIC+0x1003);
     //setupAudio(2,2,false);
     appendParameter( p_Type = new parInteger( this,"type",      "", 0, 0,5, str_type) );
     appendParameter( p_Thr  = new parFloatPow(this,"threshold", "", 1, 0,1,0, 3 ) );
     appendParameter( p_Pre  = new parFloatPow(this,"pre gain",  "", 1, 1,2,0, 3 ) );
     appendParameter( p_Post = new parFloatPow(this,"post gain", "", 1, 0,2,0, 3 ) );
     appendParameter( p_Flt  = new parFloatPow(this,"filter",    "", 1, 0,1,0, 3 ) );
     appendParameter( p_Vol  = new parFloatPow(this,"volume",    "", 1, 0,1,0, 3 ) );
     setupParameters();
   }
Esempio n. 14
0
//--------------------------------------------------------------
void ofRender::setup(){
    
    
    setupParameters();
    
    // Display settings -------------------------------------------
    ofSetVerticalSync(true);
	ofSetFrameRate(60);
    ofEnableAlphaBlending();
    
    ofSetBackgroundAuto(true);
    
    ofSetWindowShape(m_slWidthDisplay, m_slHeightDisplay);
    
    // PARTICLES WORLD Setup
    m_oPartWorld.setup(m_oColorSet);
    // Ajout des forces --------------------------------------------------------
    //m_aAttractors.push_back(ofxAttractor(m_oPartWorld, ofPoint(0.5*ofGetWidth(), 0.6*ofGetHeight())));
    // Top Horizontal
    m_aAttractors["top"] = ofxAttractor(m_oPartWorld, ofPoint(0,0), ofPoint(ofGetWidth(), 0));
    // Bottom Horizontal
    m_aAttractors["bottom"] = ofxAttractor(m_oPartWorld, ofPoint(0,ofGetHeight()), ofPoint(ofGetWidth(), ofGetHeight()));
    // Right Horizontal
    m_aAttractors["right"] = ofxAttractor(m_oPartWorld, ofPoint(ofGetWidth(),0), ofPoint(ofGetWidth(), ofGetHeight()));
    // Left Horizontal
    m_aAttractors["left"] = ofxAttractor(m_oPartWorld, ofPoint(0,0), ofPoint(0, ofGetHeight()));
    
    // SPREADS Motifs --------------------------------------------------------------
    m_oSpreads.setup("XML/SpreadsSettings.xml");
    m_oSpreads.set_refColorSet(m_oColorSet);
    // Load all Drawings files -------------------------------------------------------------
    m_oSpreads.loadSVGDirectory("drawings", m_oPartWorld, m_oColorSet);
    m_oSpreads.loadDrawingDirectory("drawings", m_oPartWorld, m_oColorSet);
    m_nameSpreads = m_oSpreads.lastSpreadFamily();
    
    // MSA -----------------------
    //m_MSA.set_refColorSet(m_oColorSet);
    //m_MSA.setup();
    
    // SYPHON ------------------------
    m_oTexSyphon.allocate(m_slWidthDisplay, m_slWidthDisplay, GL_RGB);
    m_oSyphonServer.setName("Spread_Display");
    
    // ARDUINO ------------------------
    m_oArduinoServer.setup();
    
    // SPIRALO ------------------------
    m_oSpiralo.setup(m_oColorSet);
    
    m_oStrips.setup(m_oColorSet);
	
}
void GuiScanningDialog::onDraw(sf::RenderTarget& window)
{
    updateSignal();
    
    if (my_spaceship)
    {
        if (my_spaceship->scanning_delay > 0.0 && my_spaceship->scanning_complexity > 0)
        {
            if (!box->isVisible())
            {
                box->show();
                scan_depth = 0;
                setupParameters();
            }
            
            if (locked && engine->getElapsedTime() - lock_start_time > lock_delay)
            {
                scan_depth += 1;
                if (scan_depth >= my_spaceship->scanning_depth)
                {
                    my_spaceship->commandScanDone();
                    lock_start_time = engine->getElapsedTime() - 1.0f;
                }else{
                    setupParameters();
                }
            }
            
            if (locked && engine->getElapsedTime() - lock_start_time > lock_delay / 2.0f)
            {
                locked_label->show();
            }else{
                locked_label->hide();
            }
        }else{
            box->hide();
        }
    }
}
Esempio n. 16
0
 void ParameterOperator::initialize()
 {
     OperatorKernel::initialize(setupInputs(), setupOutputs(), setupParameters());
     
     m_matrixParam.resize(3, 4, stromx::runtime::Matrix::FLOAT_32);
     for (unsigned int i = 0; i < m_matrixParam.rows(); ++i)
         for (unsigned int j = 0; j < m_matrixParam.cols(); ++j)
             m_matrixParam.at<float>(i, j) = float(i + j);
         
     m_intMatrixParam.resize(1, 2, stromx::runtime::Matrix::UINT_32);
     for (unsigned int i = 0; i < m_intMatrixParam.rows(); ++i)
         for (unsigned int j = 0; j < m_intMatrixParam.cols(); ++j)
             m_intMatrixParam.at<uint32_t>(i, j) = i + j;
 }
void SeedSearcherMain::CmdLineParameters::setup (const Str& seq, const Str& wgt)
{
   this->_seqFilename = seq;
   this->_wgtFilename = wgt;

   //
   //
   _prepType = _parser.__prep;
   _useSpecialization = _parser.__proj_spec;
   _useReverse = _parser.__count_reverse;


   //
   //
   setupParameters ();

   //
   //
   setupLangauge ();

   //
   // create random projections
   setupProjections ();

   //
   // setup the db
   setupDB ();

   //
   // create the weight function
   setupWeightFunction ();

   //
   // create the preprocessor
   setupPreprocessor ();

   //
   // create the hyper-geometric scoring scheme
   setupScoreFunc ();

   //
   // keep only the best features
   // TODO: what should we do when _parser.__seed_r
   // is too large for the length of seed?
   setupFeatureContainer ();

   //
   // TODO: HACK HERE!!!
   (boost::polymorphic_downcast<ACGTLangauge*> (_langauge.get ()))->includeN (false);
}
Esempio n. 18
0
audioStreamer *create_audioStreamer_PortAudio(const char *hostAPI,
        const char *inputDevice, const char *outputDevice, SPLPROC proc)
{
    PaStreamParameters inputParams, outputParams;
    if (!setupParameters(hostAPI, inputDevice, outputDevice,
                         &inputParams, &outputParams)) {
        return NULL;
    }

    PortAudioStreamer *streamer = new PortAudioStreamer(proc);
    if (!streamer->Start(&inputParams, &outputParams)) {
        delete streamer;
        return NULL;
    }
    return streamer;
}
void linearRegressionExample()
{
    // Load data into input/reference matrices
    //  divide into training set/validation set
    auto inputData     = loadInputData();
    auto referenceData = loadReferenceData();

    size_t inputCount   = inputData.size()[0];
    size_t inputSamples = inputData.size()[1];

    size_t trainingSamples   = 400;
    //size_t validationSamples = inputSamples - trainingSamples;

    auto trainingData      = slice(inputData,     {0, 0}, {inputCount, trainingSamples});
    auto trainingReference = slice(referenceData, {0, 0}, {1,          trainingSamples});

    auto validationData      = slice(inputData,     {0, trainingSamples}, {inputCount, inputSamples});
    auto validationReference = slice(referenceData, {0, trainingSamples}, {1,          inputSamples});

    setupParameters();

    // Create the network
    network::NeuralNetwork simpleNetwork;

    simpleNetwork.addLayer(std::make_unique<network::FeedForwardLayer>(inputCount, 1, matrix::DoublePrecision()));
    simpleNetwork.back()->setActivationFunction(network::ActivationFunctionFactory::create("NullActivationFunction"));
    simpleNetwork.setCostFunction(network::CostFunctionFactory::create("SumOfSquaresCostFunction"));
    simpleNetwork.initialize();

    // Train it
    simpleNetwork.train(trainingData, trainingReference);

    // Evaluate it on test set
    //auto trainingPredictions = simpleNetwork.runInputs(trainingData);

    //compare(trainingPredictions, trainingReference);

    // Evaluate it on validation set
    auto predictions = simpleNetwork.runInputs(validationData);

    compare(predictions, validationReference);

   //for(size_t sample = 0; sample < validationSamples; ++ sample)
    //{
    //    std::cout << sample << ", " << predictions(0, sample) << ", " << validationReference(0, sample) << "\n";
    //}
}
void vtkDataMeshInteractor::setData(medAbstractData *data)
{
    medAbstractInteractor::setData(data);

    if(data->identifier() == "vtkDataMesh4D" || data->identifier() == "vtkDataMesh")
    {
        vtkMetaDataSet * mesh = dynamic_cast<vtkMetaDataSet*>((vtkDataObject *)(data->data()));

        d->metaDataSet = mesh;
        d->lut = LutPair(NULL, "Default");

        updatePipeline();

        setupParameters();
    }

    qDebug() << d->metaDataSet->GetType();
}
Esempio n. 21
0
// .cpp stuff
GridAssembler::GridAssembler() : rosNode("~"), combined_grid(new nav_msgs::OccupancyGrid())
{
  // Parameters
  setupParameters();
  
  // Topics
  inMapSubscriber = rosNode.subscribe(inMapSubscriberTopic, 100, &GridAssembler::onGridMsg, this);
  outMapPublisher = rosNode.advertise<nav_msgs::OccupancyGrid>(outMapPublisherTopic, 10);
  dMapPublisher1 = rosNode.advertise<nav_msgs::OccupancyGrid>("/fmKnowledge/map_difference", 10);

  // Init data
  mapInitialized = false;

  // Dynamic reconfigure
  dynamic_reconfigure::Server<occupancy_grid_assembler::MyStuffConfig> configserver;
  dynamic_reconfigure::Server<occupancy_grid_assembler::MyStuffConfig>::CallbackType f;
  f = boost::bind(&GridAssembler::configcallback, this, _1, _2);
  configserver.setCallback(f);
}
ofxBaseShaderNode::ofxBaseShaderNode(ofxFboAllocator *a, ofFbo::Settings s, string n, ofShader * sh){
    allocator = a;
    settings = s;
    shader = sh;
    num_dependents = 0;
    node_count++;
    output = NULL;
    hasSizeParameter = false;

    if(n==""){
        char temp[100];
        snprintf(temp, 100, "node%04d", node_count);
        name = string(temp);
    }
    else
        name = n;

    if(shader)
        setupParameters();
}
void SeedSearcherMain::CmdLineParameters::secondarySetup (const Parser& inParser)
{
   _parser= inParser;

   //
   //
   setupParameters ();

   //
   // create random projections
   setupProjections ();

   //
   // create the weight function
   setupWeightFunction ();

   //
   // create the hyper-geometric scoring scheme
   setupScoreFunc ();
}
Esempio n. 24
0
void pointCloudStitcher::setup(){
    // zero the tilt on startup
    angle = -30;
    hasNewFrame = false; 
    for(int i=0; i<amt; ++i){
        kinect[i].setRegistration(true);
        kinect[i].init(false, true);
        kinect[i].open();
        kinect[i].setCameraTiltAngle(angle);
        
        grayImage[i].allocate(kinect[0].width, kinect[0].height);
    }
    width = kinect[0].width;
    height = kinect[0].height;
    patchedImageCv.allocate(kinect[0].width, kinect[0].height);
    
    // start from the front
    bDrawPointCloud = false;
    setupParameters();
}
Esempio n. 25
0
void mgsCooperSymbols::setup() {
  setAuthor("Michael Simpson");
  setOriginalArtist("Muriel Cooper");
  // - 'A Primer Of Visual Literacy' Book Cover - 1973
  setupParameters();
  ofSetCircleResolution(100);
  loadCode("scenes/mgsCooperSymbols/exampleCode.cpp");
  
  cursorColor = ofColor(0,0,255,1);
  clearColor = ofColor(0,0,0,255);
  symbolColor = ofColor(255,255,255,255);
  gw = dimensions.width/gridSize;
  gh = dimensions.height/gridSize;
  bNeedsRedraw = bNeedRedrawFullScene = true;
  frame.allocate(dimensions.width, dimensions.height);
  frame.begin();
  ofClear(0);
  frame.end();
  drawFullScene();
  drawScene();
}
Esempio n. 26
0
 void Bitwise_and::initialize()
 {
     runtime::OperatorKernel::initialize(setupInputs(), setupOutputs(), setupParameters());
 }
Esempio n. 27
0
 void ReadDirectory::initialize()
 {
     OperatorKernel::initialize(setupInputs(), setupOutputs(), setupParameters());
 }
Esempio n. 28
0
void cylinder :: render(GemState *state)
{
  setupParameters();
  if(m_drawType==GL_DEFAULT_GEM)m_drawType=GL_FILL;

  GLdouble da, r, dr, dz;
  GLfloat x, y, z, nz;
  GLint i, j;
  /* coverity[dead_error_condition] we might want to play with orientation (FIXME) */
  GLboolean orientation = false; /* true=INSIDE */
  GLfloat nsign = (orientation)?-1.0:1.0;

  TexCoord*texCoords=NULL;
  int texType=0;
  int texNum=0;
  bool lighting=false;
  state->get(GemState::_GL_TEX_COORDS, texCoords);
  state->get(GemState::_GL_TEX_TYPE, texType);
  state->get(GemState::_GL_TEX_NUMCOORDS, texNum);
  state->get(GemState::_GL_LIGHTING, lighting);


  GLfloat xsize = 1.0, xsize0 = 0.0;
  GLfloat ysize = 1.0, ysize0 = 0.0;
  if(texType && texNum>=3){
    xsize0 = texCoords[0].s;
    xsize  = texCoords[1].s-xsize0;
    ysize0 = texCoords[1].t;
    ysize  = texCoords[2].t-ysize0;
  }

  glPushMatrix();
  glTranslatef(0.f, 0.f, -m_size);

  // gluCylinder(m_thing, m_size, m_size, m_size * 2, m_numSlices, m_numSlices);
  da = 2.0 * M_PI / slices;
  dr = (topRadius - baseRadius) / stacks;
  dz = height / stacks;
  nz = (baseRadius - topRadius) / height;	/* Z component of normal vectors */

  if (m_drawType == GL_POINT) {
    glBegin(GL_POINTS);
    for (i = 0; i < slices; i++) {
      x = cos(i * da);
      y = sin(i * da);
      normal3f(x * nsign, y * nsign, nz * nsign);

      z = 0.0;
      r = baseRadius;
      for (j = 0; j <= stacks; j++) {
        glVertex3f(x * r, y * r, z);
        z += dz;
        r += dr;
      }
    }
    glEnd();
  }
  else if (m_drawType == GL_LINE || m_drawType == GLU_SILHOUETTE) {
    /* Draw rings */
    if (m_drawType == GL_LINE) {
      z = 0.0;
      r = baseRadius;
      for (j = 0; j <= stacks; j++) {
        glBegin(GL_LINE_LOOP);
        for (i = 0; i < slices; i++) {
          x = cos(i * da);
          y = sin(i * da);
          normal3f(x * nsign, y * nsign, nz * nsign);
          glVertex3f(x * r, y * r, z);
        }
        glEnd();
        z += dz;
        r += dr;
      }
    }
    else {
      /* draw one ring at each end */
      if (baseRadius != 0.0) {
        glBegin(GL_LINE_LOOP);
        for (i = 0; i < slices; i++) {
          x = cos(i * da);
          y = sin(i * da);
          normal3f(x * nsign, y * nsign, nz * nsign);
          glVertex3f(x * baseRadius, y * baseRadius, 0.0);
        }
        glEnd();
        glBegin(GL_LINE_LOOP);
        for (i = 0; i < slices; i++) {
          x = cos(i * da);
          y = sin(i * da);
          normal3f(x * nsign, y * nsign, nz * nsign);
          glVertex3f(x * topRadius, y * topRadius, height);
        }
        glEnd();
      }
    }
    /* draw length lines */
    glBegin(GL_LINES);
    for (i = 0; i < slices; i++) {
      x = cos(i * da);
      y = sin(i * da);
      normal3f(x * nsign, y * nsign, nz * nsign);
      glVertex3f(x * baseRadius, y * baseRadius, 0.0);
      glVertex3f(x * topRadius, y * topRadius, height);
    }
    glEnd();
  }
  else if (m_drawType == GL_FILL) {
    GLfloat ds = 1.0 / slices;
    GLfloat dt = 1.0 / stacks;
    GLfloat t = 0.0;
    z = 0.0;
    r = baseRadius;
    for (j = 0; j < stacks; j++) {
      GLfloat s = 0.0;
      glBegin(GL_QUAD_STRIP);
      for (i = 0; i <= slices; i++) {
        GLfloat x, y;
        if (i == slices) {
          x = sin(0.0);
          y = cos(0.0);
        }
        else {
          x = sin(i * da);
          y = cos(i * da);
        }
	normal3f(x * nsign, y * nsign, nz * nsign);
	if(texType)glTexCoord2f(s*xsize+xsize0, t*ysize+ysize0);
	glVertex3f(x * r, y * r, z);
	normal3f(x * nsign, y * nsign, nz * nsign);
	if(texType)glTexCoord2f(s*xsize+xsize0, (t + dt)*ysize+ysize0);
	glVertex3f(x * (r + dr), y * (r + dr), z + dz);

	s += ds;
      }			/* for slices */
      glEnd();
      r += dr;
      t += dt;
      z += dz;
    }				/* for stacks */
  }
  glPopMatrix();
}
Esempio n. 29
0
 void PyrUp::initialize()
 {
     runtime::OperatorKernel::initialize(setupInputs(), setupOutputs(), setupParameters());
 }
Esempio n. 30
0
 void CornerMinEigenVal::initialize()
 {
     runtime::OperatorKernel::initialize(setupInputs(), setupOutputs(), setupParameters());
 }