<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>Hello, I'm
working on my thesis with the VTK ToolKit and i have some
<BR>problems...<BR><BR>I want to put diffrent actors on some points of a mesh. I
use vtkGlyph3D and <BR>set my sources in and setIndexModeToScalar();<BR>//
CODE<BR> glyph->SetSource(0, spheres->GetOutput());<BR>
glyph->SetSource(1, spheres->GetOutput());<BR>
glyph->SetSource(2, cubes->GetOutput());<BR> glyph->SetSource(3,
spheres->GetOutput());<BR> glyph->SetSource(4,
cubes->GetOutput());<BR> glyph->SetSource(5,
cubes->GetOutput());<BR> glyph->SetSource(6,
cones->GetOutput());<BR>
glyph->SetIndexModeToScalar();<BR>//<BR><BR>==> The problem is that only
for the value 0 i see a sphere, the rest of the <BR>value's are all
cones!!! You can see it at the image : <BR></FONT><A href=""><FONT
face="Times New Roman"
size=3>http://webs.hogent.be/~023174sv/BC2.jpg</FONT></A><BR><BR><FONT
face="Times New Roman" size=3>You can see a actor of the lookuptable where you
can see that each value has <BR>a diffrent colour, but alle values 1 --> 6
are CONES , and only number 6 <BR>should be a cone....<BR><BR>Can anyone please
help me ?<BR><BR>Also i have a other question, the size of the actors should fit
to the mesh, <BR>that means that when the points are further from eachother the
actors should <BR>be bigger when there are lot's of point laying next to
eachother....., is it <BR>possible in any way to get the maximum distance
between points of a <BR>unstructured grid?? Or any option to solve this
problem<BR><BR>// HERE IS PART OF MY CODE:<BR> vtkConeSource * cones =
vtkConeSource::New();<BR> cones->SetResolution(10);<BR>
cones->SetRadius(radius);<BR>
cones->SetHeight(radius*2);<BR><BR> vtkSphereSource *spheres =
vtkSphereSource::New();<BR>
spheres->SetThetaResolution(10);<BR>
spheres->SetPhiResolution(10);<BR>
spheres->SetRadius(radius);<BR><BR> vtkCubeSource * cubes =
vtkCubeSource::New();<BR> cubes->SetXLength(radius);<BR>
cubes->SetYLength(radius);<BR> cubes->SetZLength(radius);<BR><BR>//
MOET IN EEN KLASSE KOMEN VIA MAPPER vtkcolor["kleur"] return double*<BR>//<BR>//
Setting up a color database: white, red, green, blue,
yellow<BR>//
cyan, magenta, sky blue, black<BR>//<BR> double** vtkcolors = new
double*[9];<BR> for (int i=0; i<9; i++)<BR> vtkcolors[i] = new
double[4];<BR><BR> //white<BR> vtkcolors[0][0]=1;<BR> vtkcolors[0][1]=1;<BR> vtkcolors[0][2]=1;<BR> vtkcolors[0][3]=1;<BR><BR> //red<BR> vtkcolors[1][0]=1;<BR> vtkcolors[1][1]=0;<BR> vtkcolors[1][2]=0;<BR> vtkcolors[1][3]=1;<BR><BR> //green<BR> vtkcolors[2][0]=0;<BR> vtkcolors[2][1]=1;<BR> vtkcolors[2][2]=0;<BR> vtkcolors[2][3]=1;<BR><BR> //blue<BR> vtkcolors[3][0]=0;<BR> vtkcolors[3][1]=0;<BR> vtkcolors[3][2]=1;<BR> vtkcolors[3][3]=1;<BR><BR> //yellow<BR> vtkcolors[4][0]=1;<BR> vtkcolors[4][1]=1;<BR> vtkcolors[4][2]=0;<BR> vtkcolors[4][3]=1;<BR><BR> //cyan<BR> vtkcolors[5][0]=0;<BR> vtkcolors[5][1]=1;<BR> vtkcolors[5][2]=1;<BR> vtkcolors[5][3]=1;<BR><BR> //mangenta<BR> vtkcolors[6][0]=1;<BR> vtkcolors[6][1]=0;<BR> vtkcolors[6][2]=1;<BR> vtkcolors[6][3]=1;<BR><BR> //sky
blue<BR> vtkcolors[7][0]=0.5;<BR> vtkcolors[7][1]=0.5;<BR> vtkcolors[7][2]=1;<BR> vtkcolors[7][3]=1;<BR><BR> //black<BR> vtkcolors[8][0]=0;<BR> vtkcolors[8][1]=0;<BR> vtkcolors[8][2]=0;<BR> vtkcolors[8][3]=1;<BR><BR><BR> vtkLookupTable
*glyphlut = vtkLookupTable::New();<BR>
glyphlut->SetRange(0,6);<BR>
glyphlut->SetNumberOfTableValues(7);<BR>
glyphlut->SetTableValue(0,vtkcolors[1]);<BR>
glyphlut->SetTableValue(1,vtkcolors[2]);<BR>
glyphlut->SetTableValue(2,vtkcolors[3]);<BR>
glyphlut->SetTableValue(3,vtkcolors[4]);<BR>
glyphlut->SetTableValue(4,vtkcolors[5]);<BR>
glyphlut->SetTableValue(5,vtkcolors[6]);<BR>
glyphlut->SetTableValue(6,vtkcolors[7]);<BR>
glyphlut->Build();<BR><BR> vtkGlyph3D *glyph =
vtkGlyph3D::New();<BR> glyph->SetInput(polydata);<BR>
glyph->ScalingOff();<BR> glyph->SetNumberOfSources(7);<BR>
glyph->SetSource(0, spheres->GetOutput());<BR>
glyph->SetSource(1, spheres->GetOutput());<BR>
glyph->SetSource(2, cubes->GetOutput());<BR> glyph->SetSource(3,
spheres->GetOutput());<BR> glyph->SetSource(4,
cubes->GetOutput());<BR> glyph->SetSource(5,
cubes->GetOutput());<BR> glyph->SetSource(6,
cones->GetOutput());<BR> glyph->SetIndexModeToScalar();<BR>
glyph->SetColorModeToColorByScalar();<BR>
glyph->Update();<BR><BR><BR> //--- MAPPING AND RENDERING
---//<BR> vtkPolyDataMapper *umap = vtkPolyDataMapper::New();<BR>
umap->SetInput(glyph->GetOutput());<BR>
umap->ScalarVisibilityOn();<BR>
umap->SetLookupTable(glyphlut);<BR>
umap->UseLookupTableScalarRangeOn();<BR>
umap->SetColorModeToMapScalars();<BR><BR> vtkDataSetMapper *gmap =
vtkDataSetMapper::New();<BR>
gmap->SetInput(ugridreader->GetOutput());<BR>
gmap->ScalarVisibilityOff();<BR><BR>//// MOET LEGENDE WORDEN / MAG
WEG<BR> loadBarActor();<BR>
baractor->SetLookupTable(umap->GetLookupTable());<BR>
baractor->SetTitle(toConstChar("Boundairy
Conditions"));<BR><BR> vtkActor *uactor = vtkActor::New();<BR>
uactor->SetMapper(umap);<BR><BR> vtkActor *gactor =
vtkActor::New();<BR> gactor->SetMapper(gmap);<BR>
gactor->GetProperty()->SetColor(0.5,0.5,0.5);<BR>
gactor->GetProperty()->SetOpacity(0.1);<BR>
gactor->GetProperty()->SetRepresentationToWireframe();<BR><BR> ren->AddActor(gactor);<BR> ren->AddActor(uactor);<BR><BR> //start
clock<BR> Stopwatch
test;<BR> test.start();<BR><BR> //render<BR> renWin->Render();</FONT><BR></FONT></DIV></BODY></HTML>