Changeset 3639
- Timestamp:
- Apr 27, 2013 3:37:55 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/Renderer.cpp
r3621 r3639 45 45 #include "ColorMap.h" 46 46 #include "Trace.h" 47 48 //#define NEW_SCALAR_BAR 47 49 48 50 #define MSECS_ELAPSED(t1, t2) \ … … 1926 1928 // Set viewport-relative width/height/pos 1927 1929 if (title.empty() && numLabels == 0) { 1928 _scalarBarActor->SetPosition(0, 0); 1930 #ifdef NEW_SCALAR_BAR 1931 _scalarBarActor->SetBarRatio(1); 1932 #endif 1929 1933 if (width > height) { 1930 1934 // horizontal 1935 #ifdef NEW_SCALAR_BAR 1936 _scalarBarActor->SetDisplayPosition(0, 0); 1937 _scalarBarActor->GetPosition2Coordinate()->SetCoordinateSystemToDisplay(); 1938 _scalarBarActor->GetPosition2Coordinate()->SetValue(width+4, height); 1939 #else 1940 _scalarBarActor->SetPosition(0, 0); 1931 1941 _scalarBarActor->SetHeight((((double)height+1.5)/((double)height))/0.4); // VTK: floor(actorHeight * .4) 1932 1942 _scalarBarActor->SetWidth(1); // VTK: actorWidth 1943 #endif 1933 1944 } else { 1934 1945 // vertical 1946 #ifdef NEW_SCALAR_BAR 1947 _scalarBarActor->SetDisplayPosition(0, -4); 1948 _scalarBarActor->GetPosition2Coordinate()->SetCoordinateSystemToDisplay(); 1949 _scalarBarActor->GetPosition2Coordinate()->SetValue(width+1, height+5); 1950 #else 1951 _scalarBarActor->SetPosition(0, 0); 1935 1952 _scalarBarActor->SetHeight((((double)height+1.5)/((double)height))/0.86); // VTK: floor(actorHeight * .86) 1936 1953 _scalarBarActor->SetWidth(((double)(width+5))/((double)width)); // VTK: actorWidth - 4 pixels 1954 #endif 1937 1955 } 1938 1956 } else { 1957 #ifdef NEW_SCALAR_BAR 1958 _scalarBarActor->SetBarRatio(0.375); 1959 _scalarBarActor->SetDisplayPosition(0, 0); 1960 _scalarBarActor->GetPosition2Coordinate()->SetCoordinateSystemToDisplay(); 1961 _scalarBarActor->GetPosition2Coordinate()->SetValue(width, height); 1962 #else 1939 1963 if (width > height) { 1940 1964 // horizontal … … 1948 1972 _scalarBarActor->SetWidth(0.8); 1949 1973 } 1974 #endif 1950 1975 } 1951 1976 … … 2083 2108 _scalarBarActor->SetTitle(""); 2084 2109 } 2110 2111 double color[3]; 2112 color[0] = 1 - _bgColor[0]; 2113 color[1] = 1 - _bgColor[1]; 2114 color[2] = 1 - _bgColor[2]; 2115 2116 _scalarBarActor->GetTitleTextProperty()->SetColor(color); 2117 _scalarBarActor->GetTitleTextProperty()->BoldOff(); 2085 2118 _scalarBarActor->GetTitleTextProperty()->ItalicOff(); 2119 _scalarBarActor->GetTitleTextProperty()->ShadowOff(); 2086 2120 _scalarBarActor->SetNumberOfLabels(numLabels); 2121 _scalarBarActor->GetLabelTextProperty()->SetColor(color); 2087 2122 _scalarBarActor->GetLabelTextProperty()->BoldOff(); 2088 2123 _scalarBarActor->GetLabelTextProperty()->ItalicOff(); 2089 2124 _scalarBarActor->GetLabelTextProperty()->ShadowOff(); 2125 #ifdef NEW_SCALAR_BAR 2126 if (title.empty() && numLabels == 0) { 2127 _scalarBarActor->DrawAnnotationsOff(); 2128 _scalarBarActor->SetAnnotationLeaderPadding(0); 2129 _scalarBarActor->SetTextPad(0); 2130 } else { 2131 _scalarBarActor->DrawAnnotationsOn(); 2132 _scalarBarActor->SetAnnotationLeaderPadding(8); 2133 _scalarBarActor->SetTextPad(1); 2134 } 2135 #endif 2090 2136 2091 2137 _legendRenderWindow->Render(); … … 2615 2661 focalDepth = viewFocus[2]; 2616 2662 2617 computeDisplayToWorld(( x * 2. + 1.) *_windowWidth / 2.0,2618 ( y * 2. + 1.) *_windowHeight / 2.0,2663 computeDisplayToWorld((x * 2. + 1.) * (double)_windowWidth / 2.0, 2664 (y * 2. + 1.) * (double)_windowHeight / 2.0, 2619 2665 focalDepth, 2620 2666 newPickPoint); 2621 2667 2622 computeDisplayToWorld( _windowWidth / 2.0,2623 _windowHeight / 2.0,2668 computeDisplayToWorld((double)_windowWidth / 2.0, 2669 (double)_windowHeight / 2.0, 2624 2670 focalDepth, 2625 2671 oldPickPoint);
Note: See TracChangeset
for help on using the changeset viewer.