new vtk:ProbeFilter Box32
set Box32.BoxProcessMode "Reactive"
++<<<<<<< HEAD
+new creaVtk:TensorsVisu_Widget Box33
+
+new wx:LayoutTab Box36
+
+new creaVtk:TensorsVisu_Widget Box37
++=======
+ new creaVtk:TensorsVisu_Wideget Box33
+
+ new wx:LayoutTab Box36
+
+ new creaVtk:TensorsVisu_Wideget Box37
++>>>>>>> master
new vtk:MaskPoint Box38
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
++<<<<<<< HEAD
+# - /tmpEED/creaTools2/ci/bin/../share/bbtk/bbs/creaVtk/appli/exampleVectorsVisu.bbg
++=======
+ # - /tmpEED/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu.bbg
++>>>>>>> master
# ----------------------------------
APP_START
wx:LayoutSplit:Box05
ISEXEC:TRUE
20.586047:-67.968368:-900.000000
++<<<<<<< HEAD
+57.261047:-77.968368:-900.000000
++=======
+ 59.666047:-77.968368:-900.000000
++>>>>>>> master
PORT
Proportion:"10"
FIN_BOX
BOX
wx:FileSelector:Box06
ISEXEC:FALSE
++<<<<<<< HEAD
+-79.676950:57.942181:-900.000000
+-42.301950:47.942181:-900.000000
++=======
+ -82.100831:48.785297:-900.000000
+ -44.725831:38.785297:-900.000000
++>>>>>>> master
FIN_BOX
BOX
vtk:LoadHola:Box07
BOX
vtk:StructuredPointsReader:Box08
ISEXEC:FALSE
++<<<<<<< HEAD
+-65.776361:20.644357:-900.000000
+-17.076361:10.644357:-900.000000
++=======
+ -77.679349:22.958827:-900.000000
+ -28.979349:12.958827:-900.000000
++>>>>>>> master
PORT
In:"/home/davila/Creatis/creaVtk/data/Vectors.vtk"
FIN_BOX
BOX
++<<<<<<< HEAD
+std:ConcatStrings:Box09
+ISEXEC:FALSE
+-9.468286:43.584173:-900.000000
+30.256714:33.584173:-900.000000
+PORT
+In2:"/creaVtk/Vectors.vtk"
+FIN_BOX
+BOX
+std:Configuration:Box10
+ISEXEC:FALSE
+8.566544:63.723067:-900.000000
+47.991544:53.723067:-900.000000
++=======
+ std:Configuration:Box09
+ ISEXEC:FALSE
+ -32.049096:69.753914:-900.000000
+ 7.375904:59.753914:-900.000000
+ FIN_BOX
+ BOX
+ std:ConcatStrings:Box10
+ ISEXEC:FALSE
+ -37.166178:46.323063:-900.000000
+ 2.558822:36.323063:-900.000000
+ PORT
+ In2:"/creaVtk/Vectors.vtk"
++>>>>>>> master
FIN_BOX
CONNECTIONS:9
CONNECTION
Box08:Out:Box01:In
NumberOfControlPoints:0
CONNECTION
++<<<<<<< HEAD
+Box10:DataPath:Box09:In1
+NumberOfControlPoints:0
+CONNECTION
+Box09:Out:Box08:In
++=======
+ Box09:DataPath:Box10:In1
+ NumberOfControlPoints:0
+ CONNECTION
+ Box10:Out:Box08:In
++>>>>>>> master
NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script
++<<<<<<< HEAD
+# - /tmpEED/creaTools2/ci/bin/../share/bbtk/bbs/creaVtk/appli/exampleVectorsVisu.bbs
++=======
+ # - /tmpEED/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu.bbs
++>>>>>>> master
# ----------------------------------
# BBTK GEditor Script
category "<VOID>"
new vtk:MaskPoint Box01
++<<<<<<< HEAD
+ set Box01.Ratio "30"
++=======
+ set Box01.Ratio "1"
++>>>>>>> master
new creaVtk:VectorsVisu Box02
set Box02.Active "true"
new vtk:StructuredPointsReader Box08
set Box08.In "/home/davila/Creatis/creaVtk/data/Vectors.vtk"
++<<<<<<< HEAD
+new std:ConcatStrings Box09
+ set Box09.In2 "/creaVtk/Vectors.vtk"
+
+new std:Configuration Box10
++=======
+ new std:Configuration Box09
+
+ new std:ConcatStrings Box10
+ set Box10.In2 "/creaVtk/Vectors.vtk"
++>>>>>>> master
connect Box01.Out Box02.In
connect Box08.Out Box01.In
++<<<<<<< HEAD
+connect Box10.DataPath Box09.In1
+
+connect Box09.Out Box08.In
++=======
+ connect Box09.DataPath Box10.In1
+
+ connect Box10.Out Box08.In
++>>>>>>> master
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
++<<<<<<< HEAD
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg
++=======
+ # - /tmpEED/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg
++>>>>>>> master
# ----------------------------------
APP_START
renderer
-52.117833:88.203991:-900.000000
FIN_COMPLEX_PORT
++<<<<<<< HEAD
+BOXES:8
+BOX
+creaVtk:VectorsVisu:Box00
+ISEXEC:FALSE
+-2.817636:-56.941435:-900.000000
+34.807364:-66.941435:-900.000000
++=======
+ COMPLEX_PORT
+ boxexecute
+ -104.232070:88.823851:-900.000000
+ FIN_COMPLEX_PORT
+ BOXES:9
+ BOX
+ creaVtk:VectorsVisu:Box00
+ ISEXEC:FALSE
+ -4.465574:-69.418679:-900.000000
+ 41.109426:-79.418679:-900.000000
++>>>>>>> master
FIN_BOX
BOX
creaVtk:PlaneWidget:Box01
std:SharedMemory:Box15
ISEXEC:FALSE
-79.072661:-36.761184:-900.000000
--33.497661:-46.761184:-900.000000
+-37.897661:-46.761184:-900.000000
FIN_BOX
++<<<<<<< HEAD
+CONNECTIONS:21
++=======
+ BOX
+ std:MagicBox:Box11
+ ISEXEC:FALSE
+ -116.304953:49.494646:-900.000000
+ -70.729953:39.494646:-900.000000
+ FIN_BOX
+ CONNECTIONS:22
++>>>>>>> master
CONNECTION
Box03:Out:Box00:In
NumberOfControlPoints:0
Box15:Out:Box13:BoxExecute
NumberOfControlPoints:0
CONNECTION
++<<<<<<< HEAD
+Box01:BoxChange:Box15:In2
++=======
+ boxexecute:boxexecute:Box11:BoxExecute
+ NumberOfControlPoints:0
+ CONNECTION
+ Box11:Out:Box15:In2
++>>>>>>> master
NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
++<<<<<<< HEAD
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs
++=======
+ # - /tmpEED/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs
++>>>>>>> master
# ----------------------------------
include std
set Box13.BoxProcessMode "Reactive"
new std:SharedMemory Box15
++<<<<<<< HEAD
++=======
+
+ new std:MagicBox Box11
++>>>>>>> master
connect Box03.Out Box00.In
connect Box15.Out Box00.BoxExecute
connect Box06.boxChange Box15.In1
connect Box15.Out Box13.BoxExecute
++<<<<<<< HEAD
+connect Box01.BoxChange Box15.In2
++=======
+ connect Box11.Out Box15.In2
++>>>>>>> master
# Complex input ports
input vtkImageData Box04.In " "
float spcX=-1,spcY=-1,spcZ=-1;
float ox=-1,oy=-1,oz=-1;
long int headersize=0;
-
vtkImageData *newImage=NULL;
++
+ int imageType;
+
char mystring[250];
char strTmp[30];
char strTmp2[30];
{
strcpy(mystring,"\n");
fgets(mystring,250,ffIn);
- if (strncmp("NDims",mystring,5)==0) { sscanf(mystring,"%s %s %d" ,strTmp, strTmp, &dim); }
- if (strncmp("DimSize",mystring,6)==0) { sscanf(mystring,"%s %s %d %d %d" ,strTmp, strTmp, &dimX, &dimY,&dimZ); }
+ if (strncmp("NDims",mystring,5)==0) { sscanf(mystring,"%s %s %d" ,strTmp, strTmp, &dim); }
+ if (strncmp("DimSize",mystring,6)==0) { sscanf(mystring,"%s %s %d %d %d" ,strTmp, strTmp, &dimX, &dimY,&dimZ); }
if (strncmp("ElementType",mystring,11)==0) { sscanf(mystring,"%s %s %s" ,strTmp, strTmp, strTmp2); formattype=strTmp2; }
- if (strncmp("ElementSpacing",mystring,14)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &spcX,&spcY,&spcZ); }
- if (strncmp("ElementSize",mystring,11)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &spcX,&spcY,&spcZ); }
- if (strncmp("Offset",mystring,6)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &ox, &oy, &oz); }
- if (strncmp("HeaderSize",mystring,10)==0) { sscanf(mystring,"%s %s %ld" ,strTmp, strTmp, &headersize); }
+ if (strncmp("ElementSpacing",mystring,14)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &spcX,&spcY,&spcZ); }
+ if (strncmp("ElementSize",mystring,11)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &spcX,&spcY,&spcZ); }
+ if (strncmp("Offset",mystring,6)==0) { sscanf(mystring,"%s %s %f %f %f" ,strTmp, strTmp, &ox, &oy, &oz); }
+ if (strncmp("HeaderSize",mystring,10)==0) { sscanf(mystring,"%s %s %ld" ,strTmp, strTmp, &headersize); }
if (strncmp("ElementDataFile",mystring,15)==0) { sscanf(mystring,"%s %s %s" ,strTmp, strTmp, strTmp2); elementdatafile=strTmp2; }
- if (strncmp("ElementType = MET_CHAR",mystring,22)==0) { newImage->SetScalarTypeToChar(); dataSize=sizeof(char); }
- if (strncmp("ElementType = VTK_CHAR",mystring,22)==0) { newImage->SetScalarTypeToChar(); dataSize=sizeof(char); }
- if (strncmp("ElementType = MET_UCHAR",mystring,23)==0) { newImage->SetScalarTypeToUnsignedChar(); dataSize=sizeof(unsigned char); }
- if (strncmp("ElementType = VTK_UNSIGNED_CHAR",mystring,31)==0) { newImage->SetScalarTypeToUnsignedChar(); dataSize=sizeof(unsigned char); }
- if (strncmp("ElementType = MET_USHORT",mystring,24)==0) { newImage->SetScalarTypeToUnsignedShort(); dataSize=sizeof(unsigned short);}
- if (strncmp("ElementType = VTK_UNSIGNED_SHORT",mystring,32)==0) { newImage->SetScalarTypeToUnsignedShort(); dataSize=sizeof(unsigned short);}
- if (strncmp("ElementType = MET_SHORT",mystring,23)==0) { newImage->SetScalarTypeToShort(); dataSize=sizeof(short); }
- if (strncmp("ElementType = VTK_SHORT",mystring,23)==0) { newImage->SetScalarTypeToShort(); dataSize=sizeof(short); }
- if (strncmp("ElementType = MET_UINT",mystring,22)==0) { newImage->SetScalarTypeToUnsignedInt(); dataSize=sizeof(unsigned int); }
- if (strncmp("ElementType = VTK_UNSIGNED_INT",mystring,30)==0) { newImage->SetScalarTypeToUnsignedInt(); dataSize=sizeof(unsigned int); }
- if (strncmp("ElementType = MET_INT",mystring,21)==0) { newImage->SetScalarTypeToInt(); dataSize=sizeof(int); }
- if (strncmp("ElementType = VTK_INT",mystring,21)==0) { newImage->SetScalarTypeToInt(); dataSize=sizeof(int); }
- if (strncmp("ElementType = MET_FLOAT",mystring,23)==0) { newImage->SetScalarTypeToFloat(); dataSize=sizeof(float); }
- if (strncmp("ElementType = VTK_FLOAT",mystring,23)==0) { newImage->SetScalarTypeToFloat(); dataSize=sizeof(float); }
- if (strncmp("ElementType = MET_LONG",mystring,22)==0) { newImage->SetScalarTypeToLong(); dataSize=sizeof(long); }
- if (strncmp("ElementType = VTK_LONG",mystring,22)==0) { newImage->SetScalarTypeToLong(); dataSize=sizeof(long); }
- if (strncmp("ElementType = MET_DOUBLE",mystring,24)==0) { newImage->SetScalarTypeToDouble(); dataSize=sizeof(double); }
- if (strncmp("ElementType = VTK_DOUBLE",mystring,24)==0) { newImage->SetScalarTypeToDouble(); dataSize=sizeof(double); }
+
-
++
+
+ if (strncmp("ElementType = MET_CHAR",mystring,22)==0) { imageType =VTK_CHAR; dataSize=sizeof(char); }
+ if (strncmp("ElementType = VTK_CHAR",mystring,22)==0) { imageType =VTK_CHAR; dataSize=sizeof(char); }
+ if (strncmp("ElementType = MET_UCHAR",mystring,23)==0) { imageType =VTK_UNSIGNED_CHAR; dataSize=sizeof(unsigned char); }
+ if (strncmp("ElementType = VTK_UNSIGNED_CHAR",mystring,31)==0) { imageType =VTK_UNSIGNED_CHAR; dataSize=sizeof(unsigned char); }
+ if (strncmp("ElementType = MET_USHORT",mystring,24)==0) { imageType =VTK_UNSIGNED_SHORT; dataSize=sizeof(unsigned short);}
+ if (strncmp("ElementType = VTK_UNSIGNED_SHORT",mystring,32)==0) { imageType =VTK_UNSIGNED_SHORT; dataSize=sizeof(unsigned short);}
+ if (strncmp("ElementType = MET_SHORT",mystring,23)==0) { imageType =VTK_SHORT; dataSize=sizeof(short); }
+ if (strncmp("ElementType = VTK_SHORT",mystring,23)==0) { imageType =VTK_SHORT; dataSize=sizeof(short); }
+ if (strncmp("ElementType = MET_UINT",mystring,22)==0) { imageType =VTK_UNSIGNED_INT; dataSize=sizeof(unsigned int); }
+ if (strncmp("ElementType = VTK_UNSIGNED_INT",mystring,30)==0) { imageType =VTK_UNSIGNED_INT; dataSize=sizeof(unsigned int); }
+ if (strncmp("ElementType = MET_INT",mystring,21)==0) { imageType =VTK_INT; dataSize=sizeof(int); }
+ if (strncmp("ElementType = VTK_INT",mystring,21)==0) { imageType =VTK_INT; dataSize=sizeof(int); }
+ if (strncmp("ElementType = MET_FLOAT",mystring,23)==0) { imageType =VTK_FLOAT; dataSize=sizeof(float); }
+ if (strncmp("ElementType = VTK_FLOAT",mystring,23)==0) { imageType =VTK_FLOAT; dataSize=sizeof(float); }
+ if (strncmp("ElementType = MET_LONG",mystring,22)==0) { imageType =VTK_LONG; dataSize=sizeof(long); }
+ if (strncmp("ElementType = VTK_LONG",mystring,22)==0) { imageType =VTK_LONG; dataSize=sizeof(long); }
+ if (strncmp("ElementType = MET_DOUBLE",mystring,24)==0) { imageType =VTK_DOUBLE; dataSize=sizeof(double); }
+ if (strncmp("ElementType = VTK_DOUBLE",mystring,24)==0) { imageType =VTK_DOUBLE; dataSize=sizeof(double); }
+
} // while
fclose(ffIn);
-
newImage->Initialize();
-
-
int fd;
long long ret;
std::size_t found;
vtkVectorsTensorsVisuBase::vtkVectorsTensorsVisuBase()
{
- _firsttime = true;
- _active = false;
- _scalefactor= 1;
- _opacity = 1;
- _dataobject = NULL;
- _renderer = NULL;
- _typeForm = 0;
+ _firsttime = true;
+ _active = false;
+ _scalefactor = 1;
+ _opacity = 1;
+ _dataobject = NULL;
+ _renderer = NULL;
+ _typeForm = 0;
_LutEED = vtkLookupTableDirectionVector::New();
- // _LutEED->SetVectorMode(0);
- //_LutEED->SetVectorModeToMagnitude();
- //_LutEED->SetVectorModeToComponent();
- _LutEED->SetVectorModeToRGBColors();
+ //_LutEED->SetVectorMode(0);
+ //_LutEED->SetVectorModeToMagnitude();
+ //_LutEED->SetVectorModeToComponent();
+ _LutEED->SetVectorModeToRGBColors();
_pdm = vtkPolyDataMapper::New();
_actor = vtkActor::New();
:vtkVectorsTensorsVisuBase()
{
_vtkarrowsource = vtkArrowSource::New();
++<<<<<<< HEAD
+ _vtklinesource = vtkLineSource::New();
++=======
++>>>>>>> master
_vtkglyph = vtkGlyph3D::New();
+ _vtklinesource = vtkLineSource::New();
+
+ double point1[3];
+ double point2[3];
+ point1[0]=1;
+ point1[1]=0;
+ point1[2]=0;
+ point2[0]=-1;
+ point2[1]=0;
+ point2[2]=0;
+ _vtklinesource->SetPoint1( point1 );
+ _vtklinesource->SetPoint2( point2 );
}
-
//------------------------------------------------------------------------------
vtkVectorsVisu::~vtkVectorsVisu()
{
//------------------------------------------------------------------------------
void vtkVectorsVisu::Process()
{
++<<<<<<< HEAD
+
++=======
++>>>>>>> master
if(_active==true)
{
+#if VTK_MAJOR_VERSION <= 5
_vtkglyph->SetInput( GetDataObject() );
++<<<<<<< HEAD
+#else
+ _vtkglyph->SetInputData( GetDataObject() );
+#endif
+
++=======
++>>>>>>> master
if(GetTypeForm()==1) // source Arrow
{
- _vtkglyph->SetSource( _vtkarrowsource->GetOutput() );
+#if VTK_MAJOR_VERSION <= 5
+ _vtkglyph->SetSource( _vtkarrowsource->GetOutput() );
+#else
+ _vtkarrowsource->Update();
+ _vtkglyph->SetSourceData( _vtkarrowsource->GetOutput() );
+#endif
} else { // source Line
+#if VTK_MAJOR_VERSION <= 5
_vtkglyph->SetSource( _vtklinesource->GetOutput() );
+#else
+ _vtklinesource->Update();
+ _vtkglyph->SetSourceData( _vtklinesource->GetOutput() );
+#endif
}
-
_vtkglyph->SetScaleModeToScaleByVector();
_vtkglyph->SetColorModeToColorByVector();
_vtkglyph->SetScaleFactor( GetScaleFactor() );
++<<<<<<< HEAD
+
+ _vtkglyph->Update();
+
+#if VTK_MAJOR_VERSION <= 5
+ _pdm->SetInput( _vtkglyph->GetOutput());
+#else
+ _pdm->SetInputData( _vtkglyph->GetOutput());
+#endif
+
++=======
+ _vtkglyph->Update();
+ _pdm->SetInput( _vtkglyph->GetOutput());
++>>>>>>> master
vtkPointData *data = _vtkglyph->GetOutput()->GetPointData();
//printf("EED -------------------------------------------\n");
//_vtkglyph->GetOutput()->Print(std::cout);
//printf("EED -------------------------------------------\n");
//data->Print(std::cout);
- printf("EED -------------------------------------------\n");
int i,sizeDa = data->GetNumberOfArrays();
- printf("EED vtkVectorsVisu::Process sizeDa %d \n", sizeDa );
for (i=0;i<sizeDa;i++)
{
++<<<<<<< HEAD
+ printf("EED vtkVectorsVisu::Process-name %d, %s \n", i, data->GetArrayName(i) );
+}
+
+//EED _pdm->SetScalarRange( range );
+//EED vtkPolyData *pd = vGlyphFlowPlane->GetOutput();
+//EED vtkPointData *pointdata = pd->GetPointData();
+//EED vtkDataArray *da = pointdata->GetVectors();
+//EED vtkDataArray *nda = vtkFloatArray::New();
+//EED nda->DeepCopy(da);
+// pointdata->RemoveArray( "GlyphVector" );
+// bbGetInputIn()->GetPointData()->RemoveArray( "GlyphVector" );
+//EED pointdata->AddArray( nda );
+//EED bbGetInputIn()->GetPointData()->AddArray( nda );
+//EED2 _pdm->ScalarVisibilityOn();
+
++=======
+ data->GetArray(i)->Print(std::cout);
+ }
+
++>>>>>>> master
_pdm->ScalarVisibilityOn();
_pdm->SetColorModeToMapScalars();
//_pdm->SetColorModeToDefault();