[opengtl-commits] [416] add GTLGlue

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 416
Author:   cyrille
Date:     2008-09-30 22:31:08 +0200 (Tue, 30 Sep 2008)

Log Message:
-----------
add GTLGlue

Modified Paths:
--------------
    trunk/OpenGTL/OpenGTL/CMakeLists.txt

Added Paths:
-----------
    trunk/OpenGTL/OpenGTL/GTLGlue/
    trunk/OpenGTL/OpenGTL/GTLGlue/CMakeLists.txt
    trunk/OpenGTL/OpenGTL/GTLGlue/CtlProcessingNode.cpp
    trunk/OpenGTL/OpenGTL/GTLGlue/CtlProcessingNode.h
    trunk/OpenGTL/OpenGTL/GTLGlue/Debug_p.h
    trunk/OpenGTL/OpenGTL/GTLGlue/DestinationNode_p.cpp
    trunk/OpenGTL/OpenGTL/GTLGlue/DestinationNode_p.h
    trunk/OpenGTL/OpenGTL/GTLGlue/InputNode.cpp
    trunk/OpenGTL/OpenGTL/GTLGlue/InputNode.h
    trunk/OpenGTL/OpenGTL/GTLGlue/NodeData_p.cpp
    trunk/OpenGTL/OpenGTL/GTLGlue/NodeData_p.h
    trunk/OpenGTL/OpenGTL/GTLGlue/OutputNode.cpp
    trunk/OpenGTL/OpenGTL/GTLGlue/OutputNode.h
    trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline.cpp
    trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline.h
    trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline_p.cpp
    trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline_p.h
    trunk/OpenGTL/OpenGTL/GTLGlue/ProcessingNode.cpp
    trunk/OpenGTL/OpenGTL/GTLGlue/ProcessingNode.h
    trunk/OpenGTL/OpenGTL/GTLGlue/ShivaProcessingNode.cpp
    trunk/OpenGTL/OpenGTL/GTLGlue/ShivaProcessingNode.h
    trunk/OpenGTL/OpenGTL/GTLGlue/SourceNode_p.cpp
    trunk/OpenGTL/OpenGTL/GTLGlue/SourceNode_p.h
    trunk/OpenGTL/OpenGTL/GTLGlue/tests/
    trunk/OpenGTL/OpenGTL/GTLGlue/tests/xml/
    trunk/OpenGTL/OpenGTL/GTLGlue/tests/xml/mix.gf
    trunk/OpenGTL/OpenGTL/GTLGlue/tests/xml/mix3.gf
    trunk/OpenGTL/OpenGTL/GTLGlue.doxy


Modified: trunk/OpenGTL/OpenGTL/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenGTL/CMakeLists.txt	2008-09-30 20:29:08 UTC (rev 415)
+++ trunk/OpenGTL/OpenGTL/CMakeLists.txt	2008-09-30 20:31:08 UTC (rev 416)
@@ -3,4 +3,5 @@
 add_subdirectory(GTLCore)
 add_subdirectory(GTLTest)
 add_subdirectory(GTLImageIO)
+add_subdirectory(GTLGlue)
 add_subdirectory(tools)

Added: trunk/OpenGTL/OpenGTL/GTLGlue/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/CMakeLists.txt	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/CMakeLists.txt	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,22 @@
+set(GTLGlue_SRCS
+    Pipeline.cpp
+    ProcessingNode.cpp
+    ShivaProcessingNode.cpp
+    CtlProcessingNode.cpp
+    InputNode.cpp
+    DestinationNode_p.cpp
+    OutputNode.cpp
+# Private source files
+    SourceNode_p.cpp
+    NodeData_p.cpp
+    Pipeline_p.cpp
+    )
+
+include_directories(${CMAKE_SOURCE_DIR}/OpenCTL ${CMAKE_SOURCE_DIR}/OpenShiva)
+
+add_definitions( -DCOUMPONENT_NAME="GTLGlue" )
+
+# Create GTLGlue library
+add_library(GTLGlue SHARED ${GTLGlue_SRCS} )
+
+target_link_libraries(GTLGlue GTLCore )

Added: trunk/OpenGTL/OpenGTL/GTLGlue/CtlProcessingNode.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/CtlProcessingNode.cpp	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/CtlProcessingNode.cpp	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,44 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "CtlProcessingNode.h"
+
+#include "GTLCore/String.h"
+#include "OpenCTL/Module.h"
+
+using namespace GTLGlue;
+
+struct CtlProcessingNode::Private
+{
+  GTLCore::String functionName;
+  OpenCTL::Module* ctlModule;
+};
+
+CtlProcessingNode::CtlProcessingNode(const GTLCore::String& _functionName, OpenCTL::Module* _ctlModule ) : d(new Private)
+{
+  d->functionName = _functionName;
+  d->ctlModule = _ctlModule;
+}
+
+
+CtlProcessingNode::~CtlProcessingNode()
+{
+  delete d->ctlModule;
+  delete d;
+}

Added: trunk/OpenGTL/OpenGTL/GTLGlue/CtlProcessingNode.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/CtlProcessingNode.h	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/CtlProcessingNode.h	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,45 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GTLGlue_CTL_PROCESSING_NODE_H_
+#define _GTLGlue_CTL_PROCESSING_NODE_H_
+
+#include <GTLGlue/ProcessingNode.h>
+
+namespace OpenCTL {
+  class Module;
+}
+
+namespace GTLCore {
+  class String;
+}
+
+namespace GTLGlue {
+  class CtlProcessingNode : public ProcessingNode {
+    public:
+      CtlProcessingNode( const GTLCore::String& _functionName, OpenCTL::Module* _ctlModule );
+      ~CtlProcessingNode();
+    private:
+      struct Private;
+      Private* const d;  
+  };
+
+}
+
+#endif

Added: trunk/OpenGTL/OpenGTL/GTLGlue/Debug_p.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/Debug_p.h	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/Debug_p.h	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,29 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GTLFUSER_DEBUG_H_
+#define _GTLFUSER_DEBUG_H_
+
+#include <GTLCore/Debug.h>
+
+#define GTLF_WARNING(msg) GTL_WARNING(msg)
+#define GTLF_DEBUG(msg) GTL_DEBUG(msg)
+#define GTLF_ASSERT(assrt) GTL_ASSERT(assrt)
+
+#endif

Added: trunk/OpenGTL/OpenGTL/GTLGlue/DestinationNode_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/DestinationNode_p.cpp	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/DestinationNode_p.cpp	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,29 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "DestinationNode_p.h"
+
+using namespace GTLGlue;
+
+DestinationNode::DestinationNode( const GTLCore::PixelDescription& ) {
+}
+
+DestinationNode::~DestinationNode()
+{
+}

Added: trunk/OpenGTL/OpenGTL/GTLGlue/DestinationNode_p.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/DestinationNode_p.h	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/DestinationNode_p.h	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,41 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GTLGlue_DESTINATION_NODE_H_
+#define _GTLGlue_DESTINATION_NODE_H_
+
+#include "InputNode.h"
+
+namespace GTLCore {
+  class PixelDescription;
+}
+
+namespace GTLGlue {
+  /**
+   * @ingroup GTLGlue
+   * This class defines a node that takes a node as input.
+   */
+  class DestinationNode : public InputNode {
+    public:
+      DestinationNode( const GTLCore::PixelDescription& );
+      ~DestinationNode();
+  };
+}
+
+#endif

Added: trunk/OpenGTL/OpenGTL/GTLGlue/InputNode.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/InputNode.cpp	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/InputNode.cpp	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,48 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "InputNode.h"
+
+#include "NodeData_p.h"
+
+using namespace GTLGlue;
+
+struct InputNode::Private {
+  NodeData nodeData;  
+};
+
+
+InputNode::InputNode() : d(new Private)
+{
+}
+
+InputNode::~InputNode()
+{
+  delete d;
+}
+
+const NodeData* InputNode::data() const
+{
+  return &d->nodeData;
+}
+
+NodeData* InputNode::data()
+{
+  return &d->nodeData;
+}

Added: trunk/OpenGTL/OpenGTL/GTLGlue/InputNode.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/InputNode.h	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/InputNode.h	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,50 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GTLGlue_INPUT_NODE_H_
+#define _GTLGlue_INPUT_NODE_H_
+
+namespace GTLGlue {
+  class NodeData;
+  class OutputNode;
+  /**
+   * @ingroup GTLGlue
+   * This class defines a node that takes an image as output.
+   */
+  class InputNode {
+    friend class ProcessingNode;
+    friend class DestinationNode;
+    private:
+      InputNode();
+      ~InputNode();
+    public:
+      /**
+       * Connect an entry of this input node 
+       */
+      void connectTo( int _entry, const OutputNode* _node);
+    private:
+      const NodeData* data() const;
+      NodeData* data();
+    private:
+      struct Private;
+      Private* const d;
+  };
+}
+
+#endif

