<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19190">
<STYLE></STYLE>
</HEAD>
<BODY
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"
bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Hi Karl,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I made 3 additions to vtkScalarBarActor some time
ago...</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> 1. Set a ceiling on
the text font size.</FONT></DIV>
<DIV><FONT size=2 face=Arial> 2. Allow a different title to be
used when the legend is horizontal.</FONT></DIV>
<DIV><FONT size=2 face=Arial> 3. Supply discrete
labels.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>The extend class is attached - it may require
updating for your VTK version.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>HTH</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>John.</FONT></DIV>
<DIV> </DIV>
<DIV>----- Original Message ----- </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=karl@elemtech.com href="mailto:karl@elemtech.com">Karl Merkley</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=vtkusers@vtk.org
href="mailto:vtkusers@vtk.org">VTK</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, February 24, 2012 3:04
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [vtkusers] Scalar bar with
discrete values</DIV>
<DIV><BR></DIV>Setting the number of labels does help but it doesn't give me
the discrete values on the scalar bar. For example, if I have
three discrete values .4, .5, 1.25. The scalar bar displays .4 .825,
1.25. The .825 appears to be just average of the minimum and the
maximum for the three value case.
<DIV><BR></DIV>
<DIV>Looking the source code for
vtkScalarBarActor::AllocateAndSizeLabels(...), it looks like the interior
values of scalar bar are a function of the range and the number of
labels. There is no way to specify the discrete values. It
looks like I will have to subclass vtkScalarBarActor and overload
AllocateAndSizeLabels. Fortunately, it is a virtual method!</DIV>
<DIV><BR></DIV>
<DIV> -- Karl</DIV>
<DIV><BR>
<DIV>
<DIV>On Feb 23, 2012, at 2:33 AM, Jothybasu Selvaraj wrote:</DIV><BR
class=Apple-interchange-newline>
<BLOCKQUOTE type="cite">
<DIV dir=ltr>You could do that by<BR><BR>//For 10 labels<BR><SPAN
style="COLOR: rgb(0,128,0)">scalarBar->SetMaximumNumberOfColors(10);<BR></SPAN><SPAN
style="COLOR: #008000">scalarBar->SetNumberOfLabels(10);</SPAN><BR><BR>Jothy<BR><BR>
<DIV class=gmail_quote>On Thu, Feb 23, 2012 at 12:10 AM, Karl Merkley <SPAN
dir=ltr><<A
href="mailto:karl@elemtech.com">karl@elemtech.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote><BR>I have a set of discrete values (thicknesses) that I
want to describe with a scalar bar. Each color has exactly one
value associated with it. When I set up my scalar bar it has a
range defined by each color. Is there a way to get a single
label drawn at the center of the color range instead of labels at the tops
and bottoms of each range?<BR><BR> Thanks,<BR>
Karl<BR><BR><BR><BR><BR><BR><BR>_______________________________________________<BR>Powered
by <A href="http://www.kitware.com/"
target=_blank>www.kitware.com</A><BR><BR>Visit other Kitware open-source
projects at <A href="http://www.kitware.com/opensource/opensource.html"
target=_blank>http://www.kitware.com/opensource/opensource.html</A><BR><BR>Please
keep messages on-topic and check the VTK FAQ at: <A
href="http://www.vtk.org/Wiki/VTK_FAQ"
target=_blank>http://www.vtk.org/Wiki/VTK_FAQ</A><BR><BR>Follow this link
to subscribe/unsubscribe:<BR><A
href="http://www.vtk.org/mailman/listinfo/vtkusers"
target=_blank>http://www.vtk.org/mailman/listinfo/vtkusers</A><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR>
<DIV
dir=ltr>Jothy<BR></DIV><BR></DIV>_______________________________________________<BR>Powered
by <A href="http://www.kitware.com">www.kitware.com</A><BR><BR>Visit other
Kitware open-source projects at <A
href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</A><BR><BR>Please
keep messages on-topic and check the VTK FAQ at: <A
href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</A><BR><BR>Follow
this link to subscribe/unsubscribe:<BR><A
href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR></BLOCKQUOTE></DIV><BR>
<DIV><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Helvetica; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"
class=Apple-style-span><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"
class=Apple-style-span>
<DIV
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"
class=Apple-style-span>
<DIV
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV>---------------------------</DIV>
<DIV>Karl Merkley, Ph.D.</DIV>
<DIV><BR></DIV>
<DIV><SPAN style="FONT-SIZE: medium" class=Apple-style-span>Elemental
Technologies, Inc.</SPAN><SPAN style="FONT-SIZE: medium"
class=Apple-style-span><BR></SPAN><SPAN style="FONT-SIZE: medium"
class=Apple-style-span>Computational Simulation Software, LLC</SPAN><SPAN
style="FONT-SIZE: medium" class=Apple-style-span><BR></SPAN><SPAN
style="FONT-SIZE: medium" class=Apple-style-span><A
href="http://www.csimsoft.com/">www.csimsoft.com</A></SPAN><SPAN
style="FONT-SIZE: medium" class=Apple-style-span><BR></SPAN><SPAN
style="FONT-SIZE: medium" class=Apple-style-span><BR></SPAN><SPAN
style="FONT-SIZE: medium" class=Apple-style-span>Office: 1-801-756-1972,
ext 1</SPAN></DIV>
<DIV><BR></DIV></DIV></SPAN><BR
class=Apple-interchange-newline></DIV></SPAN><BR
class=Apple-interchange-newline></SPAN><BR
class=Apple-interchange-newline></DIV><BR></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Powered by
www.kitware.com<BR><BR>Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html<BR><BR>Please keep messages
on-topic and check the VTK FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ<BR><BR>Follow this link to
subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></BLOCKQUOTE></BODY></HTML>