[Paraview] Contribution : Silhouette edges filter
Paul Edwards
paul.m.edwards at gmail.com
Wed Jul 30 07:55:02 EDT 2008
The XML file is the only extra part that is needed in order to create
a plugin for ParaView but I'm still not sure how to go about
initialising the camera.
I've included the CMakeLists.txt required to build the plugin at the
end of the mail.
Regards,
Paul
8<--------------------------------
FIND_PACKAGE(ParaView REQUIRED)
INCLUDE(${PARAVIEW_USE_FILE})
# Server Manager Plugin
ADD_PARAVIEW_PLUGIN(PolyDataSilhouetteSMPlugin "0.1"
SERVER_MANAGER_XML vtkPolyDataSilhouette.xml
SERVER_MANAGER_SOURCES vtkPolyDataSilhouette.cxx)
-------------------------------->8
2008/7/30 <Thierry.CARRARD at cea.fr>:
> Hi,
>
> You don't need to initialize the prop, just the camera. I use it in my own VTK application so I'm not so familiar with Paraview architecture. Basically you have to initialize the camera with the one that is used by you're rendering window's renderer.
> Here is a c++ pseudo-code :
> renderer = renderWindow->GetRenderers()->GetFirstRenderer(); // correct if you have only one render
>
> mySilhouetteFilter = vtkPolyDataSilhouette::New();
> mySilhouetteFilter->SetInput( somePolyData );
> mySilhouetteFilter->SetCamera( renderer->GetActiveCamera() );
> mySilhouetteFilter->SetDirectionToCameraOrigin(); // this is the default
>
> myMapper = vtkPolyDataMapper::New();
> myMapper->SetInput(mySilhouetteFilter->GetOutput());
>
> myActor = vtkActor::New();
> myActor->SetMapper(myMapper);
>
> renderWindow->AddViewProp(myActor);
>
> PS: if you have a working plug-in for ParaView, please put it on the list or mail it to me.
>
> Regards,
> Thierry
>
>
> -----Message d'origine-----
> De : Paul Edwards [mailto:paul.m.edwards at gmail.com]
> Envoyé : mercredi 30 juillet 2008 12:14
> À : CARRARD Thierry 601617
> Cc : paraview at paraview.org; COLIN DE VERDIERE Guillaume 114968; NOMINE Jean-Philippe 126153; COLOMBET Laurent 173059
> Objet : Re: [Paraview] Contribution : Silhouette edges filter
>
> The filter looks good. I've tried to create an XML file to use in
> ParaView. I've attached my attempt although I don't know how to
> initialise the camera or prop. Can anyone help here?
>
> Regards,
> Paul
>
> 2008/7/30 <Thierry.CARRARD at cea.fr>:
>> Dear colleagues,
>>
>>
>>
>> Here attached is a vtk filter that extracts silhouette edges from a poly
>> data.
>>
>> Silhouette of a surface is made of lines lying on the surface where the
>> surface normal is orthogonal to a direction.
>>
>>
>>
>> Such edges are useful to produce CAD or sketch like drawings. It can be
>> combined with a constant colored surface rendering to hide non-visible
>> edges.
>>
>>
>>
>> Attached example images are made from an iso-surface, but much nicer results
>> are achieved when working with lagrangian numerical simulations.
>>
>>
>>
>>
>>
>> Usage:
>>
>>
>>
>> Pipeline: vtkPolyData à vtkPolyDataSilhouette à vtkPolyDataMapper à vtkActor
>>
>>
>>
>> Parameters: SpecifiedVector and CameraVector modes use a uniform direction
>> (resp. explicit or from a camera), while SpecifiedOrigin and CameraOrigin
>> modes use the origin-to-center-of-the-edge direction. CameraOrigin mode is
>> the one to use to produce sketch like drawings.
>>
>>
>>
>> tips: try to combine black silhouettes edges (with line width between 1 and
>> 3) with different kinds of surface base renderings (with or without
>> lighting, constant colored or one color per material). It emphasizes very
>> well the shape of some phenomena, especially for numerical simulations.
>>
>>
>>
>> Note: Silhouette edges can also serve to generate shadow volumes, but this
>> would need an additional contribution.
>>
>>
>>
>>
>>
>> Contribution :
>>
>>
>>
>> Author:
>>
>> Thierry Carrard
>>
>>
>>
>> Affiliation:
>>
>> Commissariat à l'Energie Atomique (CEA), Direction des Applications
>> Militaires, Département des Sciences de l'Information et de la Simulation.
>>
>> BP12, 91680 Bruyères Le Chatel, France.
>>
>> _______________________________________________
>> ParaView mailing list
>> ParaView at paraview.org
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>>
>
More information about the ParaView
mailing list