[vtkusers] How to set premitives' edge color?

L.J. van Ruijven (ACTA) L.J.vanRuijven at amc.uva.nl
Thu Apr 26 04:23:44 EDT 2001


Hi Ben,

I also wrote a program in tcl/tk to make the edges visible.The file 
Condyle_Model.VTK contains an object of type vtkPolyData.

Here is the complete code:
# intro copied from vtkInt.tcl
catch {load vtktcl}
source c:/progs/vtk31/examplesTcl/vtkInt.tcl
vtkRenderer ren1
    ren1 SetBackground 1 1 1
vtkRenderWindow renWin
    renWin AddRenderer ren1
vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin

# read the surface data
vtkDataSetReader reader
    reader SetFileName "Condyle_Model.VTK"

vtkDataSetMapper moldMapper
    moldMapper SetInput [reader GetOutput]
    moldMapper SetScalarVisibility 0
vtkActor moldActor
    moldActor SetMapper moldMapper
    [moldActor GetProperty] SetOpacity 1
    ren1 AddActor moldActor

vtkDataSetMapper moldMapper1
    moldMapper1 SetInput [reader GetOutput]
    moldMapper1 SetScalarVisibility 0
vtkActor moldActor1
    moldActor1 SetMapper moldMapper1
    set prop [moldActor1 GetProperty]
    $prop SetRepresentationToWireframe
    $prop SetColor 0 0 0
    $prop SetLineWidth 2
    moldActor1 SetProperty $prop
    ren1 AddActor moldActor1

iren Render

success Leo.


> from that of the facets themselves. This is how my code segment looks
> like right now:
> 
>   vtkActor *actor1 = vtkActor::New();
>   actor1->SetMapper(mapper);
>   actor1->GetProperty()->SetColor(1.0000,0.7529,0.7961);
>   actor1->GetProperty()->SetOpacity(1);
>   actor1->GetProperty()->EdgeVisibilityOn();  %enable edge visibility
>   actor1->GetProperty()->SetEdgeColor(blue);  %
> 
> However, I can't see what I expect to see, though no any
> compling/linking errors are reported.
> 
> I wonder if anybody out there have had the similar problem before, and
> how fixed it if possible? I use VTK within a MFC application.
> 
> Thank you very much.
> Ben
> 
> __________________________________________________

***************************************************************************
* drs L.J. van Ruijven                 Tel: 31 (0)20 566 5357               *
* Dept. of Functional Anatomy, ACTA    FAX: 31 (0)20 691 1856               *
* Meibergdreef 15                      email: L.J.vanRuijven at AMC.UvA.Nl   *
* 1105 AZ Amsterdam                                                       *
***************************************************************************





More information about the vtkusers mailing list