[vtkusers] Change properties of axis titles for a vtkCubeAxesRepresentation
Sébastien PULVERAIL
skeleton18 at gmail.com
Tue Aug 13 07:48:22 EDT 2013
Hi Seb,
I can assure you that you can have different colors between the axis and
its title. I investigate a little bit more on my code..
If I execute the following code, only the label colors (blue) and the axis
color (red) change.
this->CubeAxesActor->GetXAxesLinesProperty()->SetColor(1.0, 0.0, 0.0);
this->CubeAxesActor->GetTitleTextProperty(0)->SetColor(0.0, 1.0, 0.0);
this->CubeAxesActor->GetLabelTextProperty(0)->SetColor(0.0, 0.0, 1.0);
Then, just after, I run the following code:
this->CubeAxesActor->SetXTitle("X2");
And the title is correctly update, and the color (green) is also changed...
I already try the call to ->Modified() on first the vtkCubeAxesActor and
then on the vtkCubeAxesRepresentation.. But nothing change on the view..
Seb
On Mon, Aug 12, 2013 at 6:54 PM, Sebastien Jourdain <
sebastien.jourdain at kitware.com> wrote:
> 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/20130813/37f45ecc/attachment.htm>
More information about the vtkusers
mailing list