Revision: 40870
          http://brlcad.svn.sourceforge.net/brlcad/?rev=40870&view=rev
Author:   davidloman
Date:     2010-09-29 19:42:20 +0000 (Wed, 29 Sep 2010)

Log Message:
-----------
Implemented handleGeometryRequest such that it will search for a path and 
return the geometry on that path

Modified Paths:
--------------
    rt^3/trunk/src/GS/DataManager.cxx

Modified: rt^3/trunk/src/GS/DataManager.cxx
===================================================================
--- rt^3/trunk/src/GS/DataManager.cxx   2010-09-29 19:38:35 UTC (rev 40869)
+++ rt^3/trunk/src/GS/DataManager.cxx   2010-09-29 19:42:20 UTC (rev 40870)
@@ -84,17 +84,55 @@
                log->logERROR("DataManager", "handleGeometryReqMsg(): NULL 
Portal!");
                return;
        }
+       if (data.length() == 0) {
+               TypeOnlyMsg* tom = new TypeOnlyMsg(BAD_REQUEST, msg);
+               origin->send(tom);
+               return;
+       }
 
        if (reqType == REQ_BY_PATH){
+               //TODO remove hardcoded FileDataSource
+               if (this->datasources.length() > 0) {
+                       IDataSource* ds = this->datasources.at(0);
 
+                       DbObject* obj = ds->getByPath(data);
+
+                       if (obj == NULL) {
+                               TypeOnlyMsg* tom = new 
TypeOnlyMsg(COULD_NOT_FIND_GEOMETRY, msg);
+                               origin->send(tom);
+                               return;
+                       }
+
+                       QList<QString> items;
+                       QByteArray* data = obj->getData();
+
+                       GeometryChunkMsg* chunk = new 
GeometryChunkMsg(data->data(), data->length());
+                       items.append(obj->getPath());
+
+                       GeometryManifestMsg* manifest = new 
GeometryManifestMsg(items);
+                       origin->send(manifest);
+
+                       origin->send(chunk);
+                       return;
+
+               } else {
+                       TypeOnlyMsg* tom = new 
TypeOnlyMsg(OPERATION_NOT_AVAILABLE, msg);
+                       origin->send(tom);
+                       return;
+               }
+
+
        } else if (reqType == REQ_BY_UUID) {
                //Not implemented!!!
-
+               TypeOnlyMsg* tom = new TypeOnlyMsg(OPERATION_NOT_AVAILABLE, 
msg);
+               origin->send(tom);
+               return;
        } else {
                //Not implemented!!!
-
+               TypeOnlyMsg* tom = new TypeOnlyMsg(OPERATION_NOT_AVAILABLE, 
msg);
+               origin->send(tom);
+               return;
        }
-
 }
 
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to