Skip to content

Commit

Permalink
small fix to text3d
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomusy committed Nov 29, 2023
1 parent 2c8fccc commit 81df0e6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
6 changes: 4 additions & 2 deletions tests/pipeline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ cd ~/Projects/server/vedo-bias-course/scripts && ./run_all.sh
cd $VDIR/examples/other/trimesh && ./run_all.sh

# DOLFIN #######################################
# conda create -n fenics -c conda-forge fenics
cd $VDIR
conda activate fenics
pip install -e .
Expand Down Expand Up @@ -110,16 +111,16 @@ cd ~/Projects/napari-vedo-bridge
# conda create -y -n napari-env -c conda-forge python=3.9
# conda activate napari-env
# python -m pip install "napari[all]"
# cd ../vedo && pip install . && cd -
conda activate napari-env
cd $VDIR && pip install . && cd -
python $VDIR/examples/other/napari1.py
napari
conda deactivate
################
cd ~/Projects/welleng/examples
python
################
cd ~/Projects/brainrender_orig/examples
cd ~/Projects/server/brainrender_orig/examples
python
################
cd ~/Projects/clonal_analysis2d_splines
Expand All @@ -128,6 +129,7 @@ cd ~/Projects/clonal_analysis2d_splines

# DOCUMETATION #################################
mount_staging
pip install pdoc
cd $VDIR/docs/pdoc
./build_html.py

Expand Down
3 changes: 3 additions & 0 deletions vedo/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ def __init__(
self.interactor.SetRenderWindow(self.window)
vsty = vtk.new("InteractorStyleTrackballCamera")
self.interactor.SetInteractorStyle(vsty)
self.interactor.RemoveObservers("CharEvent")

if settings.enable_default_keyboard_callbacks:
self.interactor.AddObserver("KeyPressEvent", self._keypress)
Expand Down Expand Up @@ -3306,6 +3307,7 @@ def show(
# vedo.logger.debug("On Mac OSX try: pip install pyobjc")
pass

# Set the interaction style
self.user_mode(mode)

if screenshot:
Expand Down Expand Up @@ -3455,6 +3457,7 @@ def user_mode(self, mode):
# see https://vtk.org/doc/nightly/html/classvtkInteractorStyle.html
if mode in (0, "TrackballCamera"):
self.interactor.SetInteractorStyle(vtk.new("InteractorStyleTrackballCamera"))
self.interactor.RemoveObservers("CharEvent")
elif mode in (1, "TrackballActor"):
self.interactor.SetInteractorStyle(vtk.new("InteractorStyleTrackballActor"))
elif mode in (2, "JoystickCamera"):
Expand Down
2 changes: 1 addition & 1 deletion vedo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def __init__(self):
# 0 = normal
# 1 = do not hold execution
# 2 = do not hold execution and do not show any window
self.dry_run_mode = 2
self.dry_run_mode = 0

self.default_backend = "vtk"
try:
Expand Down
6 changes: 3 additions & 3 deletions vedo/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4336,9 +4336,9 @@ def _get_text3d_poly(

if not literal:
reps2 = [
("\_", "┭"), # trick to protect ~ _ and ^ chars
("\^", "┮"), #
("\~", "┯"), #
(r"\_", "┭"), # trick to protect ~ _ and ^ chars
(r"\^", "┮"), #
(r"\~", "┯"), #
("**", "^"), # order matters
("e+0", dotsep + "10^"),
("e-0", dotsep + "10^-"),
Expand Down
6 changes: 5 additions & 1 deletion vedo/visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,9 @@ def cmap(
self.mapper.SetScalarModeToUsePointData()
except AttributeError:
on = "points"
elif on == "Default":
on = "points"
self.mapper.SetScalarModeToUsePointData()

if input_array is None:
if not self.pointdata.keys() and self.celldata.keys():
Expand All @@ -1236,7 +1239,8 @@ def cmap(
data = self.dataset.GetCellData()
n = self.dataset.GetNumberOfCells()
else:
vedo.logger.error("Must specify in cmap(on=...) to either 'cells' or 'points'")
vedo.logger.error(
f"Must specify in cmap(on=...) to either 'cells' or 'points', not {on}")
raise RuntimeError()

if input_array is None: # if None try to fetch the active scalars
Expand Down

0 comments on commit 81df0e6

Please sign in to comment.