Added: trunk/OpenGTL/OpenGTL/GTLGlue/NodeData_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/NodeData_p.cpp	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/NodeData_p.cpp	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,20 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "NodeData_p.h"

Added: trunk/OpenGTL/OpenGTL/GTLGlue/NodeData_p.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/NodeData_p.h	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/NodeData_p.h	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,31 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GTL_FUSER_NODE_DATA_P_H_
+#define _GTL_FUSER_NODE_DATA_P_H_
+
+namespace GTLFuser {
+  /**
+   * @ingroup GTLFuser
+   */
+  class NodeData {
+  };
+}
+
+#endif

Added: trunk/OpenGTL/OpenGTL/GTLGlue/OutputNode.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/OutputNode.cpp	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/OutputNode.cpp	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,48 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "OutputNode.h"
+
+#include "NodeData_p.h"
+
+using namespace GTLGlue;
+
+struct OutputNode::Private {
+  NodeData nodeData;  
+};
+
+
+OutputNode::OutputNode() : d(new Private)
+{
+}
+
+OutputNode::~OutputNode()
+{
+  delete d;
+}
+
+const NodeData* OutputNode::data() const
+{
+  return &d->nodeData;
+}
+
+NodeData* OutputNode::data()
+{
+  return &d->nodeData;
+}

Added: trunk/OpenGTL/OpenGTL/GTLGlue/OutputNode.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/OutputNode.h	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/OutputNode.h	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,44 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GTLGlue_OUTPUT_H_
+#define _GTLGlue_OUTPUT_H_
+
+namespace GTLGlue {
+  class NodeData;
+  /**
+   * @ingroup GTLGlue
+   * This class defines a node that output a \ref GTLCore::AbstractImage .
+   */
+  class OutputNode {
+    friend class ProcessingNode;
+    friend class SourceNode;
+    private:
+      OutputNode();
+      ~OutputNode();
+    private:
+      const NodeData* data() const;
+      NodeData* data();
+    private:
+      struct Private;
+      Private* const d;
+  };
+}
+
+#endif

Added: trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline.cpp	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline.cpp	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,58 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "Pipeline_p.h"
+
+using namespace GTLGlue;
+
+Pipeline::Pipeline() : d(new Private)
+{
+}
+
+Pipeline::~Pipeline()
+{
+  delete d;
+}
+
+void Pipeline::appendSource( const GTLCore::PixelDescription& _pd )
+{
+  d->appendSource( _pd );
+}
+
+void Pipeline::appendDestination( const GTLCore::PixelDescription& _pd )
+{
+  d->appendDestination( _pd );
+}
+
+OutputNode* Pipeline::sourceNode( unsigned int _index)
+{
+  return d->sourceNode( _index );
+}
+
+InputNode* Pipeline::destinationNode( unsigned int _index)
+{
+  return d->destinationNode( _index );
+}
+
+void Pipeline::appendProcessingNode( ProcessingNode* _processingNode )
+{
+  d->appendProcessingNode( _processingNode );
+  _processingNode->setPipeline( this );
+}
+

Added: trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline.h	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline.h	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,60 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GTLGlue_PIPELINE_H_
+#define _GTLGlue_PIPELINE_H_
+
+#include <GTLGlue/ProcessingNode.h>
+
+namespace GTLCore {
+  class PixelDescription;
+}
+
+namespace GTLGlue {
+  class OutputNode;
+  class InputNode;
+  /**
+   * @ingroup GTLGlue
+   * This is the main class for GTLGlue, this class contains the image processing
+   * pipeline.
+   */
+  class Pipeline : public ProcessingNode {
+    friend class ProcessingNode;
+    public:
+      Pipeline();
+      ~Pipeline();
+    public:
+      /**
+       * Append a source to the \ref Pipeline.
+       */
+      void appendSource( const GTLCore::PixelDescription& );
+      /**
+       * Append a destination to the \ref Pipeline.
+       */
+      void appendDestination( const GTLCore::PixelDescription& );
+      void appendProcessingNode( ProcessingNode* _processingNode );
+      OutputNode* sourceNode( unsigned int _index);
+      InputNode* destinationNode( unsigned int _index);
+    private:
+      class Private;
+      Private* const d;
+  };
+}
+
+#endif

