# ======================
# -- Executable names --
# ======================
-
-IF(MSVC)
- FIND_PROGRAM(
- cpPlugins_HostCreator_APP
- NAMES cpPlugins_HostCreator
- HINTS /usr /usr/local
- PATHS @CMAKE_INSTALL_PREFIX@/bin @PROJECT_BINARY_DIR@/Debug @PROJECT_BINARY_DIR@/Release @PROJECT_BINARY_DIR@/MinSizeRel @PROJECT_BINARY_DIR@/RelWithDebInfo
- PATH_SUFFIXES bin sbin
- DOC "Where is cpPlugins_HostCreator?"
- )
-ELSE(MSVC)
- FIND_PROGRAM(
- cpPlugins_HostCreator_APP
- NAMES cpPlugins_HostCreator
- HINTS /usr /usr/local
- PATHS @CMAKE_INSTALL_PREFIX@/bin @PROJECT_BINARY_DIR@
- PATH_SUFFIXES bin sbin
- DOC "Where is cpPlugins_HostCreator?"
- )
-ENDIF(MSVC)
+SET(
+ exec_PROGRAMS
+ cpPlugins_CreateInstances
+ cpPlugins_HostCreator
+ )
+FOREACH(prog ${exec_PROGRAMS})
+ IF(MSVC)
+ FIND_PROGRAM(
+ NAMES ${prog}
+ HINTS /usr /usr/local
+ PATHS @CMAKE_INSTALL_PREFIX@/bin @PROJECT_BINARY_DIR@/Debug @PROJECT_BINARY_DIR@/Release @PROJECT_BINARY_DIR@/MinSizeRel @PROJECT_BINARY_DIR@/RelWithDebInfo
+ PATH_SUFFIXES bin sbin
+ DOC "Where is ${prog}?"
+ )
+ ELSE(MSVC)
+ FIND_PROGRAM(
+ ${prog}
+ NAMES ${prog}
+ HINTS /usr /usr/local
+ PATHS @CMAKE_INSTALL_PREFIX@/bin @PROJECT_BINARY_DIR@
+ PATH_SUFFIXES bin sbin
+ DOC "Where is ${prog}?"
+ )
+ ENDIF(MSVC)
+ENDFOREACH(prog)
## eof - $RCSfile$
--- /dev/null
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__POLYLINEPARAMETRICPATH__H__
+#define __CPEXTENSIONS__DATASTRUCTURES__POLYLINEPARAMETRICPATH__H__
+
+#include <itkPolyLineParametricPath.h>
+#include <itkImageBase.h>
+
+namespace cpExtensions
+{
+ namespace DataStructures
+ {
+ /**
+ */
+ template< unsigned int _NDim >
+ class PolyLineParametricPath
+ : public itk::PolyLineParametricPath< _NDim >
+ {
+ public:
+ typedef PolyLineParametricPath Self;
+ typedef itk::PolyLineParametricPath< _NDim > Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ typedef itk::ImageBase< _NDim > TImageBase;
+
+ public:
+ itkNewMacro( Self );
+ itkTypeMacro( PolyLineParametricPath, itk::PolyLineParametricPath );
+
+ public:
+ TImageBase* GetReferenceImage( )
+ { return( this->m_ReferenceImage ); }
+ const TImageBase* GetReferenceImage( ) const
+ { return( this->m_ReferenceImage ); }
+ void SetReferenceImage( const TImageBase* image )
+ {
+ this->m_ReferenceImage = TImageBase::New( );
+ this->m_ReferenceImage->SetDirection( image->GetDirection( ) );
+ this->m_ReferenceImage->SetOrigin( image->GetOrigin( ) );
+ this->m_ReferenceImage->SetSpacing( image->GetSpacing( ) );
+ this->Modified( );
+ }
+
+ protected:
+ PolyLineParametricPath( ) { }
+ virtual ~PolyLineParametricPath( ) { }
+
+ private:
+ // Purposely not implemented
+ PolyLineParametricPath( const Self& other );
+ Self& operator=( const Self& other );
+
+ protected:
+ typename TImageBase::Pointer m_ReferenceImage;
+ };
+
+ } // ecapseman
+
+} // ecapseman
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__POLYLINEPARAMETRICPATH__H__
+
+// eof - $RCSfile$
#include <vtkInformation.h>
#include <vtkInformationVector.h>
+#include <vtkSmartPointer.h>
// -------------------------------------------------------------------------
template< class _TPolyLine >
points->SetNumberOfPoints( lst->Size( ) );
// Prepare cells
- vtkSmartPointer< vtkCellArray > verts =
- vtkSmartPointer< vtkCellArray >::New( );
+ /* TODO
+ vtkSmartPointer< vtkCellArray > verts =
+ vtkSmartPointer< vtkCellArray >::New( );
+ */
vtkSmartPointer< vtkCellArray > lines =
vtkSmartPointer< vtkCellArray >::New( );
points->SetPoint( i, idx[ 0 ], idx[ 1 ], idx[ 2 ] );
} // fi
- verts->InsertNextCell( 1 );
- verts->InsertCellPoint( i );
+ /* TODO
+ verts->InsertNextCell( 1 );
+ verts->InsertCellPoint( i );
+ */
if( i > 0 )
{
lines->InsertNextCell( 2 );
} // rof
out->SetPoints( points );
- out->SetVerts( verts );
+ // TODO: out->SetVerts( verts );
out->SetLines( lines );
return( 1 );
}
--- /dev/null
+#include <cpPlugins/Path.h>
+
+// -------------------------------------------------------------------------
+void cpPlugins::Path::
+SetITK( itk::LightObject* o )
+{
+ this->Superclass::SetITK( o );
+ bool s = this->_ITK_2_VTK< 2 >( o );
+ if( !s ) s = this->_ITK_2_VTK< 3 >( o );
+ if( !s )
+ {
+ this->m_VTKObject = NULL;
+ this->m_ITKvVTK = NULL;
+
+ } // fi
+ this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Path::
+SetVTK( vtkObjectBase* o )
+{
+ // Do nothing
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Path::
+Path( )
+ : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Path::
+~Path( )
+{
+}
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __CPPLUGINS__PATH__H__
+#define __CPPLUGINS__PATH__H__
+
+#include <cpPlugins/DataObject.h>
+
+#include <vtkPolyDataAlgorithm.h>
+#include <vtkSmartPointer.h>
+
+namespace cpPlugins
+{
+ /**
+ */
+ class cpPlugins_EXPORT Path
+ : public DataObject
+ {
+ public:
+ typedef Path Self;
+ typedef DataObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ public:
+ itkNewMacro( Self );
+ itkTypeMacro( Path, DataObject );
+ cpPlugins_Id_Macro( Path, Object );
+
+ public:
+ virtual void SetITK( itk::LightObject* o ) ITK_OVERRIDE;
+ virtual void SetVTK( vtkObjectBase* o ) ITK_OVERRIDE;
+
+ protected:
+ Path( );
+ virtual ~Path( );
+
+ template< unsigned int _NDim >
+ inline bool _ITK_2_VTK( itk::LightObject* o );
+
+ private:
+ // Purposely not implemented
+ Path( const Self& );
+ Self& operator=( const Self& );
+
+ protected:
+ vtkSmartPointer< vtkPolyDataAlgorithm > m_ITKvVTK;
+ };
+
+} // ecapseman
+
+#include <cpPlugins/Path.hxx>
+
+#endif // __CPPLUGINS__PATH__H__
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __CPPLUGINS__PATH__HXX__
+#define __CPPLUGINS__PATH__HXX__
+
+#include <cpPlugins_Instances/Paths.h>
+
+// -------------------------------------------------------------------------
+template< unsigned int _NDim >
+bool cpPlugins::Path::
+_ITK_2_VTK( itk::LightObject* o )
+{
+ typedef
+ cpExtensions::DataStructures::PolyLineParametricPath< _NDim >
+ _TPath;
+ typedef
+ cpExtensions::Visualization::PolyLineParametricPathToPolyData< _TPath >
+ _TFilter;
+
+ auto path = dynamic_cast< _TPath* >( o );
+ if( path != NULL )
+ {
+ _TFilter* f = dynamic_cast< _TFilter* >( this->m_ITKvVTK.GetPointer( ) );
+ if( f == NULL )
+ {
+ vtkSmartPointer< _TFilter > nf = _TFilter::New( );
+ this->m_ITKvVTK = nf.GetPointer( );
+ f = nf.GetPointer( );
+
+ } // fi
+ f->SetInput( path );
+ f->SetReferenceImage( path->GetReferenceImage( ) );
+ f->Update( );
+
+ // Keep object track
+ this->m_ITKObject = o;
+ this->m_VTKObject = f->GetOutput( );
+ return( true );
+ }
+ else
+ return( false );
+}
+
+#endif // __CPPLUGINS__PATH__HXX__
+
+// eof - $RCSfile$
## Target links
TARGET_LINK_LIBRARIES(cpPlugins_Base ${ITK_LIBRARIES})
TARGET_LINK_LIBRARIES(cpPlugins_Transforms ${ITK_LIBRARIES} cpPlugins_Base)
-TARGET_LINK_LIBRARIES(cpPlugins_Paths cpPlugins_Base)
+TARGET_LINK_LIBRARIES(cpPlugins_Paths cpPlugins_Base ${VTK_LIBRARIES})
TARGET_LINK_LIBRARIES(cpPlugins_Mesh cpPlugins_Base)
TARGET_LINK_LIBRARIES(cpPlugins_Image cpPlugins_Base)
TARGET_LINK_LIBRARIES(cpPlugins_ImageIterators ${ITK_LIBRARIES} cpPlugins_Image)
f cpPlugins_Instances/Base.h
+i cpExtensions/DataStructures/PolyLineParametricPath.h
t itkPolyLineParametricPath.h
t itkPath.h
t itkParametricPath.h
t itkVectorContainer.h
+t cpExtensions/Visualization/PolyLineParametricPathToPolyData.h
d #dims=2;3
c itk::PolyLineParametricPath< #dims >
+c cpExtensions::Visualization::PolyLineParametricPathToPolyData< cpExtensions::DataStructures::PolyLineParametricPath< #dims > >
+