shrink_filter.ShrinkFactor = 0.8
shrink_filter.UpdatePipeline()
shrinked_ds = GetRepresentation(shrink_filter)
- shrinked_ds.ColorAttributeType = ds.ColorAttributeType
- shrinked_ds.ColorArrayName = ds.ColorArrayName
+ shrinked_ds.ColorArrayName = ds.ColorArrayName[0:2]
shrinked_ds.LookupTable = ds.LookupTable
ds.Visibility = 0
shrinked_ds.Representation = ds.Representation
shrink_filter.ShrinkFactor = 0.8
shrink_filter.UpdatePipeline()
shr_sm_on_ds = GetRepresentation(shrink_filter)
- shr_sm_on_ds.ColorArrayName = sm_on_ds.ColorArrayName
+ shr_sm_on_ds.ColorArrayName = sm_on_ds[0:2]
shr_sm_on_ds.LookupTable = sm_on_ds.LookupTable
- shr_sm_on_ds.ColorAttributeType = sm_on_ds.ColorAttributeType
sm_on_ds.Visibility = 0
shr_sm_on_ds.Representation = sm_on_ds.Representation
shape_to_show = shr_sm_on_ds
shrink_filter.ShrinkFactor = 0.8
shrink_filter.UpdatePipeline()
shrinked_scalar_map = GetRepresentation(shrink_filter)
-shrinked_scalar_map.ColorAttributeType = EntityType.get_pvtype(EntityType.CELL)
-shrinked_scalar_map.ColorArrayName = field_name
+shrinked_scalar_map.ColorArrayName = (EntityType.get_pvtype(EntityType.CELL), field_name)
shrinked_scalar_map.Representation = scalar_map.Representation
lookup_table = scalar_map.LookupTable
shrinked_scalar_map.LookupTable = lookup_table
shrink_filter.ShrinkFactor = 0.8
shrink_filter.UpdatePipeline()
shrinked_scalar_map = GetRepresentation(shrink_filter)
-shrinked_scalar_map.ColorAttributeType = EntityType.get_pvtype(EntityType.CELL)
-shrinked_scalar_map.ColorArrayName = field_name
+shrinked_scalar_map.ColorArrayName = (EntityType.get_pvtype(EntityType.CELL), field_name)
shrinked_scalar_map.Representation = scalar_map.Representation
lookup_table = scalar_map.LookupTable
shrinked_scalar_map.LookupTable = lookup_table
shrink_filter = Shrink(scalar_map.Input)
shrinked_sm = GetRepresentation(shrink_filter)
shrink_filter.ShrinkFactor = 0.8
- shrink_filter.UpdatePipeline()
- shrinked_sm.ColorAttributeType = scalar_map.ColorAttributeType
- shrinked_sm.ColorArrayName = scalar_map.ColorArrayName
+ shrink_filter.UpdatePipeline()
+ shrinked_sm.ColorArrayName = scalar_map.ColorArrayName[0:2]
lookup_table = scalar_map.LookupTable
shrinked_sm.LookupTable = lookup_table
lookup_table.LockScalarRange = 0
# Set properties
-pointmap3d.ColorAttributeType = EntityType.get_pvtype(entity)
-pointmap3d.ColorArrayName = table_name
+pointmap3d.ColorArrayName = (EntityType.get_pvtype(entity), table_name)
pointmap3d.LookupTable = lookup_table
# Add scalar bar
print " ** end of message **"
pass
+ if _out:
+ print _out
return res
#
field_name = 'Table'
vector_mode = 'Magnitude'
nb_components = 1
-
+
# Get lookup table
lookup_table = get_lookup_table(field_name, nb_components, vector_mode)
lookup_table.LockScalarRange = 0
# Set properties
- prs.ColorAttributeType = EntityType.get_pvtype(EntityType.NODE)
- prs.ColorArrayName = field_name
+ prs.ColorArrayName = (EntityType.get_pvtype(EntityType.NODE), field_name)
prs.LookupTable = lookup_table
# Add scalar bar
bar = add_scalar_bar(available_tables[table_nb], nb_components, vector_mode,
lookup_table, "")
-
+
reset_view()
pvsimple.Delete(bar)
print "Creating Scalar Map......."
scmap1 = ScalarMapOnField(med_reader, EntityType.NODE, field_name, timestamp_id)
-if scmap1 is None :
+if scmap1 is None :
raise RuntimeError, "ScalarMap presentation is None!!!"
else:
print "OK"
# 3. Create Deformed Shape And Scalar Map
print "Creating DeformedShapeAndScalarMap......."
scmap2 = DeformedShapeAndScalarMapOnField(med_reader, EntityType.NODE, field_name, timestamp_id)
-if scmap2 is None :
+if scmap2 is None :
raise RuntimeError, "DeformedShapeAndScalarMapOnField presentation is None!!!"
else:
print "OK"
-
+
scmap2.Input.ScaleFactor = 1.0
display_only(scmap2)
# 4.Create Deformed Shape
print "Creating DeformedShape........"
scmap3 = DeformedShapeOnField(med_reader, EntityType.NODE, field_name, timestamp_id)
-if scmap3 is None :
+if scmap3 is None :
raise RuntimeError, "DeformedShapeOnField presentation is None!!!"
else:
print "OK"
scmap2.Input.ScaleFactor = 1.0
# show colored:
-scmap3.ColorAttributeType = EntityType.get_pvtype(EntityType.NODE)
-scmap3.ColorArrayName = field_name
+scmap3.ColorArrayName = (EntityType.get_pvtype(EntityType.NODE), field_name)
display_only(scmap3)
reset_view()
-
-
-
def set_prs_colored(prs, proxy, entity, field_name, vector_mode, timestamp_nb):
# Get time value
time_value = get_time(proxy, timestamp_nb)
-
+
# Check vector mode
nb_components = get_nb_components(proxy, entity, field_name)
check_vector_mode(vector_mode, nb_components)
lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0]
# Set properties
- prs.ColorAttributeType = EntityType.get_pvtype(entity)
- prs.ColorArrayName = field_name
+ prs.ColorArrayName = (EntityType.get_pvtype(entity), field_name)
prs.LookupTable = lookup_table
# Add scalar bar
add_scalar_bar(field_name, nb_components,
vector_mode, lookup_table, time_value)
-
+
# 1. Import of the "Penta6.med" file
print 'Import "Penta6.med" file........',
# 2. Creation of "CutPlanes" presentation, based on time stamp of "scalar field" field
print 'Creation of "CutPlanes" presentation, based on time stamp of "scalar field" field....'
cutplanes = CutPlanesOnField(med_reader, EntityType.CELL, "scalar field", 1)
-if cutplanes is None :
+if cutplanes is None :
raise RuntimeError, "Presentation is None!!!"
else:
print "OK"
print 'Creation of "CutPlanes" presentation, based on time stamp of "vectoriel field" field....'
cutplanes = CutPlanesOnField(med_reader, EntityType.CELL, "vectoriel field", 1)
-if cutplanes is None :
+if cutplanes is None :
raise RuntimeError, "Presentation is None!!!"
else:
print "OK"