wx:Slider:Box01
ISEXEC:FALSE
-2.231532:70.499689:-900.000000
-49.168468:60.499689:-900.000000
+29.343468:60.499689:-900.000000
PORT
In:"100"
PORT
wx:LayoutTab:Box04
ISEXEC:FALSE
-83.037560:-20.291032:-900.000000
--25.477560:-30.291032:-900.000000
+-46.787560:-30.291032:-900.000000
FIN_BOX
BOX
std:MultipleInputs:Box05
wx:Slider:Box06
ISEXEC:FALSE
76.333366:74.957602:-900.000000
-127.733366:64.957602:-900.000000
+107.908366:64.957602:-900.000000
PORT
ChangeResolution:"true"
PORT
-30.731216:78.085161:-900.000000
PORT
In:"Line Arrow"
+PORT
+WinHeight:"50"
FIN_BOX
BOX
wx:LayoutLine:Box09
new wx:ComboBox Box08
set Box08.In "Line Arrow"
+ set Box08.WinHeight "50"
new wx:LayoutLine Box09
set Box09.Orientation "H"
BoxChange
-148.185967:-105.619763:-900.000000
FIN_COMPLEX_PORT
-COMPLEXINPUTS:3
+COMPLEXINPUTS:4
COMPLEX_PORT
renderer
--116.813076:40.976013:-900.000000
+-115.777988:44.672757:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
vtkDataObject
--138.011324:45.349330:-900.000000
+-139.194282:43.574893:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
boxExecute
--196.920121:41.238358:-900.000000
+-196.920121:43.900014:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+orientation
+-95.893542:43.917320:-900.000000
FIN_COMPLEX_PORT
BOXES:3
BOX
PORT
BoxProcessMode:"Reactive"
FIN_BOX
-CONNECTIONS:11
+CONNECTIONS:12
CONNECTION
Box05:Opacity:Box03:Opacity
NumberOfControlPoints:0
CONNECTION
Box05:Type:Box03:TypeForm
NumberOfControlPoints:0
+CONNECTION
+orientation:orientation:Box03:Orientation
+NumberOfControlPoints:0
APP_END
input renderer Box03.Renderer " "
input vtkDataObject Box03.In " "
input boxExecute Box07.In1 " "
+input orientation Box03.Orientation " "
# Complex output ports
output BoxChange Box03.BoxChange " "
vectorsvisu.SetOpacity( bbGetInputOpacity() );
vectorsvisu.SetRenderer( bbGetInputRenderer() );
vectorsvisu.SetTypeForm( bbGetInputTypeForm() );
+ vectorsvisu.SetOrientation( bbGetInputOrientation() );
vectorsvisu.Process();
bbSetOutputOut( vectorsvisu.GetProp3D() );
bbSetInputScaleFactor(500);
bbSetInputOpacity(1);
bbSetInputTypeForm(0);
+ bbSetInputOrientation(0);
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
BBTK_DECLARE_INPUT(ScaleFactor,double);
BBTK_DECLARE_INPUT(Opacity,double);
BBTK_DECLARE_INPUT(TypeForm,int);
+ BBTK_DECLARE_INPUT(Orientation,int);
BBTK_DECLARE_OUTPUT(Out,vtkProp3D*);
BBTK_PROCESS(Process);
void Process();
BBTK_INPUT(VectorsVisu,Opacity,"Opacity (1 default)",double,"");
BBTK_INPUT(VectorsVisu,Renderer,"vtkRenderer",vtkRenderer*,"");
BBTK_INPUT(VectorsVisu,TypeForm,"0 Line, 1 Arrow (default 0)",int,"");
+ BBTK_INPUT(VectorsVisu,Orientation,"(default 0) 0=3D, 1=xy, 2=yz, 3=xz",int,"");
BBTK_OUTPUT(VectorsVisu,Out,"vtkProp3D of an vtkActor",vtkProp3D*,"");
BBTK_END_DESCRIBE_BLACK_BOX(VectorsVisu);
//=====
dim[0]=ext[1]-ext[0]+1;
dim[1]=ext[3]-ext[2]+1;
dim[2]=ext[5]-ext[4]+1;
- std::cout<<"dim "<< dim[0] <<" "<< dim[1] <<" "<< dim[2] <<std::endl;
-
imageY->GetSpacing(spc);
int i;
-printf("EED vtkImageDataStrucPoints::joinComponents sizeimage %d\n", sizeimage );
for( i = 0 ; i < sizeimage ; i++ )
{
vx = *ptrX;
ss = vtkSphereSource::New();
superquadratic = vtkSuperquadricSource::New();
cs = vtkCubeSource::New();
- tg = vtkTensorGlyph::New();
+
+ tg = NULL;
+
pdn = vtkPolyDataNormals::New();
pd = vtkPolyData::New();
pod = vtkPointData::New();
{
if(GetTypeForm()==2) // source superquadratic
{
+ if (tg==NULL) { tg = vtkTensorGlyph::New(); }
+
superquadratic->SetThetaResolution(20);
superquadratic->SetPhiResolution(20);
#if VTK_MAJOR_VERSION <= 5
inIncr=3;
- printf("EED length %d %p\n", length,input);
+// printf("EED length %d %p\n", length,input);
// mag = new double[length];
for (i = 0; i < length; ++i)
{
int inputIncrement,
int outputFormat)
{
- printf("vtkLookupTableEED::MapScalarsThroughTable2 inputIncrement=%d inputDataType=%d\n",inputIncrement,inputDataType);
+// printf("vtkLookupTableEED::MapScalarsThroughTable2 inputIncrement=%d inputDataType=%d\n",inputIncrement,inputDataType);
// if (this->UseMagnitude && inputIncrement > 1)
// {
switch (inputDataType)
_dataobject = NULL;
_renderer = NULL;
_typeForm = 0;
+ _orientation = 0;
_LutEED = vtkLookupTableDirectionVector::New();
//_LutEED->SetVectorMode(0);
}
}
+//------------------------------------------------------------------------------
+void vtkVectorsTensorsVisuBase::SetOrientation(int orientation)
+{
+ _orientation = orientation;
+}
+
+//------------------------------------------------------------------------------
+int vtkVectorsTensorsVisuBase::GetOrientation()
+{
+ return _orientation;
+}
+
void SetTypeForm(int);
void SetColorLaw(int);
void SetColor(std::vector<double>);
+ void SetOrientation(int orientation);
bool GetActive();
vtkDataObject* GetDataObject();
double GetOpacity();
vtkProp3D* GetProp3D();
int GetTypeForm();
+ int GetOrientation();
virtual void Process();
void VisibilityActor();
vtkDataObject *_dataobject;
vtkRenderer *_renderer;
int _typeForm;
+ int _orientation;
protected:
bool _firsttime;
:vtkVectorsTensorsVisuBase()
{
_vtkarrowsource = vtkArrowSource::New();
- _vtkglyph = vtkGlyph3D::New();
- _vtklinesource = vtkLineSource::New();
+ _vtkglyph = NULL;
+ _vtklinesource = vtkLineSource ::New();
+ _trans = vtkTransform ::New();
double point1[3];
double point2[3];
{
if(_active==true)
{
+ if (_vtkglyph==NULL)
+ {
+ if (GetOrientation()==0)
+ {
+ _vtkglyph = vtkGlyph3D::New();
+ } // _orientation
+ if ((GetOrientation()>=1) && (GetOrientation()<=3))
+ {
+ _vtkglyph = vtkGlyph2D::New();
+ } // _orientation
+ } // _vtkglyph NULL
+
+
#if VTK_MAJOR_VERSION <= 5
_vtkglyph->SetInput( GetDataObject() );
#else
//_vtkglyph->GetOutput()->Print(std::cout);
//printf("EED -------------------------------------------\n");
//data->Print(std::cout);
-int i,sizeDa = data->GetNumberOfArrays();
-for (i=0;i<sizeDa;i++)
-{
- data->GetArray(i)->Print(std::cout);
-}
+//int i,sizeDa = data->GetNumberOfArrays();
+//for (i=0;i<sizeDa;i++)
+//{
+// data->GetArray(i)->Print(std::cout);
+//}
_pdm->ScalarVisibilityOn();
_pdm->SetColorModeToMapScalars();
#else
_pdm->Update();
#endif
+
+ // Orientation 0 3D OK
+ // Orientation 1 2D xy OK
+
+ // Orientation 2 2D yz
+ if (GetOrientation()==2)
+ {
+ _trans->Identity();
+ _trans->Translate(900,0,0);
+ _trans->RotateWXYZ(-90,0,1,0);
+ _actor->SetUserTransform(_trans);
+ }
+
+ // Orientation 3 2D xz
+ if (GetOrientation()==3)
+ {
+ _trans->Identity();
+ _trans->RotateWXYZ(90,1,0,0);
+ _actor->SetUserTransform(_trans);
+ }
+
_actor->SetMapper( _pdm );
_actor->GetProperty()->SetOpacity( GetOpacity() );
}// if _active
#include "vtkArrowSource.h"
#include "vtkLineSource.h"
+
#include "vtkGlyph3D.h"
+#include "vtkGlyph2D.h"
+#include <vtkTransform.h>
+
//---------------------------------------------
// Class Name: vtkVectorsVisu
// [classdescription]
private:
vtkArrowSource *_vtkarrowsource;
vtkLineSource *_vtklinesource;
- vtkGlyph3D *_vtkglyph;
+ vtkGlyph3D *_vtkglyph;
+ vtkTransform *_trans;
};
//-end of _vtkVectorsVISU_H_------------------------------------------------------