Permalink
Browse files

Spacca tutto!

  • Loading branch information...
1 parent 9aa4188 commit 6bf43d9edbf021c92966dd6191287cdbffda9583 @fibo committed May 14, 2012
View
@@ -8,7 +8,7 @@ use warnings;
# as x.yy_zz so it will not be listed by CPAN.pm as the last.
# After test results will be ok, it can be officially released x.(yy+1) version.
-our $VERSION = '0.34';
+our $VERSION = '0.35';
$VERSION = eval $VERSION;
1;
@@ -37,24 +37,6 @@ L<PNI::Guides>
L<PNI demo|http://pnidemo-fibo.dotcloud.com>
-=head1 DEVELOPMENT
-
-L<PNI repository|http://github.com/fibo/pni-pm>
-
-=head1 RESOURCES
-
-L<PNI blog|http://perl-node-interface.blogspot.com>
-
-L<PNI class diagram|http://goo.gl/MQ89f>
-
-L<PNI node coverage|http://goo.gl/hfAoU>
-
-=head1 SUPPORT
-
-L<#pni IRC channel on freenode|irc://freenode/pni>
-
-L<PNI mailing list|http://groups.google.com/group/perl-node-interface>
-
=head1 AUTHOR
G. Casati , E<lt>fibo@cpan.orgE<gt>
View
@@ -31,7 +31,7 @@ sub startup {
$r->get('/node/:node_id')->to('node#to_json');
# Questa put dovrebbe essere una post
- $r->put('/node/:node_id')->to('node#update_position');
+ $r->post('/node/:node_id')->to('node#update_position');
$r->post('/node')->to('scenario#add_node');
$r->get('/scenario/:scenario_id')->to('scenario#to_json');
@@ -3,7 +3,6 @@
var $j = jQuery.noConflict();
-//require(['THREE/Scene']);
// PNI //[
@@ -97,9 +96,9 @@ PNI.Scenario = function(arg) { //[
this.stage = new Kinetic.Stage("scenario",width,height);
this.layer = new Kinetic.Layer();
- this.currenSlot = undefined;
- this.currenNode = undefined;
- this.semiEdge = undefined;
+ this.currentSlot = undefined;
+ this.currentNode = undefined;
+ this.semiEdge = undefined; // TODO this.semiEdge = new PNI.SemiEdge();
this.updateView();
@@ -210,7 +209,7 @@ PNI.Scenario.prototype = {
}, //]
- //getModel: function() { },
+ // TODO getModel: function() { },
runTask: function() {
@@ -269,6 +268,11 @@ PNI.Scenario.prototype = {
arg.scenario = this;
arg.model = model;
+ if( model.type == "JS::THREE::Scene" ) {
+ // TODO lo lascio qua giusto per fare lo sborone
+ require(['THREE/Scene']);
+ }
+
if( model.type == "Perldata::Scalar" ) {
node = new PNI.Node.Perldata.Scalar(arg);
}
@@ -495,7 +499,7 @@ PNI.Node = function(arg) {
var requestData = {x:that.x,y:that.y};
$j.ajax({
- type: 'PUT',
+ type: 'POST',
url: '/node/'+that.model.id,
data: requestData
});
@@ -511,7 +515,9 @@ PNI.extend(PNI.Node,PNI.Elem);
PNI.Node.Perldata = {};
-PNI.Node.Perldata.Scalar = function(arg) {
+// PNI.Node.Perldata.Scalar //[
+
+PNI.Node.Perldata.Scalar = function(arg) { //[
PNI.Node.call( this, arg );
@@ -576,31 +582,43 @@ PNI.Node.Perldata.Scalar = function(arg) {
}
}
-
});
- /*
- var label;
- var inId = arg.ins[0];
+} //]
+
+PNI.Node.Perldata.Scalar.prototype = {};
+
+PNI.extend(PNI.Node.Perldata.Scalar,PNI.Node);
+
+//]
+
+// PNI.Node.Perldata.Array //[
- $j.ajax({
- type: 'GET',
- url: '/slot/'+inId+'/data',
- success: function(responseData) {
+PNI.Node.Perldata.Array = function(arg) { //[
- // TODO BRUTTISSIMA SOLUZIONE ma basta che funzioni per ora
- label = responseData;
- arg.label = label;
PNI.Node.call( this, arg );
- }
- });
- */
-}
+} //]
-PNI.Node.Perldata.Scalar.prototype = {};
+PNI.Node.Perldata.Array.prototype = {};
-PNI.extend(PNI.Node.Perldata.Scalar,PNI.Node);
+PNI.extend(PNI.Node.Perldata.Array,PNI.Node);
+
+//]
+
+// PNI.Node.Perldata.Hash //[
+
+PNI.Node.Perldata.Hash = function(arg) { //[
+
+ PNI.Node.call( this, arg );
+
+} //]
+
+PNI.Node.Perldata.Hash.prototype = {};
+
+PNI.extend(PNI.Node.Perldata.Hash,PNI.Node);
+
+//]
// PNI.Slot //[
@@ -628,13 +646,13 @@ PNI.Slot = function(arg) {
this.box.on("mouseover", function(evt) {
- that.scenario.currenSlot = that;
+ that.scenario.currentSlot = that;
});
this.box.on("mouseout", function(evt) {
- that.scenario.currenSlot = undefined;
+ that.scenario.currentSlot = undefined;
});
@@ -679,7 +697,7 @@ PNI.extend(PNI.Slot,PNI.Elem);
// PNI.In //[
-PNI.In = function(arg) {
+PNI.In = function(arg) { //[
PNI.Slot.call( this, arg );
@@ -720,21 +738,21 @@ PNI.In = function(arg) {
}
});
-}
+} //]
-PNI.In.prototype = {
+PNI.In.prototype = { //[
getY: function() { return this.node.y - PNI.Theme.slotSide; }
-};
+}; //]
PNI.extend(PNI.In,PNI.Slot);
//]
// PNI.Out //[
-PNI.Out = function(arg) {
+PNI.Out = function(arg) { //[
PNI.Slot.call( this, arg );
@@ -753,18 +771,41 @@ PNI.Out = function(arg) {
});
-}
+} //]
-PNI.Out.prototype = {
+PNI.Out.prototype = { //[
getY: function() { return this.node.y + this.node.height; }
-};
+}; //]
PNI.extend( PNI.Out, PNI.Slot );
//]
+// PNI.SemiEdge //[
+
+PNI.SemiEdge = function(arg) { //[
+
+ this.startX;
+ this.startY;
+ this.endX;
+ this.endY;
+
+ // TODO questa classe rappresenta un edge ancora non collegato
+ // si deve vedere come una linea, poi l' edge collegato invece e' come una
+ // bezier. Sull' onrelease del mouse non si deve distruggere perchè ogni
+ // scenario ne ha un' istanza, deve pero sparire.
+} //]
+
+PNI.SemiEdge.prototype = { //[
+
+ drawLine: function() { }
+
+}; //]
+
+//]
+
// PNI.Edge //[
PNI.Edge = function(arg) { //[
@@ -14,7 +14,7 @@ If one day one person will get well from a genetic disease thanks to PNI, it wil
=head2 Does PNI run on my OS?
-Yes, probably! Check out this L<report|http://matrix.cpantesters.org/?dist=Perl-Node-Interface>.
+Yes, probably! Check out L<this report|http://matrix.cpantesters.org/?dist=Perl-Node-Interface>.
=head2 What are nodes and edges?
@@ -19,5 +19,27 @@ There are a lot of node programming languages (L<VVVV|http://vvvv.org/>, L<Pured
This is my effort to provide a node interface that brings Perl power to people who don't know the Perl language.
+=head1 DEVELOPMENT
+
+L<PNI repository|http://github.com/fibo/pni-pm>
+
+=head1 RESOURCES
+
+L<PNI blog|http://perl-node-interface.blogspot.com>
+
+L<PNI class diagram|http://goo.gl/MQ89f>
+
+L<PNI node coverage|http://goo.gl/hfAoU>
+
+=head1 SUPPORT
+
+L<#pni IRC channel on freenode|irc://freenode/pni>
+
+L<PNI mailing list|http://groups.google.com/group/perl-node-interface>
+
+=head1 SEE ALSO
+
+L<PNI::Guides>
+
=cut
@@ -0,0 +1,7 @@
+
+=head1 NAME
+
+PNI::Guides::Installation
+
+=cut
+
@@ -16,7 +16,7 @@ function init() {
renderer = new THREE.CanvasRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
- var d = document.getElementById('dashboard-tab');
+ var d = document.getElementById('scenario');
d.appendChild( renderer.domElement );
}
@@ -38,8 +38,7 @@ function render() {
}
-var camera, scene, renderer,
-geometry, material, mesh;
+var camera, scene, renderer, geometry, material, mesh;
init();
animate();
View
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 30;
+use Test::More tests => 31;
use Test::Mojo;
use PNI::Scenario;
@@ -77,9 +77,9 @@ $t->get_ok( '/edge/' . $edge->id )
;
# GET /node_list
-#use PNI::Finder;
-#my $find = PNI::Finder->new;
-#my $node_listref = [$find->nodes];
+use PNI::Finder;
+my $find = PNI::Finder->new;
+my @node_list = $find->nodes;
$t->get_ok('/node_list')
@@ -90,7 +90,7 @@ $t->get_ok('/node_list')
->content_type_is('application/json')
# Check json content.
- #->json_is( $node_listref )
+ ->json_is( \@node_list )
# End of GET /scenario endpoint tests.
;

0 comments on commit 6bf43d9

Please sign in to comment.