R/ACurve.R

setClass("Curve", representation(curveSegments = "list"), contains = "SBase")

setMethod("describe", "Curve", function(object) {
  paste(sapply(curveSegments(object), describe), collapse = " to ")
})

 setGeneric("curveSegments", function(object) standardGeneric("curveSegments"))
setMethod("curveSegments", "Curve", function(object) object@curveSegments)

 setGeneric("curveSegments<-", function(object, value) standardGeneric("curveSegments<-"))
setReplaceMethod("curveSegments", "Curve", function(object, value) {
  if (!all(sapply(value, inherits, "LineSegment")))
    stop("All curve segments must be LineSegment objects")
  object@curveSegments <- value
  object
})

Try the rsbml package in your browser

Any scripts or data that you put into this service are public.

rsbml documentation built on Nov. 8, 2020, 8:09 p.m.