[vtkusers] Change properties of axis titles for a vtkCubeAxesRepresentation

Sebastien Jourdain sebastien.jourdain at kitware.com
Mon Aug 12 12:54:05 EDT 2013


Hi Seb,

I don't think vtkCubeAxesRepresentation allow you to have different color
between the axis and its title. On top of that, to force the regeneration
of the axes, you can call ->Modified() on the vtkCubeAxesActor

Seb


On Mon, Aug 12, 2013 at 11:11 AM, Sébastien PULVERAIL
<skeleton18 at gmail.com>wrote:

> Ok, thank you for your help.. But I didn't express correctly..
>
> The people I work for make their own software based on the Paraview's
> plugins.. They use vtkCubeAxesRepresentation and vtkCubeAxisActor to make
> their cube axes.
>
> They have a little bug when updating the color of the axis title: they can
> correctly instantiate a new cube axes (as in the example you gave me), but
> when they want to change the color of an axis directly from the GUI: the
> axis itself, the labels change color, but not the title.
>
> So, it is not during the initialization that I have a problem, but when I
> want to change the color inside the GUI.
>
> Sorry for the misunderstanding.
>
> Seb
>
>
> On Mon, Aug 12, 2013 at 4:13 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:
>
>> I just changed this example to illustrate how to set axis properties:
>> http://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CubeAxesActor
>>
>> NOTE: the tarball will not be updated until tonight but you can still
>> cut/paste the code from the wiki page.
>>
>> Bill
>>
>>
>>
>> On Mon, Aug 12, 2013 at 8:02 AM, Sébastien PULVERAIL <
>> skeleton18 at gmail.com> wrote:
>>
>>> Yes, Sorry.. I don't copy-paste my code because it's confidential, and I
>>> forgot to put the index for the GetTitleTextProperty function.
>>>
>>> Can you provide me the code to show how you test it please? By this way,
>>> I will be able to compare with my own code.
>>>
>>> Thanks in advance.
>>>
>>> Seb
>>>
>>>
>>> On Mon, Aug 12, 2013 at 1:56 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:
>>>
>>>> GetTitleTextProperty requires an argument specifying an axis.
>>>> The code you provided does not compile.
>>>> Try
>>>> this->CubeAxesActor->GetTitleTextProperty(0)->SetColor(1.0, 0.0, 0.0);
>>>> this->CubeAxesActor->GetTitleTextProperty(0)->GetColor(); // Print 1.0
>>>> 0.0 0.0
>>>> this->CubeAxesActor->GetTitleTextProperty(0)->SetFontFamily(VTK_ARIAL);
>>>> this->CubeAxesActor->GetTitleTextProperty(0)->GetFontFamily(); // Print
>>>> VTK_ARIAL
>>>>
>>>> works for me.
>>>>
>>>>
>>>>
>>>> On Mon, Aug 12, 2013 at 5:28 AM, Sébastien PULVERAIL <
>>>> skeleton18 at gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have been trying to change the properties (color and font) of the
>>>>> title axes for a vtkCubeAxesRepresentation using the setter functions.
>>>>>
>>>>> But, nothing changed in the representation. However, when I call the
>>>>> getter functions, the changes have been made.
>>>>>
>>>>> Is there some kind of an update function, or a modified one that I
>>>>> need to call?
>>>>>
>>>>> Here is the piece of code I use:
>>>>> this->CubeAxesActor->GetTitleTextProperty()->SetColor(1.0, 0.0, 0.0);
>>>>> this->CubeAxesActor->GetTitleTextProperty()->GetColor(); // Print 1.0
>>>>> 0.0 0.0
>>>>> this->CubeAxesActor->GetTitleTextProperty()->SetFontFamily(VTK_ARIAL);
>>>>> this->CubeAxesActor->GetTitleTextProperty()->GetFontFamily(); // Print
>>>>> VTK_ARIAL
>>>>>
>>>>> Thanks in advance.
>>>>> Seb
>>>>>
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Please keep messages on-topic and check the VTK FAQ at:
>>>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Unpaid intern in BillsBasement at noware dot com
>>>>
>>>
>>>
>>
>>
>> --
>> Unpaid intern in BillsBasement at noware dot com
>>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130812/f5df445b/attachment.htm>


More information about the vtkusers mailing list