Skip to content

Commit

Permalink
Added a close function to the SimpleAPI. Fixes #15. (#17)
Browse files Browse the repository at this point in the history
* Added a close function to the SimpleAPI. Fixes #15.

* corrected formatting
  • Loading branch information
marcelluethi authored and Ghazi-Bouabene committed Dec 1, 2017
1 parent 30c27ef commit 6580a75
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/scala/scalismo/ui/api/ScalismoUI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ class ScalismoUI(title: String) extends SimpleAPI with SimpleAPIDefaultImpl {

}

override def close(): Unit = {
frame.closeOperation()
}

}

object ScalismoUI {
Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/scalismo/ui/api/ScalismoUIHeadless.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ case class ScalismoUIHeadless() extends SimpleAPI with SimpleAPIDefaultImpl {

override def setVisibility[V <: ObjectView](view: V, visibleViewports: Seq[Viewport]): Unit = ()

override def close(): Unit = ()

}
2 changes: 2 additions & 0 deletions src/main/scala/scalismo/ui/api/SimpleAPI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ trait SimpleAPI {

def find[V <: ObjectView: FindInScene](group: Group, pred: V => Boolean): Option[V]

def close(): Unit

def onNodeAdded[A <: ObjectView: HandleCallback, R](g: Group, f: A => R): Unit

def onNodeRemoved[A <: ObjectView: HandleCallback, R](g: Group, f: A => R): Unit
Expand Down

0 comments on commit 6580a75

Please sign in to comment.