Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ben Boeckel
ParaView
Commits
07fcc618
Commit
07fcc618
authored
Jun 30, 2004
by
Charles Law
Browse files
Texture for color option.
parent
00579dc7
Changes
7
Hide whitespace changes
Inline
Side-by-side
GUI/Client/vtkPVColorMap.cxx
View file @
07fcc618
...
...
@@ -50,7 +50,7 @@
#include "vtkPVRenderModule.h"
//----------------------------------------------------------------------------
vtkStandardNewMacro
(
vtkPVColorMap
);
vtkCxxRevisionMacro
(
vtkPVColorMap
,
"1.9
2
"
);
vtkCxxRevisionMacro
(
vtkPVColorMap
,
"1.9
3
"
);
int
vtkPVColorMapCommand
(
ClientData
cd
,
Tcl_Interp
*
interp
,
int
argc
,
char
*
argv
[]);
...
...
@@ -848,9 +848,19 @@ void vtkPVColorMap::CreateParallelTclObjects(vtkPVApplication *pvApp)
pm
->
SendStream
(
vtkProcessModule
::
CLIENT
|
vtkProcessModule
::
RENDER_SERVER
);
this
->
LookupTable
=
vtkLookupTable
::
SafeDownCast
(
pm
->
GetObjectFromID
(
this
->
LookupTableID
));
pm
->
GetStream
()
<<
vtkClientServerStream
::
Invoke
<<
this
->
LookupTableID
<<
"SetVectorModeToMagnitude"
<<
vtkClientServerStream
::
End
;
if
(
this
->
NumberOfVectorComponents
>
1
)
{
pm
->
GetStream
()
<<
vtkClientServerStream
::
Invoke
<<
this
->
LookupTableID
<<
"SetVectorModeToMagnitude"
<<
vtkClientServerStream
::
End
;
}
else
{
pm
->
GetStream
()
<<
vtkClientServerStream
::
Invoke
<<
this
->
LookupTableID
<<
"SetVectorModeToComponent"
<<
vtkClientServerStream
::
End
;
}
this
->
ScalarBar
=
vtkScalarBarWidget
::
New
();
this
->
ScalarBar
->
SetCurrentRenderer
(
pvApp
->
GetRenderModule
()
->
GetRenderer2D
());
...
...
GUI/Client/vtkPVData.cxx
View file @
07fcc618
...
...
@@ -83,7 +83,7 @@
//----------------------------------------------------------------------------
vtkStandardNewMacro
(
vtkPVData
);
vtkCxxRevisionMacro
(
vtkPVData
,
"1.28
7
"
);
vtkCxxRevisionMacro
(
vtkPVData
,
"1.28
8
"
);
int
vtkPVDataCommand
(
ClientData
cd
,
Tcl_Interp
*
interp
,
int
argc
,
char
*
argv
[]);
...
...
@@ -138,6 +138,7 @@ vtkPVData::vtkPVData()
this
->
ColorMenu
=
vtkKWOptionMenu
::
New
();
this
->
MapScalarsCheck
=
vtkKWCheckButton
::
New
();
this
->
InterpolateColorsCheck
=
vtkKWCheckButton
::
New
();
this
->
EditColorMapButton
=
vtkKWPushButton
::
New
();
this
->
ColorButton
=
vtkKWChangeColorButton
::
New
();
...
...
@@ -261,6 +262,9 @@ vtkPVData::~vtkPVData()
this
->
MapScalarsCheck
->
Delete
();
this
->
MapScalarsCheck
=
NULL
;
this
->
InterpolateColorsCheck
->
Delete
();
this
->
InterpolateColorsCheck
=
NULL
;
this
->
ColorButton
->
Delete
();
this
->
ColorButton
=
NULL
;
...
...
@@ -615,7 +619,6 @@ void vtkPVData::CreateProperties()
this
->
ColorButton
->
SetBalloonHelpString
(
"Edit the constant color for the geometry."
);
this
->
MapScalarsCheck
->
SetParent
(
this
->
ColorFrame
->
GetFrame
());
this
->
MapScalarsCheck
->
Create
(
this
->
GetApplication
(),
"-text {Map Scalars}"
);
this
->
MapScalarsCheck
->
SetState
(
0
);
...
...
@@ -625,6 +628,16 @@ void vtkPVData::CreateProperties()
"%s configure -command {%s MapScalarsCheckCallback}"
,
this
->
MapScalarsCheck
->
GetWidgetName
(),
this
->
GetTclName
());
this
->
InterpolateColorsCheck
->
SetParent
(
this
->
ColorFrame
->
GetFrame
());
this
->
InterpolateColorsCheck
->
Create
(
this
->
GetApplication
(),
"-text {Interpolate Colors}"
);
this
->
InterpolateColorsCheck
->
SetState
(
1
);
this
->
InterpolateColorsCheck
->
SetBalloonHelpString
(
"Interpolate colors after mapping."
);
this
->
GetApplication
()
->
Script
(
"%s configure -command {%s InterpolateColorsCheckCallback}"
,
this
->
InterpolateColorsCheck
->
GetWidgetName
(),
this
->
GetTclName
());
this
->
EditColorMapButton
->
SetParent
(
this
->
ColorFrame
->
GetFrame
());
this
->
EditColorMapButton
->
Create
(
this
->
GetApplication
(),
""
);
...
...
@@ -637,20 +650,21 @@ void vtkPVData::CreateProperties()
this
->
Script
(
"grid %s %s -sticky wns"
,
this
->
ColorMenuLabel
->
GetWidgetName
(),
this
->
ColorMenu
->
GetWidgetName
());
this
->
Script
(
"grid %s -sticky news -padx %d -pady %d"
,
this
->
ColorMenu
->
GetWidgetName
(),
col_1_padx
,
button_pady
);
this
->
Script
(
"grid %s %s -sticky wns"
,
this
->
MapScalarsCheck
->
GetWidgetName
(),
this
->
ColorButton
->
GetWidgetName
());
this
->
Script
(
"grid %s -column 1 -sticky news -padx %d -pady %d"
,
this
->
ColorButton
->
GetWidgetName
(),
col_1_padx
,
button_pady
);
this
->
ColorButtonVisible
=
0
;
this
->
Script
(
"grid %s %s -sticky wns"
,
this
->
MapScala
rsCheck
->
GetWidgetName
(),
this
->
InterpolateColo
rsCheck
->
GetWidgetName
(),
this
->
EditColorMapButton
->
GetWidgetName
());
this
->
Script
(
"grid %s -sticky news -padx %d -pady %d"
,
this
->
EditColorMapButton
->
GetWidgetName
(),
col_1_padx
,
button_pady
);
...
...
@@ -2707,6 +2721,33 @@ void vtkPVData::SetMapScalarsFlag(int val)
}
}
//----------------------------------------------------------------------------
void
vtkPVData
::
InterpolateColorsCheckCallback
()
{
this
->
SetInterpolateColorsFlag
(
this
->
InterpolateColorsCheck
->
GetState
());
if
(
this
->
GetPVRenderView
()
)
{
this
->
GetPVRenderView
()
->
EventuallyRender
();
}
}
//----------------------------------------------------------------------------
void
vtkPVData
::
SetInterpolateColorsFlag
(
int
val
)
{
if
(
this
->
InterpolateColorsCheck
->
GetState
()
!=
val
)
{
this
->
AddTraceEntry
(
"$kw(%s) SetInterpolateColorsFlag %d"
,
this
->
GetTclName
(),
val
);
this
->
InterpolateColorsCheck
->
SetState
(
val
);
}
int
num
,
idx
;
num
=
this
->
PVSource
->
GetNumberOfParts
();
for
(
idx
=
0
;
idx
<
num
;
++
idx
)
{
this
->
PVSource
->
GetPart
(
idx
)
->
GetPartDisplay
()
->
SetInterpolateColorsFlag
(
val
);
}
}
//----------------------------------------------------------------------------
void
vtkPVData
::
SetPointSize
(
int
size
)
{
...
...
GUI/Client/vtkPVData.h
View file @
07fcc618
...
...
@@ -287,7 +287,6 @@ public:
// and to determine whether the scalar bar should be visible.
void
SetVisibilityCheckState
(
int
v
);
// Description:
// This determines whether to map array values through a color
// map or use arrays values as colors directly. The direct option
...
...
@@ -295,6 +294,15 @@ public:
void
SetMapScalarsFlag
(
int
val
);
void
MapScalarsCheckCallback
();
// Description:
// This determines whether we will interpolate before or after
// scalrs are mapped. Interpolate after is the standard VTK
// OpenGL vertex coloring. It gives smooth coloring, but
// may generate colors not in the map Interpolating before
// mapping uses a 1d texture map.
void
SetInterpolateColorsFlag
(
int
val
);
void
InterpolateColorsCheckCallback
();
vtkGetMacro
(
ColorSetByUser
,
int
);
vtkGetMacro
(
ArraySetByUser
,
int
);
...
...
@@ -399,6 +407,7 @@ protected:
vtkKWCheckButton
*
ScalarBarCheck
;
vtkKWCheckButton
*
MapScalarsCheck
;
vtkKWCheckButton
*
InterpolateColorsCheck
;
// For translating actor
vtkKWLabeledFrame
*
ActorControlFrame
;
...
...
GUI/Client/vtkPVLODPartDisplay.cxx
View file @
07fcc618
...
...
@@ -41,7 +41,7 @@
//----------------------------------------------------------------------------
vtkStandardNewMacro
(
vtkPVLODPartDisplay
);
vtkCxxRevisionMacro
(
vtkPVLODPartDisplay
,
"1.2
4
"
);
vtkCxxRevisionMacro
(
vtkPVLODPartDisplay
,
"1.2
5
"
);
//----------------------------------------------------------------------------
...
...
@@ -488,6 +488,34 @@ void vtkPVLODPartDisplay::SetDirectColorFlag(int val)
}
}
//----------------------------------------------------------------------------
void
vtkPVLODPartDisplay
::
SetInterpolateColorsFlag
(
int
val
)
{
if
(
val
)
{
val
=
1
;
}
if
(
val
==
this
->
InterpolateColorsFlag
)
{
return
;
}
vtkPVApplication
*
pvApp
=
this
->
GetPVApplication
();
vtkPVProcessModule
*
pm
=
pvApp
->
GetProcessModule
();
this
->
InterpolateColorsFlag
=
val
;
pm
->
GetStream
()
<<
vtkClientServerStream
::
Invoke
<<
this
->
MapperID
<<
"SetInterpolateScalarsBeforeMapping"
<<
(
!
val
)
<<
vtkClientServerStream
::
End
;
pm
->
GetStream
()
<<
vtkClientServerStream
::
Invoke
<<
this
->
LODMapperID
<<
"SetInterpolateScalarsBeforeMapping"
<<
(
!
val
)
<<
vtkClientServerStream
::
End
;
pm
->
SendStream
(
vtkProcessModule
::
CLIENT
|
vtkProcessModule
::
RENDER_SERVER
);
}
//----------------------------------------------------------------------------
void
vtkPVLODPartDisplay
::
SetPointLabelVisibility
(
int
val
)
{
...
...
GUI/Client/vtkPVLODPartDisplay.h
View file @
07fcc618
...
...
@@ -56,6 +56,10 @@ public:
virtual
void
SetScalarVisibility
(
int
val
);
virtual
void
ColorByArray
(
vtkPVColorMap
*
colorMap
,
int
field
);
// Description:
// Option to use a 1d texture map for the attribute color.
virtual
void
SetInterpolateColorsFlag
(
int
val
);
// Description:
// This method updates the piece that has been assigned to this process.
// It also gathers the data information.
...
...
GUI/Client/vtkPVPartDisplay.cxx
View file @
07fcc618
...
...
@@ -48,7 +48,7 @@
//----------------------------------------------------------------------------
vtkStandardNewMacro
(
vtkPVPartDisplay
);
vtkCxxRevisionMacro
(
vtkPVPartDisplay
,
"1.3
6
"
);
vtkCxxRevisionMacro
(
vtkPVPartDisplay
,
"1.3
7
"
);
//----------------------------------------------------------------------------
...
...
@@ -57,6 +57,7 @@ vtkPVPartDisplay::vtkPVPartDisplay()
this
->
PVApplication
=
NULL
;
this
->
DirectColorFlag
=
1
;
this
->
InterpolateColorsFlag
=
1
;
this
->
Visibility
=
1
;
this
->
Part
=
NULL
;
...
...
@@ -570,6 +571,29 @@ void vtkPVPartDisplay::SetDirectColorFlag(int val)
pm
->
SendStream
(
vtkProcessModule
::
CLIENT
|
vtkProcessModule
::
RENDER_SERVER
);
}
//----------------------------------------------------------------------------
void
vtkPVPartDisplay
::
SetInterpolateColorsFlag
(
int
val
)
{
if
(
val
)
{
val
=
1
;
}
if
(
val
==
this
->
InterpolateColorsFlag
)
{
return
;
}
vtkPVApplication
*
pvApp
=
this
->
GetPVApplication
();
vtkPVProcessModule
*
pm
=
pvApp
->
GetProcessModule
();
vtkClientServerStream
&
stream
=
pm
->
GetStream
();
this
->
InterpolateColorsFlag
=
val
;
stream
<<
vtkClientServerStream
::
Invoke
<<
this
->
MapperID
<<
"SetInterpolateScalarsBeforeMapping"
<<
(
!
val
)
<<
vtkClientServerStream
::
End
;
pm
->
SendStream
(
vtkProcessModule
::
CLIENT
|
vtkProcessModule
::
RENDER_SERVER
);
}
//----------------------------------------------------------------------------
void
vtkPVPartDisplay
::
ColorByArray
(
vtkPVColorMap
*
colorMap
,
int
field
)
...
...
@@ -754,6 +778,7 @@ void vtkPVPartDisplay::PrintSelf(ostream& os, vtkIndent indent)
os
<<
indent
<<
"PVApplication: "
<<
this
->
PVApplication
<<
endl
;
os
<<
indent
<<
"DirectColorFlag: "
<<
this
->
DirectColorFlag
<<
endl
;
os
<<
indent
<<
"InterpolateColorsFlag: "
<<
this
->
InterpolateColorsFlag
<<
endl
;
os
<<
indent
<<
"UpdateSuppressor: "
<<
this
->
UpdateSuppressorID
.
ID
<<
endl
;
os
<<
indent
<<
"VolumeID: "
<<
this
->
VolumeID
.
ID
<<
endl
;
...
...
GUI/Client/vtkPVPartDisplay.h
View file @
07fcc618
...
...
@@ -68,6 +68,11 @@ public:
virtual
void
SetScalarVisibility
(
int
val
);
virtual
void
ColorByArray
(
vtkPVColorMap
*
colorMap
,
int
field
);
// Description:
// Option to use a 1d texture map for the attribute color.
virtual
void
SetInterpolateColorsFlag
(
int
val
);
vtkGetMacro
(
InterpolateColorsFlag
,
int
);
// Description:
// This just sets the color of the property.
// you also have to set scalar visiblity to off.
...
...
@@ -181,6 +186,7 @@ protected:
vtkPVApplication
*
PVApplication
;
int
DirectColorFlag
;
int
InterpolateColorsFlag
;
int
Visibility
;
// Problems with vtkLODActor led me to use these.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment