[Paraview-developers] How do you modifying the text display panel default settings via a plugin?

Sebastien Jourdain sebastien.jourdain at kitware.com
Wed Nov 14 11:14:31 EST 2012


Hi Niek,

If you try to automatically change any text representation that get created
to use some other font size default, the right way to do that is to almost
do the same thing as the example that you can find in ParaView source tree
under the following directory: Examples/Plugins/RepresentationBehavior

But the content of the onRepresentationAdded will look like that:

void pqSurfaceRepresentationBehavior::onRepresentationAdded(pqRepresentation*
rep)

{

  if(rep->getSMName() == "TextSourceRepresentation")

    {

    vtkSMPropertyHelper(rep->getProxy(), "FontSize").Set(12);

    rep->getProxy()->UpdateVTKObjects();

    }

}


Seb




On Wed, Nov 7, 2012 at 11:17 AM, Verhoeven, Nicolaas (UK) <
Nicolaas.Verhoeven at baesystems.com> wrote:

>  (errata)****
>
> Typo in first message****
>
> ** **
>
> The constructor is not ****
>
> myDecorator::pqIrisAnnotationDecorator(pqDisplayPanel* panel) :
> Superclass(panel)****
>
> but****
>
> myDecorator:: myDecorator(pqDisplayPanel* panel) : Superclass(panel)****
>
> ** **
>
> Apologies****
>
> ** **
>
> Niek****
>
> ** **
>
> ** **
>
> *From:* paraview-developers-bounces at paraview.org [mailto:
> paraview-developers-bounces at paraview.org] *On Behalf Of *Verhoeven,
> Nicolaas (UK)
> *Sent:* 07 November 2012 15:49
> *To:* paraview-developers at paraview.org
> *Subject:* [Paraview-developers] How do you modifying the text display
> panel default settings via a plugin?****
>
> ** **
>
> ** **
>
> **** WARNING ****
>
> *This message originates from outside our organisation, either from an
> external partner or the internet.**
> Keep this in mind if you answer this message.
> Please see this process<http://intranet.ent.baesystems.com/howwework/security/spotlights/Documents/Dealing%20With%20Suspicious%20Emails.pdf>on how to deal with suspicious emails.
> *****
>
> I have inherited a plugin for text annotation which is based on the source
> ‘Annotated Time’.****
>
> The text plugin is constructed as given by
> http://www.cmake.org/Wiki/ParaView/Plugin_HowTo#Deprecated****
>
> ** **
>
> I know the constructor of myDecorator can be used to access the property
> FontSize e.g.****
>
> myDecorator::pqIrisAnnotationDecorator(pqDisplayPanel* panel) :
> Superclass(panel)****
>
> {****
>
>   pqRepresentation* rep = panel->getRepresentation();****
>
>   vtkSMProxy* repProxy = rep->getProxy();****
>
>   vtkSMProperty* smProb = repProxy->GetProperty("FontSize");****
>
>   QVariant v = pqSMAdaptor::getElementProperty(smProb);****
>
>   int fontSize0 = v.value<int>();****
>
> }****
>
> Therefor appending the following to this should change the fontsize.****
>
> ** **
>
>   v.setValue<int>(12);****
>
>   pqSMAdaptor::setElementProperty(smProb0,v);****
>
> ** **
>
> However this does not have any effect.****
>
> ** **
>
> Questions:****
>
> Is it possible to use a ‘decorator’ to change the default settings as set
> by rendering.xml****
>
> If yes. What do I have to add to achieve my goal?****
>
> Further the used methods are flagged as deprecated. ****
>
> What are the recommended alternatives? ****
>
> Can these be used to change to default values via a plugin?****
>
> ** **
>
> Regards****
>
> ** **
>
> Niek****
>
>
> ********************************************************************
> This email and any attachments are confidential to the intended
> recipient and may also be privileged. If you are not the intended
> recipient please delete it from your system and notify the sender.
> You should not copy it or use it for any purpose nor disclose or
> distribute its contents to any other person.
> ************************************************************************
>
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20121114/0612146a/attachment.htm>


More information about the Paraview-developers mailing list