RE: determining if field is "index"

Hi Michelle,

I guess I don't understand what you're asking. It sounds like you want
to parse the ScalarType list that MappingDialog uses, but you shouldn't
need to do that.

Here are some VisAD methods that you may find helpful:

1. RealType index_rt = RealType.getRealType("index")
      This will return the RealType object corresponding to "index"

2. Vector v = display.getMapVector();
      This will return a Vector containing all ScalarMaps for the
      given display. You can then iterate through the vector,
      checking each ScalarMap:
         for (int i=0; i<v.size(); i++) {
            ScalarMap map = (ScalarMap) v.elementAt(i)

3. ScalarType st = map.getScalar();
      This gets the ScalarType object being mapped to the display
      You could then do:
         if (st.equals(index_rt))
      to see if the mapping is an "index" mapping.

4. DisplayRealType drt = map.getDisplayScalar();
      This detects what is being mapped to in the display.
      You could then check:
         if (drt.equals(Display.IsoContour))
      to see if the mapping is an isocontour mapping.

If these methods do not provide the tools you need, please
explain why not.


At 05:52 PM 7/31/2003, you wrote:
>Hi Curtis,
>The problem is that I can't tell which integer value the input field
>called "index" has. If I knew what integer value represented the input
>field "index" (the field called index *not* an index into an array),
>then I would be able to just check if it was mapped to the range value
>of "iso-contour." So the problem is that I can't tell what integer numer
>represents the field called "index". 
>This is all before I've ever set up a ScalarMap of a RealType and
>DisplayRealType. I'm wondering if there is such a way to know what
>integer value "index" is once the data file is loaded in or sometime
>before the scalar map is constructed.
>Michelle Kam           (408) 742-2881
>Lockheed Martin Space Systems Co. SSM/ATC/MSIS
>B/153 O/L922 
>1111 Lockheed Martin Way, Sunnyvale, CA 94089

  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: