# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu.bbg
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu.bbg
# ----------------------------------
APP_START
AUTHOR:Author ??
COMPLEXBOX:FALSE
COMPLEXINPUTS:0
-BOXES:8
+BOXES:10
BOX
vtk:MaskPoint:Box01
ISEXEC:FALSE
-87.126923:-1.070619:-900.000000
--41.551923:-11.070619:-900.000000
+-50.976923:-11.070619:-900.000000
PORT
Ratio:"1"
FIN_BOX
creaVtk:VectorsVisu:Box02
ISEXEC:FALSE
-38.604946:-35.505673:-900.000000
-6.970054:-45.505673:-900.000000
+-0.979946:-45.505673:-900.000000
PORT
ScaleFactor:"100"
FIN_BOX
creaMaracasVisu:ViewerNV:Box03
ISEXEC:FALSE
27.598176:-3.687687:-900.000000
-73.173176:-13.687687:-900.000000
+91.318176:-13.687687:-900.000000
PORT
nTypeView:"5"
FIN_BOX
wx:CommandButton:Box04
ISEXEC:FALSE
0.713746:16.059283:-900.000000
-46.288746:6.059283:-900.000000
+43.488746:6.059283:-900.000000
PORT
Label:"Run"
FIN_BOX
wx:LayoutSplit:Box05
ISEXEC:TRUE
20.586047:-67.968368:-900.000000
-66.161047:-77.968368:-900.000000
+59.666047:-77.968368:-900.000000
PORT
Proportion:"10"
FIN_BOX
wx:FileSelector:Box06
ISEXEC:FALSE
-79.676950:57.942181:-900.000000
--34.101950:47.942181:-900.000000
+-42.301950:47.942181:-900.000000
FIN_BOX
BOX
vtk:LoadHola:Box07
ISEXEC:FALSE
68.757525:22.245082:-900.000000
-114.332525:12.245082:-900.000000
+104.307525:12.245082:-900.000000
FIN_BOX
BOX
vtk:StructuredPointsReader:Box08
ISEXEC:FALSE
-77.679349:22.958827:-900.000000
--6.504349:12.958827:-900.000000
+-28.979349:12.958827:-900.000000
PORT
In:"/home/davila/Creatis/creaVtk/data/Vectors.vtk"
FIN_BOX
-CONNECTIONS:7
+BOX
+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
+FIN_BOX
+CONNECTIONS:9
CONNECTION
Box01:Out:Box02:In
NumberOfControlPoints:0
CONNECTION
Box08:Out:Box01:In
NumberOfControlPoints:0
+CONNECTION
+Box10:DataPath:Box09:In1
+NumberOfControlPoints:0
+CONNECTION
+Box09:Out:Box08:In
+NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script
-# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu.bbs
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsVisu.bbs
# ----------------------------------
# BBTK GEditor Script
include creaVtk
include creaMaracasVisu
include wx
+include std
author "Author ??"
description "Description ??"
category "<VOID>"
-new MaskPoint Box01
+new vtk:MaskPoint Box01
set Box01.Ratio "1"
-new VectorsVisu Box02
+new creaVtk:VectorsVisu Box02
set Box02.ScaleFactor "100"
-new ViewerNV Box03
+new creaMaracasVisu:ViewerNV Box03
set Box03.nTypeView "5"
-new CommandButton Box04
+new wx:CommandButton Box04
set Box04.Label "Run"
-new LayoutSplit Box05
+new wx:LayoutSplit Box05
set Box05.Proportion "10"
-new FileSelector Box06
+new wx:FileSelector Box06
-new LoadHola Box07
+new vtk:LoadHola Box07
-new StructuredPointsReader Box08
+new vtk:StructuredPointsReader Box08
set Box08.In "/home/davila/Creatis/creaVtk/data/Vectors.vtk"
+new std:ConcatStrings Box09
+ set Box09.In2 "/creaVtk/Vectors.vtk"
+
+new std:Configuration Box10
+
connect Box01.Out Box02.In
connect Box08.Out Box01.In
+connect Box10.DataPath Box09.In1
+
+connect Box09.Out Box08.In
+
# Complex input ports
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg
# ----------------------------------
APP_START
renderer
-52.117833:88.203991:-900.000000
FIN_COMPLEX_PORT
-BOXES:10
+BOXES:8
BOX
creaVtk:VectorsVisu:Box00
ISEXEC:FALSE
-2.817636:-56.941435:-900.000000
-42.757364:-66.941435:-900.000000
+34.807364:-66.941435:-900.000000
FIN_BOX
BOX
creaVtk:PlaneWidget:Box01
ISEXEC:FALSE
-66.409855:2.022991:-900.000000
--20.834855:-7.977009:-900.000000
+-27.884855:-7.977009:-900.000000
FIN_BOX
BOX
vtk:ProbeFilter:Box03
ISEXEC:FALSE
-29.657798:-23.712064:-900.000000
-15.917202:-33.712064:-900.000000
+6.742202:-33.712064:-900.000000
FIN_BOX
BOX
vtk:vtkImageDataPointerRelay:Box04
ISEXEC:FALSE
31.994878:59.395975:-900.000000
-103.169878:49.395975:-900.000000
+84.169878:49.395975:-900.000000
FIN_BOX
BOX
std:MagicBox:Box05
ISEXEC:FALSE
-63.018802:49.434694:-900.000000
--17.443802:39.434694:-900.000000
+-26.943802:39.434694:-900.000000
FIN_BOX
BOX
creaVtk:PlaneVectorViso_Interface:Box06
ISEXEC:FALSE
53.843860:42.438188:-900.000000
-125.018860:32.438188:-900.000000
+105.768860:32.438188:-900.000000
PORT
typeFormsStr:"Line Arrow"
FIN_BOX
BOX
-std:ExecSystemCommand:Box11
-ISEXEC:FALSE
-90.911957:-18.902735:-900.000000
-162.086957:-28.902735:-900.000000
-PORT
-In:"echo pppppppp"
-FIN_BOX
-BOX
vtk:UpdateRender:Box13
ISEXEC:FALSE
-129.325679:-71.617843:-900.000000
--83.750679:-81.617843:-900.000000
+-89.000679:-81.617843:-900.000000
PORT
Active:"true"
PORT
BoxProcessMode:"Reactive"
FIN_BOX
BOX
-std:ExecSystemCommand:Box14
-ISEXEC:FALSE
--68.601930:-72.048687:-900.000000
-2.573070:-82.048687:-900.000000
-PORT
-In:"echo ccccccccccccccccc"
-FIN_BOX
-BOX
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
-CONNECTIONS:22
+CONNECTIONS:21
CONNECTION
Box03:Out:Box00:In
NumberOfControlPoints:0
Box06:typeForm:Box00:TypeForm
NumberOfControlPoints:0
CONNECTION
-Box06:boxChange:Box11:BoxExecute
-NumberOfControlPoints:0
-CONNECTION
Box05:Out:Box13:Renderer
NumberOfControlPoints:0
CONNECTION
-Box15:Out:Box14:BoxExecute
-NumberOfControlPoints:0
-CONNECTION
Box15:Out:Box00:BoxExecute
NumberOfControlPoints:0
CONNECTION
CONNECTION
Box15:Out:Box13:BoxExecute
NumberOfControlPoints:0
+CONNECTION
+Box01:BoxChange:Box15:In2
+NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs
+# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs
# ----------------------------------
include std
category "<VOID>"
-new VectorsVisu Box00
+new creaVtk:VectorsVisu Box00
-new PlaneWidget Box01
+new creaVtk:PlaneWidget Box01
-new ProbeFilter Box03
+new vtk:ProbeFilter Box03
-new vtkImageDataPointerRelay Box04
+new vtk:vtkImageDataPointerRelay Box04
-new MagicBox Box05
+new std:MagicBox Box05
-new PlaneVectorViso_Interface Box06
+new creaVtk:PlaneVectorViso_Interface Box06
set Box06.typeFormsStr "Line Arrow"
-new ExecSystemCommand Box11
- set Box11.In "echo pppppppp"
-
-new UpdateRender Box13
+new vtk:UpdateRender Box13
set Box13.Active "true"
set Box13.BoxProcessMode "Reactive"
-new ExecSystemCommand Box14
- set Box14.In "echo ccccccccccccccccc"
-
-new SharedMemory Box15
+new std:SharedMemory Box15
connect Box03.Out Box00.In
connect Box06.ScaleFactor Box00.ScaleFactor
connect Box06.Ratio Box01.Resolution
connect Box06.typeForm Box00.TypeForm
-connect Box06.boxChange Box11.BoxExecute
connect Box05.Out Box13.Renderer
-connect Box15.Out Box14.BoxExecute
connect Box15.Out Box00.BoxExecute
connect Box06.boxChange Box15.In1
connect Box15.Out Box13.BoxExecute
+connect Box01.BoxChange Box15.In2
# Complex input ports
input vtkImageData Box04.In " "
// * TYPE is the C++ type of the input/output
// (the one provided in the attribute 'type' of the tag 'input')
-printf("EED VectorsVisu::Process Start \n");
-
-if ( bbGetInputActive()==true)
-{
- printf("EED VectorsVisu::Process active = true \n");
-} else {
- printf("EED VectorsVisu::Process active = false \n");
-}
-
- printf("EED VectorsVisu::Process In = %p\n",bbGetInputIn() );
- printf("EED VectorsVisu::Process ScaleFactor = %f\n",bbGetInputScaleFactor() );
- printf("EED VectorsVisu::Process Opacity = %f\n",bbGetInputOpacity() );
- printf("EED VectorsVisu::Process Renderer = %p\n",bbGetInputRenderer() );
-
vectorsvisu.SetActive( bbGetInputActive() );
vectorsvisu.SetDataObject( bbGetInputIn() );
vectorsvisu.SetScaleFactor( bbGetInputScaleFactor() );
vectorsvisu.SetTypeForm( bbGetInputTypeForm() );
vectorsvisu.Process();
bbSetOutputOut( vectorsvisu.GetProp3D() );
-printf("EED VectorsVisu::Process End\n");
}
//=====
//------------------------------------------------------------------------
void vtkTensorsVisu::Process()
{
-printf("EED vtkTensorsVisu::Process() start\n");
if (_active==true)
{
if(GetTypeForm()==2) // source superquadratic
#if VTK_MAJOR_VERSION <= 5
tg->SetSource(superquadratic->GetOutput());
#else
+ superquadratic->Update();
tg->SetSourceData(superquadratic->GetOutput());
#endif
} else if(GetTypeForm()==1) { // source sphere
#if VTK_MAJOR_VERSION <= 5
tg->SetSource(ss->GetOutput());
#else
+ ss->Update();
tg->SetSourceData(ss->GetOutput());
#endif
} else { // source cube
#if VTK_MAJOR_VERSION <= 5
tg->SetSource(cs->GetOutput());
#else
+ cs->Update();
tg->SetSourceData(cs->GetOutput());
#endif
}
// tg->SetScaling(25);
tg->SetScaleFactor( GetScaleFactor() );
-printf("EED vtkTensorsVisu::Process() 1\n");
-
-
//The normals are needed to generate the right colors and if
// not used some of the glyphs are black.
//EED 2017-01-01 Migration VTK7
pdn->SetInput(tg->GetOutput());
_pdm->SetInput( pdn->GetOutput() );
#else
-printf("EED vtkTensorsVisu::Process() 1.1\n");
pdn->SetInputData(tg->GetOutput());
-printf("EED vtkTensorsVisu::Process() 1.2\n");
+ pdn->Update();
_pdm->SetInputData( pdn->GetOutput() );
_pdm->Update();
#endif
-printf("EED vtkTensorsVisu::Process() 1.3\n");
_actor->SetMapper( _pdm );
-printf("EED vtkTensorsVisu::Process() 1.4\n");
_actor->GetProperty()->SetOpacity( GetOpacity() );
-
-
-
-printf("EED vtkTensorsVisu::Process() 1.5\n");
tg->SetColorModeToEigenvalues();
// tg->SetColorModeToScalars();
-printf("EED vtkTensorsVisu::Process() 1.6\n");
tg->Update();
-printf("EED vtkTensorsVisu::Process() 1.7\n");
-
-
-
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
pd = tg->GetOutput();
#endif
pod = pd->GetPointData();
-printf("EED vtkTensorsVisu::Process() 1.8\n");
pod->Update();
-printf("EED vtkTensorsVisu::Process() 1.9\n");
tg->Update();
vtkPolyData *pd_pdn = pdn->GetOutput();
vtkPolyData *pd_tg = tg->GetOutput();
vtkPointData *pointdata_tg = pd_tg->GetPointData();
-printf("EED vtkTensorsVisu::Process() 1.20\n");
vtkPolyData *pd_do = (vtkPolyData*)GetDataObject();
vtkPointData *pointdata_do = pd_do->GetPointData();
vtkIdType numSourcePts;
// vtkIdType numSourceCells;
-printf("EED vtkTensorsVisu::Process() 1.22\n");
vtkPoints *sourcePts = tg->GetSource()->GetPoints();
-printf("EED vtkTensorsVisu::Process() 1.23\n");
numSourcePts = sourcePts->GetNumberOfPoints();
// numSourceCells = tg->GetSource()->GetNumberOfCells();
-
-printf("EED vtkTensorsVisu::Process() 2\n");
-
-
vtkDataArray *tensorsArray = pointdata_do->GetArray("tensors");
if (tensorsArray)
{
tg->Update();
} // if tensorsArray
-
-
-
-
-printf("EED vtkTensorsVisu::Process() 3\n");
-
_pdm->ScalarVisibilityOn();
_pdm->SetColorModeToMapScalars();
//_pdm->SetColorModeToDefault();
}
*/
-
-
} // _active
-printf("EED vtkTensorsVisu::Process() 4\n");
-
- VisibilityActor();
-
-printf("EED vtkTensorsVisu::Process() END\n");
-
-
+ VisibilityActor();
}
*/
#include "vtkVectorsTensorsVisuBase.h"
-
-
#include "vtkObjectFactory.h"
-
-
-
vtkStandardNewMacro(vtkLookupTableDirectionVector);
// Construct with range=(0,1); and hsv ranges set up for rainbow color table
{
}
-
-
unsigned char *vtkLookupTableDirectionVector::MapValue(double v)
{
//int idx = this->GetIndex(v);
- //return (this->Table->GetPointer(0) + 4*idx);
-
+ //return (this->Table->GetPointer(0) + 4*idx);
return 0;
}
}
-
//----------------------------------------------------------------------------
void vtkLookupTableDirectionVector::MapScalarsThroughTable2(void *input,
unsigned char *output,
{
}
-
-
//------------------------------------------------------------------------------
void vtkVectorsTensorsVisuBase::VisibilityActor()
{
} // if _active==false
}
-
//------------------------------------------------------------------------------
void vtkVectorsTensorsVisuBase::SetColorLaw(int colorlaw)
{
#ifndef _VTKVECTORSTENSORSVISUBASE_H_
#define _VTKVECTORSTENSORSVISUBASE_H_
-
#include "vtkActor.h"
#include "vtkLookupTable.h"
#include "vtkPolyDataMapper.h"
#include "vtkSmartPointer.h"
#include "vtkVectorNorm.h"
-
//---------------------------------------------
// Class Name: vtkVectorsTensorsVisuBase
// [classdescription]
//---------------------------------------------
-
-
-
class /*VTK_COMMON_EXPORT*/ vtkLookupTableDirectionVector : public vtkScalarsToColors
{
public:
void MapScalarsThroughTable2(void *input, unsigned char *output,
int inputDataType, int numberOfValues,
int inputIncrement, int outputIncrement);
-
-
+
protected:
-
- double TableRange[2];
+ double TableRange[2];
vtkLookupTableDirectionVector(int sze=256, int ext=256);
~vtkLookupTableDirectionVector();
-
private:
vtkLookupTableDirectionVector(const vtkLookupTableDirectionVector&); // Not implemented.
};
-
-
-
-
-
-
-
-
-
-
-
-
class vtkVectorsTensorsVisuBase
{
void SetColorLaw(int);
void SetColor(std::vector<double>);
- bool GetActive();
+ bool GetActive();
vtkDataObject* GetDataObject();
- vtkRenderer* GetRenderer();
+ vtkRenderer* GetRenderer();
double GetScaleFactor();
double GetOpacity();
vtkProp3D* GetProp3D();
int GetTypeForm();
virtual void Process();
- void VisibilityActor();
+ void VisibilityActor();
//Methods and attributes only visible by this class
//---------------------------------------------
private:
- bool _actorAdded;
-
- double _scalefactor;
- double _opacity;
- vtkDataObject *_dataobject;
- vtkRenderer *_renderer;
- int _typeForm;
-
+ bool _actorAdded;
+ double _scalefactor;
+ double _opacity;
+ vtkDataObject *_dataobject;
+ vtkRenderer *_renderer;
+ int _typeForm;
protected:
- bool _firsttime;
- bool _active;
-
- vtkSmartPointer<vtkPolyDataMapper> _pdm;
- vtkSmartPointer<vtkActor> _actor;
- vtkLookupTableDirectionVector *_LutEED;
+ bool _firsttime;
+ bool _active;
+ vtkSmartPointer<vtkPolyDataMapper> _pdm;
+ vtkSmartPointer<vtkActor> _actor;
+ vtkLookupTableDirectionVector *_LutEED;
int _colorlaw;
double _colorR,_colorG,_colorB;
-
};
//-end of _VTKVECTORSTENSORSVISUBASE_H_------------------------------------------------------
_vtkglyph = vtkGlyph3D::New();
}
-
//------------------------------------------------------------------------------
vtkVectorsVisu::~vtkVectorsVisu()
{
}
+
//------------------------------------------------------------------------------
void vtkVectorsVisu::Process()
{
-printf("EED vtkVectorsVisu::Process Start\n");
if(_active==true)
{
if(GetTypeForm()==1) // source Arrow
{
#if VTK_MAJOR_VERSION <= 5
- _vtkglyph->SetSource( _vtkarrowsource->GetOutput() );
+ _vtkglyph->SetSource( _vtkarrowsource->GetOutput() );
#else
- _vtkglyph->SetSourceData( _vtkarrowsource->GetOutput() );
+ _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() );
-printf("EED vtkVectorsVisu::Process A\n" );
-
_vtkglyph->Update();
//EED bbGetInputIn()->GetPointData()->AddArray( nda );
//EED2 _pdm->ScalarVisibilityOn();
-
-
-
-
_pdm->ScalarVisibilityOn();
_pdm->SetColorModeToMapScalars();
//_pdm->SetColorModeToDefault();
//_LutEED->SetVectorModeToRGBColors();
//_LutEED->SetVectorModeToMagnitud();
-
-
// _pdm->SetScalarModeToUsePointFieldData();
_pdm->SetLookupTable( _LutEED );
_pdm->SelectColorArray( "GlyphVector" );
}// if _active
VisibilityActor();
-printf("EED vtkVectorsVisu::Process END\n");
}
-
-
-
-
-
private:
vtkArrowSource *_vtkarrowsource;
vtkLineSource *_vtklinesource;
- vtkGlyph3D *_vtkglyph;
+ vtkGlyph3D *_vtkglyph;
};
//-end of _vtkVectorsVISU_H_------------------------------------------------------