Ignore:
Timestamp:
02/26/14 11:19:05 (10 years ago)
Author:
mmichalski
Message:

Load NeuroClass? from f0def.xml and load correct xml from server

File:
1 edited

Legend:

Unmodified
Added
Removed
  • js/viewer-f0/js/graphicsEngine.js

    r134 r143  
    253253}
    254254
    255 GraphicsEngine.prototype.drawNeuron = function(){
    256     var scheme = [4,4,26,27,26,73,73,73,73,27,26,27,1,73,50,100,50,1,56,68,46,68,2,41,47,51,32,51,68];
    257     //pobieranie schematu
    258     //inne określenie położeń
    259 
    260 
    261     var obj = new THREE.Object3D();
    262 
    263     var material = new THREE.LineBasicMaterial({
    264         color: 0x0000ff
    265     });
    266     var position = 0;
    267     var noOfBlocks = 0;//number of "blocks" to draw
    268     var noOfLines = 0;//number of line to draw
    269     noOfBlocks = scheme[position++];
    270     for (var i = 0; i < noOfBlocks; i++)
    271     {
    272         noOfLines = scheme[position++];
    273 
    274         for (var j = 0; j < noOfLines; j++)
    275         {
    276             var geometry = new THREE.Geometry();
    277             geometry.vertices.push(new THREE.Vector3(scheme[position++], scheme[position++], 0));
    278             geometry.vertices.push(new THREE.Vector3(scheme[position++], scheme[position++], 0));
    279             position = position - 2; //get to last point in list
    280             var line = new THREE.Line(geometry, material);
    281             obj.add(line);
    282         }
    283         position = position + 2;//move to value which define number of lines to draw
    284     }
    285 
    286     obj.scale.set(0.1,0.1,0.1)
    287     this._scene.add(obj)
    288 }
    289 
    290 GraphicsEngine.prototype.drawConnection = function(connection, id, connestions, neurons){
    291 
    292     var destination = connection.getDestination();
    293     var numberOfConnToDest = 0;
    294     var numberOfDrawenCon = 0;
    295 
    296     //check how many conenctions have the same destination
    297     for(var i = 0; i < connestions.length; i++){
    298         if(connestions[i].getDestination() == destination)
    299             numberOfConnToDest++;
    300     }
    301 
    302     //check how many connections had been drawen
    303     for(var i = 0; i < id; i++){
    304         if(connestions[i].getDestination() == destination)
    305             numberOfDrawenCon++;
    306     }
    307 
    308     var positionY = (numberOfDrawenCon + 1) * 100 / (numberOfConnToDest + 1);
    309     var positionX = (numberOfDrawenCon + 1) * 10 / (numberOfConnToDest + 1);
    310 
    311     /*var x1 =
    312     var x2
    313     var y1
    314     var y2*/
    315 
    316 }
    317 
    318255GraphicsEngine.prototype.debugTest = function()
    319256{
    320     this.drawNeuron();
    321 
    322 
    323 }
    324 
     257
     258}
     259
Note: See TracChangeset for help on using the changeset viewer.