[Paraview] [EXTERNAL] Duplicate Layouts

Mondry, Tobias Tobias.Mondry at pfinder.de
Tue Dec 6 05:54:15 EST 2016


Hi Venke,

thank you for your Script.
I modified your Script a little. It is working for me, as long as I have only one view in the layout.
When I have more than one view I can't reproduce the layout. It is possible to read and set the ViewSize. Is there a way to read and define the exact location of a view in a layout?

Here the modified script, in case it helps someone:

rv1=GetActiveView()
ALL=GetSources()

dispProps=list()

for i in range(len(ALL.keys())):
    dispProps.append(GetDisplayProperties(ALL.values()[i]))


viewLayout1 = GetLayout()
#viewLayout1.SplitHorizontal(0, 0.5)

viewLayout2 = CreateLayout()

rv2=CreateView('RenderView')

SetActiveView(rv2)

propNameList=['Visibility', 'Color', 'LookupTable', 'DiffuseColor', 'Scale', 'Representation', 'Texture', 'Opacity','Origin','Position','ScaleFactor']

for j in range(len(ALL.keys())):

    SetDisplayProperties(ALL.values()[j],ColorArrayName=dispProps[j].ColorArrayName[1])
    for name in propNameList:
        try:
            eval('SetDisplayProperties(ALL.values()[j], ' + name + ' =dispProps[j].' + name + ')')
        except:
            pass



ResetCamera()

Greetings
Tobias

_____________________________
Von: postgurke at web.de [postgurke at web.de]
Gesendet: Donnerstag, 1. Dezember 2016 11:01
An: Mondry, Tobias; Scott, W Alan; paraview at paraview.org
Betreff: Re: [Paraview] [EXTERNAL] Duplicate Layouts

Hi Tobias

You could get the DisplayProperties of all your objects and then set them
accordingly in the new render window using the Python Shell. I have written a
short script for myself for this task --- however something is not quite
correct, as strange colorings sometimes appear after turning the model in the
second view. It can be fixed by making that object invisible and visible again,
but still.... Maybe someone more experienced can correct my answer in that
respect or has a better idea to tackle this problem...?

Here is my code:

rv1=GetActiveViewOrCreate('RenderView')
ALL=GetSources()

dispProps=list()
for i in range(len(ALL.keys())):
        dispProps.append(GetDisplayProperties(ALL.values()[i]))

viewLayout1 = GetLayout()
viewLayout1.SplitHorizontal(0, 0.5)

rv2=CreateView('RenderView')
viewLayout1.AssignView(2, rv2)

SetActiveView(rv2)

for j in range(len(ALL.keys())):
        SetDisplayProperties(ALL.values()[j],Visibility=dispProps[j].Visibility)

SetDisplayProperties(ALL.values()[j],ColorArrayName=dispProps[j].ColorArrayName[1])
        SetDisplayProperties(ALL.values()[j],LookupTable=dispProps[j].LookupTable)
        SetDisplayProperties(ALL.values()[j],DiffuseColor=dispProps[j].DiffuseColor)
        SetDisplayProperties(ALL.values()[j],Scale=dispProps[j].Scale)

SetDisplayProperties(ALL.values()[j],Representation=dispProps[j].Representation)
        SetDisplayProperties(ALL.values()[j],Texture=dispProps[j].Texture)



Cheers
Venke



> "Mondry, Tobias" <Tobias.Mondry at pfinder.de> hat am 1. Dezember 2016 um 08:46
> geschrieben:
>
>
> Camera link is nice, but not what I want.
>
> Example:
> - load a stl file
> - make a clip and use red as solid color
> - open a new view or layout
>
> Now it would be useful to have the same "image" in the new view or layout:
> - the clip is in show
> - the clipped geometry has the color red
>
> It's like a copy and paste of all settings of a view.
>
>
> Tobias
>
> ________________________________
> Von: Scott, W Alan [wascott at sandia.gov]
> Gesendet: Mittwoch, 30. November 2016 18:48
> An: Mondry, Tobias; paraview at paraview.org
> Betreff: RE: [EXTERNAL] [Paraview] Duplicate Layouts
>
> You mean link the cameras for two views?  Right click on the background, then
> left click in the other view.
>
> Alan
>
> From: ParaView [mailto:paraview-bounces at paraview.org] On Behalf Of Mondry,
> Tobias
> Sent: Wednesday, November 30, 2016 8:39 AM
> To: paraview at paraview.org
> Subject: [EXTERNAL] [Paraview] Duplicate Layouts
>
> Hi,
>
> do you know a way to duplicate a Layout, in GUI or python?
> This would be useful when you want to have different Layouts with slightly
> different color bar settings, for example.
>
> Kind regards
>
> Tobias
________________________________

Pfinder KG
Rudolf-Diesel-Strasse 14
71032 Böblingen / Germany
Telefon: + 49 (7031) 27 01 0 / Telefax: + 49 (7031) 28 05 00 / Internet: www.pfinder.de
Handelsregister: Amtsgericht Stuttgart, Registergericht HRA 240702

Diese E-Mail kann Betriebs- und Geschäftsgeheimnisse oder sonstige vertrauliche und /oder rechtlich geschützte Informationen enthalten. Sollten Sie diese eMail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der eMail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die eMail. Der Absender hat alle erdenklichen Vorsichtsmaßnahmen getroffen, dass die Anlagen dieser eMail frei von Computerviren o.ä. sind. Gleichwohl schließen wir die Haftung für jeden Schaden aus, der durch Computerviren o.ä. verursacht wurde, soweit wir nicht vorsätzlich oder grob fahrlässig gehandelt haben. Wir raten Ihnen, dass Sie in jedem Fall Ihre eigene Virenprüfung vornehmen, bevor Sie die Anlagen öffnen. Vielen Dank !

The information contained in this email message may be confidential, and may also be the subject of legal professional privilege. If you are not the intended recipient, any use, interference with, disclosure or copying of this material is unauthorised and prohibited. Please inform us immediately and destroy the email. We have taken every reasonable precaution to ensure that any attachment to this email has been swept for viruses. However, we cannot accept liability for any damage sustained as a result of software viruses and would advise that you carry out your own virus checks before opening any attachment. Thank you for your cooperation !


More information about the ParaView mailing list