Added: trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline_p.cpp	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline_p.cpp	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,62 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "Pipeline_p.h"
+
+#include "GTLCore/Utils_p.h"
+
+#include "Debug_p.h"
+#include "DestinationNode_p.h"
+#include "SourceNode_p.h"
+
+using namespace GTLGlue;
+
+Pipeline::Private::~Private()
+{
+  GTLCore::deleteAll( m_sources );
+  GTLCore::deleteAll( m_destinations );
+  GTLCore::deleteAll( m_nodes );
+}
+
+void Pipeline::Private::appendSource( const GTLCore::PixelDescription& _pd)
+{
+  m_sources.push_back( new SourceNode( _pd ) );
+}
+
+void Pipeline::Private::appendDestination( const GTLCore::PixelDescription& _pd )
+{
+  m_destinations.push_back( new DestinationNode( _pd ) );
+}
+
+OutputNode* Pipeline::Private::sourceNode( unsigned int _index)
+{
+  GTLF_ASSERT( _index < m_sources.size() );
+  return m_sources[ _index ];
+}
+
+InputNode* Pipeline::Private::destinationNode( unsigned int _index)
+{
+  GTLF_ASSERT( _index < m_destinations.size() );
+  return m_destinations[ _index ];
+}
+
+void Pipeline::Private::appendProcessingNode( ProcessingNode* _processingNode )
+{
+  m_nodes.push_back( _processingNode );
+}

Added: trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline_p.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline_p.h	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/Pipeline_p.h	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,52 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GTLGlue_PIPELINE_P_H_
+#define _GTLGlue_PIPELINE_P_H_
+
+#include "Pipeline.h"
+
+#include <vector>
+
+namespace GTLGlue {
+  class SourceNode;
+  class DestinationNode;
+  class Pipeline::Private {
+    public:
+      ~Private();
+//      void appendProcessingNode();
+      /**
+       * Append a source to the \ref Pipeline.
+       */
+      void appendSource( const GTLCore::PixelDescription& );
+      /**
+       * Append a destination to the \ref Pipeline.
+       */
+      void appendDestination( const GTLCore::PixelDescription& );
+      void appendProcessingNode( ProcessingNode* _processingNode );
+      OutputNode* sourceNode( unsigned int _index);
+      InputNode* destinationNode( unsigned int _index);
+    private:
+      std::vector<SourceNode*> m_sources;
+      std::vector<DestinationNode*> m_destinations;
+      std::vector<ProcessingNode*> m_nodes;
+  };
+}
+
+#endif

Added: trunk/OpenGTL/OpenGTL/GTLGlue/ProcessingNode.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/ProcessingNode.cpp	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/ProcessingNode.cpp	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,46 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "ProcessingNode.h"
+
+#include <OpenShiva/Kernel.h>
+
+using namespace GTLGlue;
+
+struct ProcessingNode::Private
+{
+  Private() : parent(0)
+  {
+  }
+  Pipeline* parent;
+};
+
+ProcessingNode::ProcessingNode() : d(new Private)
+{
+}
+
+ProcessingNode::~ProcessingNode()
+{
+  delete d;
+}
+
+void ProcessingNode::setPipeline( Pipeline* _parent )
+{
+  d->parent = _parent;
+}

Added: trunk/OpenGTL/OpenGTL/GTLGlue/ProcessingNode.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/ProcessingNode.h	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/ProcessingNode.h	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,44 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GTLGlue_PROCESSING_NODE_H_
+#define _GTLGlue_PROCESSING_NODE_H_
+
+#include <GTLGlue/InputNode.h>
+#include <GTLGlue/OutputNode.h>
+
+namespace GTLGlue {
+  class Pipeline;
+  /**
+   * @ingroup GTLGlue
+   */
+  class ProcessingNode : public InputNode, public OutputNode {
+    friend class Pipeline;
+    public:
+      ProcessingNode( );
+      ~ProcessingNode();
+    private:
+      void setPipeline( Pipeline* _parent );
+    private:
+      struct Private;
+      Private* const d;
+  };
+}
+
+#endif

Added: trunk/OpenGTL/OpenGTL/GTLGlue/ShivaProcessingNode.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/ShivaProcessingNode.cpp	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/ShivaProcessingNode.cpp	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,40 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "ShivaProcessingNode.h"
+
+#include "OpenShiva/Kernel.h"
+
+using namespace GTLGlue;
+
+struct ShivaProcessingNode::Private
+{
+  OpenShiva::Kernel* shivaKernel;
+};
+
+ShivaProcessingNode::ShivaProcessingNode( OpenShiva::Kernel* _shivaKernel ) : d(new Private)
+{
+  d->shivaKernel = _shivaKernel;
+}
+
+ShivaProcessingNode::~ShivaProcessingNode()
+{
+  delete d->shivaKernel;
+  delete d;
+}

