[enable visibility toggling
Andreas Röver <roever@users.sourceforge.net>**20050619173600] {
hunk ./src/gui/BlockList.cpp 296
-  if (p->problemNumber() > 0)
+  if (p->problemNumber() > 0) {
hunk ./src/gui/BlockList.cpp 298
-  else
+    for (unsigned int i = 0; i < p->probPieceNumber(0); i++)
+      visState[i] = 0;
+  } else
hunk ./src/gui/BlockList.cpp 318
-  while (block >= puzzle->probGetShapeCount(problem, shape)) {
-    block -= puzzle->probGetShapeCount(problem, shape);
+  unsigned int subBlock = block;
+
+  while (subBlock >= puzzle->probGetShapeCount(problem, shape)) {
+    subBlock -= puzzle->probGetShapeCount(problem, shape);
hunk ./src/gui/BlockList.cpp 326
-  snprintf(txt, 199, "%i.%i", shape, block);
+  snprintf(txt, 199, "%i.%i", shape, subBlock);
hunk ./src/gui/BlockList.cpp 328
-  r = int(255*pieceColorR(shape, block));
-  g = int(255*pieceColorG(shape, block));
-  b = int(255*pieceColorB(shape, block));
+  r = int(255*pieceColorR(shape, subBlock));
+  g = int(255*pieceColorG(shape, subBlock));
+  b = int(255*pieceColorB(shape, subBlock));
hunk ./src/gui/BlockList.cpp 337
-  fl_rectf(x, y, w, h, r, g, b);
+  switch(visState[block]) {
+  case 0:
+    fl_rectf(x, y, w, h, r, g, b);
+    break;
+  case 1:
+    fl_rectf(x+2, y+2, w-4, h-4, r, g, b);
+    break;
+  case 2:
+    fl_rectf(x, y, w, 2, r, g, b);
+    fl_rectf(x, y+h-2, w, 2, r, g, b);
+    fl_rectf(x, y, 2, h, r, g, b);
+    fl_rectf(x+w-2, y, 2, h, r, g, b);
+    break;
+  }
hunk ./src/gui/BlockList.cpp 387
+
+  if (visState)
+    delete [] visState;
+
+  visState = new unsigned char[pz->probPieceNumber(prob)];
+
+  for (unsigned int i = 0; i < pz->probPieceNumber(0); i++)
+    visState[i] = 0;
hunk ./src/gui/BlockList.cpp 396
+
+void PieceVisibility::push(unsigned int block) {
+
+  visState[block]++;
+
+  if (visState[block] == 3) visState[block] = 0;
+
+  redraw();
+
+  do_callback(RS_CHANGEDSELECTION);
+}
+
hunk ./src/gui/BlockList.h 226
+  enum {
+    RS_CHANGEDSELECTION = RS_LIST_LAST,
+    RS_VISIBILITY_LAST
+  };
+
+
hunk ./src/gui/BlockList.h 238
+
+  virtual void push(unsigned int block);
+
+  unsigned char getVisibility(unsigned int piece) {
+    assert(piece < puzzle->probPieceNumber(problem));
+    return visState[piece];
+  }
hunk ./src/gui/MainWindow.cpp 447
-  View3D->redraw();
+  View3D->updateVisibility(PcVis);
hunk ./src/gui/WindowWidgets.cpp 442
+void View3dGroup::updateVisibility(PieceVisibility * pcvis) {
+  View3D->update(false);
+
+  for (unsigned int p = 0; p < View3D->spaceNumber(); p++) {
+
+    switch(pcvis->getVisibility(p)) {
+    case 0:
+      View3D->setDrawingMode(p, VoxelView::normal);
+      break;
+    case 1:
+      View3D->setDrawingMode(p, VoxelView::gridline);
+      break;
+    case 2:
+      View3D->setDrawingMode(p, VoxelView::invisible);
+      break;
+    }
+  }
+
+  View3D->update(true);
+}
+
+
hunk ./src/gui/WindowWidgets.h 278
+  void updateVisibility(PieceVisibility * pcvis);
}