Added: trunk/OpenGTL/OpenGTL/GTLGlue/ShivaProcessingNode.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/ShivaProcessingNode.h	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/ShivaProcessingNode.h	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,41 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GTLGlue_SHIVA_PROCESSING_NODE_H_
+#define _GTLGlue_SHIVA_PROCESSING_NODE_H_
+
+#include <GTLGlue/ProcessingNode.h>
+
+namespace OpenShiva {
+  class Kernel;
+}
+
+namespace GTLGlue {
+  class ShivaProcessingNode : public ProcessingNode {
+    public:
+      ShivaProcessingNode( OpenShiva::Kernel* _shivaKernel );
+      ~ShivaProcessingNode();
+    private:
+      struct Private;
+      Private* const d;  
+  };
+
+}
+
+#endif

Added: trunk/OpenGTL/OpenGTL/GTLGlue/SourceNode_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/SourceNode_p.cpp	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/SourceNode_p.cpp	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,29 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "SourceNode_p.h"
+
+using namespace GTLGlue;
+
+SourceNode::SourceNode( const GTLCore::PixelDescription& ) {
+}
+
+SourceNode::~SourceNode()
+{
+}

Added: trunk/OpenGTL/OpenGTL/GTLGlue/SourceNode_p.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/SourceNode_p.h	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/SourceNode_p.h	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,43 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GTLGlue_SOURCE_NODE_H_
+#define _GTLGlue_SOURCE_NODE_H_
+
+#include <GTLGlue/OutputNode.h>
+
+namespace GTLCore {
+  class PixelDescription;
+}
+
+namespace GTLGlue {
+  /**
+   * @ingroup GTLGlue
+   * @internal
+   * This is an internal class which defines a node that output one of the source \ref GTLCore::AbstractImage
+   * from the \ref Pipeline.
+   */
+  class SourceNode : public OutputNode {
+    public:
+      SourceNode( const GTLCore::PixelDescription& );
+      ~SourceNode();
+  };
+}
+
+#endif

Added: trunk/OpenGTL/OpenGTL/GTLGlue/tests/xml/mix.gf
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/tests/xml/mix.gf	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/tests/xml/mix.gf	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,20 @@
+<pipeline>
+  <source name="cmd1" />
+  <source name="cmd2" />
+  <shiva name="mix">
+    <use name="cmd1" />
+    <use name="cmd2" />
+    <source>
+kernel mix {
+
+   void evaluatePixel(image img1, image img2, output pixel result)
+   {
+     result = img1.sampleNearest( result.coord ) + img2.sampleNearest( result.coord );
+   }
+}
+    </source>
+  </shiva>
+  <destination>
+    <use name="mix" />
+  </destination>
+</pipeline>
\ No newline at end of file

Added: trunk/OpenGTL/OpenGTL/GTLGlue/tests/xml/mix3.gf
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue/tests/xml/mix3.gf	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue/tests/xml/mix3.gf	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,28 @@
+<pipeline>
+  <kernels>
+    <kernel name="mix">
+kernel mix {
+   void evaluatePixel(image img1, image img2, output pixel result)
+   {
+     result = (img1.sampleNearest( result.coord ) + img2.sampleNearest( result.coord )) * 0.5;
+   }
+}
+    </kernel>
+  </kernels>
+  <source name="cmd1" />
+  <source name="cmd2" />
+  <source name="cmd3" />
+  <shiva name="mix1">
+    <use name="cmd1" />
+    <use name="cmd2" />
+    <kernel name="mix" />
+  </shiva>
+  <shiva name="mix2">
+    <use name="mix1" />
+    <use name="cmd3" />
+    <kernel name="mix" />
+  </shiva>
+  <destination>
+    <use name="mix2" />
+  </destination>
+</pipeline>
\ No newline at end of file

Added: trunk/OpenGTL/OpenGTL/GTLGlue.doxy
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLGlue.doxy	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLGlue.doxy	2008-09-30 20:31:08 UTC (rev 416)
@@ -0,0 +1,12 @@
+/**
+ * @addtogroup GTLFuser GTLFuser Library
+ * @version 0.9.6
+ * @author Cyrille Berger
+ * 
+ * This library allows to create an image processing pipeline (see \ref Pipeline ) containing a graph
+ * of Shiva and CTL processing nodes (see \ref ProcessingNode).
+ *
+ * The main interest of the library is that it will first generate a program calling all the processing
+ * functions, then run optimisation on this program before executing it, which allow to create a faster
+ * pipeline than by doing individual call, one by one.
+ */


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/